diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 9c747961..8e852093 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -44,7 +44,6 @@ jobs:
echo 'Please update your tag to match the expected regex pattern'
exit 1
fi
-
- name: Checkout
uses: actions/checkout@v3
with:
@@ -54,11 +53,9 @@ jobs:
run: |
pip install -r requirements.txt
pip install -r test-requirements.txt
-
- name: Test
run: |
pytest -v
-
- name: Deploy to PYPI
run: |
pip install twine
@@ -93,9 +90,8 @@ jobs:
echo 'Please update your tag to match the expected regex pattern'
exit 1
fi
-
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v2
- name: Install Packages
run: pip install -r requirements_dev.txt
diff --git a/.github/workflows/listener.yml b/.github/workflows/listener.yml
index b920cd90..72568e83 100644
--- a/.github/workflows/listener.yml
+++ b/.github/workflows/listener.yml
@@ -1,4 +1,4 @@
-# Ingest repository_dispatch events and trigger appropriate actions
+# Ingest repository_dispatch events and trigger appropriate actions
name: Listener
on:
@@ -6,24 +6,24 @@ on:
types: [Build]
jobs:
- build:
+ build:
if: ${{ github.event.action == 'Build' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- - name: Build SDK and Open PR
- uses: Bandwidth/generate-sdk-action@v1.0.0
- with:
+ - name: Build SDK and Open PR
+ uses: Bandwidth/generate-sdk-action@v2.0.1
+ with:
branch-name: ${{ github.event.client_payload.branchName }}
username: ${{ secrets.DX_GITHUB_USERNAME }}
token: ${{ secrets.DX_GITHUB_TOKEN }}
- openapi-generator-version: v5.4.0
- language: python
+ openapi-generator-version: 6.0.1
+ language: python
config: ./openapi-config.yml
- env:
+ env:
GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}
-
+
- name: Open Pull Request
run: |
exists=$(hub pr list -h {{ inputs.branch-name }})
@@ -34,34 +34,22 @@ jobs:
echo "PR already exists for this branch"
fi
env:
- GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}
-
- - name: Output PR Number
+ GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}
+
+ - name: Output PR Number
id: output-pr-number
run: echo "PR_NUMBER=$(hub pr list -h ${{ inputs.branch-name }} -f %I)" >> $GITHUB_ENV
env:
- GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}
+ GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}
- - uses: actions/github-script@v6
- with:
- github-token: ${{secrets.DX_GITHUB_TOKEN}}
- script: |
- github.rest.issues.createComment({
- issue_number: ${{ github.event.client_payload.prNumber }},
- owner: context.repo.owner,
- repo: 'api-specs',
- body: 'Python SDK built successfully\n\nSee the corresponding PR opened on the SDK repository (no action required):\nhttps://github.com/Bandwidth/api-docs/pull/${{ env.PR_NUMBER }}'
- })
-
- - name: Notify for Failure
+ # Comment on PR
+ - name: Comment on PR
uses: actions/github-script@v6
- if: failure()
with:
- github-token: ${{secrets.DX_GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: ${{ github.event.client_payload.prNumber }},
- owner: context.repo.owner,
+ owner: 'Bandwidth',
repo: 'api-specs',
- body: 'Python SDK failed to build successfully\n\nSee the Python SDK repository [action logs](https://github.com/Bandwidth/python-sdk/actions) for more information.'
+ body: 'Python SDK built successfully\n\nSee the corresponding PR opened on the SDK repository (no action required):\nhttps://github.com/Bandwidth/api-docs/pull/${{ env.PR_NUMBER }}'
})
diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml
deleted file mode 100644
index 4c511d97..00000000
--- a/.github/workflows/test-pr.yml
+++ /dev/null
@@ -1,94 +0,0 @@
-name: Test PR
-
-on:
- pull_request:
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref }}
- cancel-in-progress: true
-
-env:
- BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }}
- BW_USERNAME: ${{ secrets.BW_USERNAME }}
- BW_PASSWORD: ${{ secrets.BW_PASSWORD }}
- BW_USERNAME_FORBIDDEN: ${{ secrets.BW_USERNAME_FORBIDDEN }}
- BW_PASSWORD_FORBIDDEN: ${{ secrets.BW_PASSWORD_FORBIDDEN }}
- BW_VOICE_APPLICATION_ID: ${{ secrets.BW_VOICE_APPLICATION_ID }}
- BW_MESSAGING_APPLICATION_ID: ${{ secrets.BW_MESSAGING_APPLICATION_ID }}
- BW_NUMBER: ${{ secrets.BW_NUMBER }}
- USER_NUMBER: ${{ secrets.USER_NUMBER }}
- VZW_NUMBER: ${{ secrets.VZW_NUMBER }}
- ATT_NUMBER: ${{ secrets.ATT_NUMBER }}
- T_MOBILE_NUMBER: ${{ secrets.T_MOBILE_NUMBER }}
- BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }}
- MANTECA_ACTIVE_NUMBER: ${{ secrets.MANTECA_ACTIVE_NUMBER }}
- MANTECA_IDLE_NUMBER: ${{ secrets.MANTECA_IDLE_NUMBER }}
- MANTECA_BASE_URL: ${{ secrets.MANTECA_BASE_URL }}
- MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }}
- BW_NUMBER_PROVIDER: ${{ secrets.BW_NUMBER_PROVIDER }}
-
-jobs:
- test_pr_main:
- name: Test PR to Main Branch
- runs-on: ${{ matrix.os }}
- if: github.base_ref == 'main'
- strategy:
- matrix:
- os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-22.04]
- python-version: [3.7, 3.8, 3.9, '3.10', '3.11']
- exclude:
- - os: windows-2019
- python-version: '3.11'
- - os: windows-2022
- python-version: '3.11'
- steps:
- - name: Checkout
- uses: actions/checkout@v3
-
- - name: Set up Python
- uses: actions/setup-python@v4
- with:
- python-version: ${{ matrix.python-version }}
-
- - name: Install Packages and Test
- run: |
- pip install -r requirements_dev.txt
- python -m pytest --pyargs bandwidth
-
- test_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]
- python-version: [3.8, 3.9, '3.10']
- env:
- PYTHON_VERSION: ${{ matrix.python-version }}
- OPERATING_SYSTEM: ${{ matrix.os }}
- steps:
- - name: Checkout
- uses: actions/checkout@v3
-
- - name: Set up Python
- uses: actions/setup-python@v4
- with:
- python-version: ${{ matrix.python-version }}
-
- - name: Install Packages
- run: |
- pip install --upgrade setuptools
- pip install -r requirements.txt
- pip install -r test-requirements.txt
-
- - name: Test at Debug Level
- if: ${{ inputs.logLevel == 'DEBUG' }}
- run: |
- echo "Log level: DEBUG"
- pytest -v --log-cli-level=DEBUG
-
- - name: Test at Warning Level
- if: ${{( inputs.logLevel == null) || ( inputs.logLevel == 'WARNING') }}
- run: |
- echo "Log level: WARNING"
- pytest -v --log-cli-level=WARNING
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
new file mode 100644
index 00000000..2d78310d
--- /dev/null
+++ b/.github/workflows/test.yaml
@@ -0,0 +1,80 @@
+name: Test
+
+on:
+ schedule:
+ - cron: "0 4 * * *"
+ pull_request:
+ workflow_dispatch:
+ inputs:
+ logLevel:
+ description: Log level
+ required: false
+ default: WARNING
+ type: choice
+ options:
+ - WARNING
+ - DEBUG
+
+jobs:
+ deploy:
+ name: Test
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-latest]
+ python-version: [3.8, 3.9, "3.10", "3.11"]
+ 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 }}
+ PYTHON_VERSION: ${{ matrix.python-version }}
+ OPERATING_SYSTEM: ${{ matrix.os }}
+ 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: Checkout
+ uses: actions/checkout@v2
+
+ - name: Set up Python
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python-version }}
+
+ - name: Install Packages
+ run: |
+ pip install -r requirements.txt
+ pip install -r test-requirements.txt
+
+ - name: Test at Debug Level
+ if: ${{ inputs.logLevel == 'DEBUG' }}
+ run: |
+ echo "Log level: DEBUG"
+ pytest -v --log-cli-level=DEBUG
+
+ - name: Test at Warning Level
+ if: ${{( inputs.logLevel == null) || ( inputs.logLevel == 'WARNING') }}
+ run: |
+ echo "Log level: WARNING"
+ pytest -v --log-cli-level=WARNING
+
+ - name: Notify Slack of Failures
+ uses: Bandwidth/build-notify-slack-action@v1.0.0
+ if: failure() && !github.event.pull_request.draft
+ with:
+ job-status: ${{ job.status }}
+ slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
+ slack-channel: ${{ secrets.SLACK_CHANNEL }}
diff --git a/.gitignore b/.gitignore
index d5ce33e4..d5dfbee6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,10 +1,79 @@
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+# C extensions
+*.so
+
+# MacOS Files
.DS_Store
-.idea/
-*.pyc
-.pytest_cache/
-# Build files
+# Distribution / packaging
+.Python
+env/
build/
-bandwidth_sdk.egg-info
-pyproject.toml
+logs/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+*.egg-info/
+.installed.cfg
+*.egg
+
+# PyInstaller
+# Usually these files are written by a python script from a template
+# before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*,cover
+.hypothesis/
+venv/
+.venv/
+.python-version
+.pytest_cache
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+target/
+
+#Ipython Notebook
+.ipynb_checkpoints
+
+# IntelliJ
+.idea
+
+# VS Code
+.vscode
+
+# Test Fixtures
+test/fixtures/
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 00000000..4b6ac748
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,25 @@
+# NOTE: This file is auto generated by OpenAPI Generator.
+# URL: https://openapi-generator.tech
+#
+# ref: https://docs.gitlab.com/ee/ci/README.html
+# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml
+
+stages:
+ - test
+
+.pytest:
+ stage: test
+ script:
+ - pip install -r requirements.txt
+ - pip install -r test-requirements.txt
+ - pytest --cov=bandwidth
+
+pytest-3.7:
+ extends: .pytest
+ image: python:3.7-alpine
+pytest-3.8:
+ extends: .pytest
+ image: python:3.8-alpine
+pytest-3.9:
+ extends: .pytest
+ image: python:3.9-alpine
\ No newline at end of file
diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore
new file mode 100644
index 00000000..818bd90f
--- /dev/null
+++ b/.openapi-generator-ignore
@@ -0,0 +1,30 @@
+# 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
+
+.gitignore
+setup.cfg
+setup.py
+#*requirements.txt
+test/*
+.github/workflows/python.yml
diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES
new file mode 100644
index 00000000..59040755
--- /dev/null
+++ b/.openapi-generator/FILES
@@ -0,0 +1,210 @@
+.github/workflows/python.yml
+.gitlab-ci.yml
+.travis.yml
+README.md
+bandwidth/__init__.py
+bandwidth/api/__init__.py
+bandwidth/api/calls_api.py
+bandwidth/api/conferences_api.py
+bandwidth/api/media_api.py
+bandwidth/api/messages_api.py
+bandwidth/api/mfa_api.py
+bandwidth/api/phone_number_lookup_api.py
+bandwidth/api/recordings_api.py
+bandwidth/api/statistics_api.py
+bandwidth/api_client.py
+bandwidth/api_response.py
+bandwidth/configuration.py
+bandwidth/exceptions.py
+bandwidth/models/__init__.py
+bandwidth/models/account_statistics.py
+bandwidth/models/answer_callback.py
+bandwidth/models/bridge_complete_callback.py
+bandwidth/models/bridge_target_complete_callback.py
+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/callback_method_enum.py
+bandwidth/models/code_request.py
+bandwidth/models/conference.py
+bandwidth/models/conference_completed_callback.py
+bandwidth/models/conference_created_callback.py
+bandwidth/models/conference_member.py
+bandwidth/models/conference_member_exit_callback.py
+bandwidth/models/conference_member_join_callback.py
+bandwidth/models/conference_recording_available_callback.py
+bandwidth/models/conference_recording_metadata.py
+bandwidth/models/conference_redirect_callback.py
+bandwidth/models/conference_state_enum.py
+bandwidth/models/create_call.py
+bandwidth/models/create_call_response.py
+bandwidth/models/create_lookup_response.py
+bandwidth/models/create_message_request_error.py
+bandwidth/models/deferred_result.py
+bandwidth/models/disconnect_callback.py
+bandwidth/models/diversion.py
+bandwidth/models/dtmf_callback.py
+bandwidth/models/field_error.py
+bandwidth/models/file_format_enum.py
+bandwidth/models/gather_callback.py
+bandwidth/models/inbound_message_callback.py
+bandwidth/models/inbound_message_callback_message.py
+bandwidth/models/initiate_callback.py
+bandwidth/models/list_message_direction_enum.py
+bandwidth/models/list_message_item.py
+bandwidth/models/lookup_request.py
+bandwidth/models/lookup_result.py
+bandwidth/models/lookup_status.py
+bandwidth/models/lookup_status_enum.py
+bandwidth/models/machine_detection_complete_callback.py
+bandwidth/models/machine_detection_configuration.py
+bandwidth/models/machine_detection_mode_enum.py
+bandwidth/models/machine_detection_result.py
+bandwidth/models/media.py
+bandwidth/models/message.py
+bandwidth/models/message_delivered_callback.py
+bandwidth/models/message_delivered_callback_message.py
+bandwidth/models/message_direction_enum.py
+bandwidth/models/message_failed_callback.py
+bandwidth/models/message_failed_callback_message.py
+bandwidth/models/message_request.py
+bandwidth/models/message_sending_callback.py
+bandwidth/models/message_sending_callback_message.py
+bandwidth/models/message_status_enum.py
+bandwidth/models/message_type_enum.py
+bandwidth/models/messages_list.py
+bandwidth/models/messaging_code_response.py
+bandwidth/models/messaging_request_error.py
+bandwidth/models/mfa_forbidden_request_error.py
+bandwidth/models/mfa_request_error.py
+bandwidth/models/mfa_unauthorized_request_error.py
+bandwidth/models/page_info.py
+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/redirect_callback.py
+bandwidth/models/redirect_method_enum.py
+bandwidth/models/stir_shaken.py
+bandwidth/models/tag.py
+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
+bandwidth/models/update_call.py
+bandwidth/models/update_call_recording.py
+bandwidth/models/update_conference.py
+bandwidth/models/update_conference_member.py
+bandwidth/models/verify_code_request.py
+bandwidth/models/verify_code_response.py
+bandwidth/models/voice_api_error.py
+bandwidth/models/voice_code_response.py
+bandwidth/py.typed
+bandwidth/rest.py
+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/DisconnectCallback.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/MachineDetectionResult.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
+pyproject.toml
+requirements.txt
+test-requirements.txt
+tox.ini
diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION
new file mode 100644
index 00000000..41225218
--- /dev/null
+++ b/.openapi-generator/VERSION
@@ -0,0 +1 @@
+7.0.0
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 00000000..27e94b28
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,17 @@
+# ref: https://docs.travis-ci.com/user/languages/python
+language: python
+python:
+ - "3.7"
+ - "3.8"
+ - "3.9"
+ - "3.10"
+ - "3.11"
+ # uncomment the following if needed
+ #- "3.11-dev" # 3.11 development branch
+ #- "nightly" # nightly build
+# command to install dependencies
+install:
+ - "pip install -r requirements.txt"
+ - "pip install -r test-requirements.txt"
+# command to run tests
+script: pytest --cov=bandwidth
diff --git a/MANIFEST.in b/MANIFEST.in
deleted file mode 100644
index 64aa22e7..00000000
--- a/MANIFEST.in
+++ /dev/null
@@ -1,2 +0,0 @@
-include LICENSE
-include README.md
diff --git a/README.md b/README.md
index b9154464..35194257 100644
--- a/README.md
+++ b/README.md
@@ -1,211 +1,244 @@
-# Bandwidth Python SDK
+# bandwidth-sdk
+Bandwidth's Communication APIs
-[![Test](https://github.com/Bandwidth/python-sdk/actions/workflows/test.yaml/badge.svg)](https://github.com/Bandwidth/python-sdk/actions/workflows/test.yaml)
+This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
-| **OS** | **Python** |
-|:---:|:-------------------------:|
-| Windows 2016 | 3.7, 3.8, 3.9, 3.10, 3.11 |
-| Windows 2019 | 3.7, 3.8, 3.9, 3.10, 3.11 |
-| Ubuntu 20.04 | 3.7, 3.8, 3.9, 3.10, 3.11 |
-| Ubuntu 22.04 | 3.7, 3.8, 3.9, 3.10, 3.11 |
+- API version: 1.0.0
+- Package version: 15.0.0
+- Build package: org.openapitools.codegen.languages.PythonClientCodegen
+For more information, please visit [https://dev.bandwidth.com](https://dev.bandwidth.com)
+## Requirements.
-## Getting Started
-
-### Installation
+Python 3.7+
-```
-pip install bandwidth-sdk
-```
+## Installation & Usage
+### pip install
-### Initialize
+If the python package is hosted on a repository, you can install directly using:
-```python
-from bandwidth.bandwidth_client import BandwidthClient
-
-from bandwidth.messaging.models.message_request import MessageRequest
-from bandwidth.messaging.exceptions.messaging_exception import MessagingException
-
-from bandwidth.voice.models.create_call_request import CreateCallRequest
-from bandwidth.voice.exceptions.api_error_exception import ApiErrorException
-from bandwidth.voice.bxml.response import Response
-from bandwidth.voice.bxml.verbs import *
-
-from bandwidth.multifactorauth.models.two_factor_code_request_schema import TwoFactorCodeRequestSchema
-from bandwidth.multifactorauth.models.two_factor_verify_request_schema import TwoFactorVerifyRequestSchema
-
-from bandwidth.phonenumberlookup.controllers.api_controller import APIController, ApiResponse, APIException
-from bandwidth.phonenumberlookup.models.order_request import OrderRequest
-
-from bandwidth.webrtc.models.session import Session
-from bandwidth.webrtc.models.participant import Participant
-from bandwidth.webrtc.models.publish_permission_enum import PublishPermissionEnum
-
-bandwidth_client = BandwidthClient(
- voice_basic_auth_user_name='username',
- voice_basic_auth_password='password',
- messaging_basic_auth_user_name='username',
- messaging_basic_auth_password='password',
- multi_factor_auth_basic_auth_user_name='username',
- multi_factor_auth_basic_auth_password='password',
- phone_number_lookup_basic_auth_user_name='username',
- phone_number_lookup_basic_auth_password='password',
- web_rtc_basic_auth_user_name='username',
- web_rtc_basic_auth_password='password'
-)
-account_id = "12345"
+```sh
+pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
```
+(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)
-### Create A Phone Call
-
+Then import the package:
```python
-voice_client = bandwidth_client.voice_client.client
-
-##Create phone call
-body = CreateCallRequest()
-body.mfrom = "+17777777777"
-body.to = "+16666666666"
-body.application_id = "3-d-4-b-5"
-body.answer_url = "https://test.com"
-
-try:
- response = voice_client.create_call(account_id, body=body)
- print(response.body.call_id) #c-3f758f24-a59bb21e-4f23-4d62-afe9-53o2ls3o4saio4l
- print(response.status_code) #201
-except ApiErrorResponseException as e:
- print(e.description) #Invalid from: must be an E164 telephone number
- print(e.response_code) #400
+import bandwidth
```
-### Send A Text Message
+### Setuptools
-```python
-messaging_client = bandwidth_client.messaging_client.client
-
-body = MessageRequest()
-body.application_id = "1-d-b"
-body.to = ["+17777777777"]
-body.mfrom = "+18888888888"
-body.text = "Greetings!"
-
-try:
- response = messaging_client.create_message(account_id, body)
- print(response.body.id) #1570819529611mexbyfr7ugrouuxy
- print(response.status_code) #202
-except MessagingException as e:
- print(e.description) #Your request could not be accepted.
- print(e.response_code) #400
-```
-
-### Create BXML
+Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
-```python
-response = Response()
-speak_sentence = SpeakSentence(
- sentence="Test",
- voice="susan",
- locale="en_US",
- gender="female"
-)
-
-response.add_verb(speak_sentence)
-print(response.to_bxml())
+```sh
+python setup.py install --user
```
+(or `sudo python setup.py install` to install the package for all users)
-### Create A MFA Request
-
+Then import the package:
```python
-auth_client = bandwidth_client.multi_factor_auth_client.client
-
-from_phone = "+18888888888"
-to_phone = "+17777777777"
-messaging_application_id = "1-d-b"
-scope = "scope"
-digits = 6
-
-body = TwoFactorCodeRequestSchema(
- mfrom = from_phone,
- to = to_phone,
- application_id = messaging_application_id,
- scope = scope,
- digits = digits,
- 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(
- to = to_phone,
- application_id = application_id,
- scope = scope,
- code = code,
- expiration_time_in_minutes = 3
-)
-response = auth_client.create_verify_two_factor(account_id, body)
-print("Auth status: " + str(response.body.valid))
+import bandwidth
```
-### Perform a TN Lookup Request
-
-```python
-tnLookup_controller = bandwidth_client.phone_number_lookup_client.client
-body = AccountsTnlookupRequest()
-body.tns = ['+19195551234']
-
-try:
- response = tnLookup_controller.create_tn_lookup_request(account_id, body)
- print(response.status_code)
-
-except APIException as e:
- print("Error:", e.response_code)
-
-requestId = response.body.request_id # "1234-abcd-5678-efgh"
+### Tests
-try:
- response = tnLookup_controller.get_tn_lookup_result(account_id, requestId)
- print(response)
+Execute `pytest` to run the tests.
-except APIException as e:
- print("Error:", e.response_code)
-```
+## Getting Started
-### WebRtc Participant & Session Management
+Please follow the [installation procedure](#installation--usage) and then run the following:
```python
-web_rtc_client = bandwidth_client.web_rtc_client.client
-participant1 = {'participantId': '456'}
-participant2 = {'participantId': '789', 'streamAliases': ['alias1', 'alias2']}
-subscriptions = {'sessionId': session_id_arg, 'participants': [participant1, participant2]}
+import time
+import bandwidth
+from bandwidth.rest import ApiException
+from pprint import pprint
-create_session_body = Session()
-create_session_body.tag = 'new-session'
-
-create_session_response = web_rtc_client.create_session(account_id, create_session_body)
-session_id = create_session_response.body.id
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
-create_participant_body = Participant()
-create_participant_body.publish_permissions = [
- PublishPermissionEnum.AUDIO,
- PublishPermissionEnum.VIDEO
-]
-create_participant_body.callback_url = "https://sample.com"
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
-create_participant_response = web_rtc_client.create_participant(account_id, create_participant_body)
-participant_id = create_participant_response.body.participant.id
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
-web_rtc_client.add_participant_to_session(account_id, session_id, participant_id, subscriptions)
-```
-## Supported Python Versions
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.CallsApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ create_call = bandwidth.CreateCall() # CreateCall | JSON object containing information to create an outbound call
-This package can be used with Python >= 3.0
+ try:
+ # Create Call
+ api_response = api_instance.create_call(account_id, create_call)
+ print("The response of CallsApi->create_call:\n")
+ pprint(api_response)
+ except ApiException as e:
+ print("Exception when calling CallsApi->create_call: %s\n" % e)
-## Documentation
+```
-Documentation for this package can be found at https://dev.bandwidth.com/sdks/python.html
+## Documentation for API Endpoints
+
+All URIs are relative to *http://localhost*
+
+Class | Method | HTTP request | Description
+------------ | ------------- | ------------- | -------------
+*CallsApi* | [**create_call**](docs/CallsApi.md#create_call) | **POST** /accounts/{accountId}/calls | Create Call
+*CallsApi* | [**get_call_state**](docs/CallsApi.md#get_call_state) | **GET** /accounts/{accountId}/calls/{callId} | Get Call State Information
+*CallsApi* | [**update_call**](docs/CallsApi.md#update_call) | **POST** /accounts/{accountId}/calls/{callId} | Update Call
+*CallsApi* | [**update_call_bxml**](docs/CallsApi.md#update_call_bxml) | **PUT** /accounts/{accountId}/calls/{callId}/bxml | Update Call BXML
+*ConferencesApi* | [**download_conference_recording**](docs/ConferencesApi.md#download_conference_recording) | **GET** /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}/media | Download Conference Recording
+*ConferencesApi* | [**get_conference**](docs/ConferencesApi.md#get_conference) | **GET** /accounts/{accountId}/conferences/{conferenceId} | Get Conference Information
+*ConferencesApi* | [**get_conference_member**](docs/ConferencesApi.md#get_conference_member) | **GET** /accounts/{accountId}/conferences/{conferenceId}/members/{memberId} | Get Conference Member
+*ConferencesApi* | [**get_conference_recording**](docs/ConferencesApi.md#get_conference_recording) | **GET** /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId} | Get Conference Recording Information
+*ConferencesApi* | [**list_conference_recordings**](docs/ConferencesApi.md#list_conference_recordings) | **GET** /accounts/{accountId}/conferences/{conferenceId}/recordings | Get Conference Recordings
+*ConferencesApi* | [**list_conferences**](docs/ConferencesApi.md#list_conferences) | **GET** /accounts/{accountId}/conferences | Get Conferences
+*ConferencesApi* | [**update_conference**](docs/ConferencesApi.md#update_conference) | **POST** /accounts/{accountId}/conferences/{conferenceId} | Update Conference
+*ConferencesApi* | [**update_conference_bxml**](docs/ConferencesApi.md#update_conference_bxml) | **PUT** /accounts/{accountId}/conferences/{conferenceId}/bxml | Update Conference BXML
+*ConferencesApi* | [**update_conference_member**](docs/ConferencesApi.md#update_conference_member) | **PUT** /accounts/{accountId}/conferences/{conferenceId}/members/{memberId} | Update Conference Member
+*MFAApi* | [**generate_messaging_code**](docs/MFAApi.md#generate_messaging_code) | **POST** /accounts/{accountId}/code/messaging | Messaging Authentication Code
+*MFAApi* | [**generate_voice_code**](docs/MFAApi.md#generate_voice_code) | **POST** /accounts/{accountId}/code/voice | Voice Authentication Code
+*MFAApi* | [**verify_code**](docs/MFAApi.md#verify_code) | **POST** /accounts/{accountId}/code/verify | Verify Authentication Code
+*MediaApi* | [**delete_media**](docs/MediaApi.md#delete_media) | **DELETE** /users/{accountId}/media/{mediaId} | Delete Media
+*MediaApi* | [**get_media**](docs/MediaApi.md#get_media) | **GET** /users/{accountId}/media/{mediaId} | Get Media
+*MediaApi* | [**list_media**](docs/MediaApi.md#list_media) | **GET** /users/{accountId}/media | List Media
+*MediaApi* | [**upload_media**](docs/MediaApi.md#upload_media) | **PUT** /users/{accountId}/media/{mediaId} | Upload Media
+*MessagesApi* | [**create_message**](docs/MessagesApi.md#create_message) | **POST** /users/{accountId}/messages | Create Message
+*MessagesApi* | [**list_messages**](docs/MessagesApi.md#list_messages) | **GET** /users/{accountId}/messages | List Messages
+*PhoneNumberLookupApi* | [**create_lookup**](docs/PhoneNumberLookupApi.md#create_lookup) | **POST** /accounts/{accountId}/tnlookup | Create Lookup
+*PhoneNumberLookupApi* | [**get_lookup_status**](docs/PhoneNumberLookupApi.md#get_lookup_status) | **GET** /accounts/{accountId}/tnlookup/{requestId} | Get Lookup Request Status
+*RecordingsApi* | [**delete_call_transcription**](docs/RecordingsApi.md#delete_call_transcription) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Delete Transcription
+*RecordingsApi* | [**delete_recording**](docs/RecordingsApi.md#delete_recording) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId} | Delete Recording
+*RecordingsApi* | [**delete_recording_media**](docs/RecordingsApi.md#delete_recording_media) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media | Delete Recording Media
+*RecordingsApi* | [**download_call_recording**](docs/RecordingsApi.md#download_call_recording) | **GET** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media | Download Recording
+*RecordingsApi* | [**get_call_recording**](docs/RecordingsApi.md#get_call_recording) | **GET** /accounts/{accountId}/calls/{callId}/recordings/{recordingId} | Get Call Recording
+*RecordingsApi* | [**get_call_transcription**](docs/RecordingsApi.md#get_call_transcription) | **GET** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Get Transcription
+*RecordingsApi* | [**list_account_call_recordings**](docs/RecordingsApi.md#list_account_call_recordings) | **GET** /accounts/{accountId}/recordings | Get Call Recordings
+*RecordingsApi* | [**list_call_recordings**](docs/RecordingsApi.md#list_call_recordings) | **GET** /accounts/{accountId}/calls/{callId}/recordings | List Call Recordings
+*RecordingsApi* | [**transcribe_call_recording**](docs/RecordingsApi.md#transcribe_call_recording) | **POST** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Create Transcription Request
+*RecordingsApi* | [**update_call_recording_state**](docs/RecordingsApi.md#update_call_recording_state) | **PUT** /accounts/{accountId}/calls/{callId}/recording | Update Recording
+*StatisticsApi* | [**get_statistics**](docs/StatisticsApi.md#get_statistics) | **GET** /accounts/{accountId}/statistics | Get Account Statistics
+
+
+## Documentation For Models
+
+ - [AccountStatistics](docs/AccountStatistics.md)
+ - [AnswerCallback](docs/AnswerCallback.md)
+ - [BridgeCompleteCallback](docs/BridgeCompleteCallback.md)
+ - [BridgeTargetCompleteCallback](docs/BridgeTargetCompleteCallback.md)
+ - [CallDirectionEnum](docs/CallDirectionEnum.md)
+ - [CallRecordingMetadata](docs/CallRecordingMetadata.md)
+ - [CallState](docs/CallState.md)
+ - [CallStateEnum](docs/CallStateEnum.md)
+ - [CallbackMethodEnum](docs/CallbackMethodEnum.md)
+ - [CodeRequest](docs/CodeRequest.md)
+ - [Conference](docs/Conference.md)
+ - [ConferenceCompletedCallback](docs/ConferenceCompletedCallback.md)
+ - [ConferenceCreatedCallback](docs/ConferenceCreatedCallback.md)
+ - [ConferenceMember](docs/ConferenceMember.md)
+ - [ConferenceMemberExitCallback](docs/ConferenceMemberExitCallback.md)
+ - [ConferenceMemberJoinCallback](docs/ConferenceMemberJoinCallback.md)
+ - [ConferenceRecordingAvailableCallback](docs/ConferenceRecordingAvailableCallback.md)
+ - [ConferenceRecordingMetadata](docs/ConferenceRecordingMetadata.md)
+ - [ConferenceRedirectCallback](docs/ConferenceRedirectCallback.md)
+ - [ConferenceStateEnum](docs/ConferenceStateEnum.md)
+ - [CreateCall](docs/CreateCall.md)
+ - [CreateCallResponse](docs/CreateCallResponse.md)
+ - [CreateLookupResponse](docs/CreateLookupResponse.md)
+ - [CreateMessageRequestError](docs/CreateMessageRequestError.md)
+ - [DeferredResult](docs/DeferredResult.md)
+ - [DisconnectCallback](docs/DisconnectCallback.md)
+ - [Diversion](docs/Diversion.md)
+ - [DtmfCallback](docs/DtmfCallback.md)
+ - [FieldError](docs/FieldError.md)
+ - [FileFormatEnum](docs/FileFormatEnum.md)
+ - [GatherCallback](docs/GatherCallback.md)
+ - [InboundMessageCallback](docs/InboundMessageCallback.md)
+ - [InboundMessageCallbackMessage](docs/InboundMessageCallbackMessage.md)
+ - [InitiateCallback](docs/InitiateCallback.md)
+ - [ListMessageDirectionEnum](docs/ListMessageDirectionEnum.md)
+ - [ListMessageItem](docs/ListMessageItem.md)
+ - [LookupRequest](docs/LookupRequest.md)
+ - [LookupResult](docs/LookupResult.md)
+ - [LookupStatus](docs/LookupStatus.md)
+ - [LookupStatusEnum](docs/LookupStatusEnum.md)
+ - [MachineDetectionCompleteCallback](docs/MachineDetectionCompleteCallback.md)
+ - [MachineDetectionConfiguration](docs/MachineDetectionConfiguration.md)
+ - [MachineDetectionModeEnum](docs/MachineDetectionModeEnum.md)
+ - [MachineDetectionResult](docs/MachineDetectionResult.md)
+ - [Media](docs/Media.md)
+ - [Message](docs/Message.md)
+ - [MessageDeliveredCallback](docs/MessageDeliveredCallback.md)
+ - [MessageDeliveredCallbackMessage](docs/MessageDeliveredCallbackMessage.md)
+ - [MessageDirectionEnum](docs/MessageDirectionEnum.md)
+ - [MessageFailedCallback](docs/MessageFailedCallback.md)
+ - [MessageFailedCallbackMessage](docs/MessageFailedCallbackMessage.md)
+ - [MessageRequest](docs/MessageRequest.md)
+ - [MessageSendingCallback](docs/MessageSendingCallback.md)
+ - [MessageSendingCallbackMessage](docs/MessageSendingCallbackMessage.md)
+ - [MessageStatusEnum](docs/MessageStatusEnum.md)
+ - [MessageTypeEnum](docs/MessageTypeEnum.md)
+ - [MessagesList](docs/MessagesList.md)
+ - [MessagingCodeResponse](docs/MessagingCodeResponse.md)
+ - [MessagingRequestError](docs/MessagingRequestError.md)
+ - [MfaForbiddenRequestError](docs/MfaForbiddenRequestError.md)
+ - [MfaRequestError](docs/MfaRequestError.md)
+ - [MfaUnauthorizedRequestError](docs/MfaUnauthorizedRequestError.md)
+ - [PageInfo](docs/PageInfo.md)
+ - [PriorityEnum](docs/PriorityEnum.md)
+ - [RecordingAvailableCallback](docs/RecordingAvailableCallback.md)
+ - [RecordingCompleteCallback](docs/RecordingCompleteCallback.md)
+ - [RecordingStateEnum](docs/RecordingStateEnum.md)
+ - [RedirectCallback](docs/RedirectCallback.md)
+ - [RedirectMethodEnum](docs/RedirectMethodEnum.md)
+ - [StirShaken](docs/StirShaken.md)
+ - [Tag](docs/Tag.md)
+ - [TnLookupRequestError](docs/TnLookupRequestError.md)
+ - [TranscribeRecording](docs/TranscribeRecording.md)
+ - [Transcription](docs/Transcription.md)
+ - [TranscriptionAvailableCallback](docs/TranscriptionAvailableCallback.md)
+ - [TranscriptionList](docs/TranscriptionList.md)
+ - [TranscriptionMetadata](docs/TranscriptionMetadata.md)
+ - [TransferAnswerCallback](docs/TransferAnswerCallback.md)
+ - [TransferCompleteCallback](docs/TransferCompleteCallback.md)
+ - [TransferDisconnectCallback](docs/TransferDisconnectCallback.md)
+ - [UpdateCall](docs/UpdateCall.md)
+ - [UpdateCallRecording](docs/UpdateCallRecording.md)
+ - [UpdateConference](docs/UpdateConference.md)
+ - [UpdateConferenceMember](docs/UpdateConferenceMember.md)
+ - [VerifyCodeRequest](docs/VerifyCodeRequest.md)
+ - [VerifyCodeResponse](docs/VerifyCodeResponse.md)
+ - [VoiceApiError](docs/VoiceApiError.md)
+ - [VoiceCodeResponse](docs/VoiceCodeResponse.md)
+
+
+
+## Documentation For Authorization
+
+
+Authentication schemes defined for the API:
+
+### Basic
+
+- **Type**: HTTP basic authentication
+
+
+## Author
+
+letstalk@bandwidth.com
-## Credentials
-Information for credentials for this package can be found at https://dev.bandwidth.com/guides/accountCredentials.html
diff --git a/bandwidth.yml b/bandwidth.yml
new file mode 100644
index 00000000..1cbcd06f
--- /dev/null
+++ b/bandwidth.yml
@@ -0,0 +1,5626 @@
+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
+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'
+ '406':
+ $ref: '#/components/responses/messagingNotAcceptableError'
+ '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'
+ '406':
+ $ref: '#/components/responses/messagingNotAcceptableError'
+ '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.
+
+
+ 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
+ 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'
+ '406':
+ $ref: '#/components/responses/messagingNotAcceptableError'
+ '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'
+ '406':
+ $ref: '#/components/responses/messagingNotAcceptableError'
+ '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/campaignId'
+ - $ref: '#/components/parameters/sort'
+ - $ref: '#/components/parameters/pageToken'
+ - $ref: '#/components/parameters/limit'
+ - $ref: '#/components/parameters/limitTotalCount'
+ 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'
+ '406':
+ $ref: '#/components/responses/messagingNotAcceptableError'
+ '415':
+ $ref: '#/components/responses/messagingInvalidMediaTypeError'
+ '429':
+ $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:
+ 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/accountId'
+ 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/accountId'
+ - $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/accountId'
+ - $ref: '#/components/parameters/callId'
+ requestBody:
+ $ref: '#/components/requestBodies/updateCallRequest'
+ responses:
+ '200':
+ description: Call was 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/accountId'
+ - $ref: '#/components/parameters/callId'
+ requestBody:
+ $ref: '#/components/requestBodies/updateCallBxmlRequest'
+ responses:
+ '204':
+ description: Call BXML was 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/accountId'
+ - $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/accountId'
+ - $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/accountId'
+ - $ref: '#/components/parameters/conferenceId'
+ requestBody:
+ $ref: '#/components/requestBodies/updateConferenceRequest'
+ responses:
+ '204':
+ description: Conference was 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/accountId'
+ - $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/accountId'
+ - $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/accountId'
+ - $ref: '#/components/parameters/conferenceId'
+ - $ref: '#/components/parameters/memberId'
+ requestBody:
+ $ref: '#/components/requestBodies/updateConferenceMemberRequest'
+ responses:
+ '204':
+ description: Conference member was 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/accountId'
+ - $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/accountId'
+ - $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/accountId'
+ - $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/accountId'
+ - $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/accountId'
+ - $ref: '#/components/parameters/callId'
+ requestBody:
+ $ref: '#/components/requestBodies/updateCallRecordingRequest'
+ responses:
+ '200':
+ description: Recording state was 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/accountId'
+ - $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/accountId'
+ - $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/accountId'
+ - $ref: '#/components/parameters/callId'
+ - $ref: '#/components/parameters/recordingId'
+ responses:
+ '204':
+ description: Recording was 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/accountId'
+ - $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/accountId'
+ - $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/accountId'
+ - $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/accountId'
+ - $ref: '#/components/parameters/callId'
+ - $ref: '#/components/parameters/recordingId'
+ requestBody:
+ $ref: '#/components/requestBodies/transcribeRecordingRequest'
+ responses:
+ '204':
+ description: Transcription was 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/accountId'
+ - $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/accountId'
+ 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/accountId'
+ 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/accountId'
+ 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/accountId'
+ 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/accountId'
+ 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/accountId'
+ - $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
+components:
+ schemas:
+ priorityEnum:
+ type: string
+ description: |-
+ The priority specified by the user.
+
+ Not supported on MMS.
+ 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: >-
+ 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'
+ 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
+ format: date-time
+ 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
+ campaignId:
+ type: string
+ description: The campaign ID of the message if it has one.
+ nullable: true
+ example: CJEUMDK
+ 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
+ format: date-time
+ 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'
+ 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
+ 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
+ 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
+ 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
+ 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. 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
+ 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:
+ $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
+ 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:
+ $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
+ 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:
+ $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
+ 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:
+ $ref: '#/components/schemas/messageFailedCallbackMessage'
+ errorCode:
+ type: integer
+ example: 9902
+ required:
+ - time
+ - type
+ - to
+ - 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
+ 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
+ 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.
+ example: wav
+ 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
+ example: completed
+ conferenceStateEnum:
+ nullable: true
+ type: string
+ default: active
+ enum:
+ - active
+ - completed
+ description: >-
+ Setting the conference state to `completed` ends the conference and
+ ejects all members.
+ example: completed
+ 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.
+ example: async
+ 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.example`)).
+ 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'
+ 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
+ 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.example/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.example/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
+ example: https://www.myCallbackServer.example/webhooks/disconnect
+ 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
+ example: 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
+ example: 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.
+ example: 5
+ 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.
+ maxLength: 256
+ example: arbitrary text here
+ 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: 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 this call's 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.example/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.example/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.example/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: 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.example/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.example/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`.
+ maxLength: 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.example/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.example/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.example/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.example/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.example/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.example/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
+ 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:
+ 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'
+ disconnectCallback:
+ 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
+ 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.
+ 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: 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
+ 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
+ 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'
+ messagingNotAcceptableError:
+ description: Not Acceptable
+ 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.
+ 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
+ campaignId:
+ in: query
+ name: campaignId
+ required: false
+ description: The campaign ID of the message.
+ example: CJEUMDK
+ 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
+ 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
+ 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.
+ 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
+ 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'
+ 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==`
+ 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
+ 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.example/bandwidth/webhooks/answer
+ answerFallbackMethod: POST
+ disconnectMethod: POST
+ disconnectUrl: https://myServer.example/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.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.'
+ 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
diff --git a/bandwidth/__init__.py b/bandwidth/__init__.py
index cdb0db88..c7a1b41e 100644
--- a/bandwidth/__init__.py
+++ b/bandwidth/__init__.py
@@ -1,10 +1,129 @@
-__all__ = [
- 'api_helper',
- 'bandwidth_client',
- 'configuration',
- 'controllers',
- 'decorators',
- 'exceptions',
- 'http',
- 'models',
-]
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+__version__ = "15.0.0"
+
+# import apis into sdk package
+from bandwidth.api.calls_api import CallsApi
+from bandwidth.api.conferences_api import ConferencesApi
+from bandwidth.api.mfa_api import MFAApi
+from bandwidth.api.media_api import MediaApi
+from bandwidth.api.messages_api import MessagesApi
+from bandwidth.api.phone_number_lookup_api import PhoneNumberLookupApi
+from bandwidth.api.recordings_api import RecordingsApi
+from bandwidth.api.statistics_api import StatisticsApi
+
+# import ApiClient
+from bandwidth.api_response import ApiResponse
+from bandwidth.api_client import ApiClient
+from bandwidth.configuration import Configuration
+from bandwidth.exceptions import OpenApiException
+from bandwidth.exceptions import ApiTypeError
+from bandwidth.exceptions import ApiValueError
+from bandwidth.exceptions import ApiKeyError
+from bandwidth.exceptions import ApiAttributeError
+from bandwidth.exceptions import ApiException
+
+# import models into sdk package
+from bandwidth.models.account_statistics import AccountStatistics
+from bandwidth.models.answer_callback import AnswerCallback
+from bandwidth.models.bridge_complete_callback import BridgeCompleteCallback
+from bandwidth.models.bridge_target_complete_callback import BridgeTargetCompleteCallback
+from bandwidth.models.call_direction_enum import CallDirectionEnum
+from bandwidth.models.call_recording_metadata import CallRecordingMetadata
+from bandwidth.models.call_state import CallState
+from bandwidth.models.call_state_enum import CallStateEnum
+from bandwidth.models.callback_method_enum import CallbackMethodEnum
+from bandwidth.models.code_request import CodeRequest
+from bandwidth.models.conference import Conference
+from bandwidth.models.conference_completed_callback import ConferenceCompletedCallback
+from bandwidth.models.conference_created_callback import ConferenceCreatedCallback
+from bandwidth.models.conference_member import ConferenceMember
+from bandwidth.models.conference_member_exit_callback import ConferenceMemberExitCallback
+from bandwidth.models.conference_member_join_callback import ConferenceMemberJoinCallback
+from bandwidth.models.conference_recording_available_callback import ConferenceRecordingAvailableCallback
+from bandwidth.models.conference_recording_metadata import ConferenceRecordingMetadata
+from bandwidth.models.conference_redirect_callback import ConferenceRedirectCallback
+from bandwidth.models.conference_state_enum import ConferenceStateEnum
+from bandwidth.models.create_call import CreateCall
+from bandwidth.models.create_call_response import CreateCallResponse
+from bandwidth.models.create_lookup_response import CreateLookupResponse
+from bandwidth.models.create_message_request_error import CreateMessageRequestError
+from bandwidth.models.deferred_result import DeferredResult
+from bandwidth.models.disconnect_callback import DisconnectCallback
+from bandwidth.models.diversion import Diversion
+from bandwidth.models.dtmf_callback import DtmfCallback
+from bandwidth.models.field_error import FieldError
+from bandwidth.models.file_format_enum import FileFormatEnum
+from bandwidth.models.gather_callback import GatherCallback
+from bandwidth.models.inbound_message_callback import InboundMessageCallback
+from bandwidth.models.inbound_message_callback_message import InboundMessageCallbackMessage
+from bandwidth.models.initiate_callback import InitiateCallback
+from bandwidth.models.list_message_direction_enum import ListMessageDirectionEnum
+from bandwidth.models.list_message_item import ListMessageItem
+from bandwidth.models.lookup_request import LookupRequest
+from bandwidth.models.lookup_result import LookupResult
+from bandwidth.models.lookup_status import LookupStatus
+from bandwidth.models.lookup_status_enum import LookupStatusEnum
+from bandwidth.models.machine_detection_complete_callback import MachineDetectionCompleteCallback
+from bandwidth.models.machine_detection_configuration import MachineDetectionConfiguration
+from bandwidth.models.machine_detection_mode_enum import MachineDetectionModeEnum
+from bandwidth.models.machine_detection_result import MachineDetectionResult
+from bandwidth.models.media import Media
+from bandwidth.models.message import Message
+from bandwidth.models.message_delivered_callback import MessageDeliveredCallback
+from bandwidth.models.message_delivered_callback_message import MessageDeliveredCallbackMessage
+from bandwidth.models.message_direction_enum import MessageDirectionEnum
+from bandwidth.models.message_failed_callback import MessageFailedCallback
+from bandwidth.models.message_failed_callback_message import MessageFailedCallbackMessage
+from bandwidth.models.message_request import MessageRequest
+from bandwidth.models.message_sending_callback import MessageSendingCallback
+from bandwidth.models.message_sending_callback_message import MessageSendingCallbackMessage
+from bandwidth.models.message_status_enum import MessageStatusEnum
+from bandwidth.models.message_type_enum import MessageTypeEnum
+from bandwidth.models.messages_list import MessagesList
+from bandwidth.models.messaging_code_response import MessagingCodeResponse
+from bandwidth.models.messaging_request_error import MessagingRequestError
+from bandwidth.models.mfa_forbidden_request_error import MfaForbiddenRequestError
+from bandwidth.models.mfa_request_error import MfaRequestError
+from bandwidth.models.mfa_unauthorized_request_error import MfaUnauthorizedRequestError
+from bandwidth.models.page_info import PageInfo
+from bandwidth.models.priority_enum import PriorityEnum
+from bandwidth.models.recording_available_callback import RecordingAvailableCallback
+from bandwidth.models.recording_complete_callback import RecordingCompleteCallback
+from bandwidth.models.recording_state_enum import RecordingStateEnum
+from bandwidth.models.redirect_callback import RedirectCallback
+from bandwidth.models.redirect_method_enum import RedirectMethodEnum
+from bandwidth.models.stir_shaken import StirShaken
+from bandwidth.models.tag import Tag
+from bandwidth.models.tn_lookup_request_error import TnLookupRequestError
+from bandwidth.models.transcribe_recording import TranscribeRecording
+from bandwidth.models.transcription import Transcription
+from bandwidth.models.transcription_available_callback import TranscriptionAvailableCallback
+from bandwidth.models.transcription_list import TranscriptionList
+from bandwidth.models.transcription_metadata import TranscriptionMetadata
+from bandwidth.models.transfer_answer_callback import TransferAnswerCallback
+from bandwidth.models.transfer_complete_callback import TransferCompleteCallback
+from bandwidth.models.transfer_disconnect_callback import TransferDisconnectCallback
+from bandwidth.models.update_call import UpdateCall
+from bandwidth.models.update_call_recording import UpdateCallRecording
+from bandwidth.models.update_conference import UpdateConference
+from bandwidth.models.update_conference_member import UpdateConferenceMember
+from bandwidth.models.verify_code_request import VerifyCodeRequest
+from bandwidth.models.verify_code_response import VerifyCodeResponse
+from bandwidth.models.voice_api_error import VoiceApiError
+from bandwidth.models.voice_code_response import VoiceCodeResponse
diff --git a/bandwidth/api/__init__.py b/bandwidth/api/__init__.py
new file mode 100644
index 00000000..1af480a8
--- /dev/null
+++ b/bandwidth/api/__init__.py
@@ -0,0 +1,12 @@
+# flake8: noqa
+
+# import apis into api package
+from bandwidth.api.calls_api import CallsApi
+from bandwidth.api.conferences_api import ConferencesApi
+from bandwidth.api.mfa_api import MFAApi
+from bandwidth.api.media_api import MediaApi
+from bandwidth.api.messages_api import MessagesApi
+from bandwidth.api.phone_number_lookup_api import PhoneNumberLookupApi
+from bandwidth.api.recordings_api import RecordingsApi
+from bandwidth.api.statistics_api import StatisticsApi
+
diff --git a/bandwidth/api/calls_api.py b/bandwidth/api/calls_api.py
new file mode 100644
index 00000000..96e7569f
--- /dev/null
+++ b/bandwidth/api/calls_api.py
@@ -0,0 +1,737 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import re # noqa: F401
+import io
+import warnings
+
+from pydantic import validate_arguments, ValidationError
+from typing_extensions import Annotated
+
+from pydantic import Field, StrictStr
+
+from bandwidth.models.call_state import CallState
+from bandwidth.models.create_call import CreateCall
+from bandwidth.models.create_call_response import CreateCallResponse
+from bandwidth.models.update_call import UpdateCall
+
+from bandwidth.api_client import ApiClient
+from bandwidth.api_response import ApiResponse
+from bandwidth.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class CallsApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+ @validate_arguments
+ def create_call(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], create_call : Annotated[CreateCall, Field(..., description="JSON object containing information to create an outbound call")], **kwargs) -> CreateCallResponse: # noqa: E501
+ """Create Call # noqa: E501
+
+ 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. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.create_call(account_id, create_call, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param create_call: JSON object containing information to create an outbound call (required)
+ :type create_call: CreateCall
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: CreateCallResponse
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the create_call_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.create_call_with_http_info(account_id, create_call, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def create_call_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], create_call : Annotated[CreateCall, Field(..., description="JSON object containing information to create an outbound call")], **kwargs) -> ApiResponse: # noqa: E501
+ """Create Call # noqa: E501
+
+ 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. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.create_call_with_http_info(account_id, create_call, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param create_call: JSON object containing information to create an outbound call (required)
+ :type create_call: CreateCall
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(CreateCallResponse, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _hosts = [
+ 'https://voice.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'create_call'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method create_call" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ if _params['create_call'] is not None:
+ _body_params = _params['create_call']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {
+ '201': "CreateCallResponse",
+ '400': "VoiceApiError",
+ '401': "VoiceApiError",
+ '403': "VoiceApiError",
+ '404': "VoiceApiError",
+ '405': "VoiceApiError",
+ '415': "VoiceApiError",
+ '429': "VoiceApiError",
+ '500': "VoiceApiError",
+ }
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/calls', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def get_call_state(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], **kwargs) -> CallState: # noqa: E501
+ """Get Call State Information # noqa: E501
+
+ 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. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_call_state(account_id, call_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param call_id: Programmable Voice API Call ID. (required)
+ :type call_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: CallState
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the get_call_state_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.get_call_state_with_http_info(account_id, call_id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def get_call_state_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], **kwargs) -> ApiResponse: # noqa: E501
+ """Get Call State Information # noqa: E501
+
+ 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. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_call_state_with_http_info(account_id, call_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param call_id: Programmable Voice API Call ID. (required)
+ :type call_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(CallState, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _hosts = [
+ 'https://voice.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'call_id'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method get_call_state" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+ if _params['call_id']:
+ _path_params['callId'] = _params['call_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {
+ '200': "CallState",
+ '400': "VoiceApiError",
+ '401': "VoiceApiError",
+ '403': "VoiceApiError",
+ '404': "VoiceApiError",
+ '405': "VoiceApiError",
+ '415': "VoiceApiError",
+ '429': "VoiceApiError",
+ '500': "VoiceApiError",
+ }
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/calls/{callId}', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def update_call(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], update_call : Annotated[UpdateCall, Field(..., description="JSON object containing information to redirect an existing call to a new BXML document")], **kwargs) -> None: # noqa: E501
+ """Update Call # noqa: E501
+
+ Interrupts and redirects a call to a different URL that should return a BXML document. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_call(account_id, call_id, update_call, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param call_id: Programmable Voice API Call ID. (required)
+ :type call_id: str
+ :param update_call: JSON object containing information to redirect an existing call to a new BXML document (required)
+ :type update_call: UpdateCall
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the update_call_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.update_call_with_http_info(account_id, call_id, update_call, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def update_call_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], update_call : Annotated[UpdateCall, Field(..., description="JSON object containing information to redirect an existing call to a new BXML document")], **kwargs) -> ApiResponse: # noqa: E501
+ """Update Call # noqa: E501
+
+ Interrupts and redirects a call to a different URL that should return a BXML document. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_call_with_http_info(account_id, call_id, update_call, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param call_id: Programmable Voice API Call ID. (required)
+ :type call_id: str
+ :param update_call: JSON object containing information to redirect an existing call to a new BXML document (required)
+ :type update_call: UpdateCall
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _hosts = [
+ 'https://voice.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'call_id',
+ 'update_call'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method update_call" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+ if _params['call_id']:
+ _path_params['callId'] = _params['call_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ if _params['update_call'] is not None:
+ _body_params = _params['update_call']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/calls/{callId}', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def update_call_bxml(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], body : StrictStr, **kwargs) -> None: # noqa: E501
+ """Update Call BXML # noqa: E501
+
+ Interrupts and replaces an active call's BXML document. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_call_bxml(account_id, call_id, body, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param call_id: Programmable Voice API Call ID. (required)
+ :type call_id: str
+ :param body: (required)
+ :type body: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the update_call_bxml_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.update_call_bxml_with_http_info(account_id, call_id, body, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def update_call_bxml_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], body : StrictStr, **kwargs) -> ApiResponse: # noqa: E501
+ """Update Call BXML # noqa: E501
+
+ Interrupts and replaces an active call's BXML document. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_call_bxml_with_http_info(account_id, call_id, body, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param call_id: Programmable Voice API Call ID. (required)
+ :type call_id: str
+ :param body: (required)
+ :type body: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _hosts = [
+ 'https://voice.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'call_id',
+ 'body'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method update_call_bxml" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+ if _params['call_id']:
+ _path_params['callId'] = _params['call_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ if _params['body'] is not None:
+ _body_params = _params['body']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/xml']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/calls/{callId}/bxml', 'PUT',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
diff --git a/bandwidth/api/conferences_api.py b/bandwidth/api/conferences_api.py
new file mode 100644
index 00000000..bfa60933
--- /dev/null
+++ b/bandwidth/api/conferences_api.py
@@ -0,0 +1,1642 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import re # noqa: F401
+import io
+import warnings
+
+from pydantic import validate_arguments, ValidationError
+from typing_extensions import Annotated
+
+from pydantic import Field, StrictStr, conint
+
+from typing import List, Optional, Union
+
+from bandwidth.models.conference import Conference
+from bandwidth.models.conference_member import ConferenceMember
+from bandwidth.models.conference_recording_metadata import ConferenceRecordingMetadata
+from bandwidth.models.update_conference import UpdateConference
+from bandwidth.models.update_conference_member import UpdateConferenceMember
+
+from bandwidth.api_client import ApiClient
+from bandwidth.api_response import ApiResponse
+from bandwidth.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class ConferencesApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+ @validate_arguments
+ def download_conference_recording(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> bytearray: # noqa: E501
+ """Download Conference Recording # noqa: E501
+
+ Downloads the specified recording file. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.download_conference_recording(account_id, conference_id, recording_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param conference_id: Programmable Voice API Conference ID. (required)
+ :type conference_id: str
+ :param recording_id: Programmable Voice API Recording ID. (required)
+ :type recording_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: bytearray
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the download_conference_recording_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.download_conference_recording_with_http_info(account_id, conference_id, recording_id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def download_conference_recording_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> ApiResponse: # noqa: E501
+ """Download Conference Recording # noqa: E501
+
+ Downloads the specified recording file. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.download_conference_recording_with_http_info(account_id, conference_id, recording_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param conference_id: Programmable Voice API Conference ID. (required)
+ :type conference_id: str
+ :param recording_id: Programmable Voice API Recording ID. (required)
+ :type recording_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(bytearray, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _hosts = [
+ 'https://voice.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'conference_id',
+ 'recording_id'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method download_conference_recording" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+ if _params['conference_id']:
+ _path_params['conferenceId'] = _params['conference_id']
+
+ if _params['recording_id']:
+ _path_params['recordingId'] = _params['recording_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['audio/vnd.wave', 'audio/mpeg', 'application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {
+ '200': "bytearray",
+ '400': "VoiceApiError",
+ '401': "VoiceApiError",
+ '403': "VoiceApiError",
+ '404': "VoiceApiError",
+ '405': "VoiceApiError",
+ '415': "VoiceApiError",
+ '429': "VoiceApiError",
+ '500': "VoiceApiError",
+ }
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}/media', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def get_conference(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], **kwargs) -> Conference: # noqa: E501
+ """Get Conference Information # noqa: E501
+
+ Returns information about the specified conference. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_conference(account_id, conference_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param conference_id: Programmable Voice API Conference ID. (required)
+ :type conference_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Conference
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the get_conference_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.get_conference_with_http_info(account_id, conference_id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def get_conference_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], **kwargs) -> ApiResponse: # noqa: E501
+ """Get Conference Information # noqa: E501
+
+ Returns information about the specified conference. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_conference_with_http_info(account_id, conference_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param conference_id: Programmable Voice API Conference ID. (required)
+ :type conference_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Conference, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _hosts = [
+ 'https://voice.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'conference_id'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method get_conference" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+ if _params['conference_id']:
+ _path_params['conferenceId'] = _params['conference_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {
+ '200': "Conference",
+ '400': "VoiceApiError",
+ '401': "VoiceApiError",
+ '403': "VoiceApiError",
+ '404': "VoiceApiError",
+ '405': "VoiceApiError",
+ '415': "VoiceApiError",
+ '429': "VoiceApiError",
+ '500': "VoiceApiError",
+ }
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/conferences/{conferenceId}', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def get_conference_member(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], member_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference Member ID.")], **kwargs) -> ConferenceMember: # noqa: E501
+ """Get Conference Member # noqa: E501
+
+ Returns information about the specified conference member. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_conference_member(account_id, conference_id, member_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param conference_id: Programmable Voice API Conference ID. (required)
+ :type conference_id: str
+ :param member_id: Programmable Voice API Conference Member ID. (required)
+ :type member_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: ConferenceMember
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the get_conference_member_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.get_conference_member_with_http_info(account_id, conference_id, member_id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def get_conference_member_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], member_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference Member ID.")], **kwargs) -> ApiResponse: # noqa: E501
+ """Get Conference Member # noqa: E501
+
+ Returns information about the specified conference member. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_conference_member_with_http_info(account_id, conference_id, member_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param conference_id: Programmable Voice API Conference ID. (required)
+ :type conference_id: str
+ :param member_id: Programmable Voice API Conference Member ID. (required)
+ :type member_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(ConferenceMember, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _hosts = [
+ 'https://voice.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'conference_id',
+ 'member_id'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method get_conference_member" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+ if _params['conference_id']:
+ _path_params['conferenceId'] = _params['conference_id']
+
+ if _params['member_id']:
+ _path_params['memberId'] = _params['member_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {
+ '200': "ConferenceMember",
+ '400': "VoiceApiError",
+ '401': "VoiceApiError",
+ '403': "VoiceApiError",
+ '404': "VoiceApiError",
+ '405': "VoiceApiError",
+ '415': "VoiceApiError",
+ '429': "VoiceApiError",
+ '500': "VoiceApiError",
+ }
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/conferences/{conferenceId}/members/{memberId}', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def get_conference_recording(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> ConferenceRecordingMetadata: # noqa: E501
+ """Get Conference Recording Information # noqa: E501
+
+ Returns metadata for the specified recording. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_conference_recording(account_id, conference_id, recording_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param conference_id: Programmable Voice API Conference ID. (required)
+ :type conference_id: str
+ :param recording_id: Programmable Voice API Recording ID. (required)
+ :type recording_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: ConferenceRecordingMetadata
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the get_conference_recording_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.get_conference_recording_with_http_info(account_id, conference_id, recording_id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def get_conference_recording_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> ApiResponse: # noqa: E501
+ """Get Conference Recording Information # noqa: E501
+
+ Returns metadata for the specified recording. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_conference_recording_with_http_info(account_id, conference_id, recording_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param conference_id: Programmable Voice API Conference ID. (required)
+ :type conference_id: str
+ :param recording_id: Programmable Voice API Recording ID. (required)
+ :type recording_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(ConferenceRecordingMetadata, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _hosts = [
+ 'https://voice.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'conference_id',
+ 'recording_id'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method get_conference_recording" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+ if _params['conference_id']:
+ _path_params['conferenceId'] = _params['conference_id']
+
+ if _params['recording_id']:
+ _path_params['recordingId'] = _params['recording_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {
+ '200': "ConferenceRecordingMetadata",
+ '400': "VoiceApiError",
+ '401': "VoiceApiError",
+ '403': "VoiceApiError",
+ '404': "VoiceApiError",
+ '405': "VoiceApiError",
+ '415': "VoiceApiError",
+ '429': "VoiceApiError",
+ '500': "VoiceApiError",
+ }
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def list_conference_recordings(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], **kwargs) -> List[ConferenceRecordingMetadata]: # noqa: E501
+ """Get Conference Recordings # noqa: E501
+
+ Returns a (potentially empty) list of metadata for the recordings that took place during the specified conference. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.list_conference_recordings(account_id, conference_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param conference_id: Programmable Voice API Conference ID. (required)
+ :type conference_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: List[ConferenceRecordingMetadata]
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the list_conference_recordings_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.list_conference_recordings_with_http_info(account_id, conference_id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def list_conference_recordings_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], **kwargs) -> ApiResponse: # noqa: E501
+ """Get Conference Recordings # noqa: E501
+
+ Returns a (potentially empty) list of metadata for the recordings that took place during the specified conference. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.list_conference_recordings_with_http_info(account_id, conference_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param conference_id: Programmable Voice API Conference ID. (required)
+ :type conference_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(List[ConferenceRecordingMetadata], status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _hosts = [
+ 'https://voice.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'conference_id'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method list_conference_recordings" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+ if _params['conference_id']:
+ _path_params['conferenceId'] = _params['conference_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {
+ '200': "List[ConferenceRecordingMetadata]",
+ '400': "VoiceApiError",
+ '401': "VoiceApiError",
+ '403': "VoiceApiError",
+ '404': "VoiceApiError",
+ '405': "VoiceApiError",
+ '415': "VoiceApiError",
+ '429': "VoiceApiError",
+ '500': "VoiceApiError",
+ }
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/conferences/{conferenceId}/recordings', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def list_conferences(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], name : Annotated[Optional[StrictStr], Field(description="Filter results by the `name` field.")] = None, min_created_time : Annotated[Optional[StrictStr], Field(description="Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format).")] = None, max_created_time : Annotated[Optional[StrictStr], Field(description="Filter results to conferences which have a `createdTime` before or at `maxCreatedTime` (in ISO8601 format).")] = None, page_size : Annotated[Optional[conint(strict=True, le=1000, ge=1)], Field(description="Specifies the max number of conferences that will be returned.")] = None, page_token : Annotated[Optional[StrictStr], Field(description="Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description.")] = None, **kwargs) -> List[Conference]: # noqa: E501
+ """Get Conferences # noqa: E501
+
+ 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. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.list_conferences(account_id, name, min_created_time, max_created_time, page_size, page_token, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param name: Filter results by the `name` field.
+ :type name: str
+ :param min_created_time: Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format).
+ :type min_created_time: str
+ :param max_created_time: Filter results to conferences which have a `createdTime` before or at `maxCreatedTime` (in ISO8601 format).
+ :type max_created_time: str
+ :param page_size: Specifies the max number of conferences that will be returned.
+ :type page_size: int
+ :param page_token: Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description.
+ :type page_token: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: List[Conference]
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the list_conferences_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.list_conferences_with_http_info(account_id, name, min_created_time, max_created_time, page_size, page_token, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def list_conferences_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], name : Annotated[Optional[StrictStr], Field(description="Filter results by the `name` field.")] = None, min_created_time : Annotated[Optional[StrictStr], Field(description="Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format).")] = None, max_created_time : Annotated[Optional[StrictStr], Field(description="Filter results to conferences which have a `createdTime` before or at `maxCreatedTime` (in ISO8601 format).")] = None, page_size : Annotated[Optional[conint(strict=True, le=1000, ge=1)], Field(description="Specifies the max number of conferences that will be returned.")] = None, page_token : Annotated[Optional[StrictStr], Field(description="Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description.")] = None, **kwargs) -> ApiResponse: # noqa: E501
+ """Get Conferences # noqa: E501
+
+ 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. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.list_conferences_with_http_info(account_id, name, min_created_time, max_created_time, page_size, page_token, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param name: Filter results by the `name` field.
+ :type name: str
+ :param min_created_time: Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format).
+ :type min_created_time: str
+ :param max_created_time: Filter results to conferences which have a `createdTime` before or at `maxCreatedTime` (in ISO8601 format).
+ :type max_created_time: str
+ :param page_size: Specifies the max number of conferences that will be returned.
+ :type page_size: int
+ :param page_token: Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description.
+ :type page_token: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(List[Conference], status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _hosts = [
+ 'https://voice.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'name',
+ 'min_created_time',
+ 'max_created_time',
+ 'page_size',
+ 'page_token'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method list_conferences" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+
+ # process the query parameters
+ _query_params = []
+ if _params.get('name') is not None: # noqa: E501
+ _query_params.append(('name', _params['name']))
+
+ if _params.get('min_created_time') is not None: # noqa: E501
+ _query_params.append(('minCreatedTime', _params['min_created_time']))
+
+ if _params.get('max_created_time') is not None: # noqa: E501
+ _query_params.append(('maxCreatedTime', _params['max_created_time']))
+
+ if _params.get('page_size') is not None: # noqa: E501
+ _query_params.append(('pageSize', _params['page_size']))
+
+ if _params.get('page_token') is not None: # noqa: E501
+ _query_params.append(('pageToken', _params['page_token']))
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {
+ '200': "List[Conference]",
+ '400': "VoiceApiError",
+ '401': "VoiceApiError",
+ '403': "VoiceApiError",
+ '404': "VoiceApiError",
+ '405': "VoiceApiError",
+ '415': "VoiceApiError",
+ '429': "VoiceApiError",
+ '500': "VoiceApiError",
+ }
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/conferences', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def update_conference(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], update_conference : UpdateConference, **kwargs) -> None: # noqa: E501
+ """Update Conference # noqa: E501
+
+ Update the conference state. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_conference(account_id, conference_id, update_conference, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param conference_id: Programmable Voice API Conference ID. (required)
+ :type conference_id: str
+ :param update_conference: (required)
+ :type update_conference: UpdateConference
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the update_conference_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.update_conference_with_http_info(account_id, conference_id, update_conference, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def update_conference_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], update_conference : UpdateConference, **kwargs) -> ApiResponse: # noqa: E501
+ """Update Conference # noqa: E501
+
+ Update the conference state. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_conference_with_http_info(account_id, conference_id, update_conference, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param conference_id: Programmable Voice API Conference ID. (required)
+ :type conference_id: str
+ :param update_conference: (required)
+ :type update_conference: UpdateConference
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _hosts = [
+ 'https://voice.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'conference_id',
+ 'update_conference'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method update_conference" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+ if _params['conference_id']:
+ _path_params['conferenceId'] = _params['conference_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ if _params['update_conference'] is not None:
+ _body_params = _params['update_conference']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/conferences/{conferenceId}', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def update_conference_bxml(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], body : StrictStr, **kwargs) -> None: # noqa: E501
+ """Update Conference BXML # noqa: E501
+
+ Update the conference BXML document. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_conference_bxml(account_id, conference_id, body, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param conference_id: Programmable Voice API Conference ID. (required)
+ :type conference_id: str
+ :param body: (required)
+ :type body: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the update_conference_bxml_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.update_conference_bxml_with_http_info(account_id, conference_id, body, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def update_conference_bxml_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], body : StrictStr, **kwargs) -> ApiResponse: # noqa: E501
+ """Update Conference BXML # noqa: E501
+
+ Update the conference BXML document. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_conference_bxml_with_http_info(account_id, conference_id, body, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param conference_id: Programmable Voice API Conference ID. (required)
+ :type conference_id: str
+ :param body: (required)
+ :type body: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _hosts = [
+ 'https://voice.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'conference_id',
+ 'body'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method update_conference_bxml" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+ if _params['conference_id']:
+ _path_params['conferenceId'] = _params['conference_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ if _params['body'] is not None:
+ _body_params = _params['body']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/xml']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/conferences/{conferenceId}/bxml', 'PUT',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def update_conference_member(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], member_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference Member ID.")], update_conference_member : UpdateConferenceMember, **kwargs) -> None: # noqa: E501
+ """Update Conference Member # noqa: E501
+
+ Updates settings for a particular conference member. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_conference_member(account_id, conference_id, member_id, update_conference_member, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param conference_id: Programmable Voice API Conference ID. (required)
+ :type conference_id: str
+ :param member_id: Programmable Voice API Conference Member ID. (required)
+ :type member_id: str
+ :param update_conference_member: (required)
+ :type update_conference_member: UpdateConferenceMember
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the update_conference_member_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.update_conference_member_with_http_info(account_id, conference_id, member_id, update_conference_member, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def update_conference_member_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], conference_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference ID.")], member_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Conference Member ID.")], update_conference_member : UpdateConferenceMember, **kwargs) -> ApiResponse: # noqa: E501
+ """Update Conference Member # noqa: E501
+
+ Updates settings for a particular conference member. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_conference_member_with_http_info(account_id, conference_id, member_id, update_conference_member, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param conference_id: Programmable Voice API Conference ID. (required)
+ :type conference_id: str
+ :param member_id: Programmable Voice API Conference Member ID. (required)
+ :type member_id: str
+ :param update_conference_member: (required)
+ :type update_conference_member: UpdateConferenceMember
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _hosts = [
+ 'https://voice.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'conference_id',
+ 'member_id',
+ 'update_conference_member'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method update_conference_member" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+ if _params['conference_id']:
+ _path_params['conferenceId'] = _params['conference_id']
+
+ if _params['member_id']:
+ _path_params['memberId'] = _params['member_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ if _params['update_conference_member'] is not None:
+ _body_params = _params['update_conference_member']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/conferences/{conferenceId}/members/{memberId}', 'PUT',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
diff --git a/bandwidth/api/media_api.py b/bandwidth/api/media_api.py
new file mode 100644
index 00000000..feb05fe2
--- /dev/null
+++ b/bandwidth/api/media_api.py
@@ -0,0 +1,735 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import re # noqa: F401
+import io
+import warnings
+
+from pydantic import validate_arguments, ValidationError
+from typing_extensions import Annotated
+
+from pydantic import Field, StrictBytes, StrictStr
+
+from typing import List, Optional, Union
+
+from bandwidth.models.media import Media
+
+from bandwidth.api_client import ApiClient
+from bandwidth.api_response import ApiResponse
+from bandwidth.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class MediaApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+ @validate_arguments
+ def delete_media(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], media_id : Annotated[StrictStr, Field(..., description="Media ID to retrieve.")], **kwargs) -> None: # noqa: E501
+ """Delete Media # noqa: E501
+
+ 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. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.delete_media(account_id, media_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param media_id: Media ID to retrieve. (required)
+ :type media_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the delete_media_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.delete_media_with_http_info(account_id, media_id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def delete_media_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], media_id : Annotated[StrictStr, Field(..., description="Media ID to retrieve.")], **kwargs) -> ApiResponse: # noqa: E501
+ """Delete Media # noqa: E501
+
+ 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. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.delete_media_with_http_info(account_id, media_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param media_id: Media ID to retrieve. (required)
+ :type media_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _hosts = [
+ 'https://messaging.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'media_id'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method delete_media" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+ if _params['media_id']:
+ _path_params['mediaId'] = _params['media_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/users/{accountId}/media/{mediaId}', 'DELETE',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def get_media(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], media_id : Annotated[StrictStr, Field(..., description="Media ID to retrieve.")], **kwargs) -> bytearray: # noqa: E501
+ """Get Media # noqa: E501
+
+ Downloads a media file you previously uploaded. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_media(account_id, media_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param media_id: Media ID to retrieve. (required)
+ :type media_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: bytearray
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the get_media_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.get_media_with_http_info(account_id, media_id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def get_media_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], media_id : Annotated[StrictStr, Field(..., description="Media ID to retrieve.")], **kwargs) -> ApiResponse: # noqa: E501
+ """Get Media # noqa: E501
+
+ Downloads a media file you previously uploaded. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_media_with_http_info(account_id, media_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param media_id: Media ID to retrieve. (required)
+ :type media_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(bytearray, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _hosts = [
+ 'https://messaging.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'media_id'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method get_media" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+ if _params['media_id']:
+ _path_params['mediaId'] = _params['media_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/octet-stream', 'application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {
+ '200': "bytearray",
+ '400': "MessagingRequestError",
+ '401': "MessagingRequestError",
+ '403': "MessagingRequestError",
+ '404': "MessagingRequestError",
+ '406': "MessagingRequestError",
+ '415': "MessagingRequestError",
+ '429': "MessagingRequestError",
+ '500': "MessagingRequestError",
+ }
+
+ return self.api_client.call_api(
+ '/users/{accountId}/media/{mediaId}', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def list_media(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], continuation_token : Annotated[Optional[StrictStr], Field(description="Continuation token used to retrieve subsequent media.")] = None, **kwargs) -> List[Media]: # noqa: E501
+ """List Media # noqa: E501
+
+ Gets a list of your media files. No query parameters are supported. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.list_media(account_id, continuation_token, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param continuation_token: Continuation token used to retrieve subsequent media.
+ :type continuation_token: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: List[Media]
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the list_media_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.list_media_with_http_info(account_id, continuation_token, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def list_media_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], continuation_token : Annotated[Optional[StrictStr], Field(description="Continuation token used to retrieve subsequent media.")] = None, **kwargs) -> ApiResponse: # noqa: E501
+ """List Media # noqa: E501
+
+ Gets a list of your media files. No query parameters are supported. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.list_media_with_http_info(account_id, continuation_token, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param continuation_token: Continuation token used to retrieve subsequent media.
+ :type continuation_token: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(List[Media], status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _hosts = [
+ 'https://messaging.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'continuation_token'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method list_media" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ if _params['continuation_token']:
+ _header_params['Continuation-Token'] = _params['continuation_token']
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {
+ '200': "List[Media]",
+ '400': "MessagingRequestError",
+ '401': "MessagingRequestError",
+ '403': "MessagingRequestError",
+ '404': "MessagingRequestError",
+ '406': "MessagingRequestError",
+ '415': "MessagingRequestError",
+ '429': "MessagingRequestError",
+ '500': "MessagingRequestError",
+ }
+
+ return self.api_client.call_api(
+ '/users/{accountId}/media', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def upload_media(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], media_id : Annotated[StrictStr, Field(..., description="Media ID to retrieve.")], body : Union[StrictBytes, StrictStr], content_type : Annotated[Optional[StrictStr], Field(description="The media type of the entity-body.")] = None, cache_control : Annotated[Optional[StrictStr], Field(description="General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain.")] = None, **kwargs) -> None: # noqa: E501
+ """Upload Media # noqa: E501
+
+ 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-). # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.upload_media(account_id, media_id, body, content_type, cache_control, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param media_id: Media ID to retrieve. (required)
+ :type media_id: str
+ :param body: (required)
+ :type body: bytearray
+ :param content_type: The media type of the entity-body.
+ :type content_type: str
+ :param cache_control: General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain.
+ :type cache_control: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the upload_media_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.upload_media_with_http_info(account_id, media_id, body, content_type, cache_control, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def upload_media_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], media_id : Annotated[StrictStr, Field(..., description="Media ID to retrieve.")], body : Union[StrictBytes, StrictStr], content_type : Annotated[Optional[StrictStr], Field(description="The media type of the entity-body.")] = None, cache_control : Annotated[Optional[StrictStr], Field(description="General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain.")] = None, **kwargs) -> ApiResponse: # noqa: E501
+ """Upload Media # noqa: E501
+
+ 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-). # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.upload_media_with_http_info(account_id, media_id, body, content_type, cache_control, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param media_id: Media ID to retrieve. (required)
+ :type media_id: str
+ :param body: (required)
+ :type body: bytearray
+ :param content_type: The media type of the entity-body.
+ :type content_type: str
+ :param cache_control: General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain.
+ :type cache_control: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _hosts = [
+ 'https://messaging.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'media_id',
+ 'body',
+ 'content_type',
+ 'cache_control'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method upload_media" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+ if _params['media_id']:
+ _path_params['mediaId'] = _params['media_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ if _params['content_type']:
+ _header_params['Content-Type'] = _params['content_type']
+
+ if _params['cache_control']:
+ _header_params['Cache-Control'] = _params['cache_control']
+
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ if _params['body'] is not None:
+ _body_params = _params['body']
+ # convert to byte array if the input is a file name (str)
+ if isinstance(_body_params, str):
+ with io.open(_body_params, "rb") as _fp:
+ _body_params_from_file = _fp.read()
+ _body_params = _body_params_from_file
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.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_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/users/{accountId}/media/{mediaId}', 'PUT',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
diff --git a/bandwidth/api/messages_api.py b/bandwidth/api/messages_api.py
new file mode 100644
index 00000000..10a99b55
--- /dev/null
+++ b/bandwidth/api/messages_api.py
@@ -0,0 +1,506 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import re # noqa: F401
+import io
+import warnings
+
+from pydantic import validate_arguments, ValidationError
+from typing_extensions import Annotated
+
+from pydantic import Field, StrictBool, StrictInt, StrictStr
+
+from typing import Optional
+
+from bandwidth.models.list_message_direction_enum import ListMessageDirectionEnum
+from bandwidth.models.message import Message
+from bandwidth.models.message_request import MessageRequest
+from bandwidth.models.message_status_enum import MessageStatusEnum
+from bandwidth.models.message_type_enum import MessageTypeEnum
+from bandwidth.models.messages_list import MessagesList
+
+from bandwidth.api_client import ApiClient
+from bandwidth.api_response import ApiResponse
+from bandwidth.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class MessagesApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+ @validate_arguments
+ def create_message(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], message_request : MessageRequest, **kwargs) -> Message: # noqa: E501
+ """Create Message # noqa: E501
+
+ Endpoint for sending text messages and picture messages using V2 messaging. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.create_message(account_id, message_request, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param message_request: (required)
+ :type message_request: MessageRequest
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Message
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the create_message_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.create_message_with_http_info(account_id, message_request, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def create_message_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], message_request : MessageRequest, **kwargs) -> ApiResponse: # noqa: E501
+ """Create Message # noqa: E501
+
+ Endpoint for sending text messages and picture messages using V2 messaging. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.create_message_with_http_info(account_id, message_request, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param message_request: (required)
+ :type message_request: MessageRequest
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Message, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _hosts = [
+ 'https://messaging.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'message_request'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method create_message" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ if _params['message_request'] is not None:
+ _body_params = _params['message_request']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {
+ '202': "Message",
+ '400': "CreateMessageRequestError",
+ '401': "MessagingRequestError",
+ '403': "MessagingRequestError",
+ '404': "MessagingRequestError",
+ '406': "MessagingRequestError",
+ '415': "MessagingRequestError",
+ '429': "MessagingRequestError",
+ '500': "MessagingRequestError",
+ }
+
+ return self.api_client.call_api(
+ '/users/{accountId}/messages', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def list_messages(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], message_id : Annotated[Optional[StrictStr], Field(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.")] = None, source_tn : Annotated[Optional[StrictStr], Field(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').")] = None, destination_tn : Annotated[Optional[StrictStr], Field(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').")] = None, message_status : Annotated[Optional[MessageStatusEnum], Field(description="The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED.")] = None, message_direction : Annotated[Optional[ListMessageDirectionEnum], Field(description="The direction of the message. One of INBOUND OUTBOUND.")] = None, carrier_name : Annotated[Optional[StrictStr], Field(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).")] = None, message_type : Annotated[Optional[MessageTypeEnum], Field(description="The type of message. Either sms or mms.")] = None, error_code : Annotated[Optional[StrictInt], Field(description="The error code of the message.")] = None, from_date_time : Annotated[Optional[StrictStr], Field(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.")] = None, to_date_time : Annotated[Optional[StrictStr], Field(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.")] = None, campaign_id : Annotated[Optional[StrictStr], Field(description="The campaign ID of the message.")] = None, sort : Annotated[Optional[StrictStr], Field(description="The field and direction to sort by combined with a colon. Direction is either asc or desc.")] = None, page_token : Annotated[Optional[StrictStr], Field(description="A base64 encoded value used for pagination of results.")] = None, limit : Annotated[Optional[StrictInt], Field(description="The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000.")] = None, limit_total_count : Annotated[Optional[StrictBool], Field(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.")] = None, **kwargs) -> MessagesList: # noqa: E501
+ """List Messages # noqa: E501
+
+ Returns a list of messages based on query parameters. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.list_messages(account_id, message_id, source_tn, destination_tn, message_status, message_direction, carrier_name, message_type, error_code, from_date_time, to_date_time, campaign_id, sort, page_token, limit, limit_total_count, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param 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.
+ :type message_id: str
+ :param 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').
+ :type source_tn: str
+ :param 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').
+ :type destination_tn: str
+ :param message_status: The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED.
+ :type message_status: MessageStatusEnum
+ :param message_direction: The direction of the message. One of INBOUND OUTBOUND.
+ :type message_direction: ListMessageDirectionEnum
+ :param 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).
+ :type carrier_name: str
+ :param message_type: The type of message. Either sms or mms.
+ :type message_type: MessageTypeEnum
+ :param error_code: The error code of the message.
+ :type error_code: int
+ :param 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.
+ :type from_date_time: str
+ :param 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.
+ :type to_date_time: str
+ :param campaign_id: The campaign ID of the message.
+ :type campaign_id: str
+ :param sort: The field and direction to sort by combined with a colon. Direction is either asc or desc.
+ :type sort: str
+ :param page_token: A base64 encoded value used for pagination of results.
+ :type page_token: str
+ :param limit: The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000.
+ :type limit: int
+ :param 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.
+ :type limit_total_count: bool
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: MessagesList
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the list_messages_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.list_messages_with_http_info(account_id, message_id, source_tn, destination_tn, message_status, message_direction, carrier_name, message_type, error_code, from_date_time, to_date_time, campaign_id, sort, page_token, limit, limit_total_count, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def list_messages_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], message_id : Annotated[Optional[StrictStr], Field(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.")] = None, source_tn : Annotated[Optional[StrictStr], Field(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').")] = None, destination_tn : Annotated[Optional[StrictStr], Field(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').")] = None, message_status : Annotated[Optional[MessageStatusEnum], Field(description="The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED.")] = None, message_direction : Annotated[Optional[ListMessageDirectionEnum], Field(description="The direction of the message. One of INBOUND OUTBOUND.")] = None, carrier_name : Annotated[Optional[StrictStr], Field(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).")] = None, message_type : Annotated[Optional[MessageTypeEnum], Field(description="The type of message. Either sms or mms.")] = None, error_code : Annotated[Optional[StrictInt], Field(description="The error code of the message.")] = None, from_date_time : Annotated[Optional[StrictStr], Field(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.")] = None, to_date_time : Annotated[Optional[StrictStr], Field(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.")] = None, campaign_id : Annotated[Optional[StrictStr], Field(description="The campaign ID of the message.")] = None, sort : Annotated[Optional[StrictStr], Field(description="The field and direction to sort by combined with a colon. Direction is either asc or desc.")] = None, page_token : Annotated[Optional[StrictStr], Field(description="A base64 encoded value used for pagination of results.")] = None, limit : Annotated[Optional[StrictInt], Field(description="The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000.")] = None, limit_total_count : Annotated[Optional[StrictBool], Field(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.")] = None, **kwargs) -> ApiResponse: # noqa: E501
+ """List Messages # noqa: E501
+
+ Returns a list of messages based on query parameters. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.list_messages_with_http_info(account_id, message_id, source_tn, destination_tn, message_status, message_direction, carrier_name, message_type, error_code, from_date_time, to_date_time, campaign_id, sort, page_token, limit, limit_total_count, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param 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.
+ :type message_id: str
+ :param 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').
+ :type source_tn: str
+ :param 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').
+ :type destination_tn: str
+ :param message_status: The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED.
+ :type message_status: MessageStatusEnum
+ :param message_direction: The direction of the message. One of INBOUND OUTBOUND.
+ :type message_direction: ListMessageDirectionEnum
+ :param 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).
+ :type carrier_name: str
+ :param message_type: The type of message. Either sms or mms.
+ :type message_type: MessageTypeEnum
+ :param error_code: The error code of the message.
+ :type error_code: int
+ :param 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.
+ :type from_date_time: str
+ :param 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.
+ :type to_date_time: str
+ :param campaign_id: The campaign ID of the message.
+ :type campaign_id: str
+ :param sort: The field and direction to sort by combined with a colon. Direction is either asc or desc.
+ :type sort: str
+ :param page_token: A base64 encoded value used for pagination of results.
+ :type page_token: str
+ :param limit: The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000.
+ :type limit: int
+ :param 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.
+ :type limit_total_count: bool
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(MessagesList, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _hosts = [
+ 'https://messaging.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'message_id',
+ 'source_tn',
+ 'destination_tn',
+ 'message_status',
+ 'message_direction',
+ 'carrier_name',
+ 'message_type',
+ 'error_code',
+ 'from_date_time',
+ 'to_date_time',
+ 'campaign_id',
+ 'sort',
+ 'page_token',
+ 'limit',
+ 'limit_total_count'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method list_messages" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+
+ # process the query parameters
+ _query_params = []
+ if _params.get('message_id') is not None: # noqa: E501
+ _query_params.append(('messageId', _params['message_id']))
+
+ if _params.get('source_tn') is not None: # noqa: E501
+ _query_params.append(('sourceTn', _params['source_tn']))
+
+ if _params.get('destination_tn') is not None: # noqa: E501
+ _query_params.append(('destinationTn', _params['destination_tn']))
+
+ if _params.get('message_status') is not None: # noqa: E501
+ _query_params.append(('messageStatus', _params['message_status'].value))
+
+ if _params.get('message_direction') is not None: # noqa: E501
+ _query_params.append(('messageDirection', _params['message_direction'].value))
+
+ if _params.get('carrier_name') is not None: # noqa: E501
+ _query_params.append(('carrierName', _params['carrier_name']))
+
+ if _params.get('message_type') is not None: # noqa: E501
+ _query_params.append(('messageType', _params['message_type'].value))
+
+ if _params.get('error_code') is not None: # noqa: E501
+ _query_params.append(('errorCode', _params['error_code']))
+
+ if _params.get('from_date_time') is not None: # noqa: E501
+ _query_params.append(('fromDateTime', _params['from_date_time']))
+
+ if _params.get('to_date_time') is not None: # noqa: E501
+ _query_params.append(('toDateTime', _params['to_date_time']))
+
+ if _params.get('campaign_id') is not None: # noqa: E501
+ _query_params.append(('campaignId', _params['campaign_id']))
+
+ if _params.get('sort') is not None: # noqa: E501
+ _query_params.append(('sort', _params['sort']))
+
+ if _params.get('page_token') is not None: # noqa: E501
+ _query_params.append(('pageToken', _params['page_token']))
+
+ if _params.get('limit') is not None: # noqa: E501
+ _query_params.append(('limit', _params['limit']))
+
+ if _params.get('limit_total_count') is not None: # noqa: E501
+ _query_params.append(('limitTotalCount', _params['limit_total_count']))
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {
+ '200': "MessagesList",
+ '400': "MessagingRequestError",
+ '401': "MessagingRequestError",
+ '403': "MessagingRequestError",
+ '404': "MessagingRequestError",
+ '415': "MessagingRequestError",
+ '429': "MessagingRequestError",
+ '500': "MessagingRequestError",
+ }
+
+ return self.api_client.call_api(
+ '/users/{accountId}/messages', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
diff --git a/bandwidth/api/mfa_api.py b/bandwidth/api/mfa_api.py
new file mode 100644
index 00000000..b18fe2ca
--- /dev/null
+++ b/bandwidth/api/mfa_api.py
@@ -0,0 +1,563 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import re # noqa: F401
+import io
+import warnings
+
+from pydantic import validate_arguments, ValidationError
+from typing_extensions import Annotated
+
+from pydantic import Field, StrictStr
+
+from bandwidth.models.code_request import CodeRequest
+from bandwidth.models.messaging_code_response import MessagingCodeResponse
+from bandwidth.models.verify_code_request import VerifyCodeRequest
+from bandwidth.models.verify_code_response import VerifyCodeResponse
+from bandwidth.models.voice_code_response import VoiceCodeResponse
+
+from bandwidth.api_client import ApiClient
+from bandwidth.api_response import ApiResponse
+from bandwidth.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class MFAApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+ @validate_arguments
+ def generate_messaging_code(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], code_request : Annotated[CodeRequest, Field(..., description="MFA code request body.")], **kwargs) -> MessagingCodeResponse: # noqa: E501
+ """Messaging Authentication Code # noqa: E501
+
+ Send an MFA code via text message (SMS). # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.generate_messaging_code(account_id, code_request, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param code_request: MFA code request body. (required)
+ :type code_request: CodeRequest
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: MessagingCodeResponse
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the generate_messaging_code_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.generate_messaging_code_with_http_info(account_id, code_request, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def generate_messaging_code_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], code_request : Annotated[CodeRequest, Field(..., description="MFA code request body.")], **kwargs) -> ApiResponse: # noqa: E501
+ """Messaging Authentication Code # noqa: E501
+
+ Send an MFA code via text message (SMS). # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.generate_messaging_code_with_http_info(account_id, code_request, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param code_request: MFA code request body. (required)
+ :type code_request: CodeRequest
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(MessagingCodeResponse, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _hosts = [
+ 'https://mfa.bandwidth.com/api/v1'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'code_request'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method generate_messaging_code" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ if _params['code_request'] is not None:
+ _body_params = _params['code_request']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {
+ '200': "MessagingCodeResponse",
+ '400': "MfaRequestError",
+ '401': "MfaUnauthorizedRequestError",
+ '403': "MfaForbiddenRequestError",
+ '500': "MfaRequestError",
+ }
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/code/messaging', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def generate_voice_code(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], code_request : Annotated[CodeRequest, Field(..., description="MFA code request body.")], **kwargs) -> VoiceCodeResponse: # noqa: E501
+ """Voice Authentication Code # noqa: E501
+
+ Send an MFA Code via a phone call. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.generate_voice_code(account_id, code_request, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param code_request: MFA code request body. (required)
+ :type code_request: CodeRequest
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: VoiceCodeResponse
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the generate_voice_code_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.generate_voice_code_with_http_info(account_id, code_request, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def generate_voice_code_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], code_request : Annotated[CodeRequest, Field(..., description="MFA code request body.")], **kwargs) -> ApiResponse: # noqa: E501
+ """Voice Authentication Code # noqa: E501
+
+ Send an MFA Code via a phone call. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.generate_voice_code_with_http_info(account_id, code_request, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param code_request: MFA code request body. (required)
+ :type code_request: CodeRequest
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(VoiceCodeResponse, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _hosts = [
+ 'https://mfa.bandwidth.com/api/v1'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'code_request'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method generate_voice_code" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ if _params['code_request'] is not None:
+ _body_params = _params['code_request']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {
+ '200': "VoiceCodeResponse",
+ '400': "MfaRequestError",
+ '401': "MfaUnauthorizedRequestError",
+ '403': "MfaForbiddenRequestError",
+ '500': "MfaRequestError",
+ }
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/code/voice', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def verify_code(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], verify_code_request : Annotated[VerifyCodeRequest, Field(..., description="MFA code verify request body.")], **kwargs) -> VerifyCodeResponse: # noqa: E501
+ """Verify Authentication Code # noqa: E501
+
+ Verify a previously sent MFA code. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.verify_code(account_id, verify_code_request, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param verify_code_request: MFA code verify request body. (required)
+ :type verify_code_request: VerifyCodeRequest
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: VerifyCodeResponse
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the verify_code_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.verify_code_with_http_info(account_id, verify_code_request, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def verify_code_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], verify_code_request : Annotated[VerifyCodeRequest, Field(..., description="MFA code verify request body.")], **kwargs) -> ApiResponse: # noqa: E501
+ """Verify Authentication Code # noqa: E501
+
+ Verify a previously sent MFA code. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.verify_code_with_http_info(account_id, verify_code_request, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param verify_code_request: MFA code verify request body. (required)
+ :type verify_code_request: VerifyCodeRequest
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(VerifyCodeResponse, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _hosts = [
+ 'https://mfa.bandwidth.com/api/v1'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'verify_code_request'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method verify_code" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ if _params['verify_code_request'] is not None:
+ _body_params = _params['verify_code_request']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {
+ '200': "VerifyCodeResponse",
+ '400': "MfaRequestError",
+ '401': "MfaUnauthorizedRequestError",
+ '403': "MfaForbiddenRequestError",
+ '429': "MfaRequestError",
+ '500': "MfaRequestError",
+ }
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/code/verify', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
diff --git a/bandwidth/api/phone_number_lookup_api.py b/bandwidth/api/phone_number_lookup_api.py
new file mode 100644
index 00000000..da3e3140
--- /dev/null
+++ b/bandwidth/api/phone_number_lookup_api.py
@@ -0,0 +1,386 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import re # noqa: F401
+import io
+import warnings
+
+from pydantic import validate_arguments, ValidationError
+from typing_extensions import Annotated
+
+from pydantic import Field, StrictStr
+
+from bandwidth.models.create_lookup_response import CreateLookupResponse
+from bandwidth.models.lookup_request import LookupRequest
+from bandwidth.models.lookup_status import LookupStatus
+
+from bandwidth.api_client import ApiClient
+from bandwidth.api_response import ApiResponse
+from bandwidth.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class PhoneNumberLookupApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+ @validate_arguments
+ def create_lookup(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], lookup_request : Annotated[LookupRequest, Field(..., description="Phone number lookup request.")], **kwargs) -> CreateLookupResponse: # noqa: E501
+ """Create Lookup # noqa: E501
+
+ Create a Phone Number Lookup Request. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.create_lookup(account_id, lookup_request, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param lookup_request: Phone number lookup request. (required)
+ :type lookup_request: LookupRequest
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: CreateLookupResponse
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the create_lookup_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.create_lookup_with_http_info(account_id, lookup_request, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def create_lookup_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], lookup_request : Annotated[LookupRequest, Field(..., description="Phone number lookup request.")], **kwargs) -> ApiResponse: # noqa: E501
+ """Create Lookup # noqa: E501
+
+ Create a Phone Number Lookup Request. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.create_lookup_with_http_info(account_id, lookup_request, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param lookup_request: Phone number lookup request. (required)
+ :type lookup_request: LookupRequest
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(CreateLookupResponse, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _hosts = [
+ 'https://numbers.bandwidth.com/api/v1'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'lookup_request'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method create_lookup" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ if _params['lookup_request'] is not None:
+ _body_params = _params['lookup_request']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {
+ '202': "CreateLookupResponse",
+ '400': "TnLookupRequestError",
+ '401': "TnLookupRequestError",
+ '403': "TnLookupRequestError",
+ '415': "TnLookupRequestError",
+ '429': "TnLookupRequestError",
+ '500': "TnLookupRequestError",
+ }
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/tnlookup', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def get_lookup_status(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], request_id : Annotated[StrictStr, Field(..., description="The phone number lookup request ID from Bandwidth.")], **kwargs) -> LookupStatus: # noqa: E501
+ """Get Lookup Request Status # noqa: E501
+
+ Get an existing Phone Number Lookup Request. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_lookup_status(account_id, request_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param request_id: The phone number lookup request ID from Bandwidth. (required)
+ :type request_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: LookupStatus
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the get_lookup_status_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.get_lookup_status_with_http_info(account_id, request_id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def get_lookup_status_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], request_id : Annotated[StrictStr, Field(..., description="The phone number lookup request ID from Bandwidth.")], **kwargs) -> ApiResponse: # noqa: E501
+ """Get Lookup Request Status # noqa: E501
+
+ Get an existing Phone Number Lookup Request. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_lookup_status_with_http_info(account_id, request_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param request_id: The phone number lookup request ID from Bandwidth. (required)
+ :type request_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(LookupStatus, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _hosts = [
+ 'https://numbers.bandwidth.com/api/v1'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'request_id'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method get_lookup_status" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+ if _params['request_id']:
+ _path_params['requestId'] = _params['request_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {
+ '200': "LookupStatus",
+ '400': "TnLookupRequestError",
+ '401': "TnLookupRequestError",
+ '403': "TnLookupRequestError",
+ '404': None,
+ '429': "TnLookupRequestError",
+ '500': "TnLookupRequestError",
+ }
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/tnlookup/{requestId}', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
diff --git a/bandwidth/api/recordings_api.py b/bandwidth/api/recordings_api.py
new file mode 100644
index 00000000..fadfc4ca
--- /dev/null
+++ b/bandwidth/api/recordings_api.py
@@ -0,0 +1,1790 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import re # noqa: F401
+import io
+import warnings
+
+from pydantic import validate_arguments, ValidationError
+from typing_extensions import Annotated
+
+from pydantic import Field, StrictStr
+
+from typing import List, Optional, Union
+
+from bandwidth.models.call_recording_metadata import CallRecordingMetadata
+from bandwidth.models.transcribe_recording import TranscribeRecording
+from bandwidth.models.transcription_list import TranscriptionList
+from bandwidth.models.update_call_recording import UpdateCallRecording
+
+from bandwidth.api_client import ApiClient
+from bandwidth.api_response import ApiResponse
+from bandwidth.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class RecordingsApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+ @validate_arguments
+ def delete_call_transcription(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> None: # noqa: E501
+ """Delete Transcription # noqa: E501
+
+ 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. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.delete_call_transcription(account_id, call_id, recording_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param call_id: Programmable Voice API Call ID. (required)
+ :type call_id: str
+ :param recording_id: Programmable Voice API Recording ID. (required)
+ :type recording_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the delete_call_transcription_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.delete_call_transcription_with_http_info(account_id, call_id, recording_id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def delete_call_transcription_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> ApiResponse: # noqa: E501
+ """Delete Transcription # noqa: E501
+
+ 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. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.delete_call_transcription_with_http_info(account_id, call_id, recording_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param call_id: Programmable Voice API Call ID. (required)
+ :type call_id: str
+ :param recording_id: Programmable Voice API Recording ID. (required)
+ :type recording_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _hosts = [
+ 'https://voice.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'call_id',
+ 'recording_id'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method delete_call_transcription" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+ if _params['call_id']:
+ _path_params['callId'] = _params['call_id']
+
+ if _params['recording_id']:
+ _path_params['recordingId'] = _params['recording_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription', 'DELETE',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def delete_recording(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> None: # noqa: E501
+ """Delete Recording # noqa: E501
+
+ 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. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.delete_recording(account_id, call_id, recording_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param call_id: Programmable Voice API Call ID. (required)
+ :type call_id: str
+ :param recording_id: Programmable Voice API Recording ID. (required)
+ :type recording_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the delete_recording_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.delete_recording_with_http_info(account_id, call_id, recording_id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def delete_recording_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> ApiResponse: # noqa: E501
+ """Delete Recording # noqa: E501
+
+ 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. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.delete_recording_with_http_info(account_id, call_id, recording_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param call_id: Programmable Voice API Call ID. (required)
+ :type call_id: str
+ :param recording_id: Programmable Voice API Recording ID. (required)
+ :type recording_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _hosts = [
+ 'https://voice.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'call_id',
+ 'recording_id'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method delete_recording" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+ if _params['call_id']:
+ _path_params['callId'] = _params['call_id']
+
+ if _params['recording_id']:
+ _path_params['recordingId'] = _params['recording_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}', 'DELETE',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def delete_recording_media(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> None: # noqa: E501
+ """Delete Recording Media # noqa: E501
+
+ Deletes the specified recording's media. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.delete_recording_media(account_id, call_id, recording_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param call_id: Programmable Voice API Call ID. (required)
+ :type call_id: str
+ :param recording_id: Programmable Voice API Recording ID. (required)
+ :type recording_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the delete_recording_media_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.delete_recording_media_with_http_info(account_id, call_id, recording_id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def delete_recording_media_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> ApiResponse: # noqa: E501
+ """Delete Recording Media # noqa: E501
+
+ Deletes the specified recording's media. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.delete_recording_media_with_http_info(account_id, call_id, recording_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param call_id: Programmable Voice API Call ID. (required)
+ :type call_id: str
+ :param recording_id: Programmable Voice API Recording ID. (required)
+ :type recording_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _hosts = [
+ 'https://voice.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'call_id',
+ 'recording_id'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method delete_recording_media" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+ if _params['call_id']:
+ _path_params['callId'] = _params['call_id']
+
+ if _params['recording_id']:
+ _path_params['recordingId'] = _params['recording_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media', 'DELETE',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def download_call_recording(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> bytearray: # noqa: E501
+ """Download Recording # noqa: E501
+
+ Downloads the specified recording. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.download_call_recording(account_id, call_id, recording_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param call_id: Programmable Voice API Call ID. (required)
+ :type call_id: str
+ :param recording_id: Programmable Voice API Recording ID. (required)
+ :type recording_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: bytearray
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the download_call_recording_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.download_call_recording_with_http_info(account_id, call_id, recording_id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def download_call_recording_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> ApiResponse: # noqa: E501
+ """Download Recording # noqa: E501
+
+ Downloads the specified recording. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.download_call_recording_with_http_info(account_id, call_id, recording_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param call_id: Programmable Voice API Call ID. (required)
+ :type call_id: str
+ :param recording_id: Programmable Voice API Recording ID. (required)
+ :type recording_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(bytearray, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _hosts = [
+ 'https://voice.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'call_id',
+ 'recording_id'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method download_call_recording" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+ if _params['call_id']:
+ _path_params['callId'] = _params['call_id']
+
+ if _params['recording_id']:
+ _path_params['recordingId'] = _params['recording_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['audio/vnd.wave', 'audio/mpeg', 'application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {
+ '200': "bytearray",
+ '400': "VoiceApiError",
+ '401': "VoiceApiError",
+ '403': "VoiceApiError",
+ '404': "VoiceApiError",
+ '405': "VoiceApiError",
+ '415': "VoiceApiError",
+ '429': "VoiceApiError",
+ '500': "VoiceApiError",
+ }
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def get_call_recording(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> CallRecordingMetadata: # noqa: E501
+ """Get Call Recording # noqa: E501
+
+ Returns metadata for the specified recording. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_call_recording(account_id, call_id, recording_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param call_id: Programmable Voice API Call ID. (required)
+ :type call_id: str
+ :param recording_id: Programmable Voice API Recording ID. (required)
+ :type recording_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: CallRecordingMetadata
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the get_call_recording_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.get_call_recording_with_http_info(account_id, call_id, recording_id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def get_call_recording_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> ApiResponse: # noqa: E501
+ """Get Call Recording # noqa: E501
+
+ Returns metadata for the specified recording. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_call_recording_with_http_info(account_id, call_id, recording_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param call_id: Programmable Voice API Call ID. (required)
+ :type call_id: str
+ :param recording_id: Programmable Voice API Recording ID. (required)
+ :type recording_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(CallRecordingMetadata, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _hosts = [
+ 'https://voice.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'call_id',
+ 'recording_id'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method get_call_recording" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+ if _params['call_id']:
+ _path_params['callId'] = _params['call_id']
+
+ if _params['recording_id']:
+ _path_params['recordingId'] = _params['recording_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {
+ '200': "CallRecordingMetadata",
+ '400': "VoiceApiError",
+ '401': "VoiceApiError",
+ '403': "VoiceApiError",
+ '404': "VoiceApiError",
+ '405': "VoiceApiError",
+ '415': "VoiceApiError",
+ '429': "VoiceApiError",
+ '500': "VoiceApiError",
+ }
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def get_call_transcription(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> TranscriptionList: # noqa: E501
+ """Get Transcription # noqa: E501
+
+ 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. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_call_transcription(account_id, call_id, recording_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param call_id: Programmable Voice API Call ID. (required)
+ :type call_id: str
+ :param recording_id: Programmable Voice API Recording ID. (required)
+ :type recording_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: TranscriptionList
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the get_call_transcription_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.get_call_transcription_with_http_info(account_id, call_id, recording_id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def get_call_transcription_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], **kwargs) -> ApiResponse: # noqa: E501
+ """Get Transcription # noqa: E501
+
+ 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. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_call_transcription_with_http_info(account_id, call_id, recording_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param call_id: Programmable Voice API Call ID. (required)
+ :type call_id: str
+ :param recording_id: Programmable Voice API Recording ID. (required)
+ :type recording_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(TranscriptionList, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _hosts = [
+ 'https://voice.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'call_id',
+ 'recording_id'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method get_call_transcription" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+ if _params['call_id']:
+ _path_params['callId'] = _params['call_id']
+
+ if _params['recording_id']:
+ _path_params['recordingId'] = _params['recording_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {
+ '200': "TranscriptionList",
+ '400': "VoiceApiError",
+ '401': "VoiceApiError",
+ '403': "VoiceApiError",
+ '404': "VoiceApiError",
+ '405': "VoiceApiError",
+ '415': "VoiceApiError",
+ '429': "VoiceApiError",
+ '500': "VoiceApiError",
+ }
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def list_account_call_recordings(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], to : Annotated[Optional[StrictStr], Field(description="Filter results by the `to` field.")] = None, var_from : Annotated[Optional[StrictStr], Field(description="Filter results by the `from` field.")] = None, min_start_time : Annotated[Optional[StrictStr], Field(description="Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format).")] = None, max_start_time : Annotated[Optional[StrictStr], Field(description="Filter results to recordings which have a `startTime` before `maxStartTime` (in ISO8601 format).")] = None, **kwargs) -> List[CallRecordingMetadata]: # noqa: E501
+ """Get Call Recordings # noqa: E501
+
+ 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. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.list_account_call_recordings(account_id, to, var_from, min_start_time, max_start_time, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param to: Filter results by the `to` field.
+ :type to: str
+ :param var_from: Filter results by the `from` field.
+ :type var_from: str
+ :param min_start_time: Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format).
+ :type min_start_time: str
+ :param max_start_time: Filter results to recordings which have a `startTime` before `maxStartTime` (in ISO8601 format).
+ :type max_start_time: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: List[CallRecordingMetadata]
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the list_account_call_recordings_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.list_account_call_recordings_with_http_info(account_id, to, var_from, min_start_time, max_start_time, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def list_account_call_recordings_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], to : Annotated[Optional[StrictStr], Field(description="Filter results by the `to` field.")] = None, var_from : Annotated[Optional[StrictStr], Field(description="Filter results by the `from` field.")] = None, min_start_time : Annotated[Optional[StrictStr], Field(description="Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format).")] = None, max_start_time : Annotated[Optional[StrictStr], Field(description="Filter results to recordings which have a `startTime` before `maxStartTime` (in ISO8601 format).")] = None, **kwargs) -> ApiResponse: # noqa: E501
+ """Get Call Recordings # noqa: E501
+
+ 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. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.list_account_call_recordings_with_http_info(account_id, to, var_from, min_start_time, max_start_time, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param to: Filter results by the `to` field.
+ :type to: str
+ :param var_from: Filter results by the `from` field.
+ :type var_from: str
+ :param min_start_time: Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format).
+ :type min_start_time: str
+ :param max_start_time: Filter results to recordings which have a `startTime` before `maxStartTime` (in ISO8601 format).
+ :type max_start_time: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(List[CallRecordingMetadata], status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _hosts = [
+ 'https://voice.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'to',
+ 'var_from',
+ 'min_start_time',
+ 'max_start_time'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method list_account_call_recordings" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+
+ # process the query parameters
+ _query_params = []
+ if _params.get('to') is not None: # noqa: E501
+ _query_params.append(('to', _params['to']))
+
+ if _params.get('var_from') is not None: # noqa: E501
+ _query_params.append(('from', _params['var_from']))
+
+ if _params.get('min_start_time') is not None: # noqa: E501
+ _query_params.append(('minStartTime', _params['min_start_time']))
+
+ if _params.get('max_start_time') is not None: # noqa: E501
+ _query_params.append(('maxStartTime', _params['max_start_time']))
+
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {
+ '200': "List[CallRecordingMetadata]",
+ '400': "VoiceApiError",
+ '401': "VoiceApiError",
+ '403': "VoiceApiError",
+ '404': "VoiceApiError",
+ '405': "VoiceApiError",
+ '415': "VoiceApiError",
+ '429': "VoiceApiError",
+ '500': "VoiceApiError",
+ }
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/recordings', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def list_call_recordings(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], **kwargs) -> List[CallRecordingMetadata]: # noqa: E501
+ """List Call Recordings # noqa: E501
+
+ Returns a (potentially empty) list of metadata for the recordings that took place during the specified call. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.list_call_recordings(account_id, call_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param call_id: Programmable Voice API Call ID. (required)
+ :type call_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: List[CallRecordingMetadata]
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the list_call_recordings_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.list_call_recordings_with_http_info(account_id, call_id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def list_call_recordings_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], **kwargs) -> ApiResponse: # noqa: E501
+ """List Call Recordings # noqa: E501
+
+ Returns a (potentially empty) list of metadata for the recordings that took place during the specified call. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.list_call_recordings_with_http_info(account_id, call_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param call_id: Programmable Voice API Call ID. (required)
+ :type call_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(List[CallRecordingMetadata], status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _hosts = [
+ 'https://voice.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'call_id'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method list_call_recordings" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+ if _params['call_id']:
+ _path_params['callId'] = _params['call_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {
+ '200': "List[CallRecordingMetadata]",
+ '400': "VoiceApiError",
+ '401': "VoiceApiError",
+ '403': "VoiceApiError",
+ '404': "VoiceApiError",
+ '405': "VoiceApiError",
+ '415': "VoiceApiError",
+ '429': "VoiceApiError",
+ '500': "VoiceApiError",
+ }
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/calls/{callId}/recordings', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def transcribe_call_recording(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], transcribe_recording : TranscribeRecording, **kwargs) -> None: # noqa: E501
+ """Create Transcription Request # noqa: E501
+
+ Generate the transcription for a specific recording. Transcription can succeed only for recordings of length greater than 500 milliseconds and less than 4 hours. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.transcribe_call_recording(account_id, call_id, recording_id, transcribe_recording, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param call_id: Programmable Voice API Call ID. (required)
+ :type call_id: str
+ :param recording_id: Programmable Voice API Recording ID. (required)
+ :type recording_id: str
+ :param transcribe_recording: (required)
+ :type transcribe_recording: TranscribeRecording
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the transcribe_call_recording_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.transcribe_call_recording_with_http_info(account_id, call_id, recording_id, transcribe_recording, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def transcribe_call_recording_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], recording_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Recording ID.")], transcribe_recording : TranscribeRecording, **kwargs) -> ApiResponse: # noqa: E501
+ """Create Transcription Request # noqa: E501
+
+ Generate the transcription for a specific recording. Transcription can succeed only for recordings of length greater than 500 milliseconds and less than 4 hours. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.transcribe_call_recording_with_http_info(account_id, call_id, recording_id, transcribe_recording, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param call_id: Programmable Voice API Call ID. (required)
+ :type call_id: str
+ :param recording_id: Programmable Voice API Recording ID. (required)
+ :type recording_id: str
+ :param transcribe_recording: (required)
+ :type transcribe_recording: TranscribeRecording
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _hosts = [
+ 'https://voice.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'call_id',
+ 'recording_id',
+ 'transcribe_recording'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method transcribe_call_recording" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+ if _params['call_id']:
+ _path_params['callId'] = _params['call_id']
+
+ if _params['recording_id']:
+ _path_params['recordingId'] = _params['recording_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ if _params['transcribe_recording'] is not None:
+ _body_params = _params['transcribe_recording']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription', 'POST',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
+
+ @validate_arguments
+ def update_call_recording_state(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], update_call_recording : UpdateCallRecording, **kwargs) -> None: # noqa: E501
+ """Update Recording # noqa: E501
+
+ Pause or resume a recording on an active phone call. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_call_recording_state(account_id, call_id, update_call_recording, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param call_id: Programmable Voice API Call ID. (required)
+ :type call_id: str
+ :param update_call_recording: (required)
+ :type update_call_recording: UpdateCallRecording
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the update_call_recording_state_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.update_call_recording_state_with_http_info(account_id, call_id, update_call_recording, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def update_call_recording_state_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], call_id : Annotated[StrictStr, Field(..., description="Programmable Voice API Call ID.")], update_call_recording : UpdateCallRecording, **kwargs) -> ApiResponse: # noqa: E501
+ """Update Recording # noqa: E501
+
+ Pause or resume a recording on an active phone call. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_call_recording_state_with_http_info(account_id, call_id, update_call_recording, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param call_id: Programmable Voice API Call ID. (required)
+ :type call_id: str
+ :param update_call_recording: (required)
+ :type update_call_recording: UpdateCallRecording
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _hosts = [
+ 'https://voice.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id',
+ 'call_id',
+ 'update_call_recording'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method update_call_recording_state" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+ if _params['call_id']:
+ _path_params['callId'] = _params['call_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ if _params['update_call_recording'] is not None:
+ _body_params = _params['update_call_recording']
+
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get('_content_type',
+ self.api_client.select_header_content_type(
+ ['application/json']))
+ if _content_types_list:
+ _header_params['Content-Type'] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/calls/{callId}/recording', 'PUT',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
diff --git a/bandwidth/api/statistics_api.py b/bandwidth/api/statistics_api.py
new file mode 100644
index 00000000..5766d050
--- /dev/null
+++ b/bandwidth/api/statistics_api.py
@@ -0,0 +1,205 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import re # noqa: F401
+import io
+import warnings
+
+from pydantic import validate_arguments, ValidationError
+from typing_extensions import Annotated
+
+from pydantic import Field, StrictStr
+
+from bandwidth.models.account_statistics import AccountStatistics
+
+from bandwidth.api_client import ApiClient
+from bandwidth.api_response import ApiResponse
+from bandwidth.exceptions import ( # noqa: F401
+ ApiTypeError,
+ ApiValueError
+)
+
+
+class StatisticsApi(object):
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None):
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+ @validate_arguments
+ def get_statistics(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], **kwargs) -> AccountStatistics: # noqa: E501
+ """Get Account Statistics # noqa: E501
+
+ Returns details about the current state of the account. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_statistics(account_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: AccountStatistics
+ """
+ kwargs['_return_http_data_only'] = True
+ if '_preload_content' in kwargs:
+ raise ValueError("Error! Please call the get_statistics_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.get_statistics_with_http_info(account_id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def get_statistics_with_http_info(self, account_id : Annotated[StrictStr, Field(..., description="Your Bandwidth Account ID.")], **kwargs) -> ApiResponse: # noqa: E501
+ """Get Account Statistics # noqa: E501
+
+ Returns details about the current state of the account. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_statistics_with_http_info(account_id, async_req=True)
+ >>> result = thread.get()
+
+ :param account_id: Your Bandwidth Account ID. (required)
+ :type account_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(AccountStatistics, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _hosts = [
+ 'https://voice.bandwidth.com/api/v2'
+ ]
+ _host = _hosts[0]
+ if kwargs.get('_host_index'):
+ _host_index = int(kwargs.get('_host_index'))
+ if _host_index < 0 or _host_index >= len(_hosts):
+ raise ApiValueError(
+ "Invalid host index. Must be 0 <= index < %s"
+ % len(_host)
+ )
+ _host = _hosts[_host_index]
+ _params = locals()
+
+ _all_params = [
+ 'account_id'
+ ]
+ _all_params.extend(
+ [
+ 'async_req',
+ '_return_http_data_only',
+ '_preload_content',
+ '_request_timeout',
+ '_request_auth',
+ '_content_type',
+ '_headers'
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params['kwargs'].items():
+ if _key not in _all_params and _key != "_host_index":
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method get_statistics" % _key
+ )
+ _params[_key] = _val
+ del _params['kwargs']
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params['account_id']:
+ _path_params['accountId'] = _params['account_id']
+
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get('_headers', {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ ['application/json']) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ['Basic'] # noqa: E501
+
+ _response_types_map = {
+ '200': "AccountStatistics",
+ '400': "VoiceApiError",
+ '401': "VoiceApiError",
+ '403': "VoiceApiError",
+ '404': "VoiceApiError",
+ '405': "VoiceApiError",
+ '415': "VoiceApiError",
+ '429': "VoiceApiError",
+ '500': "VoiceApiError",
+ }
+
+ return self.api_client.call_api(
+ '/accounts/{accountId}/statistics', 'GET',
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get('async_req'),
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
+ _preload_content=_params.get('_preload_content', True),
+ _request_timeout=_params.get('_request_timeout'),
+ _host=_host,
+ collection_formats=_collection_formats,
+ _request_auth=_params.get('_request_auth'))
diff --git a/bandwidth/api_client.py b/bandwidth/api_client.py
new file mode 100644
index 00000000..5b45d659
--- /dev/null
+++ b/bandwidth/api_client.py
@@ -0,0 +1,756 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import atexit
+import datetime
+from dateutil.parser import parse
+import json
+import mimetypes
+from multiprocessing.pool import ThreadPool
+import os
+import re
+import tempfile
+
+from urllib.parse import quote
+
+from bandwidth.configuration import Configuration
+from bandwidth.api_response import ApiResponse
+import bandwidth.models
+from bandwidth import rest
+from bandwidth.exceptions import ApiValueError, ApiException
+
+
+class ApiClient(object):
+ """Generic API client for OpenAPI client library builds.
+
+ OpenAPI generic API client. This client handles the client-
+ server communication, and is invariant across implementations. Specifics of
+ the methods and models for each application are generated from the OpenAPI
+ templates.
+
+ :param configuration: .Configuration object for this client
+ :param header_name: a header to pass when making calls to the API.
+ :param header_value: a header value to pass when making calls to
+ the API.
+ :param cookie: a cookie to include in the header when making calls
+ to the API
+ :param pool_threads: The number of threads to use for async requests
+ to the API. More threads means more concurrent API requests.
+ """
+
+ PRIMITIVE_TYPES = (float, bool, bytes, str, int)
+ NATIVE_TYPES_MAPPING = {
+ 'int': int,
+ 'long': int, # TODO remove as only py3 is supported?
+ 'float': float,
+ 'str': str,
+ 'bool': bool,
+ 'date': datetime.date,
+ 'datetime': datetime.datetime,
+ 'object': object,
+ }
+ _pool = None
+
+ def __init__(self, configuration=None, header_name=None, header_value=None,
+ cookie=None, pool_threads=1):
+ # use default configuration if none is provided
+ if configuration is None:
+ configuration = Configuration.get_default()
+ self.configuration = configuration
+ self.pool_threads = pool_threads
+
+ self.rest_client = rest.RESTClientObject(configuration)
+ self.default_headers = {}
+ if header_name is not None:
+ self.default_headers[header_name] = header_value
+ self.cookie = cookie
+ # Set default User-Agent.
+ self.user_agent = 'OpenAPI-Generator/15.0.0/python'
+ self.client_side_validation = configuration.client_side_validation
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, exc_type, exc_value, traceback):
+ self.close()
+
+ def close(self):
+ if self._pool:
+ self._pool.close()
+ self._pool.join()
+ self._pool = None
+ if hasattr(atexit, 'unregister'):
+ atexit.unregister(self.close)
+
+ @property
+ def pool(self):
+ """Create thread pool on first request
+ avoids instantiating unused threadpool for blocking clients.
+ """
+ if self._pool is None:
+ atexit.register(self.close)
+ self._pool = ThreadPool(self.pool_threads)
+ return self._pool
+
+ @property
+ def user_agent(self):
+ """User agent for this API client"""
+ return self.default_headers['User-Agent']
+
+ @user_agent.setter
+ def user_agent(self, value):
+ self.default_headers['User-Agent'] = value
+
+ def set_default_header(self, header_name, header_value):
+ self.default_headers[header_name] = header_value
+
+
+ _default = None
+
+ @classmethod
+ def get_default(cls):
+ """Return new instance of ApiClient.
+
+ This method returns newly created, based on default constructor,
+ object of ApiClient class or returns a copy of default
+ ApiClient.
+
+ :return: The ApiClient object.
+ """
+ if cls._default is None:
+ cls._default = ApiClient()
+ return cls._default
+
+ @classmethod
+ def set_default(cls, default):
+ """Set default instance of ApiClient.
+
+ It stores default ApiClient.
+
+ :param default: object of ApiClient.
+ """
+ cls._default = default
+
+ def __call_api(
+ self, resource_path, method, path_params=None,
+ query_params=None, header_params=None, body=None, post_params=None,
+ files=None, response_types_map=None, auth_settings=None,
+ _return_http_data_only=None, collection_formats=None,
+ _preload_content=True, _request_timeout=None, _host=None,
+ _request_auth=None):
+
+ config = self.configuration
+
+ # header parameters
+ header_params = header_params or {}
+ header_params.update(self.default_headers)
+ if self.cookie:
+ header_params['Cookie'] = self.cookie
+ if header_params:
+ header_params = self.sanitize_for_serialization(header_params)
+ header_params = dict(self.parameters_to_tuples(header_params,
+ collection_formats))
+
+ # path parameters
+ if path_params:
+ path_params = self.sanitize_for_serialization(path_params)
+ path_params = self.parameters_to_tuples(path_params,
+ collection_formats)
+ for k, v in path_params:
+ # specified safe chars, encode everything
+ resource_path = resource_path.replace(
+ '{%s}' % k,
+ quote(str(v), safe=config.safe_chars_for_path_param)
+ )
+
+ # post parameters
+ if post_params or files:
+ post_params = post_params if post_params else []
+ post_params = self.sanitize_for_serialization(post_params)
+ post_params = self.parameters_to_tuples(post_params,
+ collection_formats)
+ post_params.extend(self.files_parameters(files))
+
+ # auth setting
+ self.update_params_for_auth(
+ header_params, query_params, auth_settings,
+ resource_path, method, body,
+ request_auth=_request_auth)
+
+ # body
+ if body:
+ body = self.sanitize_for_serialization(body)
+
+ # request url
+ if _host is None:
+ url = self.configuration.host + resource_path
+ else:
+ # use server/host defined in path or operation instead
+ url = _host + resource_path
+
+ # query parameters
+ if query_params:
+ query_params = self.sanitize_for_serialization(query_params)
+ url_query = self.parameters_to_url_query(query_params,
+ collection_formats)
+ url += "?" + url_query
+
+ try:
+ # perform request and return response
+ response_data = self.request(
+ method, url,
+ query_params=query_params,
+ headers=header_params,
+ post_params=post_params, body=body,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout)
+ except ApiException as e:
+ if e.body:
+ e.body = e.body.decode('utf-8')
+ raise e
+
+ self.last_response = response_data
+
+ return_data = None # assuming derialization is not needed
+ # data needs deserialization or returns HTTP data (deserialized) only
+ if _preload_content or _return_http_data_only:
+ response_type = response_types_map.get(str(response_data.status), None)
+
+ if response_type == "bytearray":
+ response_data.data = response_data.data
+ else:
+ match = None
+ content_type = response_data.getheader('content-type')
+ if content_type is not None:
+ match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type)
+ encoding = match.group(1) if match else "utf-8"
+ response_data.data = response_data.data.decode(encoding)
+
+ # deserialize response data
+ if response_type == "bytearray":
+ return_data = response_data.data
+ elif response_type:
+ return_data = self.deserialize(response_data, response_type)
+ else:
+ return_data = None
+
+ if _return_http_data_only:
+ return return_data
+ else:
+ return ApiResponse(status_code = response_data.status,
+ data = return_data,
+ headers = response_data.getheaders(),
+ raw_data = response_data.data)
+
+ def sanitize_for_serialization(self, obj):
+ """Builds a JSON POST object.
+
+ If obj is None, return None.
+ If obj is str, int, long, float, bool, return directly.
+ If obj is datetime.datetime, datetime.date
+ convert to string in iso8601 format.
+ If obj is list, sanitize each element in the list.
+ If obj is dict, return the dict.
+ If obj is OpenAPI model, return the properties dict.
+
+ :param obj: The data to serialize.
+ :return: The serialized form of data.
+ """
+ if obj is None:
+ return None
+ elif isinstance(obj, self.PRIMITIVE_TYPES):
+ return obj
+ elif isinstance(obj, list):
+ return [self.sanitize_for_serialization(sub_obj)
+ for sub_obj in obj]
+ elif isinstance(obj, tuple):
+ return tuple(self.sanitize_for_serialization(sub_obj)
+ for sub_obj in obj)
+ elif isinstance(obj, (datetime.datetime, datetime.date)):
+ return obj.isoformat()
+
+ if isinstance(obj, dict):
+ obj_dict = obj
+ else:
+ # Convert model obj to dict except
+ # attributes `openapi_types`, `attribute_map`
+ # and attributes which value is not None.
+ # Convert attribute name to json key in
+ # model definition for request.
+ obj_dict = obj.to_dict()
+
+ return {key: self.sanitize_for_serialization(val)
+ for key, val in obj_dict.items()}
+
+ def deserialize(self, response, response_type):
+ """Deserializes response into an object.
+
+ :param response: RESTResponse object to be deserialized.
+ :param response_type: class literal for
+ deserialized object, or string of class name.
+
+ :return: deserialized object.
+ """
+ # handle file downloading
+ # save response body into a tmp file and return the instance
+ if response_type == "file":
+ return self.__deserialize_file(response)
+
+ # fetch data from response object
+ try:
+ data = json.loads(response.data)
+ except ValueError:
+ data = response.data
+
+ return self.__deserialize(data, response_type)
+
+ def __deserialize(self, data, klass):
+ """Deserializes dict, list, str into an object.
+
+ :param data: dict, list or str.
+ :param klass: class literal, or string of class name.
+
+ :return: object.
+ """
+ if data is None:
+ return None
+
+ if type(klass) == str:
+ if klass.startswith('List['):
+ sub_kls = re.match(r'List\[(.*)]', klass).group(1)
+ return [self.__deserialize(sub_data, sub_kls)
+ for sub_data in data]
+
+ if klass.startswith('Dict['):
+ sub_kls = re.match(r'Dict\[([^,]*), (.*)]', klass).group(2)
+ return {k: self.__deserialize(v, sub_kls)
+ for k, v in data.items()}
+
+ # convert str to class
+ if klass in self.NATIVE_TYPES_MAPPING:
+ klass = self.NATIVE_TYPES_MAPPING[klass]
+ else:
+ klass = getattr(bandwidth.models, klass)
+
+ if klass in self.PRIMITIVE_TYPES:
+ return self.__deserialize_primitive(data, klass)
+ elif klass == object:
+ return self.__deserialize_object(data)
+ elif klass == datetime.date:
+ return self.__deserialize_date(data)
+ elif klass == datetime.datetime:
+ return self.__deserialize_datetime(data)
+ else:
+ return self.__deserialize_model(data, klass)
+
+ def call_api(self, resource_path, method,
+ path_params=None, query_params=None, header_params=None,
+ body=None, post_params=None, files=None,
+ response_types_map=None, auth_settings=None,
+ async_req=None, _return_http_data_only=None,
+ collection_formats=None, _preload_content=True,
+ _request_timeout=None, _host=None, _request_auth=None):
+ """Makes the HTTP request (synchronous) and returns deserialized data.
+
+ To make an async_req request, set the async_req parameter.
+
+ :param resource_path: Path to method endpoint.
+ :param method: Method to call.
+ :param path_params: Path parameters in the url.
+ :param query_params: Query parameters in the url.
+ :param header_params: Header parameters to be
+ placed in the request header.
+ :param body: Request body.
+ :param post_params dict: Request post form parameters,
+ for `application/x-www-form-urlencoded`, `multipart/form-data`.
+ :param auth_settings list: Auth Settings names for the request.
+ :param response: Response data type.
+ :param files dict: key -> filename, value -> filepath,
+ for `multipart/form-data`.
+ :param async_req bool: execute request asynchronously
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :param collection_formats: dict of collection formats for path, query,
+ header, and post parameters.
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_token: dict, optional
+ :return:
+ If async_req parameter is True,
+ the request will be called asynchronously.
+ The method will return the request thread.
+ If parameter async_req is False or missing,
+ then the method will return the response directly.
+ """
+ if not async_req:
+ return self.__call_api(resource_path, method,
+ path_params, query_params, header_params,
+ body, post_params, files,
+ response_types_map, auth_settings,
+ _return_http_data_only, collection_formats,
+ _preload_content, _request_timeout, _host,
+ _request_auth)
+
+ return self.pool.apply_async(self.__call_api, (resource_path,
+ method, path_params,
+ query_params,
+ header_params, body,
+ post_params, files,
+ response_types_map,
+ auth_settings,
+ _return_http_data_only,
+ collection_formats,
+ _preload_content,
+ _request_timeout,
+ _host, _request_auth))
+
+ def request(self, method, url, query_params=None, headers=None,
+ post_params=None, body=None, _preload_content=True,
+ _request_timeout=None):
+ """Makes the HTTP request using RESTClient."""
+ if method == "GET":
+ return self.rest_client.get_request(url,
+ query_params=query_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ headers=headers)
+ elif method == "HEAD":
+ return self.rest_client.head_request(url,
+ query_params=query_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ headers=headers)
+ elif method == "OPTIONS":
+ return self.rest_client.options_request(url,
+ query_params=query_params,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout)
+ elif method == "POST":
+ return self.rest_client.post_request(url,
+ query_params=query_params,
+ headers=headers,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ elif method == "PUT":
+ return self.rest_client.put_request(url,
+ query_params=query_params,
+ headers=headers,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ elif method == "PATCH":
+ return self.rest_client.patch_request(url,
+ query_params=query_params,
+ headers=headers,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ elif method == "DELETE":
+ return self.rest_client.delete_request(url,
+ query_params=query_params,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+ else:
+ raise ApiValueError(
+ "http method must be `GET`, `HEAD`, `OPTIONS`,"
+ " `POST`, `PATCH`, `PUT` or `DELETE`."
+ )
+
+ def parameters_to_tuples(self, params, collection_formats):
+ """Get parameters as list of tuples, formatting collections.
+
+ :param params: Parameters as dict or list of two-tuples
+ :param dict collection_formats: Parameter collection formats
+ :return: Parameters as list of tuples, collections formatted
+ """
+ new_params = []
+ if collection_formats is None:
+ collection_formats = {}
+ for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501
+ if k in collection_formats:
+ collection_format = collection_formats[k]
+ if collection_format == 'multi':
+ new_params.extend((k, value) for value in v)
+ else:
+ if collection_format == 'ssv':
+ delimiter = ' '
+ elif collection_format == 'tsv':
+ delimiter = '\t'
+ elif collection_format == 'pipes':
+ delimiter = '|'
+ else: # csv is the default
+ delimiter = ','
+ new_params.append(
+ (k, delimiter.join(str(value) for value in v)))
+ else:
+ new_params.append((k, v))
+ return new_params
+
+ def parameters_to_url_query(self, params, collection_formats):
+ """Get parameters as list of tuples, formatting collections.
+
+ :param params: Parameters as dict or list of two-tuples
+ :param dict collection_formats: Parameter collection formats
+ :return: URL query string (e.g. a=Hello%20World&b=123)
+ """
+ new_params = []
+ if collection_formats is None:
+ collection_formats = {}
+ for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501
+ if isinstance(v, (int, float)):
+ v = str(v)
+ if isinstance(v, bool):
+ v = str(v).lower()
+ if isinstance(v, dict):
+ v = json.dumps(v)
+
+ if k in collection_formats:
+ collection_format = collection_formats[k]
+ if collection_format == 'multi':
+ new_params.extend((k, value) for value in v)
+ else:
+ if collection_format == 'ssv':
+ delimiter = ' '
+ elif collection_format == 'tsv':
+ delimiter = '\t'
+ elif collection_format == 'pipes':
+ delimiter = '|'
+ else: # csv is the default
+ delimiter = ','
+ new_params.append(
+ (k, delimiter.join(quote(str(value)) for value in v)))
+ else:
+ new_params.append((k, quote(str(v))))
+
+ return "&".join(["=".join(item) for item in new_params])
+
+ def files_parameters(self, files=None):
+ """Builds form parameters.
+
+ :param files: File parameters.
+ :return: Form parameters with files.
+ """
+ params = []
+
+ if files:
+ for k, v in files.items():
+ if not v:
+ continue
+ file_names = v if type(v) is list else [v]
+ for n in file_names:
+ with open(n, 'rb') as f:
+ filename = os.path.basename(f.name)
+ filedata = f.read()
+ mimetype = (mimetypes.guess_type(filename)[0] or
+ 'application/octet-stream')
+ params.append(
+ tuple([k, tuple([filename, filedata, mimetype])]))
+
+ return params
+
+ def select_header_accept(self, accepts):
+ """Returns `Accept` based on an array of accepts provided.
+
+ :param accepts: List of headers.
+ :return: Accept (e.g. application/json).
+ """
+ if not accepts:
+ return
+
+ for accept in accepts:
+ if re.search('json', accept, re.IGNORECASE):
+ return accept
+
+ return accepts[0]
+
+ def select_header_content_type(self, content_types):
+ """Returns `Content-Type` based on an array of content_types provided.
+
+ :param content_types: List of content-types.
+ :return: Content-Type (e.g. application/json).
+ """
+ if not content_types:
+ return None
+
+ for content_type in content_types:
+ if re.search('json', content_type, re.IGNORECASE):
+ return content_type
+
+ return content_types[0]
+
+ def update_params_for_auth(self, headers, queries, auth_settings,
+ resource_path, method, body,
+ request_auth=None):
+ """Updates header and query params based on authentication setting.
+
+ :param headers: Header parameters dict to be updated.
+ :param queries: Query parameters tuple list to be updated.
+ :param auth_settings: Authentication setting identifiers list.
+ :resource_path: A string representation of the HTTP request resource path.
+ :method: A string representation of the HTTP request method.
+ :body: A object representing the body of the HTTP request.
+ The object type is the return value of sanitize_for_serialization().
+ :param request_auth: if set, the provided settings will
+ override the token in the configuration.
+ """
+ if not auth_settings:
+ return
+
+ if request_auth:
+ self._apply_auth_params(headers, queries,
+ resource_path, method, body,
+ request_auth)
+ return
+
+ for auth in auth_settings:
+ auth_setting = self.configuration.auth_settings().get(auth)
+ if auth_setting:
+ self._apply_auth_params(headers, queries,
+ resource_path, method, body,
+ auth_setting)
+
+ def _apply_auth_params(self, headers, queries,
+ resource_path, method, body,
+ auth_setting):
+ """Updates the request parameters based on a single auth_setting
+
+ :param headers: Header parameters dict to be updated.
+ :param queries: Query parameters tuple list to be updated.
+ :resource_path: A string representation of the HTTP request resource path.
+ :method: A string representation of the HTTP request method.
+ :body: A object representing the body of the HTTP request.
+ The object type is the return value of sanitize_for_serialization().
+ :param auth_setting: auth settings for the endpoint
+ """
+ if auth_setting['in'] == 'cookie':
+ headers['Cookie'] = auth_setting['value']
+ elif auth_setting['in'] == 'header':
+ if auth_setting['type'] != 'http-signature':
+ headers[auth_setting['key']] = auth_setting['value']
+ elif auth_setting['in'] == 'query':
+ queries.append((auth_setting['key'], auth_setting['value']))
+ else:
+ raise ApiValueError(
+ 'Authentication token must be in `query` or `header`'
+ )
+
+ def __deserialize_file(self, response):
+ """Deserializes body to file
+
+ Saves response body into a file in a temporary folder,
+ using the filename from the `Content-Disposition` header if provided.
+
+ :param response: RESTResponse.
+ :return: file path.
+ """
+ fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path)
+ os.close(fd)
+ os.remove(path)
+
+ content_disposition = response.getheader("Content-Disposition")
+ if content_disposition:
+ filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?',
+ content_disposition).group(1)
+ path = os.path.join(os.path.dirname(path), filename)
+
+ with open(path, "wb") as f:
+ f.write(response.data)
+
+ return path
+
+ def __deserialize_primitive(self, data, klass):
+ """Deserializes string to primitive type.
+
+ :param data: str.
+ :param klass: class literal.
+
+ :return: int, long, float, str, bool.
+ """
+ try:
+ return klass(data)
+ except UnicodeEncodeError:
+ return str(data)
+ except TypeError:
+ return data
+
+ def __deserialize_object(self, value):
+ """Return an original value.
+
+ :return: object.
+ """
+ return value
+
+ def __deserialize_date(self, string):
+ """Deserializes string to date.
+
+ :param string: str.
+ :return: date.
+ """
+ try:
+ return parse(string).date()
+ except ImportError:
+ return string
+ except ValueError:
+ raise rest.ApiException(
+ status=0,
+ reason="Failed to parse `{0}` as date object".format(string)
+ )
+
+ def __deserialize_datetime(self, string):
+ """Deserializes string to datetime.
+
+ The string should be in iso8601 datetime format.
+
+ :param string: str.
+ :return: datetime.
+ """
+ try:
+ return parse(string)
+ except ImportError:
+ return string
+ except ValueError:
+ raise rest.ApiException(
+ status=0,
+ reason=(
+ "Failed to parse `{0}` as datetime object"
+ .format(string)
+ )
+ )
+
+ def __deserialize_model(self, data, klass):
+ """Deserializes list or dict to model.
+
+ :param data: dict, list.
+ :param klass: class literal.
+ :return: model object.
+ """
+
+ return klass.from_dict(data)
diff --git a/bandwidth/api_helper.py b/bandwidth/api_helper.py
deleted file mode 100644
index bb191559..00000000
--- a/bandwidth/api_helper.py
+++ /dev/null
@@ -1,418 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-import re
-import sys
-import datetime
-import calendar
-import email.utils as eut
-from time import mktime
-
-import jsonpickle
-import dateutil.parser
-from requests.utils import quote
-
-
-class APIHelper(object):
-
- """A Helper Class for various functions associated with API Calls.
-
- This class contains static methods for operations that need to be
- performed during API requests. All of the methods inside this class are
- static methods, there is no need to ever initialise an instance of this
- class.
-
- """
-
- @staticmethod
- def merge_dicts(dict1, dict2):
- """Merges two dictionaries into one as a shallow copy.
-
- Args:
- dict1 (dict): The first dictionary.
- dict2 (dict): The second dictionary.
-
- Returns:
- dict: A dictionary containing key value pairs
- from both the argument dictionaries. In the case
- of a key conflict, values from dict2 are used
- and those from dict1 are lost.
-
- """
- temp = dict1.copy()
- temp.update(dict2)
- return temp
-
- @staticmethod
- def json_serialize(obj):
- """JSON Serialization of a given object.
-
- Args:
- obj (object): The object to serialize.
-
- Returns:
- str: The JSON serialized string of the object.
-
- """
- if obj is None:
- return None
-
- # Resolve any Names if it's one of our objects that needs to have this called on
- if isinstance(obj, list):
- value = list()
- for item in obj:
- if hasattr(item, "_names"):
- value.append(APIHelper.to_dictionary(item))
- else:
- value.append(item)
- obj = value
- else:
- if hasattr(obj, "_names"):
- obj = APIHelper.to_dictionary(obj)
-
- return jsonpickle.encode(obj, False)
-
- @staticmethod
- def json_deserialize(json, unboxing_function=None, as_dict=False):
- """JSON Deserialization of a given string.
-
- Args:
- json (str): The JSON serialized string to deserialize.
-
- Returns:
- dict: A dictionary representing the data contained in the
- JSON serialized string.
-
- """
- if json is None:
- return None
-
- try:
- decoded = jsonpickle.decode(json)
- except ValueError:
- return json
-
- if unboxing_function is None:
- return decoded
-
- if as_dict:
- return {k: unboxing_function(v) for k, v in decoded.items()}
- elif isinstance(decoded, list):
- return [unboxing_function(element) for element in decoded]
- else:
- return unboxing_function(decoded)
-
- @staticmethod
- def serialize_array(key, array, formatting="indexed"):
- """Converts an array parameter to a list of key value tuples.
-
- Args:
- key (str): The name of the parameter.
- array (list): The value of the parameter.
- formatting (str): The type of key formatting expected.
-
- Returns:
- list: A list with key value tuples for the array elements.
-
- """
- tuples = []
-
- if sys.version_info[0] < 3:
- serializable_types = (str, int, long, float, bool, datetime.date, APIHelper.CustomDate)
- else:
- serializable_types = (str, int, float, bool, datetime.date, APIHelper.CustomDate)
-
- if isinstance(array[0], serializable_types):
- if formatting == "unindexed":
- tuples += [("{0}[]".format(key), element) for element in array]
- elif formatting == "indexed":
- tuples += [("{0}[{1}]".format(key, index), element) for index, element in enumerate(array)]
- elif formatting == "plain":
- tuples += [(key, element) for element in array]
- else:
- raise ValueError("Invalid format provided.")
- else:
- tuples += [("{0}[{1}]".format(key, index), element) for index, element in enumerate(array)]
-
- return tuples
-
- @staticmethod
- def append_url_with_template_parameters(url, parameters):
- """Replaces template parameters in the given url.
-
- Args:
- url (str): The query url string to replace the template parameters.
- parameters (dict): The parameters to replace in the url.
-
- Returns:
- str: URL with replaced parameters.
-
- """
- # Parameter validation
- if url is None:
- raise ValueError("URL is None.")
- if parameters is None:
- return url
-
- # Iterate and replace parameters
- for key in parameters:
- value = parameters[key]['value']
- encode = parameters[key]['encode']
- replace_value = ''
-
- # Load parameter value
- if value is None:
- replace_value = ''
- elif isinstance(value, list):
- replace_value = "/".join((quote(str(x), safe='') if encode else str(x)) for x in value)
- else:
- replace_value = quote(str(value), safe='') if encode else str(value)
-
- url = url.replace('{{{0}}}'.format(key), str(replace_value))
-
- return url
-
- @staticmethod
- def append_url_with_query_parameters(url,
- parameters,
- array_serialization="indexed"):
- """Adds query parameters to a URL.
-
- Args:
- url (str): The URL string.
- parameters (dict): The query parameters to add to the URL.
- array_serialization (str): The format of array parameter serialization.
-
- Returns:
- str: URL with added query parameters.
-
- """
- # Parameter validation
- if url is None:
- raise ValueError("URL is None.")
- if parameters is None:
- return url
-
- for key, value in parameters.items():
- seperator = '&' if '?' in url else '?'
- if value is not None:
- if isinstance(value, list):
- value = [element for element in value if element]
- if array_serialization == "csv":
- url += "{0}{1}={2}".format(
- seperator,
- key,
- ",".join(quote(str(x), safe='') for x in value)
- )
- elif array_serialization == "psv":
- url += "{0}{1}={2}".format(
- seperator,
- key,
- "|".join(quote(str(x), safe='') for x in value)
- )
- elif array_serialization == "tsv":
- url += "{0}{1}={2}".format(
- seperator,
- key,
- "\t".join(quote(str(x), safe='') for x in value)
- )
- else:
- url += "{0}{1}".format(
- seperator,
- "&".join(("{0}={1}".format(k, quote(str(v), safe='')))
- for k, v in APIHelper.serialize_array(key, value, array_serialization))
- )
- else:
- url += "{0}{1}={2}".format(seperator, key, quote(str(value), safe=''))
-
- return url
-
- @staticmethod
- def clean_url(url):
- """Validates and processes the given query Url to clean empty slashes.
-
- Args:
- url (str): The given query Url to process.
-
- Returns:
- str: Clean Url as string.
-
- """
- # Ensure that the urls are absolute
- regex = "^https?://[^/]+"
- match = re.match(regex, url)
- if match is None:
- raise ValueError('Invalid Url format.')
-
- protocol = match.group(0)
- index = url.find('?')
- query_url = url[len(protocol): index if index != -1 else None]
- query_url = re.sub("//+", "/", query_url)
- parameters = url[index:] if index != -1 else ""
-
- return protocol + query_url + parameters
-
- @staticmethod
- def form_encode_parameters(form_parameters,
- array_serialization="indexed"):
- """Form encodes a dictionary of form parameters
-
- Args:
- form_parameters (dictionary): The given dictionary which has
- atleast one model to form encode.
- array_serialization (str): The format of array parameter serialization.
-
- Returns:
- dict: A dictionary of form encoded properties of the model.
-
- """
- encoded = []
-
- for key, value in form_parameters.items():
- encoded += APIHelper.form_encode(value, key, array_serialization)
-
- return encoded
-
- @staticmethod
- def form_encode(obj,
- instance_name,
- array_serialization="indexed"):
- """Encodes a model in a form-encoded manner such as person[Name]
-
- Args:
- obj (object): The given Object to form encode.
- instance_name (string): The base name to appear before each entry
- for this object.
- array_serialization (string): The format of array parameter serialization.
-
- Returns:
- dict: A dictionary of form encoded properties of the model.
-
- """
- retval = []
- # If we received an object, resolve it's field names.
- if hasattr(obj, "_names"):
- obj = APIHelper.to_dictionary(obj)
-
- if obj is None:
- return []
- elif isinstance(obj, list):
- for element in APIHelper.serialize_array(instance_name, obj, array_serialization):
- retval += APIHelper.form_encode(element[1], element[0], array_serialization)
- elif isinstance(obj, dict):
- for item in obj:
- retval += APIHelper.form_encode(obj[item], instance_name + "[" + item + "]", array_serialization)
- else:
- retval.append((instance_name, obj))
-
- return retval
-
- @staticmethod
- def to_dictionary(obj):
- """Creates a dictionary representation of a class instance. The
- keys are taken from the API description and may differ from language
- specific variable names of properties.
-
- Args:
- obj: The object to be converted into a dictionary.
-
- Returns:
- dictionary: A dictionary form of the model with properties in
- their API formats.
-
- """
- dictionary = dict()
-
- # Loop through all properties in this model
- for name in {k: v for k, v in obj.__dict__.items() if v is not None}:
- value = getattr(obj, name)
- if isinstance(value, list):
- # Loop through each item
- dictionary[obj._names[name]] = list()
- for item in value:
- dictionary[obj._names[name]].append(APIHelper.to_dictionary(item) if hasattr(item, "_names") else item)
- elif isinstance(value, dict):
- # Loop through each item
- dictionary[obj._names[name]] = dict()
- for key in value:
- dictionary[obj._names[name]][key] = APIHelper.to_dictionary(value[key]) if hasattr(value[key], "_names") else value[key]
- else:
- dictionary[obj._names[name]] = APIHelper.to_dictionary(value) if hasattr(value, "_names") else value
-
- # Return the result
- return dictionary
-
- @staticmethod
- def when_defined(func, value):
- return func(value) if value else None
-
- class CustomDate(object):
-
- """ A base class for wrapper classes of datetime.
-
- This class contains methods which help in
- appropriate serialization of datetime objects.
-
- """
-
- def __init__(self, dtime, value=None):
- self.datetime = dtime
- if not value:
- self.value = self.from_datetime(dtime)
- else:
- self.value = value
-
- def __repr__(self):
- return str(self.value)
-
- def __getstate__(self):
- return self.value
-
- def __setstate__(self, state):
- pass
-
- class HttpDateTime(CustomDate):
-
- """ A wrapper class for datetime to support HTTP date format."""
-
- @classmethod
- def from_datetime(cls, date_time):
- return eut.formatdate(timeval=mktime(date_time.timetuple()),
- localtime=False, usegmt=True)
-
- @classmethod
- def from_value(cls, value):
- dtime = datetime.datetime.fromtimestamp(eut.mktime_tz(eut.parsedate_tz(value)))
- return cls(dtime, value)
-
- class UnixDateTime(CustomDate):
-
- """ A wrapper class for datetime to support Unix date format."""
-
- @classmethod
- def from_datetime(cls, date_time):
- return calendar.timegm(date_time.utctimetuple())
-
- @classmethod
- def from_value(cls, value):
- dtime = datetime.datetime.utcfromtimestamp(float(value))
- return cls(dtime, float(value))
-
- class RFC3339DateTime(CustomDate):
-
- """ A wrapper class for datetime to support Rfc 3339 format."""
-
- @classmethod
- def from_datetime(cls, date_time):
- return date_time.isoformat()
-
- @classmethod
- def from_value(cls, value):
- dtime = dateutil.parser.parse(value)
- return cls(dtime, value)
diff --git a/bandwidth/api_response.py b/bandwidth/api_response.py
new file mode 100644
index 00000000..d81c2ff5
--- /dev/null
+++ b/bandwidth/api_response.py
@@ -0,0 +1,25 @@
+"""API response object."""
+
+from __future__ import annotations
+from typing import Any, Dict, Optional
+from pydantic import Field, StrictInt, StrictStr
+
+class ApiResponse:
+ """
+ API response object
+ """
+
+ status_code: Optional[StrictInt] = Field(None, description="HTTP status code")
+ headers: Optional[Dict[StrictStr, StrictStr]] = Field(None, description="HTTP headers")
+ data: Optional[Any] = Field(None, description="Deserialized data given the data type")
+ raw_data: Optional[Any] = Field(None, description="Raw data (HTTP response body)")
+
+ def __init__(self,
+ status_code=None,
+ headers=None,
+ data=None,
+ raw_data=None):
+ self.status_code = status_code
+ self.headers = headers
+ self.data = data
+ self.raw_data = raw_data
diff --git a/bandwidth/bandwidth_client.py b/bandwidth/bandwidth_client.py
deleted file mode 100644
index 49dee358..00000000
--- a/bandwidth/bandwidth_client.py
+++ /dev/null
@@ -1,76 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-from bandwidth.decorators import lazy_property
-from bandwidth.configuration import Configuration
-from bandwidth.configuration import Environment
-from bandwidth.messaging.messaging_client import MessagingClient
-from bandwidth.multifactorauth.multi_factor_auth_client import MultiFactorAuthClient
-from bandwidth.phonenumberlookup.phone_number_lookup_client import PhoneNumberLookupClient
-from bandwidth.voice.voice_client import VoiceClient
-from bandwidth.webrtc.web_rtc_client import WebRtcClient
-
-
-class BandwidthClient(object):
-
- @lazy_property
- def messaging_client(self):
- return MessagingClient(config=self.config)
-
- @lazy_property
- def multi_factor_auth_client(self):
- return MultiFactorAuthClient(config=self.config)
-
- @lazy_property
- def phone_number_lookup_client(self):
- return PhoneNumberLookupClient(config=self.config)
-
- @lazy_property
- def voice_client(self):
- return VoiceClient(config=self.config)
-
- @lazy_property
- def web_rtc_client(self):
- return WebRtcClient(config=self.config)
-
- def __init__(self, timeout=60, max_retries=0, 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=['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=None):
- if config is None:
- self.config = Configuration(timeout=timeout,
- max_retries=max_retries,
- 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:
- self.config = config
diff --git a/bandwidth/configuration.py b/bandwidth/configuration.py
index 52ebc2ea..62b17016 100644
--- a/bandwidth/configuration.py
+++ b/bandwidth/configuration.py
@@ -1,264 +1,459 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-from enum import Enum
-from bandwidth.api_helper import APIHelper
-from bandwidth.http.requests_client import RequestsClient
-
-
-class Environment(Enum):
- """An enum for SDK environments"""
- PRODUCTION = 0
- CUSTOM = 1
-
-
-class Server(Enum):
- """An enum for API servers"""
- DEFAULT = 0
- MESSAGINGDEFAULT = 1
- MULTIFACTORAUTHDEFAULT = 2
- PHONENUMBERLOOKUPDEFAULT = 3
- VOICEDEFAULT = 4
- WEBRTCDEFAULT = 5
-
-
-class Configuration(object):
- """A class used for configuring the SDK by a user.
- """
-
- @property
- def http_client(self):
- return self._http_client
-
- @property
- def timeout(self):
- return self._timeout
-
- @property
- def max_retries(self):
- return self._max_retries
-
- @property
- def backoff_factor(self):
- return self._backoff_factor
-
- @property
- def retry_statuses(self):
- return self._retry_statuses
-
- @property
- def retry_methods(self):
- return self._retry_methods
-
- @property
- def environment(self):
- return self._environment
-
- @property
- def base_url(self):
- return self._base_url
-
- @property
- def messaging_basic_auth_user_name(self):
- return self._messaging_basic_auth_user_name
-
- @property
- def messaging_basic_auth_password(self):
- return self._messaging_basic_auth_password
-
- @property
- def multi_factor_auth_basic_auth_user_name(self):
- return self._multi_factor_auth_basic_auth_user_name
-
- @property
- def multi_factor_auth_basic_auth_password(self):
- return self._multi_factor_auth_basic_auth_password
-
- @property
- def phone_number_lookup_basic_auth_user_name(self):
- return self._phone_number_lookup_basic_auth_user_name
-
- @property
- def phone_number_lookup_basic_auth_password(self):
- return self._phone_number_lookup_basic_auth_password
-
- @property
- def voice_basic_auth_user_name(self):
- return self._voice_basic_auth_user_name
-
- @property
- def voice_basic_auth_password(self):
- return self._voice_basic_auth_password
-
- @property
- def web_rtc_basic_auth_user_name(self):
- return self._web_rtc_basic_auth_user_name
-
- @property
- def web_rtc_basic_auth_password(self):
- return self._web_rtc_basic_auth_password
-
- def __init__(
- self, timeout=60, max_retries=0, 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=['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
- self._timeout = timeout
-
- # The number of times to retry an endpoint call if it fails
- self._max_retries = max_retries
-
- # A backoff factor to apply between attempts after the second try.
- # urllib3 will sleep for:
- # `{backoff factor} * (2 ** ({number of total retries} - 1))`
- self._backoff_factor = backoff_factor
-
- # The http statuses on which retry is to be done
- self._retry_statuses = retry_statuses
-
- # The http methods on which retry is to be done
- self._retry_methods = retry_methods
-
- # Current API environment
- self._environment = environment
-
- # base_url value
- self._base_url = base_url
-
- # The username to use with basic authentication
- self._messaging_basic_auth_user_name = messaging_basic_auth_user_name
-
- # The password to use with basic authentication
- self._messaging_basic_auth_password = messaging_basic_auth_password
-
- # The username to use with basic authentication
- self._multi_factor_auth_basic_auth_user_name = multi_factor_auth_basic_auth_user_name
-
- # The password to use with basic authentication
- self._multi_factor_auth_basic_auth_password = multi_factor_auth_basic_auth_password
-
- # The username to use with basic authentication
- self._phone_number_lookup_basic_auth_user_name = phone_number_lookup_basic_auth_user_name
-
- # The password to use with basic authentication
- self._phone_number_lookup_basic_auth_password = phone_number_lookup_basic_auth_password
-
- # The username to use with basic authentication
- self._voice_basic_auth_user_name = voice_basic_auth_user_name
-
- # The password to use with basic authentication
- self._voice_basic_auth_password = voice_basic_auth_password
-
- # The username to use with basic authentication
- self._web_rtc_basic_auth_user_name = web_rtc_basic_auth_user_name
-
- # The password to use with basic authentication
- self._web_rtc_basic_auth_password = web_rtc_basic_auth_password
-
- # The Http Client to use for making requests.
- self._http_client = self.create_http_client()
-
- def clone_with(self, timeout=None, max_retries=None, backoff_factor=None,
- retry_statuses=None, retry_methods=None, environment=None,
- base_url=None, messaging_basic_auth_user_name=None,
- messaging_basic_auth_password=None,
- multi_factor_auth_basic_auth_user_name=None,
- multi_factor_auth_basic_auth_password=None,
- phone_number_lookup_basic_auth_user_name=None,
- phone_number_lookup_basic_auth_password=None,
- voice_basic_auth_user_name=None,
- voice_basic_auth_password=None,
- web_rtc_basic_auth_user_name=None,
- web_rtc_basic_auth_password=None):
- timeout = timeout or self.timeout
- max_retries = max_retries or self.max_retries
- backoff_factor = backoff_factor or self.backoff_factor
- retry_statuses = retry_statuses or self.retry_statuses
- retry_methods = retry_methods or self.retry_methods
- environment = environment or self.environment
- base_url = base_url or self.base_url
- messaging_basic_auth_user_name = messaging_basic_auth_user_name or self.messaging_basic_auth_user_name
- messaging_basic_auth_password = messaging_basic_auth_password or self.messaging_basic_auth_password
- multi_factor_auth_basic_auth_user_name = multi_factor_auth_basic_auth_user_name or self.multi_factor_auth_basic_auth_user_name
- multi_factor_auth_basic_auth_password = multi_factor_auth_basic_auth_password or self.multi_factor_auth_basic_auth_password
- phone_number_lookup_basic_auth_user_name = phone_number_lookup_basic_auth_user_name or self.phone_number_lookup_basic_auth_user_name
- phone_number_lookup_basic_auth_password = phone_number_lookup_basic_auth_password or self.phone_number_lookup_basic_auth_password
- voice_basic_auth_user_name = voice_basic_auth_user_name or self.voice_basic_auth_user_name
- voice_basic_auth_password = voice_basic_auth_password or self.voice_basic_auth_password
- web_rtc_basic_auth_user_name = web_rtc_basic_auth_user_name or self.web_rtc_basic_auth_user_name
- web_rtc_basic_auth_password = web_rtc_basic_auth_password or self.web_rtc_basic_auth_password
-
- return Configuration(
- timeout=timeout, max_retries=max_retries,
- 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
- )
-
- def create_http_client(self):
- return RequestsClient(timeout=self.timeout,
- max_retries=self.max_retries,
- backoff_factor=self.backoff_factor,
- retry_statuses=self.retry_statuses,
- retry_methods=self.retry_methods)
-
- # 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}'
- }
- }
-
- def get_base_uri(self, server=Server.DEFAULT):
- """Generates the appropriate base URI for the environment and the
- server.
-
- Args:
- server (Configuration.Server): The server enum for which the base
- URI is required.
-
- Returns:
- String: The base URI.
-
- """
- parameters = {
- "base_url": {'value': self.base_url, 'encode': False},
- }
-
- return APIHelper.append_url_with_template_parameters(
- self.environments[self.environment][server], parameters
- )
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import copy
+import logging
+import multiprocessing
+import sys
+import urllib3
+
+import http.client as httplib
+from bandwidth.exceptions import ApiValueError
+
+JSON_SCHEMA_VALIDATION_KEYWORDS = {
+ 'multipleOf', 'maximum', 'exclusiveMaximum',
+ 'minimum', 'exclusiveMinimum', 'maxLength',
+ 'minLength', 'pattern', 'maxItems', 'minItems'
+}
+
+class Configuration(object):
+ """This class contains various settings of the API client.
+
+ :param host: Base url.
+ :param api_key: Dict to store API key(s).
+ Each entry in the dict specifies an API key.
+ The dict key is the name of the security scheme in the OAS specification.
+ The dict value is the API key secret.
+ :param api_key_prefix: Dict to store API prefix (e.g. Bearer).
+ The dict key is the name of the security scheme in the OAS specification.
+ The dict value is an API key prefix when generating the auth data.
+ :param username: Username for HTTP basic authentication.
+ :param password: Password for HTTP basic authentication.
+ :param access_token: Access token.
+ :param server_index: Index to servers configuration.
+ :param server_variables: Mapping with string values to replace variables in
+ templated server configuration. The validation of enums is performed for
+ variables with defined enum values before.
+ :param server_operation_index: Mapping from operation ID to an index to server
+ configuration.
+ :param server_operation_variables: Mapping from operation ID to a mapping with
+ string values to replace variables in templated server configuration.
+ The validation of enums is performed for variables with defined enum values before.
+ :param ssl_ca_cert: str - the path to a file of concatenated CA certificates
+ in PEM format.
+
+ :Example:
+
+ HTTP Basic Authentication Example.
+ Given the following security scheme in the OpenAPI specification:
+ components:
+ securitySchemes:
+ http_basic_auth:
+ type: http
+ scheme: basic
+
+ Configure API client with HTTP basic authentication:
+
+conf = bandwidth.Configuration(
+ username='the-user',
+ password='the-password',
+)
+
+ """
+
+ _default = None
+
+ def __init__(self, host=None,
+ api_key=None, api_key_prefix=None,
+ username=None, password=None,
+ access_token=None,
+ server_index=None, server_variables=None,
+ server_operation_index=None, server_operation_variables=None,
+ ssl_ca_cert=None,
+ ):
+ """Constructor
+ """
+ self._base_path = "http://localhost" if host is None else host
+ """Default Base url
+ """
+ self.server_index = 0 if server_index is None and host is None else server_index
+ self.server_operation_index = server_operation_index or {}
+ """Default server index
+ """
+ self.server_variables = server_variables or {}
+ self.server_operation_variables = server_operation_variables or {}
+ """Default server variables
+ """
+ self.temp_folder_path = None
+ """Temp file folder for downloading files
+ """
+ # Authentication Settings
+ self.api_key = {}
+ if api_key:
+ self.api_key = api_key
+ """dict to store API key(s)
+ """
+ self.api_key_prefix = {}
+ if api_key_prefix:
+ self.api_key_prefix = api_key_prefix
+ """dict to store API prefix (e.g. Bearer)
+ """
+ self.refresh_api_key_hook = None
+ """function hook to refresh API key if expired
+ """
+ self.username = username
+ """Username for HTTP basic authentication
+ """
+ self.password = password
+ """Password for HTTP basic authentication
+ """
+ self.access_token = access_token
+ """Access token
+ """
+ self.logger = {}
+ """Logging Settings
+ """
+ self.logger["package_logger"] = logging.getLogger("bandwidth")
+ self.logger["urllib3_logger"] = logging.getLogger("urllib3")
+ self.logger_format = '%(asctime)s %(levelname)s %(message)s'
+ """Log format
+ """
+ self.logger_stream_handler = None
+ """Log stream handler
+ """
+ self.logger_file_handler = None
+ """Log file handler
+ """
+ self.logger_file = None
+ """Debug file location
+ """
+ self.debug = False
+ """Debug switch
+ """
+
+ self.verify_ssl = True
+ """SSL/TLS verification
+ Set this to false to skip verifying SSL certificate when calling API
+ from https server.
+ """
+ self.ssl_ca_cert = ssl_ca_cert
+ """Set this to customize the certificate file to verify the peer.
+ """
+ self.cert_file = None
+ """client certificate file
+ """
+ self.key_file = None
+ """client key file
+ """
+ self.assert_hostname = None
+ """Set this to True/False to enable/disable SSL hostname verification.
+ """
+ self.tls_server_name = None
+ """SSL/TLS Server Name Indication (SNI)
+ Set this to the SNI value expected by the server.
+ """
+
+ self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
+ """urllib3 connection pool's maximum number of connections saved
+ per pool. urllib3 uses 1 connection as default value, but this is
+ not the best value when you are making a lot of possibly parallel
+ requests to the same host, which is often the case here.
+ cpu_count * 5 is used as default value to increase performance.
+ """
+
+ self.proxy = None
+ """Proxy URL
+ """
+ self.proxy_headers = None
+ """Proxy headers
+ """
+ self.safe_chars_for_path_param = ''
+ """Safe chars for path_param
+ """
+ self.retries = None
+ """Adding retries to override urllib3 default value 3
+ """
+ # Enable client side validation
+ self.client_side_validation = True
+
+ self.socket_options = None
+ """Options to pass down to the underlying urllib3 socket
+ """
+
+ self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z"
+ """datetime format
+ """
+
+ self.date_format = "%Y-%m-%d"
+ """date format
+ """
+
+ def __deepcopy__(self, memo):
+ cls = self.__class__
+ result = cls.__new__(cls)
+ memo[id(self)] = result
+ for k, v in self.__dict__.items():
+ if k not in ('logger', 'logger_file_handler'):
+ setattr(result, k, copy.deepcopy(v, memo))
+ # shallow copy of loggers
+ result.logger = copy.copy(self.logger)
+ # use setters to configure loggers
+ result.logger_file = self.logger_file
+ result.debug = self.debug
+ return result
+
+ def __setattr__(self, name, value):
+ object.__setattr__(self, name, value)
+
+ @classmethod
+ def set_default(cls, default):
+ """Set default instance of configuration.
+
+ It stores default configuration, which can be
+ returned by get_default_copy method.
+
+ :param default: object of Configuration
+ """
+ cls._default = default
+
+ @classmethod
+ def get_default_copy(cls):
+ """Deprecated. Please use `get_default` instead.
+
+ Deprecated. Please use `get_default` instead.
+
+ :return: The configuration object.
+ """
+ return cls.get_default()
+
+ @classmethod
+ def get_default(cls):
+ """Return the default configuration.
+
+ This method returns newly created, based on default constructor,
+ object of Configuration class or returns a copy of default
+ configuration.
+
+ :return: The configuration object.
+ """
+ if cls._default is None:
+ cls._default = Configuration()
+ return cls._default
+
+ @property
+ def logger_file(self):
+ """The logger file.
+
+ If the logger_file is None, then add stream handler and remove file
+ handler. Otherwise, add file handler and remove stream handler.
+
+ :param value: The logger_file path.
+ :type: str
+ """
+ return self.__logger_file
+
+ @logger_file.setter
+ def logger_file(self, value):
+ """The logger file.
+
+ If the logger_file is None, then add stream handler and remove file
+ handler. Otherwise, add file handler and remove stream handler.
+
+ :param value: The logger_file path.
+ :type: str
+ """
+ self.__logger_file = value
+ if self.__logger_file:
+ # If set logging file,
+ # then add file handler and remove stream handler.
+ self.logger_file_handler = logging.FileHandler(self.__logger_file)
+ self.logger_file_handler.setFormatter(self.logger_formatter)
+ for _, logger in self.logger.items():
+ logger.addHandler(self.logger_file_handler)
+
+ @property
+ def debug(self):
+ """Debug status
+
+ :param value: The debug status, True or False.
+ :type: bool
+ """
+ return self.__debug
+
+ @debug.setter
+ def debug(self, value):
+ """Debug status
+
+ :param value: The debug status, True or False.
+ :type: bool
+ """
+ self.__debug = value
+ if self.__debug:
+ # if debug status is True, turn on debug logging
+ for _, logger in self.logger.items():
+ logger.setLevel(logging.DEBUG)
+ # turn on httplib debug
+ httplib.HTTPConnection.debuglevel = 1
+ else:
+ # if debug status is False, turn off debug logging,
+ # setting log level to default `logging.WARNING`
+ for _, logger in self.logger.items():
+ logger.setLevel(logging.WARNING)
+ # turn off httplib debug
+ httplib.HTTPConnection.debuglevel = 0
+
+ @property
+ def logger_format(self):
+ """The logger format.
+
+ The logger_formatter will be updated when sets logger_format.
+
+ :param value: The format string.
+ :type: str
+ """
+ return self.__logger_format
+
+ @logger_format.setter
+ def logger_format(self, value):
+ """The logger format.
+
+ The logger_formatter will be updated when sets logger_format.
+
+ :param value: The format string.
+ :type: str
+ """
+ self.__logger_format = value
+ self.logger_formatter = logging.Formatter(self.__logger_format)
+
+ def get_api_key_with_prefix(self, identifier, alias=None):
+ """Gets API key (with prefix if set).
+
+ :param identifier: The identifier of apiKey.
+ :param alias: The alternative identifier of apiKey.
+ :return: The token for api key authentication.
+ """
+ if self.refresh_api_key_hook is not None:
+ self.refresh_api_key_hook(self)
+ key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None)
+ if key:
+ prefix = self.api_key_prefix.get(identifier)
+ if prefix:
+ return "%s %s" % (prefix, key)
+ else:
+ return key
+
+ def get_basic_auth_token(self):
+ """Gets HTTP basic authentication header (string).
+
+ :return: The token for basic HTTP authentication.
+ """
+ username = ""
+ if self.username is not None:
+ username = self.username
+ password = ""
+ if self.password is not None:
+ password = self.password
+ return urllib3.util.make_headers(
+ basic_auth=username + ':' + password
+ ).get('authorization')
+
+ def auth_settings(self):
+ """Gets Auth Settings dict for api client.
+
+ :return: The Auth Settings information dict.
+ """
+ auth = {}
+ if self.username is not None and self.password is not None:
+ auth['Basic'] = {
+ 'type': 'basic',
+ 'in': 'header',
+ 'key': 'Authorization',
+ 'value': self.get_basic_auth_token()
+ }
+ return auth
+
+ def to_debug_report(self):
+ """Gets the essential information for debugging.
+
+ :return: The report for debugging.
+ """
+ return "Python SDK Debug Report:\n"\
+ "OS: {env}\n"\
+ "Python Version: {pyversion}\n"\
+ "Version of the API: 1.0.0\n"\
+ "SDK Package Version: 15.0.0".\
+ format(env=sys.platform, pyversion=sys.version)
+
+ def get_host_settings(self):
+ """Gets an array of host settings
+
+ :return: An array of host settings
+ """
+ return [
+ {
+ 'url': "",
+ 'description': "No description provided",
+ }
+ ]
+
+ def get_host_from_settings(self, index, variables=None, servers=None):
+ """Gets host URL based on the index and variables
+ :param index: array index of the host settings
+ :param variables: hash of variable and the corresponding value
+ :param servers: an array of host settings or None
+ :return: URL based on host settings
+ """
+ if index is None:
+ return self._base_path
+
+ variables = {} if variables is None else variables
+ servers = self.get_host_settings() if servers is None else servers
+
+ try:
+ server = servers[index]
+ except IndexError:
+ raise ValueError(
+ "Invalid index {0} when selecting the host settings. "
+ "Must be less than {1}".format(index, len(servers)))
+
+ url = server['url']
+
+ # go through variables and replace placeholders
+ for variable_name, variable in server.get('variables', {}).items():
+ used_value = variables.get(
+ variable_name, variable['default_value'])
+
+ if 'enum_values' in variable \
+ and used_value not in variable['enum_values']:
+ raise ValueError(
+ "The variable `{0}` in the host URL has invalid value "
+ "{1}. Must be {2}.".format(
+ variable_name, variables[variable_name],
+ variable['enum_values']))
+
+ url = url.replace("{" + variable_name + "}", used_value)
+
+ return url
+
+ @property
+ def host(self):
+ """Return generated host."""
+ return self.get_host_from_settings(self.server_index, variables=self.server_variables)
+
+ @host.setter
+ def host(self, value):
+ """Fix base path."""
+ self._base_path = value
+ self.server_index = None
diff --git a/bandwidth/controllers/__init__.py b/bandwidth/controllers/__init__.py
deleted file mode 100644
index 3d169dc3..00000000
--- a/bandwidth/controllers/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-__all__ = [
- 'base_controller',
-]
diff --git a/bandwidth/controllers/base_controller.py b/bandwidth/controllers/base_controller.py
deleted file mode 100644
index ec1c6e23..00000000
--- a/bandwidth/controllers/base_controller.py
+++ /dev/null
@@ -1,95 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-from bandwidth.api_helper import APIHelper
-from bandwidth.exceptions.api_exception import APIException
-
-
-class BaseController(object):
-
- """All controllers inherit from this base class.
-
- Attributes:
- config (Configuration): The HttpClient which a specific controller
- instance will use. By default all the controller objects share
- the same HttpClient. A user can use his own custom HttpClient
- as well.
- http_call_back (HttpCallBack): An object which holds call back
- methods to be called before and after the execution of an HttpRequest.
- global_headers (dict): The global headers of the API which are sent with
- every request.
-
- """
-
- def global_headers(self):
- return {
- 'user-agent': 'python-sdk'
- }
-
- def __init__(self, config, call_back=None):
- self._config = config
- self._http_call_back = call_back
-
- @property
- def config(self):
- return self._config
-
- @property
- def http_call_back(self):
- return self._http_call_back
-
- def validate_parameters(self, **kwargs):
- """Validates required parameters of an endpoint.
-
- Args:
- kwargs (dict): A dictionary of the required parameters.
-
- """
- for name, value in kwargs.items():
- if value is None:
- raise ValueError("Required parameter {} cannot be None.".format(name))
-
- def execute_request(self, request, binary=False):
- """Executes an HttpRequest.
-
- Args:
- request (HttpRequest): The HttpRequest to execute.
- binary (bool): A flag which should be set to True if
- a binary response is expected.
-
- Returns:
- HttpResponse: The HttpResponse received.
-
- """
- # Invoke the on before request HttpCallBack if specified
- if self.http_call_back is not None:
- self.http_call_back.on_before_request(request)
-
- # Add global headers to request
- request.headers = APIHelper.merge_dicts(self.global_headers(), request.headers)
-
- # Invoke the API call to fetch the response.
- func = self.config.http_client.execute_as_binary if binary else self.config.http_client.execute_as_string
- response = func(request)
-
- # Invoke the on after response HttpCallBack if specified
- if self.http_call_back is not None:
- self.http_call_back.on_after_response(response)
-
- return response
-
- def validate_response(self, response):
- """Validates an HTTP response by checking for global errors.
-
- Args:
- response (HttpResponse): The HttpResponse of the API call.
-
- """
- if (response.status_code < 200) or (response.status_code > 208): # [200,208] = HTTP OK
- raise APIException('HTTP response not OK.', response)
diff --git a/bandwidth/decorators.py b/bandwidth/decorators.py
deleted file mode 100644
index 3084abf3..00000000
--- a/bandwidth/decorators.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class lazy_property(object):
-
- """A decorator class for lazy instantiation."""
-
- def __init__(self, fget):
- self.fget = fget
- self.func_name = fget.__name__
-
- def __get__(self, obj, cls):
- if obj is None:
- return None
- value = self.fget(obj)
- setattr(obj, self.func_name, value)
- return value
diff --git a/bandwidth/exceptions.py b/bandwidth/exceptions.py
new file mode 100644
index 00000000..25ad1ee2
--- /dev/null
+++ b/bandwidth/exceptions.py
@@ -0,0 +1,167 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+class OpenApiException(Exception):
+ """The base exception class for all OpenAPIExceptions"""
+
+
+class ApiTypeError(OpenApiException, TypeError):
+ def __init__(self, msg, path_to_item=None, valid_classes=None,
+ key_type=None):
+ """ Raises an exception for TypeErrors
+
+ Args:
+ msg (str): the exception message
+
+ Keyword Args:
+ path_to_item (list): a list of keys an indices to get to the
+ current_item
+ None if unset
+ valid_classes (tuple): the primitive classes that current item
+ should be an instance of
+ None if unset
+ key_type (bool): False if our value is a value in a dict
+ True if it is a key in a dict
+ False if our item is an item in a list
+ None if unset
+ """
+ self.path_to_item = path_to_item
+ self.valid_classes = valid_classes
+ self.key_type = key_type
+ full_msg = msg
+ if path_to_item:
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
+ super(ApiTypeError, self).__init__(full_msg)
+
+
+class ApiValueError(OpenApiException, ValueError):
+ def __init__(self, msg, path_to_item=None):
+ """
+ Args:
+ msg (str): the exception message
+
+ Keyword Args:
+ path_to_item (list) the path to the exception in the
+ received_data dict. None if unset
+ """
+
+ self.path_to_item = path_to_item
+ full_msg = msg
+ if path_to_item:
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
+ super(ApiValueError, self).__init__(full_msg)
+
+
+class ApiAttributeError(OpenApiException, AttributeError):
+ def __init__(self, msg, path_to_item=None):
+ """
+ Raised when an attribute reference or assignment fails.
+
+ Args:
+ msg (str): the exception message
+
+ Keyword Args:
+ path_to_item (None/list) the path to the exception in the
+ received_data dict
+ """
+ self.path_to_item = path_to_item
+ full_msg = msg
+ if path_to_item:
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
+ super(ApiAttributeError, self).__init__(full_msg)
+
+
+class ApiKeyError(OpenApiException, KeyError):
+ def __init__(self, msg, path_to_item=None):
+ """
+ Args:
+ msg (str): the exception message
+
+ Keyword Args:
+ path_to_item (None/list) the path to the exception in the
+ received_data dict
+ """
+ self.path_to_item = path_to_item
+ full_msg = msg
+ if path_to_item:
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
+ super(ApiKeyError, self).__init__(full_msg)
+
+
+class ApiException(OpenApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ if http_resp:
+ self.status = http_resp.status
+ self.reason = http_resp.reason
+ self.body = http_resp.data
+ self.headers = http_resp.getheaders()
+ else:
+ self.status = status
+ self.reason = reason
+ self.body = None
+ self.headers = None
+
+ def __str__(self):
+ """Custom error messages for exception"""
+ error_message = "({0})\n"\
+ "Reason: {1}\n".format(self.status, self.reason)
+ if self.headers:
+ error_message += "HTTP response headers: {0}\n".format(
+ self.headers)
+
+ if self.body:
+ error_message += "HTTP response body: {0}\n".format(self.body)
+
+ return error_message
+
+class BadRequestException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(BadRequestException, self).__init__(status, reason, http_resp)
+
+class NotFoundException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(NotFoundException, self).__init__(status, reason, http_resp)
+
+
+class UnauthorizedException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(UnauthorizedException, self).__init__(status, reason, http_resp)
+
+
+class ForbiddenException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(ForbiddenException, self).__init__(status, reason, http_resp)
+
+
+class ServiceException(ApiException):
+
+ def __init__(self, status=None, reason=None, http_resp=None):
+ super(ServiceException, self).__init__(status, reason, http_resp)
+
+
+def render_path(path_to_item):
+ """Returns a string representation of a path"""
+ result = ""
+ for pth in path_to_item:
+ if isinstance(pth, int):
+ result += "[{0}]".format(pth)
+ else:
+ result += "['{0}']".format(pth)
+ return result
diff --git a/bandwidth/exceptions/__init__.py b/bandwidth/exceptions/__init__.py
deleted file mode 100644
index 1f4885eb..00000000
--- a/bandwidth/exceptions/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-__all__ = [
- 'api_exception',
-]
diff --git a/bandwidth/exceptions/api_exception.py b/bandwidth/exceptions/api_exception.py
deleted file mode 100644
index 9a1a651d..00000000
--- a/bandwidth/exceptions/api_exception.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class APIException(Exception):
-
- """Class that handles HTTP Exceptions when fetching API Endpoints.
-
- Attributes:
- response_code (int): The status code of the response.
- response (HttpResponse): The HttpResponse of the API call.
-
- """
-
- def __init__(self,
- reason,
- response):
- """Constructor for the APIException class
-
- Args:
- reason (string): The reason (or error message) for the Exception
- to be raised.
- response (HttpResponse): The HttpResponse of the API call.
-
- """
- super(APIException, self).__init__(reason)
- self.response = response
- self.response_code = response.status_code
diff --git a/bandwidth/http/__init__.py b/bandwidth/http/__init__.py
deleted file mode 100644
index 4348222a..00000000
--- a/bandwidth/http/__init__.py
+++ /dev/null
@@ -1,9 +0,0 @@
-__all__ = [
- 'auth',
- 'http_method_enum',
- 'http_request',
- 'http_response',
- 'http_client',
- 'requests_client',
- 'http_call_back',
-]
diff --git a/bandwidth/http/api_response.py b/bandwidth/http/api_response.py
deleted file mode 100644
index 04a6c9ac..00000000
--- a/bandwidth/http/api_response.py
+++ /dev/null
@@ -1,55 +0,0 @@
-import json
-
-
-class ApiResponse:
-
- """Http response received.
-
- Attributes:
- status_code (int): The status code response from the server that
- corresponds to this response.
- reason_phrase (string): The reason phrase returned by the server.
- headers (dict): A dictionary of headers (key : value) that were
- returned with the response
- text (string): The Raw body of the HTTP Response as a string
- request (HttpRequest): The request that resulted in this response.
- body (Object): The data field specified for the response
- errors (Array): Any errors returned by the server
-
- """
-
- def __init__(self, http_response,
- body=None,
- errors=None):
-
- """The Constructor
-
- Args:
- http_response (HttpResponse): The original, raw response from the api
- data (Object): The data field specified for the response
- errors (Array): Any errors returned by the server
-
- """
-
- self.status_code = http_response.status_code
- self.reason_phrase = http_response.reason_phrase
- self.headers = http_response.headers
- self.text = http_response.text
- self.request = http_response.request
- self.body = body
- self.errors = errors
-
- def is_success(self):
- """ Returns true if status code is between 200-300
-
- """
- return 200 <= self.status_code < 300
-
- def is_error(self):
- """ Returns true if status code is between 400-600
-
- """
- return 400 <= self.status_code < 600
-
- def __repr__(self):
- return '' % (self.text)
diff --git a/bandwidth/http/auth/__init__.py b/bandwidth/http/auth/__init__.py
deleted file mode 100644
index b399bb9b..00000000
--- a/bandwidth/http/auth/__init__.py
+++ /dev/null
@@ -1,7 +0,0 @@
-__all__ = [
- 'messaging_basic_auth',
- 'multi_factor_auth_basic_auth',
- 'phone_number_lookup_basic_auth',
- 'voice_basic_auth',
- 'web_rtc_basic_auth',
-]
diff --git a/bandwidth/http/auth/messaging_basic_auth.py b/bandwidth/http/auth/messaging_basic_auth.py
deleted file mode 100644
index 193b9187..00000000
--- a/bandwidth/http/auth/messaging_basic_auth.py
+++ /dev/null
@@ -1,31 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-import base64
-
-
-class MessagingBasicAuth:
-
- @staticmethod
- def apply(config, http_request):
- """ Add basic authentication to the request.
-
- Args:
- config (Configuration): The Configuration object which holds the
- authentication information.
- http_request (HttpRequest): The HttpRequest object to which
- authentication will be added.
-
- """
- username = config.messaging_basic_auth_user_name
- password = config.messaging_basic_auth_password
- joined = "{}:{}".format(username, password)
- encoded = base64.b64encode(str.encode(joined)).decode('iso-8859-1')
- header_value = "Basic {}".format(encoded)
- http_request.headers["Authorization"] = header_value
diff --git a/bandwidth/http/auth/multi_factor_auth_basic_auth.py b/bandwidth/http/auth/multi_factor_auth_basic_auth.py
deleted file mode 100644
index 22b45716..00000000
--- a/bandwidth/http/auth/multi_factor_auth_basic_auth.py
+++ /dev/null
@@ -1,31 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-import base64
-
-
-class MultiFactorAuthBasicAuth:
-
- @staticmethod
- def apply(config, http_request):
- """ Add basic authentication to the request.
-
- Args:
- config (Configuration): The Configuration object which holds the
- authentication information.
- http_request (HttpRequest): The HttpRequest object to which
- authentication will be added.
-
- """
- username = config.multi_factor_auth_basic_auth_user_name
- password = config.multi_factor_auth_basic_auth_password
- joined = "{}:{}".format(username, password)
- encoded = base64.b64encode(str.encode(joined)).decode('iso-8859-1')
- header_value = "Basic {}".format(encoded)
- http_request.headers["Authorization"] = header_value
diff --git a/bandwidth/http/auth/phone_number_lookup_basic_auth.py b/bandwidth/http/auth/phone_number_lookup_basic_auth.py
deleted file mode 100644
index b950dee2..00000000
--- a/bandwidth/http/auth/phone_number_lookup_basic_auth.py
+++ /dev/null
@@ -1,31 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-import base64
-
-
-class PhoneNumberLookupBasicAuth:
-
- @staticmethod
- def apply(config, http_request):
- """ Add basic authentication to the request.
-
- Args:
- config (Configuration): The Configuration object which holds the
- authentication information.
- http_request (HttpRequest): The HttpRequest object to which
- authentication will be added.
-
- """
- username = config.phone_number_lookup_basic_auth_user_name
- password = config.phone_number_lookup_basic_auth_password
- joined = "{}:{}".format(username, password)
- encoded = base64.b64encode(str.encode(joined)).decode('iso-8859-1')
- header_value = "Basic {}".format(encoded)
- http_request.headers["Authorization"] = header_value
diff --git a/bandwidth/http/auth/voice_basic_auth.py b/bandwidth/http/auth/voice_basic_auth.py
deleted file mode 100644
index 3c8cd220..00000000
--- a/bandwidth/http/auth/voice_basic_auth.py
+++ /dev/null
@@ -1,31 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-import base64
-
-
-class VoiceBasicAuth:
-
- @staticmethod
- def apply(config, http_request):
- """ Add basic authentication to the request.
-
- Args:
- config (Configuration): The Configuration object which holds the
- authentication information.
- http_request (HttpRequest): The HttpRequest object to which
- authentication will be added.
-
- """
- username = config.voice_basic_auth_user_name
- password = config.voice_basic_auth_password
- joined = "{}:{}".format(username, password)
- encoded = base64.b64encode(str.encode(joined)).decode('iso-8859-1')
- header_value = "Basic {}".format(encoded)
- http_request.headers["Authorization"] = header_value
diff --git a/bandwidth/http/auth/web_rtc_basic_auth.py b/bandwidth/http/auth/web_rtc_basic_auth.py
deleted file mode 100644
index 24000bf2..00000000
--- a/bandwidth/http/auth/web_rtc_basic_auth.py
+++ /dev/null
@@ -1,31 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-import base64
-
-
-class WebRtcBasicAuth:
-
- @staticmethod
- def apply(config, http_request):
- """ Add basic authentication to the request.
-
- Args:
- config (Configuration): The Configuration object which holds the
- authentication information.
- http_request (HttpRequest): The HttpRequest object to which
- authentication will be added.
-
- """
- username = config.web_rtc_basic_auth_user_name
- password = config.web_rtc_basic_auth_password
- joined = "{}:{}".format(username, password)
- encoded = base64.b64encode(str.encode(joined)).decode('iso-8859-1')
- header_value = "Basic {}".format(encoded)
- http_request.headers["Authorization"] = header_value
diff --git a/bandwidth/http/http_call_back.py b/bandwidth/http/http_call_back.py
deleted file mode 100644
index 4111555a..00000000
--- a/bandwidth/http/http_call_back.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class HttpCallBack(object):
-
- """An interface for the callback to be called before and after the
- HTTP call for an endpoint is made.
-
- This class should not be instantiated but should be used as a base class
- for HttpCallBack classes.
-
- """
-
- def on_before_request(self,
- request):
- """The controller will call this method before making the HttpRequest.
-
- Args:
- request (HttpRequest): The request object which will be sent
- to the HttpClient to be executed.
- """
- raise NotImplementedError("This method has not been implemented.")
-
- def on_after_response(self,
- http_response):
- """The controller will call this method after making the HttpRequest.
-
- Args:
- http_response (HttpResponse): The HttpResponse of the API call.
- """
- raise NotImplementedError("This method has not been implemented.")
diff --git a/bandwidth/http/http_client.py b/bandwidth/http/http_client.py
deleted file mode 100644
index ba95e7dc..00000000
--- a/bandwidth/http/http_client.py
+++ /dev/null
@@ -1,210 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-from bandwidth.http.http_method_enum import HttpMethodEnum
-from bandwidth.http.http_request import HttpRequest
-
-
-class HttpClient(object):
-
- """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.
-
- """
-
- def execute_as_string(self, request):
- """Execute a given HttpRequest to get a string response back
-
- Args:
- request (HttpRequest): The given HttpRequest to execute.
-
- Returns:
- HttpResponse: The response of the HttpRequest.
-
- """
- raise NotImplementedError("Please Implement this method")
-
- def execute_as_binary(self, request):
- """Execute a given HttpRequest to get a binary response back
-
- Args:
- request (HttpRequest): The given HttpRequest to execute.
-
- Returns:
- HttpResponse: The response of the HttpRequest.
-
- """
- raise NotImplementedError("Please Implement this method")
-
- def convert_response(self, response, binary):
- """Converts the Response object of the HttpClient into an
- HttpResponse object.
-
- Args:
- response (dynamic): The original response object.
-
- Returns:
- HttpResponse: The converted HttpResponse object.
-
- """
- raise NotImplementedError("Please Implement this method")
-
- def get(self, query_url,
- headers={},
- query_parameters={}):
- """Create a simple GET HttpRequest object for the given parameters
-
- Args:
- query_url (string): The URL to send the request to.
- headers (dict, optional): The headers for the HTTP Request.
- query_parameters (dict, optional): Query parameters to add in the
- URL.
-
- Returns:
- HttpRequest: The generated HttpRequest for the given paremeters.
-
- """
- return HttpRequest(HttpMethodEnum.GET,
- query_url,
- headers,
- query_parameters,
- None,
- None)
-
- def head(self, query_url,
- headers={},
- query_parameters={}):
- """Create a simple HEAD HttpRequest object for the given parameters
-
- Args:
- query_url (string): The URL to send the request to.
- headers (dict, optional): The headers for the HTTP Request.
- query_parameters (dict, optional): Query parameters to add in the
- URL.
-
- Returns:
- HttpRequest: The generated HttpRequest for the given paremeters.
-
- """
- return HttpRequest(HttpMethodEnum.HEAD,
- query_url,
- headers,
- query_parameters,
- None,
- None)
-
- def post(self, query_url,
- headers={},
- query_parameters={},
- parameters={},
- files={}):
- """Create a simple POST HttpRequest object for the given parameters
-
- Args:
- query_url (string): The URL to send the request to.
- headers (dict, optional): The headers for the HTTP Request.
- query_parameters (dict, optional): Query parameters to add in the
- URL.
- parameters (dict, optional): Form or body parameters to be included
- in the body.
- files (dict, optional): Files to be sent with the request.
-
- Returns:
- HttpRequest: The generated HttpRequest for the given paremeters.
-
- """
- return HttpRequest(HttpMethodEnum.POST,
- query_url,
- headers,
- query_parameters,
- parameters,
- files)
-
- def put(self, query_url,
- headers={},
- query_parameters={},
- parameters={},
- files={}):
- """Create a simple PUT HttpRequest object for the given parameters
-
- Args:
- query_url (string): The URL to send the request to.
- headers (dict, optional): The headers for the HTTP Request.
- query_parameters (dict, optional): Query parameters to add in the
- URL.
- parameters (dict, optional): Form or body parameters to be included
- in the body.
- files (dict, optional): Files to be sent with the request.
-
- Returns:
- HttpRequest: The generated HttpRequest for the given paremeters.
-
- """
- return HttpRequest(HttpMethodEnum.PUT,
- query_url,
- headers,
- query_parameters,
- parameters,
- files)
-
- def patch(self, query_url,
- headers={},
- query_parameters={},
- parameters={},
- files={}):
- """Create a simple PATCH HttpRequest object for the given parameters
-
- Args:
- query_url (string): The URL to send the request to.
- headers (dict, optional): The headers for the HTTP Request.
- query_parameters (dict, optional): Query parameters to add in the
- URL.
- parameters (dict, optional): Form or body parameters to be included
- in the body.
- files (dict, optional): Files to be sent with the request.
-
- Returns:
- HttpRequest: The generated HttpRequest for the given paremeters.
-
- """
- return HttpRequest(HttpMethodEnum.PATCH,
- query_url,
- headers,
- query_parameters,
- parameters,
- files)
-
- def delete(self, query_url,
- headers={},
- query_parameters={},
- parameters={},
- files={}):
- """Create a simple DELETE HttpRequest object for the given parameters
-
- Args:
- query_url (string): The URL to send the request to.
- headers (dict, optional): The headers for the HTTP Request.
- query_parameters (dict, optional): Query parameters to add in the
- URL.
- parameters (dict, optional): Form or body parameters to be
- included in the body.
- files (dict, optional): Files to be sent with the request.
-
- Returns:
- HttpRequest: The generated HttpRequest for the given paremeters.
-
- """
- return HttpRequest(HttpMethodEnum.DELETE,
- query_url,
- headers,
- query_parameters,
- parameters,
- files)
diff --git a/bandwidth/http/http_method_enum.py b/bandwidth/http/http_method_enum.py
deleted file mode 100644
index 1850ca3b..00000000
--- a/bandwidth/http/http_method_enum.py
+++ /dev/null
@@ -1,50 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class HttpMethodEnum(object):
-
- """Enumeration of an HTTP Method
-
- Attributes:
- GET: A GET Request
- POST: A POST Request
- PUT: A PUT Request
- PATCH: A PATCH Request
- DELETE: A DELETE Request
-
- """
-
- GET = "GET"
-
- POST = "POST"
-
- PUT = "PUT"
-
- PATCH = "PATCH"
-
- DELETE = "DELETE"
-
- HEAD = "HEAD"
-
- @classmethod
- def to_string(cls, val):
- """Returns the string equivalent for the Enum.
-
- """
- for k, v in list(vars(cls).items()):
- if v == val:
- return k
-
- @classmethod
- def from_string(cls, str):
- """Creates an instance of the Enum from a given string.
-
- """
- return getattr(cls, str.upper(), None)
diff --git a/bandwidth/http/http_request.py b/bandwidth/http/http_request.py
deleted file mode 100644
index 3f75028b..00000000
--- a/bandwidth/http/http_request.py
+++ /dev/null
@@ -1,88 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-from bandwidth.api_helper import APIHelper
-
-
-class HttpRequest(object):
-
- """Information about an HTTP Request including its method, headers,
- parameters, URL, and Basic Auth details
-
- Attributes:
- http_method (HttpMethodEnum): The HTTP Method that this request should
- perform when called.
- headers (dict): A dictionary of headers (key : value) that should be
- sent along with the request.
- query_url (string): The URL that the request should be sent to.
- parameters (dict): A dictionary of parameters that are to be sent along
- with the request in the form body of the request
-
- """
-
- def __init__(self,
- http_method,
- query_url,
- headers=None,
- query_parameters=None,
- parameters=None,
- files=None):
- """Constructor for the HttpRequest class
-
- Args:
- http_method (HttpMethodEnum): The HTTP Method.
- query_url (string): The URL to send the request to.
- headers (dict, optional): The headers for the HTTP Request.
- query_parameters (dict, optional): Query parameters to add in the
- URL.
- parameters (dict, optional): Form or body parameters to be included
- in the body.
- files (dict, optional): Files to be sent with the request.
-
- """
- self.http_method = http_method
- self.query_url = query_url
- self.headers = headers
- self.query_parameters = query_parameters
- self.parameters = parameters
- self.files = files
-
- def add_header(self, name, value):
- """ Add a header to the HttpRequest.
-
- Args:
- name (string): The name of the header.
- value (string): The value of the header.
-
- """
- self.headers[name] = value
-
- def add_parameter(self, name, value):
- """ Add a parameter to the HttpRequest.
-
- Args:
- name (string): The name of the parameter.
- value (string): The value of the parameter.
-
- """
- self.parameters[name] = value
-
- def add_query_parameter(self, name, value):
- """ Add a query parameter to the HttpRequest.
-
- Args:
- name (string): The name of the query parameter.
- value (string): The value of the query parameter.
-
- """
- self.query_url = APIHelper.append_url_with_query_parameters(
- self.query_url,
- {name: value}
- )
- self.query_url = APIHelper.clean_url(self.query_url)
diff --git a/bandwidth/http/http_response.py b/bandwidth/http/http_response.py
deleted file mode 100644
index 118decac..00000000
--- a/bandwidth/http/http_response.py
+++ /dev/null
@@ -1,47 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class HttpResponse(object):
-
- """Information about an HTTP Response including its status code, returned
- headers, and raw body
-
- Attributes:
- status_code (int): The status code response from the server that
- corresponds to this response.
- reason_phrase (string): The reason phrase returned by the server.
- headers (dict): A dictionary of headers (key : value) that were
- returned with the response
- text (string): The Raw body of the HTTP Response as a string
- request (HttpRequest): The request that resulted in this response.
-
- """
-
- def __init__(self,
- status_code,
- reason_phrase,
- headers,
- text,
- request):
- """Constructor for the HttpResponse class
-
- Args:
- status_code (int): The response status code.
- reason_phrase (string): The response reason phrase.
- headers (dict): The response headers.
- text (string): The raw body from the server.
- request (HttpRequest): The request that resulted in this response.
-
- """
- self.status_code = status_code
- self.reason_phrase = reason_phrase
- self.headers = headers
- self.text = text
- self.request = request
diff --git a/bandwidth/http/requests_client.py b/bandwidth/http/requests_client.py
deleted file mode 100644
index ec0a20d3..00000000
--- a/bandwidth/http/requests_client.py
+++ /dev/null
@@ -1,128 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-from cachecontrol import CacheControl
-from requests import session
-from requests.adapters import HTTPAdapter
-from urllib3.util.retry import Retry
-
-from bandwidth.http.http_client import HttpClient
-from bandwidth.http.http_method_enum import HttpMethodEnum
-from bandwidth.http.http_response import HttpResponse
-
-
-class RequestsClient(HttpClient):
-
- """An implementation of HttpClient that uses Requests as its HTTP Client
-
- Attributes:
- timeout (int): The default timeout for all API requests.
-
- """
-
- def __init__(self,
- timeout=60,
- cache=False,
- max_retries=None,
- backoff_factor=None,
- retry_statuses=None,
- retry_methods=None,
- verify=True):
- """The constructor.
-
- Args:
- timeout (float): The default global timeout(seconds).
-
- """
- self.timeout = timeout
- self.session = session()
-
- retries = Retry(total=max_retries, backoff_factor=backoff_factor,
- status_forcelist=retry_statuses, allowed_methods=retry_methods)
- self.session.mount('http://', HTTPAdapter(max_retries=retries))
- self.session.mount('https://', HTTPAdapter(max_retries=retries))
-
- if cache:
- self.session = CacheControl(self.session)
-
- self.session.verify = verify
-
- def execute_as_string(self, request):
- """Execute a given HttpRequest to get a string response back
-
- Args:
- request (HttpRequest): The given HttpRequest to execute.
-
- Returns:
- HttpResponse: The response of the HttpRequest.
-
- """
- response = self.session.request(
- HttpMethodEnum.to_string(request.http_method),
- request.query_url,
- headers=request.headers,
- params=request.query_parameters,
- data=request.parameters,
- files=request.files,
- timeout=self.timeout
- )
-
- return self.convert_response(response, False, request)
-
- def execute_as_binary(self, request):
- """Execute a given HttpRequest to get a binary response back
-
- Args:
- request (HttpRequest): The given HttpRequest to execute.
-
- Returns:
- HttpResponse: The response of the HttpRequest.
-
- """
-
- response = self.session.request(
- HttpMethodEnum.to_string(request.http_method),
- request.query_url,
- headers=request.headers,
- params=request.query_parameters,
- data=request.parameters,
- files=request.files,
- timeout=self.timeout
- )
-
- return self.convert_response(response, True, request)
-
- def convert_response(self, response, binary, http_request):
- """Converts the Response object of the HttpClient into an
- HttpResponse object.
-
- Args:
- response (dynamic): The original response object.
- http_request (HttpRequest): The original HttpRequest object.
-
- Returns:
- HttpResponse: The converted HttpResponse object.
-
- """
- if binary:
- return HttpResponse(
- response.status_code,
- response.reason,
- response.headers,
- response.content,
- http_request
- )
- else:
- return HttpResponse(
- response.status_code,
- response.reason,
- response.headers,
- response.text,
- http_request
- )
diff --git a/bandwidth/messaging/__init__.py b/bandwidth/messaging/__init__.py
deleted file mode 100644
index 1216246e..00000000
--- a/bandwidth/messaging/__init__.py
+++ /dev/null
@@ -1,6 +0,0 @@
-__all__ = [
- 'controllers',
- 'exceptions',
- 'messaging_client',
- 'models',
-]
diff --git a/bandwidth/messaging/controllers/__init__.py b/bandwidth/messaging/controllers/__init__.py
deleted file mode 100644
index c1660224..00000000
--- a/bandwidth/messaging/controllers/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-__all__ = [
- 'base_controller',
- 'api_controller',
-]
diff --git a/bandwidth/messaging/controllers/api_controller.py b/bandwidth/messaging/controllers/api_controller.py
deleted file mode 100644
index 23246fe9..00000000
--- a/bandwidth/messaging/controllers/api_controller.py
+++ /dev/null
@@ -1,458 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-from bandwidth.api_helper import APIHelper
-from bandwidth.configuration import Server
-from bandwidth.http.api_response import ApiResponse
-from bandwidth.utilities.file_wrapper import FileWrapper
-from bandwidth.messaging.controllers.base_controller import BaseController
-from bandwidth.http.auth.messaging_basic_auth import MessagingBasicAuth
-from bandwidth.messaging.models.media import Media
-from bandwidth.messaging.models.bandwidth_messages_list import BandwidthMessagesList
-from bandwidth.messaging.models.bandwidth_message import BandwidthMessage
-from bandwidth.messaging.exceptions.messaging_exception import MessagingException
-
-
-class APIController(BaseController):
-
- """A Controller to access Endpoints in the bandwidth API."""
-
- def __init__(self, config, call_back=None):
- super(APIController, self).__init__(config, call_back)
-
- def list_media(self,
- account_id,
- continuation_token=None):
- """Does a GET request to /users/{accountId}/media.
-
- Gets a list of your media files. No query parameters are supported.
-
- Args:
- account_id (string): User's account ID
- continuation_token (string, optional): Continuation token used to
- retrieve subsequent media.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers.
- successful operation
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/users/{accountId}/media'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.MESSAGINGDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'accept': 'application/json',
- 'Continuation-Token': continuation_token
- }
-
- # Prepare and execute request
- _request = self.config.http_client.get(_query_url, headers=_headers)
- MessagingBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise MessagingException('400 Request is malformed or invalid', _response)
- elif _response.status_code == 401:
- raise MessagingException('401 The specified user does not have access to the account', _response)
- elif _response.status_code == 403:
- raise MessagingException('403 The user does not have access to this API', _response)
- elif _response.status_code == 404:
- raise MessagingException('404 Path not found', _response)
- elif _response.status_code == 415:
- raise MessagingException('415 The content-type of the request is incorrect', _response)
- elif _response.status_code == 429:
- raise MessagingException('429 The rate limit has been reached', _response)
- self.validate_response(_response)
-
- decoded = APIHelper.json_deserialize(_response.text, Media.from_dictionary)
- _result = ApiResponse(_response, body=decoded)
- return _result
-
- def get_media(self,
- account_id,
- media_id):
- """Does a GET request to /users/{accountId}/media/{mediaId}.
-
- Downloads a media file you previously uploaded.
-
- Args:
- account_id (string): User's account ID
- media_id (string): Media ID to retrieve
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers.
- successful operation
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/users/{accountId}/media/{mediaId}'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'mediaId': {'value': media_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.MESSAGINGDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare and execute request
- _request = self.config.http_client.get(_query_url)
- MessagingBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request, binary=True)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise MessagingException('400 Request is malformed or invalid', _response)
- elif _response.status_code == 401:
- raise MessagingException('401 The specified user does not have access to the account', _response)
- elif _response.status_code == 403:
- raise MessagingException('403 The user does not have access to this API', _response)
- elif _response.status_code == 404:
- raise MessagingException('404 Path not found', _response)
- elif _response.status_code == 415:
- raise MessagingException('415 The content-type of the request is incorrect', _response)
- elif _response.status_code == 429:
- raise MessagingException('429 The rate limit has been reached', _response)
- self.validate_response(_response)
-
- decoded = _response.text
- _result = ApiResponse(_response, body=decoded)
- return _result
-
- def upload_media(self,
- account_id,
- media_id,
- body,
- content_type='application/octet-stream',
- cache_control=None):
- """Does a PUT request to /users/{accountId}/media/{mediaId}.
-
- Uploads a file the normal HTTP way. You may add headers to the request
- in order to provide some control to your media-file.
-
- Args:
- account_id (string): User's account ID
- media_id (string): The user supplied custom media ID
- body (typing.BinaryIO): TODO: type description here.
- content_type (string, optional): The media type of the
- entity-body
- cache_control (string, optional): General-header field is used to
- specify directives that MUST be obeyed by all caching
- mechanisms along the request/response chain.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers.
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/users/{accountId}/media/{mediaId}'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'mediaId': {'value': media_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.MESSAGINGDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- if isinstance(body, FileWrapper):
- body_wrapper = body.file_stream
- body_content_type = body.content_type
- else:
- body_wrapper = body
- body_content_type = content_type
-
- # Prepare headers
- _headers = {
- 'content-type': body_content_type,
- 'Cache-Control': cache_control
- }
-
- # Prepare and execute request
- _request = self.config.http_client.put(_query_url, headers=_headers, parameters=body_wrapper)
- MessagingBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise MessagingException('400 Request is malformed or invalid', _response)
- elif _response.status_code == 401:
- raise MessagingException('401 The specified user does not have access to the account', _response)
- elif _response.status_code == 403:
- raise MessagingException('403 The user does not have access to this API', _response)
- elif _response.status_code == 404:
- raise MessagingException('404 Path not found', _response)
- elif _response.status_code == 415:
- raise MessagingException('415 The content-type of the request is incorrect', _response)
- elif _response.status_code == 429:
- raise MessagingException('429 The rate limit has been reached', _response)
- self.validate_response(_response)
-
- # Return appropriate type
- return ApiResponse(_response)
-
- def delete_media(self,
- account_id,
- media_id):
- """Does a DELETE request to /users/{accountId}/media/{mediaId}.
-
- 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.
-
- Args:
- account_id (string): User's account ID
- media_id (string): The media ID to delete
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers.
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/users/{accountId}/media/{mediaId}'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'mediaId': {'value': media_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.MESSAGINGDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare and execute request
- _request = self.config.http_client.delete(_query_url)
- MessagingBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise MessagingException('400 Request is malformed or invalid', _response)
- elif _response.status_code == 401:
- raise MessagingException('401 The specified user does not have access to the account', _response)
- elif _response.status_code == 403:
- raise MessagingException('403 The user does not have access to this API', _response)
- elif _response.status_code == 404:
- raise MessagingException('404 Path not found', _response)
- elif _response.status_code == 415:
- raise MessagingException('415 The content-type of the request is incorrect', _response)
- elif _response.status_code == 429:
- raise MessagingException('429 The rate limit has been reached', _response)
- self.validate_response(_response)
-
- # Return appropriate type
- return ApiResponse(_response)
-
- def get_messages(self,
- account_id,
- message_id=None,
- source_tn=None,
- destination_tn=None,
- message_status=None,
- error_code=None,
- from_date_time=None,
- to_date_time=None,
- page_token=None,
- limit=None,
- sort=None):
- """Does a GET request to /users/{accountId}/messages.
-
- Gets a list of messages based on query parameters.
-
- Args:
- account_id (string): User's account ID
- message_id (string, optional): The ID of the message to search
- for. Special characters need to be encoded using URL encoding
- source_tn (string, optional): The phone number that sent the
- message
- destination_tn (string, optional): The phone number that received
- the message
- message_status (string, optional): The status of the message. One
- of RECEIVED, QUEUED, SENDING, SENT, FAILED, DELIVERED,
- ACCEPTED, UNDELIVERED
- error_code (int, optional): The error code of the message
- from_date_time (string, optional): 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 (string, optional): 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.
- page_token (string, optional): A base64 encoded value used for
- pagination of results
- limit (int, optional): The maximum records requested in search
- result. Default 100. The sum of limit and after cannot be more
- than 10000
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers.
- successful operation
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/users/{accountId}/messages'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.MESSAGINGDEFAULT)
- _query_builder += _url_path
- _query_parameters = {
- '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,
- 'sort': sort
- }
- _query_builder = APIHelper.append_url_with_query_parameters(
- _query_builder,
- _query_parameters
- )
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'accept': 'application/json'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.get(_query_url, headers=_headers)
- MessagingBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise MessagingException('400 Request is malformed or invalid', _response)
- elif _response.status_code == 401:
- raise MessagingException('401 The specified user does not have access to the account', _response)
- elif _response.status_code == 403:
- raise MessagingException('403 The user does not have access to this API', _response)
- elif _response.status_code == 404:
- raise MessagingException('404 Path not found', _response)
- elif _response.status_code == 415:
- raise MessagingException('415 The content-type of the request is incorrect', _response)
- elif _response.status_code == 429:
- raise MessagingException('429 The rate limit has been reached', _response)
- self.validate_response(_response)
-
- decoded = APIHelper.json_deserialize(_response.text, BandwidthMessagesList.from_dictionary)
- _result = ApiResponse(_response, body=decoded)
- return _result
-
- def create_message(self,
- account_id,
- body):
- """Does a POST request to /users/{accountId}/messages.
-
- Endpoint for sending text messages and picture messages using V2
- messaging.
-
- Args:
- account_id (string): User's account ID
- body (MessageRequest): TODO: type description here.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers.
- successful operation
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/users/{accountId}/messages'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.MESSAGINGDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'accept': 'application/json',
- 'content-type': 'application/json; charset=utf-8'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.post(_query_url, headers=_headers, parameters=APIHelper.json_serialize(body))
- MessagingBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise MessagingException('400 Request is malformed or invalid', _response)
- elif _response.status_code == 401:
- raise MessagingException('401 The specified user does not have access to the account', _response)
- elif _response.status_code == 403:
- raise MessagingException('403 The user does not have access to this API', _response)
- elif _response.status_code == 404:
- raise MessagingException('404 Path not found', _response)
- elif _response.status_code == 415:
- raise MessagingException('415 The content-type of the request is incorrect', _response)
- elif _response.status_code == 429:
- raise MessagingException('429 The rate limit has been reached', _response)
- self.validate_response(_response)
-
- decoded = APIHelper.json_deserialize(_response.text, BandwidthMessage.from_dictionary)
- _result = ApiResponse(_response, body=decoded)
- return _result
diff --git a/bandwidth/messaging/controllers/base_controller.py b/bandwidth/messaging/controllers/base_controller.py
deleted file mode 100644
index ec1c6e23..00000000
--- a/bandwidth/messaging/controllers/base_controller.py
+++ /dev/null
@@ -1,95 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-from bandwidth.api_helper import APIHelper
-from bandwidth.exceptions.api_exception import APIException
-
-
-class BaseController(object):
-
- """All controllers inherit from this base class.
-
- Attributes:
- config (Configuration): The HttpClient which a specific controller
- instance will use. By default all the controller objects share
- the same HttpClient. A user can use his own custom HttpClient
- as well.
- http_call_back (HttpCallBack): An object which holds call back
- methods to be called before and after the execution of an HttpRequest.
- global_headers (dict): The global headers of the API which are sent with
- every request.
-
- """
-
- def global_headers(self):
- return {
- 'user-agent': 'python-sdk'
- }
-
- def __init__(self, config, call_back=None):
- self._config = config
- self._http_call_back = call_back
-
- @property
- def config(self):
- return self._config
-
- @property
- def http_call_back(self):
- return self._http_call_back
-
- def validate_parameters(self, **kwargs):
- """Validates required parameters of an endpoint.
-
- Args:
- kwargs (dict): A dictionary of the required parameters.
-
- """
- for name, value in kwargs.items():
- if value is None:
- raise ValueError("Required parameter {} cannot be None.".format(name))
-
- def execute_request(self, request, binary=False):
- """Executes an HttpRequest.
-
- Args:
- request (HttpRequest): The HttpRequest to execute.
- binary (bool): A flag which should be set to True if
- a binary response is expected.
-
- Returns:
- HttpResponse: The HttpResponse received.
-
- """
- # Invoke the on before request HttpCallBack if specified
- if self.http_call_back is not None:
- self.http_call_back.on_before_request(request)
-
- # Add global headers to request
- request.headers = APIHelper.merge_dicts(self.global_headers(), request.headers)
-
- # Invoke the API call to fetch the response.
- func = self.config.http_client.execute_as_binary if binary else self.config.http_client.execute_as_string
- response = func(request)
-
- # Invoke the on after response HttpCallBack if specified
- if self.http_call_back is not None:
- self.http_call_back.on_after_response(response)
-
- return response
-
- def validate_response(self, response):
- """Validates an HTTP response by checking for global errors.
-
- Args:
- response (HttpResponse): The HttpResponse of the API call.
-
- """
- if (response.status_code < 200) or (response.status_code > 208): # [200,208] = HTTP OK
- raise APIException('HTTP response not OK.', response)
diff --git a/bandwidth/messaging/exceptions/__init__.py b/bandwidth/messaging/exceptions/__init__.py
deleted file mode 100644
index 8d2920ac..00000000
--- a/bandwidth/messaging/exceptions/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-__all__ = [
- 'messaging_exception',
-]
diff --git a/bandwidth/messaging/exceptions/messaging_exception.py b/bandwidth/messaging/exceptions/messaging_exception.py
deleted file mode 100644
index aa6fcc1b..00000000
--- a/bandwidth/messaging/exceptions/messaging_exception.py
+++ /dev/null
@@ -1,39 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-from bandwidth.api_helper import APIHelper
-import bandwidth.exceptions.api_exception
-
-
-class MessagingException(bandwidth.exceptions.api_exception.APIException):
- def __init__(self, reason, response):
- """Constructor for the MessagingException class
-
- Args:
- reason (string): The reason (or error message) for the Exception
- to be raised.
- response (HttpResponse): The HttpResponse of the API call.
-
- """
- super(MessagingException, self).__init__(reason, response)
- dictionary = APIHelper.json_deserialize(self.response.text)
- if isinstance(dictionary, dict):
- self.unbox(dictionary)
-
- def unbox(self, dictionary):
- """Populates the properties of this object by extracting them from a dictionary.
-
- Args:
- dictionary (dictionary): A dictionary representation of the object as
- obtained from the deserialization of the server's response. The keys
- MUST match property names in the API description.
-
- """
- self.mtype = dictionary.get('type')
- self.description = dictionary.get('description')
diff --git a/bandwidth/messaging/messaging_client.py b/bandwidth/messaging/messaging_client.py
deleted file mode 100644
index 95e27962..00000000
--- a/bandwidth/messaging/messaging_client.py
+++ /dev/null
@@ -1,56 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-from bandwidth.decorators import lazy_property
-from bandwidth.configuration import Configuration
-from bandwidth.configuration import Environment
-from bandwidth.messaging.controllers.api_controller import APIController
-
-
-class MessagingClient(object):
-
- @lazy_property
- def client(self):
- return APIController(self.config)
-
- def __init__(self, timeout=60, max_retries=0, 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=['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=None):
- if config is None:
- self.config = Configuration(timeout=timeout,
- max_retries=max_retries,
- 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:
- self.config = config
diff --git a/bandwidth/messaging/models/__init__.py b/bandwidth/messaging/models/__init__.py
deleted file mode 100644
index ef3a90d5..00000000
--- a/bandwidth/messaging/models/__init__.py
+++ /dev/null
@@ -1,12 +0,0 @@
-__all__ = [
- 'bandwidth_messages_list',
- 'bandwidth_message_item',
- 'page_info',
- 'media',
- 'tag',
- 'deferred_result',
- 'bandwidth_callback_message',
- 'bandwidth_message',
- 'message_request',
- 'priority_enum',
-]
diff --git a/bandwidth/messaging/models/bandwidth_callback_message.py b/bandwidth/messaging/models/bandwidth_callback_message.py
deleted file mode 100644
index f4b2ca4b..00000000
--- a/bandwidth/messaging/models/bandwidth_callback_message.py
+++ /dev/null
@@ -1,86 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-from bandwidth.messaging.models.bandwidth_message import BandwidthMessage
-
-
-class BandwidthCallbackMessage(object):
-
- """Implementation of the 'BandwidthCallbackMessage' model.
-
- TODO: type model description here.
-
- Attributes:
- time (string): TODO: type description here.
- mtype (string): TODO: type description here.
- to (string): TODO: type description here.
- error_code (string): TODO: type description here.
- description (string): TODO: type description here.
- message (BandwidthMessage): TODO: type description here.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "time": 'time',
- "mtype": 'type',
- "to": 'to',
- "error_code": 'errorCode',
- "description": 'description',
- "message": 'message'
- }
-
- def __init__(self,
- time=None,
- mtype=None,
- to=None,
- error_code=None,
- description=None,
- message=None):
- """Constructor for the BandwidthCallbackMessage class"""
-
- # Initialize members of the class
- self.time = time
- self.mtype = mtype
- self.to = to
- self.error_code = error_code
- self.description = description
- self.message = message
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- time = dictionary.get('time')
- mtype = dictionary.get('type')
- to = dictionary.get('to')
- error_code = dictionary.get('errorCode')
- description = dictionary.get('description')
- message = BandwidthMessage.from_dictionary(dictionary.get('message')) if dictionary.get('message') else None
-
- # Return an object of this model
- return cls(time,
- mtype,
- to,
- error_code,
- description,
- message)
diff --git a/bandwidth/messaging/models/bandwidth_message.py b/bandwidth/messaging/models/bandwidth_message.py
deleted file mode 100644
index 39eb70e2..00000000
--- a/bandwidth/messaging/models/bandwidth_message.py
+++ /dev/null
@@ -1,129 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class BandwidthMessage(object):
-
- """Implementation of the 'BandwidthMessage' model.
-
- TODO: type model description here.
-
- Attributes:
- id (string): The id of the message
- owner (string): The Bandwidth phone number associated with the
- message
- application_id (string): The application ID associated with the
- message
- time (string): The datetime stamp of the message in ISO 8601
- segment_count (int): The number of segments the original message from
- the user is broken into before sending over to carrier networks
- direction (string): The direction of the message relative to
- Bandwidth. Can be in or out
- to (list of string): The phone number recipients of the message
- mfrom (string): The phone number the message was sent from
- media (list of 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.
- text (string): The contents of the message
- tag (string): The custom string set by the user
- priority (string): The priority specified by the user
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "id": 'id',
- "owner": 'owner',
- "application_id": 'applicationId',
- "time": 'time',
- "segment_count": 'segmentCount',
- "direction": 'direction',
- "to": 'to',
- "mfrom": 'from',
- "media": 'media',
- "text": 'text',
- "tag": 'tag',
- "priority": 'priority'
- }
-
- def __init__(self,
- id=None,
- owner=None,
- application_id=None,
- time=None,
- segment_count=None,
- direction=None,
- to=None,
- mfrom=None,
- media=None,
- text=None,
- tag=None,
- priority=None):
- """Constructor for the BandwidthMessage class"""
-
- # Initialize members of the class
- self.id = id
- self.owner = owner
- self.application_id = application_id
- self.time = time
- self.segment_count = segment_count
- self.direction = direction
- self.to = to
- self.mfrom = mfrom
- self.media = media
- self.text = text
- self.tag = tag
- self.priority = priority
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- id = dictionary.get('id')
- owner = dictionary.get('owner')
- application_id = dictionary.get('applicationId')
- time = dictionary.get('time')
- segment_count = dictionary.get('segmentCount')
- direction = dictionary.get('direction')
- to = dictionary.get('to')
- mfrom = dictionary.get('from')
- media = dictionary.get('media')
- text = dictionary.get('text')
- tag = dictionary.get('tag')
- priority = dictionary.get('priority')
-
- # Return an object of this model
- return cls(id,
- owner,
- application_id,
- time,
- segment_count,
- direction,
- to,
- mfrom,
- media,
- text,
- tag,
- priority)
diff --git a/bandwidth/messaging/models/bandwidth_message_item.py b/bandwidth/messaging/models/bandwidth_message_item.py
deleted file mode 100644
index cb54e04b..00000000
--- a/bandwidth/messaging/models/bandwidth_message_item.py
+++ /dev/null
@@ -1,149 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class BandwidthMessageItem(object):
-
- """Implementation of the 'BandwidthMessageItem' model.
-
- TODO: type model description here.
-
- Attributes:
- message_id (string): The message id
- account_id (string): The account id of the message
- source_tn (string): The source phone number of the message
- destination_tn (string): The recipient phone number of the message
- message_status (string): The status of the message
- message_direction (string): The direction of the message relative to
- Bandwidth. INBOUND or OUTBOUND
- message_type (string): The type of message. sms or mms
- segment_count (int): The number of segments the message was sent as
- error_code (int): The numeric error code of the message
- receive_time (string): The ISO 8601 datetime of the message
- carrier_name (string): The name of the carrier. Not currently
- supported for MMS, coming soon
- message_size (int): The size of the message including message content
- and headers
- message_length (int): The length of the message content
- attachment_count (int): The number of attachments the message has
- recipient_count (int): The number of recipients the message has
- campaign_class (string): The campaign class of the message, if it has
- one
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "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'
- }
-
- def __init__(self,
- message_id=None,
- account_id=None,
- source_tn=None,
- destination_tn=None,
- message_status=None,
- message_direction=None,
- message_type=None,
- segment_count=None,
- error_code=None,
- receive_time=None,
- carrier_name=None,
- message_size=None,
- message_length=None,
- attachment_count=None,
- recipient_count=None,
- campaign_class=None):
- """Constructor for the BandwidthMessageItem class"""
-
- # Initialize members of the class
- self.message_id = message_id
- self.account_id = account_id
- self.source_tn = source_tn
- self.destination_tn = destination_tn
- self.message_status = message_status
- self.message_direction = message_direction
- self.message_type = message_type
- self.segment_count = segment_count
- self.error_code = error_code
- self.receive_time = receive_time
- self.carrier_name = carrier_name
- self.message_size = message_size
- self.message_length = message_length
- self.attachment_count = attachment_count
- self.recipient_count = recipient_count
- self.campaign_class = campaign_class
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- message_id = dictionary.get('messageId')
- account_id = dictionary.get('accountId')
- source_tn = dictionary.get('sourceTn')
- destination_tn = dictionary.get('destinationTn')
- message_status = dictionary.get('messageStatus')
- message_direction = dictionary.get('messageDirection')
- message_type = dictionary.get('messageType')
- segment_count = dictionary.get('segmentCount')
- error_code = dictionary.get('errorCode')
- receive_time = dictionary.get('receiveTime')
- carrier_name = dictionary.get('carrierName')
- message_size = dictionary.get('messageSize')
- message_length = dictionary.get('messageLength')
- attachment_count = dictionary.get('attachmentCount')
- recipient_count = dictionary.get('recipientCount')
- campaign_class = dictionary.get('campaignClass')
-
- # Return an object of this model
- return cls(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)
diff --git a/bandwidth/messaging/models/bandwidth_messages_list.py b/bandwidth/messaging/models/bandwidth_messages_list.py
deleted file mode 100644
index 9075ff55..00000000
--- a/bandwidth/messaging/models/bandwidth_messages_list.py
+++ /dev/null
@@ -1,71 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-from bandwidth.messaging.models.bandwidth_message_item import BandwidthMessageItem
-from bandwidth.messaging.models.page_info import PageInfo
-
-
-class BandwidthMessagesList(object):
-
- """Implementation of the 'BandwidthMessagesList' model.
-
- TODO: type model description here.
-
- Attributes:
- total_count (int): Total number of messages matched by the search
- page_info (PageInfo): TODO: type description here.
- messages (list of BandwidthMessageItem): TODO: type description here.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "total_count": 'totalCount',
- "page_info": 'pageInfo',
- "messages": 'messages'
- }
-
- def __init__(self,
- total_count=None,
- page_info=None,
- messages=None):
- """Constructor for the BandwidthMessagesList class"""
-
- # Initialize members of the class
- self.total_count = total_count
- self.page_info = page_info
- self.messages = messages
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- total_count = dictionary.get('totalCount')
- page_info = PageInfo.from_dictionary(dictionary.get('pageInfo')) if dictionary.get('pageInfo') else None
- messages = None
- if dictionary.get('messages') is not None:
- messages = [BandwidthMessageItem.from_dictionary(x) for x in dictionary.get('messages')]
-
- # Return an object of this model
- return cls(total_count,
- page_info,
- messages)
diff --git a/bandwidth/messaging/models/deferred_result.py b/bandwidth/messaging/models/deferred_result.py
deleted file mode 100644
index c19a995a..00000000
--- a/bandwidth/messaging/models/deferred_result.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class DeferredResult(object):
-
- """Implementation of the 'DeferredResult' model.
-
- TODO: type model description here.
-
- Attributes:
- result (object): TODO: type description here.
- set_or_expired (bool): TODO: type description here.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "result": 'result',
- "set_or_expired": 'setOrExpired'
- }
-
- def __init__(self,
- result=None,
- set_or_expired=None):
- """Constructor for the DeferredResult class"""
-
- # Initialize members of the class
- self.result = result
- self.set_or_expired = set_or_expired
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- result = dictionary.get('result')
- set_or_expired = dictionary.get('setOrExpired')
-
- # Return an object of this model
- return cls(result,
- set_or_expired)
diff --git a/bandwidth/messaging/models/media.py b/bandwidth/messaging/models/media.py
deleted file mode 100644
index 4f180ac0..00000000
--- a/bandwidth/messaging/models/media.py
+++ /dev/null
@@ -1,67 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class Media(object):
-
- """Implementation of the 'Media' model.
-
- TODO: type model description here.
-
- Attributes:
- content (string): TODO: type description here.
- content_length (int): TODO: type description here.
- media_name (string): TODO: type description here.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "content": 'content',
- "content_length": 'contentLength',
- "media_name": 'mediaName'
- }
-
- def __init__(self,
- content=None,
- content_length=None,
- media_name=None):
- """Constructor for the Media class"""
-
- # Initialize members of the class
- self.content = content
- self.content_length = content_length
- self.media_name = media_name
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- content = dictionary.get('content')
- content_length = dictionary.get('contentLength')
- media_name = dictionary.get('mediaName')
-
- # Return an object of this model
- return cls(content,
- content_length,
- media_name)
diff --git a/bandwidth/messaging/models/message_request.py b/bandwidth/messaging/models/message_request.py
deleted file mode 100644
index 88f682ad..00000000
--- a/bandwidth/messaging/models/message_request.py
+++ /dev/null
@@ -1,99 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class MessageRequest(object):
-
- """Implementation of the 'MessageRequest' model.
-
- TODO: type model description here.
-
- Attributes:
- application_id (string): The ID of the Application your from number is
- associated with in the Bandwidth Phone Number Dashboard.
- to (list of string): The phone number(s) the message should be sent to
- in E164 format
- mfrom (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.
- media (list of string): A list of URLs to include as media attachments
- as part of the message.
- tag (string): A custom string that will be included in callback events
- of the message. Max 1024 characters
- priority (PriorityEnum): 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.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "application_id": 'applicationId',
- "to": 'to',
- "mfrom": 'from',
- "text": 'text',
- "media": 'media',
- "tag": 'tag',
- "priority": 'priority'
- }
-
- def __init__(self,
- application_id=None,
- to=None,
- mfrom=None,
- text=None,
- media=None,
- tag=None,
- priority=None):
- """Constructor for the MessageRequest class"""
-
- # Initialize members of the class
- self.application_id = application_id
- self.to = to
- self.mfrom = mfrom
- self.text = text
- self.media = media
- self.tag = tag
- self.priority = priority
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- application_id = dictionary.get('applicationId')
- to = dictionary.get('to')
- mfrom = dictionary.get('from')
- text = dictionary.get('text')
- media = dictionary.get('media')
- tag = dictionary.get('tag')
- priority = dictionary.get('priority')
-
- # Return an object of this model
- return cls(application_id,
- to,
- mfrom,
- text,
- media,
- tag,
- priority)
diff --git a/bandwidth/messaging/models/page_info.py b/bandwidth/messaging/models/page_info.py
deleted file mode 100644
index 4ea891a6..00000000
--- a/bandwidth/messaging/models/page_info.py
+++ /dev/null
@@ -1,75 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class PageInfo(object):
-
- """Implementation of the 'PageInfo' model.
-
- TODO: type model description here.
-
- Attributes:
- prev_page (string): The link to the previous page for pagination
- next_page (string): The link to the next page for pagination
- prev_page_token (string): The isolated pagination token for the
- previous page
- next_page_token (string): The isolated pagination token for the next
- page
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "prev_page": 'prevPage',
- "next_page": 'nextPage',
- "prev_page_token": 'prevPageToken',
- "next_page_token": 'nextPageToken'
- }
-
- def __init__(self,
- prev_page=None,
- next_page=None,
- prev_page_token=None,
- next_page_token=None):
- """Constructor for the PageInfo class"""
-
- # Initialize members of the class
- self.prev_page = prev_page
- self.next_page = next_page
- self.prev_page_token = prev_page_token
- self.next_page_token = next_page_token
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- prev_page = dictionary.get('prevPage')
- next_page = dictionary.get('nextPage')
- prev_page_token = dictionary.get('prevPageToken')
- next_page_token = dictionary.get('nextPageToken')
-
- # Return an object of this model
- return cls(prev_page,
- next_page,
- prev_page_token,
- next_page_token)
diff --git a/bandwidth/messaging/models/priority_enum.py b/bandwidth/messaging/models/priority_enum.py
deleted file mode 100644
index 8d25c5d8..00000000
--- a/bandwidth/messaging/models/priority_enum.py
+++ /dev/null
@@ -1,27 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class PriorityEnum(object):
-
- """Implementation of the 'Priority' enum.
-
- 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.
-
- Attributes:
- DEFAULT: TODO: type description here.
- HIGH: TODO: type description here.
-
- """
-
- DEFAULT = 'default'
-
- HIGH = 'high'
diff --git a/bandwidth/messaging/models/tag.py b/bandwidth/messaging/models/tag.py
deleted file mode 100644
index 609321aa..00000000
--- a/bandwidth/messaging/models/tag.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class Tag(object):
-
- """Implementation of the 'Tag' model.
-
- TODO: type model description here.
-
- Attributes:
- key (string): TODO: type description here.
- value (string): TODO: type description here.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "key": 'key',
- "value": 'value'
- }
-
- def __init__(self,
- key=None,
- value=None):
- """Constructor for the Tag class"""
-
- # Initialize members of the class
- self.key = key
- self.value = value
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- key = dictionary.get('key')
- value = dictionary.get('value')
-
- # Return an object of this model
- return cls(key,
- value)
diff --git a/bandwidth/models/__init__.py b/bandwidth/models/__init__.py
index e69de29b..18c7b0a3 100644
--- a/bandwidth/models/__init__.py
+++ b/bandwidth/models/__init__.py
@@ -0,0 +1,105 @@
+# coding: utf-8
+
+# flake8: noqa
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+# import models into model package
+from bandwidth.models.account_statistics import AccountStatistics
+from bandwidth.models.answer_callback import AnswerCallback
+from bandwidth.models.bridge_complete_callback import BridgeCompleteCallback
+from bandwidth.models.bridge_target_complete_callback import BridgeTargetCompleteCallback
+from bandwidth.models.call_direction_enum import CallDirectionEnum
+from bandwidth.models.call_recording_metadata import CallRecordingMetadata
+from bandwidth.models.call_state import CallState
+from bandwidth.models.call_state_enum import CallStateEnum
+from bandwidth.models.callback_method_enum import CallbackMethodEnum
+from bandwidth.models.code_request import CodeRequest
+from bandwidth.models.conference import Conference
+from bandwidth.models.conference_completed_callback import ConferenceCompletedCallback
+from bandwidth.models.conference_created_callback import ConferenceCreatedCallback
+from bandwidth.models.conference_member import ConferenceMember
+from bandwidth.models.conference_member_exit_callback import ConferenceMemberExitCallback
+from bandwidth.models.conference_member_join_callback import ConferenceMemberJoinCallback
+from bandwidth.models.conference_recording_available_callback import ConferenceRecordingAvailableCallback
+from bandwidth.models.conference_recording_metadata import ConferenceRecordingMetadata
+from bandwidth.models.conference_redirect_callback import ConferenceRedirectCallback
+from bandwidth.models.conference_state_enum import ConferenceStateEnum
+from bandwidth.models.create_call import CreateCall
+from bandwidth.models.create_call_response import CreateCallResponse
+from bandwidth.models.create_lookup_response import CreateLookupResponse
+from bandwidth.models.create_message_request_error import CreateMessageRequestError
+from bandwidth.models.deferred_result import DeferredResult
+from bandwidth.models.disconnect_callback import DisconnectCallback
+from bandwidth.models.diversion import Diversion
+from bandwidth.models.dtmf_callback import DtmfCallback
+from bandwidth.models.field_error import FieldError
+from bandwidth.models.file_format_enum import FileFormatEnum
+from bandwidth.models.gather_callback import GatherCallback
+from bandwidth.models.inbound_message_callback import InboundMessageCallback
+from bandwidth.models.inbound_message_callback_message import InboundMessageCallbackMessage
+from bandwidth.models.initiate_callback import InitiateCallback
+from bandwidth.models.list_message_direction_enum import ListMessageDirectionEnum
+from bandwidth.models.list_message_item import ListMessageItem
+from bandwidth.models.lookup_request import LookupRequest
+from bandwidth.models.lookup_result import LookupResult
+from bandwidth.models.lookup_status import LookupStatus
+from bandwidth.models.lookup_status_enum import LookupStatusEnum
+from bandwidth.models.machine_detection_complete_callback import MachineDetectionCompleteCallback
+from bandwidth.models.machine_detection_configuration import MachineDetectionConfiguration
+from bandwidth.models.machine_detection_mode_enum import MachineDetectionModeEnum
+from bandwidth.models.machine_detection_result import MachineDetectionResult
+from bandwidth.models.media import Media
+from bandwidth.models.message import Message
+from bandwidth.models.message_delivered_callback import MessageDeliveredCallback
+from bandwidth.models.message_delivered_callback_message import MessageDeliveredCallbackMessage
+from bandwidth.models.message_direction_enum import MessageDirectionEnum
+from bandwidth.models.message_failed_callback import MessageFailedCallback
+from bandwidth.models.message_failed_callback_message import MessageFailedCallbackMessage
+from bandwidth.models.message_request import MessageRequest
+from bandwidth.models.message_sending_callback import MessageSendingCallback
+from bandwidth.models.message_sending_callback_message import MessageSendingCallbackMessage
+from bandwidth.models.message_status_enum import MessageStatusEnum
+from bandwidth.models.message_type_enum import MessageTypeEnum
+from bandwidth.models.messages_list import MessagesList
+from bandwidth.models.messaging_code_response import MessagingCodeResponse
+from bandwidth.models.messaging_request_error import MessagingRequestError
+from bandwidth.models.mfa_forbidden_request_error import MfaForbiddenRequestError
+from bandwidth.models.mfa_request_error import MfaRequestError
+from bandwidth.models.mfa_unauthorized_request_error import MfaUnauthorizedRequestError
+from bandwidth.models.page_info import PageInfo
+from bandwidth.models.priority_enum import PriorityEnum
+from bandwidth.models.recording_available_callback import RecordingAvailableCallback
+from bandwidth.models.recording_complete_callback import RecordingCompleteCallback
+from bandwidth.models.recording_state_enum import RecordingStateEnum
+from bandwidth.models.redirect_callback import RedirectCallback
+from bandwidth.models.redirect_method_enum import RedirectMethodEnum
+from bandwidth.models.stir_shaken import StirShaken
+from bandwidth.models.tag import Tag
+from bandwidth.models.tn_lookup_request_error import TnLookupRequestError
+from bandwidth.models.transcribe_recording import TranscribeRecording
+from bandwidth.models.transcription import Transcription
+from bandwidth.models.transcription_available_callback import TranscriptionAvailableCallback
+from bandwidth.models.transcription_list import TranscriptionList
+from bandwidth.models.transcription_metadata import TranscriptionMetadata
+from bandwidth.models.transfer_answer_callback import TransferAnswerCallback
+from bandwidth.models.transfer_complete_callback import TransferCompleteCallback
+from bandwidth.models.transfer_disconnect_callback import TransferDisconnectCallback
+from bandwidth.models.update_call import UpdateCall
+from bandwidth.models.update_call_recording import UpdateCallRecording
+from bandwidth.models.update_conference import UpdateConference
+from bandwidth.models.update_conference_member import UpdateConferenceMember
+from bandwidth.models.verify_code_request import VerifyCodeRequest
+from bandwidth.models.verify_code_response import VerifyCodeResponse
+from bandwidth.models.voice_api_error import VoiceApiError
+from bandwidth.models.voice_code_response import VoiceCodeResponse
diff --git a/bandwidth/models/account_statistics.py b/bandwidth/models/account_statistics.py
new file mode 100644
index 00000000..e1e5c3f7
--- /dev/null
+++ b/bandwidth/models/account_statistics.py
@@ -0,0 +1,86 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictInt
+
+class AccountStatistics(BaseModel):
+ """
+ AccountStatistics
+ """
+ current_call_queue_size: Optional[StrictInt] = Field(None, alias="currentCallQueueSize", description="The number of calls currently enqueued.")
+ max_call_queue_size: Optional[StrictInt] = Field(None, alias="maxCallQueueSize", description="The maximum size of the queue before outgoing calls start being rejected.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["currentCallQueueSize", "maxCallQueueSize"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> AccountStatistics:
+ """Create an instance of AccountStatistics from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> AccountStatistics:
+ """Create an instance of AccountStatistics from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return AccountStatistics.parse_obj(obj)
+
+ _obj = AccountStatistics.parse_obj({
+ "current_call_queue_size": obj.get("currentCallQueueSize"),
+ "max_call_queue_size": obj.get("maxCallQueueSize")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/answer_callback.py b/bandwidth/models/answer_callback.py
new file mode 100644
index 00000000..9aa0fb21
--- /dev/null
+++ b/bandwidth/models/answer_callback.py
@@ -0,0 +1,135 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+from bandwidth.models.call_direction_enum import CallDirectionEnum
+from bandwidth.models.machine_detection_result import MachineDetectionResult
+
+class AnswerCallback(BaseModel):
+ """
+ The Answer event is sent to the answerUrl specified in the createCall request when an outbound call is answered.
+ """
+ event_type: Optional[StrictStr] = Field(None, alias="eventType", 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.")
+ event_time: Optional[datetime] = Field(None, alias="eventTime", 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.")
+ account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.")
+ application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.")
+ var_from: Optional[StrictStr] = Field(None, alias="from", 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.")
+ to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).")
+ direction: Optional[CallDirectionEnum] = None
+ call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.")
+ call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.")
+ enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.")
+ start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.")
+ answer_time: Optional[datetime] = Field(None, alias="answerTime", description="Time the call was answered, in ISO 8601 format.")
+ tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.")
+ machine_detection_result: Optional[MachineDetectionResult] = Field(None, alias="machineDetectionResult")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "enqueuedTime", "startTime", "answerTime", "tag", "machineDetectionResult"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> AnswerCallback:
+ """Create an instance of AnswerCallback from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of machine_detection_result
+ if self.machine_detection_result:
+ _dict['machineDetectionResult'] = self.machine_detection_result.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if enqueued_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.enqueued_time is None and "enqueued_time" in self.__fields_set__:
+ _dict['enqueuedTime'] = None
+
+ # set to None if answer_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.answer_time is None and "answer_time" in self.__fields_set__:
+ _dict['answerTime'] = None
+
+ # set to None if tag (nullable) is None
+ # and __fields_set__ contains the field
+ if self.tag is None and "tag" in self.__fields_set__:
+ _dict['tag'] = None
+
+ # set to None if machine_detection_result (nullable) is None
+ # and __fields_set__ contains the field
+ if self.machine_detection_result is None and "machine_detection_result" in self.__fields_set__:
+ _dict['machineDetectionResult'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> AnswerCallback:
+ """Create an instance of AnswerCallback from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return AnswerCallback.parse_obj(obj)
+
+ _obj = AnswerCallback.parse_obj({
+ "event_type": obj.get("eventType"),
+ "event_time": obj.get("eventTime"),
+ "account_id": obj.get("accountId"),
+ "application_id": obj.get("applicationId"),
+ "var_from": obj.get("from"),
+ "to": obj.get("to"),
+ "direction": obj.get("direction"),
+ "call_id": obj.get("callId"),
+ "call_url": obj.get("callUrl"),
+ "enqueued_time": obj.get("enqueuedTime"),
+ "start_time": obj.get("startTime"),
+ "answer_time": obj.get("answerTime"),
+ "tag": obj.get("tag"),
+ "machine_detection_result": MachineDetectionResult.from_dict(obj.get("machineDetectionResult")) if obj.get("machineDetectionResult") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/bridge_complete_callback.py b/bandwidth/models/bridge_complete_callback.py
new file mode 100644
index 00000000..e81022c8
--- /dev/null
+++ b/bandwidth/models/bridge_complete_callback.py
@@ -0,0 +1,140 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+from bandwidth.models.call_direction_enum import CallDirectionEnum
+
+class BridgeCompleteCallback(BaseModel):
+ """
+ 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.
+ """
+ event_type: Optional[StrictStr] = Field(None, alias="eventType", 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.")
+ event_time: Optional[datetime] = Field(None, alias="eventTime", 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.")
+ account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.")
+ application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.")
+ var_from: Optional[StrictStr] = Field(None, alias="from", 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.")
+ to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).")
+ direction: Optional[CallDirectionEnum] = None
+ call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.")
+ call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.")
+ enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.")
+ start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.")
+ answer_time: Optional[datetime] = Field(None, alias="answerTime", description="Time the call was answered, in ISO 8601 format.")
+ tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.")
+ cause: Optional[StrictStr] = Field(None, description="Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown.")
+ error_message: Optional[StrictStr] = Field(None, alias="errorMessage", description="Text explaining the reason that caused the call to fail in case of errors.")
+ error_id: Optional[StrictStr] = Field(None, alias="errorId", description="Bandwidth's internal id that references the error event.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "enqueuedTime", "startTime", "answerTime", "tag", "cause", "errorMessage", "errorId"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> BridgeCompleteCallback:
+ """Create an instance of BridgeCompleteCallback from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if enqueued_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.enqueued_time is None and "enqueued_time" in self.__fields_set__:
+ _dict['enqueuedTime'] = None
+
+ # set to None if answer_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.answer_time is None and "answer_time" in self.__fields_set__:
+ _dict['answerTime'] = None
+
+ # set to None if tag (nullable) is None
+ # and __fields_set__ contains the field
+ if self.tag is None and "tag" in self.__fields_set__:
+ _dict['tag'] = None
+
+ # set to None if error_message (nullable) is None
+ # and __fields_set__ contains the field
+ if self.error_message is None and "error_message" in self.__fields_set__:
+ _dict['errorMessage'] = None
+
+ # set to None if error_id (nullable) is None
+ # and __fields_set__ contains the field
+ if self.error_id is None and "error_id" in self.__fields_set__:
+ _dict['errorId'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> BridgeCompleteCallback:
+ """Create an instance of BridgeCompleteCallback from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return BridgeCompleteCallback.parse_obj(obj)
+
+ _obj = BridgeCompleteCallback.parse_obj({
+ "event_type": obj.get("eventType"),
+ "event_time": obj.get("eventTime"),
+ "account_id": obj.get("accountId"),
+ "application_id": obj.get("applicationId"),
+ "var_from": obj.get("from"),
+ "to": obj.get("to"),
+ "direction": obj.get("direction"),
+ "call_id": obj.get("callId"),
+ "call_url": obj.get("callUrl"),
+ "enqueued_time": obj.get("enqueuedTime"),
+ "start_time": obj.get("startTime"),
+ "answer_time": obj.get("answerTime"),
+ "tag": obj.get("tag"),
+ "cause": obj.get("cause"),
+ "error_message": obj.get("errorMessage"),
+ "error_id": obj.get("errorId")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/bridge_target_complete_callback.py b/bandwidth/models/bridge_target_complete_callback.py
new file mode 100644
index 00000000..7e384d95
--- /dev/null
+++ b/bandwidth/models/bridge_target_complete_callback.py
@@ -0,0 +1,124 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+from bandwidth.models.call_direction_enum import CallDirectionEnum
+
+class BridgeTargetCompleteCallback(BaseModel):
+ """
+ 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.
+ """
+ event_type: Optional[StrictStr] = Field(None, alias="eventType", 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.")
+ event_time: Optional[datetime] = Field(None, alias="eventTime", 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.")
+ account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.")
+ application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.")
+ var_from: Optional[StrictStr] = Field(None, alias="from", 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.")
+ to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).")
+ direction: Optional[CallDirectionEnum] = None
+ call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.")
+ call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.")
+ enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.")
+ start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.")
+ answer_time: Optional[datetime] = Field(None, alias="answerTime", description="Time the call was answered, in ISO 8601 format.")
+ tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "enqueuedTime", "startTime", "answerTime", "tag"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> BridgeTargetCompleteCallback:
+ """Create an instance of BridgeTargetCompleteCallback from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if enqueued_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.enqueued_time is None and "enqueued_time" in self.__fields_set__:
+ _dict['enqueuedTime'] = None
+
+ # set to None if answer_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.answer_time is None and "answer_time" in self.__fields_set__:
+ _dict['answerTime'] = None
+
+ # set to None if tag (nullable) is None
+ # and __fields_set__ contains the field
+ if self.tag is None and "tag" in self.__fields_set__:
+ _dict['tag'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> BridgeTargetCompleteCallback:
+ """Create an instance of BridgeTargetCompleteCallback from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return BridgeTargetCompleteCallback.parse_obj(obj)
+
+ _obj = BridgeTargetCompleteCallback.parse_obj({
+ "event_type": obj.get("eventType"),
+ "event_time": obj.get("eventTime"),
+ "account_id": obj.get("accountId"),
+ "application_id": obj.get("applicationId"),
+ "var_from": obj.get("from"),
+ "to": obj.get("to"),
+ "direction": obj.get("direction"),
+ "call_id": obj.get("callId"),
+ "call_url": obj.get("callUrl"),
+ "enqueued_time": obj.get("enqueuedTime"),
+ "start_time": obj.get("startTime"),
+ "answer_time": obj.get("answerTime"),
+ "tag": obj.get("tag")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/bxml/__init__.py b/bandwidth/models/bxml/__init__.py
new file mode 100644
index 00000000..32a84c4c
--- /dev/null
+++ b/bandwidth/models/bxml/__init__.py
@@ -0,0 +1,6 @@
+from .bxml import Bxml
+from .response import Response
+from .root import Root
+from .terminal_verb import TerminalVerb
+from .verb import Verb
+from .verbs import *
diff --git a/bandwidth/models/bxml/bxml.py b/bandwidth/models/bxml/bxml.py
new file mode 100644
index 00000000..ed7b17b6
--- /dev/null
+++ b/bandwidth/models/bxml/bxml.py
@@ -0,0 +1,21 @@
+"""
+bxml.py
+
+Class that allows user to generate a Bxml document
+
+@copyright Bandwidth INC
+"""
+from typing import List
+
+from .root import Root
+from .verb import Verb
+
+
+class Bxml(Root):
+ def __init__(self, nested_verbs: List[Verb] = []):
+ """Initialize an instance of the root
+
+ Args:
+ nested_verbs (list[BxmlVerb], optional): Optional nested verbs to create the model with. Defaults to [].
+ """
+ super().__init__(tag="Bxml", nested_verbs=nested_verbs)
diff --git a/bandwidth/models/bxml/response.py b/bandwidth/models/bxml/response.py
new file mode 100644
index 00000000..f269377e
--- /dev/null
+++ b/bandwidth/models/bxml/response.py
@@ -0,0 +1,21 @@
+"""
+response.py
+
+Class that allows user to generate a Response document
+
+@copyright Bandwidth INC
+"""
+from typing import List
+
+from .root import Root
+from .verb import Verb
+
+
+class Response(Root):
+ def __init__(self, nested_verbs: List[Verb] = []):
+ """Initialize an instance of the root
+
+ Args:
+ nested_verbs (list[BxmlVerb], optional): Optional nested verbs to create the model with. Defaults to [].
+ """
+ super().__init__(tag="Response", nested_verbs=nested_verbs)
diff --git a/bandwidth/models/bxml/root.py b/bandwidth/models/bxml/root.py
new file mode 100644
index 00000000..441b218d
--- /dev/null
+++ b/bandwidth/models/bxml/root.py
@@ -0,0 +1,77 @@
+"""
+root.py
+
+Defines the base verb class for all BXML roots
+
+@copyright Bandwidth INC
+"""
+from typing import List
+import xml.etree.ElementTree as ET
+
+from bandwidth.models.bxml.verb import Verb
+
+
+class Root:
+ """Base class for BXML roots
+ """
+
+ def __init__(self, tag: str, nested_verbs: List[Verb] = None):
+ """Initialize instance of class
+
+ Args:
+ tag (str): The XML element name
+ nested_verbs (list[BxmlVerb], optional): List of nested BXML verbs. Defaults to None.
+ """
+ self._tag = tag
+ self._nested_verbs = nested_verbs
+ if not self._nested_verbs:
+ self._nested_verbs = []
+
+ def __len__(self) -> int:
+ """Override default len method. Returns length of _nested_verbs array
+
+ Returns:
+ int: Length of self._nested_verbs
+ """
+ return len(self._nested_verbs)
+
+ def __getitem__(self, position: int) -> Verb:
+ """Override default getitem method. Makes the object iterable.
+
+ Args:
+ position (int): Desired self._nested_verbs list position
+
+ Returns:
+ BxmlVerb: Desired BXML verb
+ """
+ return self._nested_verbs[position]
+
+ def _generate_xml(self) -> ET.Element:
+ """Generates an XML dom
+
+ Returns:
+ ET.Element: The XML dom for the verb and its nested verbs
+ """
+ root = ET.Element(self._tag)
+ if self._nested_verbs:
+ for verb in self._nested_verbs:
+ root.append(verb._to_etree_element())
+ dom = ET.ElementTree(root)
+ return dom
+
+ def add_verb(self, verb: Verb) -> None:
+ """Add a verb to the object's nested_verbs array
+
+ Args:
+ verb (BxmlVerb): BXML verb to nest within the parent. Becomes a child xml element.
+ """
+ self._nested_verbs.append(verb)
+
+ def to_bxml(self) -> str:
+ """Return the serialized BXML string
+
+ Returns:
+ str: Serialized BXML string
+ """
+ xml_document = self._generate_xml()
+ return ET.tostring(xml_document._root, encoding='UTF-8', method='xml', xml_declaration=True).decode("utf8")
diff --git a/bandwidth/models/bxml/terminal_verb.py b/bandwidth/models/bxml/terminal_verb.py
new file mode 100644
index 00000000..41d689d5
--- /dev/null
+++ b/bandwidth/models/bxml/terminal_verb.py
@@ -0,0 +1,33 @@
+"""
+terminal_verb.py
+
+Defines the terminal_verb class BXML verbs that cant have nested_verbs
+
+@copyright Bandwidth INC
+"""
+from .verb import Verb
+
+
+class TerminalVerb(Verb):
+ """Base class for BXML verbs
+ """
+
+ def __init__(self, tag: str, content: str = None):
+ """Initialize the verb model
+
+ Args:
+ tag (str): Name of the XML element
+ content (str, optional): XML element content. Defaults to None.
+ """
+ super().__init__(tag=tag, content=content, nested_verbs=None)
+
+ def add_verb(self, verb: Verb):
+ """Adding verbs is not allowed for this class
+
+ Args:
+ verb (Verb): BXML verb
+
+ Raises:
+ AttributeError: This method is not allowed for this verb
+ """
+ raise AttributeError('Adding verbs is not supported by this verb')
diff --git a/bandwidth/models/bxml/verb.py b/bandwidth/models/bxml/verb.py
new file mode 100644
index 00000000..532881c4
--- /dev/null
+++ b/bandwidth/models/bxml/verb.py
@@ -0,0 +1,111 @@
+"""
+verb.py
+
+Defines the base verb class for all BXML verbs
+
+@copyright Bandwidth INC
+"""
+from __future__ import annotations
+from typing import Union
+import xml.etree.ElementTree as ET
+
+
+class Verb:
+ """Base class for BXML verbs
+ """
+
+ def __init__(self, tag: str, content: str = None, nested_verbs: list[Verb] = None):
+ """Initialize the verb model
+
+ Args:
+ tag (str): Name of the XML element
+ content (str, optional): XML element content. Defaults to None.
+ nested_verbs (list[BxmlVerb], optional): XML element children. Defaults to None.
+ """
+ self._tag = tag
+ self._content = content
+ self._nested_verbs = nested_verbs
+ if not self._nested_verbs:
+ self._nested_verbs = []
+
+ @property
+ def _attributes(self) -> Union[None, dict]:
+ return None
+
+ def __len__(self) -> int:
+ """Override default len method. Returns length of _nested_verbs array
+
+ Returns:
+ int: Length of self._nested_verbs
+ """
+ return len(self._nested_verbs)
+
+ def __getitem__(self, position) -> Verb:
+ """Override default getitem method. Makes the object iterable.
+
+ Args:
+ position (int): Desired self._nested_verbs list position
+
+ Returns:
+ BxmlVerb: Desired BXML verb
+ """
+ return self._nested_verbs[position]
+
+ def _set_attributes(self, root: ET.Element):
+ """Set XML attributes on an Element
+
+ Args:
+ root (ET.Element): XML Element to add attributes to
+ """
+ if self._attributes is not None:
+ for key, value in self._attributes.items():
+ if value is not None:
+ root.set(key.strip("_"), value)
+
+ def _to_etree_element(self) -> ET.Element:
+ """Generate an ET.Element object from a Verb Object
+
+ Returns:
+ ET.Element: ET.Element representation of Verb
+ """
+ root = ET.Element(self._tag)
+ if self._content:
+ root.text = self._content
+ self._set_attributes(root)
+ if self._nested_verbs:
+ for verb in self._nested_verbs:
+ root.append(verb._to_etree_element())
+ return root
+
+ def _generate_xml(self) -> ET.ElementTree:
+ """Generates an XML dom
+
+ Returns:
+ ET.Element: The XML dom for the verb and its nested verbs
+ """
+ root = ET.Element(self._tag)
+ if self._content:
+ root.text = self._content
+ self._set_attributes(root)
+ if self._nested_verbs:
+ for verb in self._nested_verbs:
+ root.append(verb._to_etree_element())
+ dom = ET.ElementTree(root)
+ return dom
+
+ def add_verb(self, verb) -> None:
+ """Add a verb to the object's nested_verbs array
+
+ Args:
+ verb (BxmlVerb): BXML verb to nest within the parent. Becomes a child xml element.
+ """
+ self._nested_verbs.append(verb)
+
+ def to_bxml(self) -> str:
+ """Return the serialized BXML string
+
+ Returns:
+ str: Serialized BXML string
+ """
+ xml_document = self._generate_xml()
+ return ET.tostring(xml_document._root).decode('utf8')
diff --git a/bandwidth/voice/bxml/verbs/__init__.py b/bandwidth/models/bxml/verbs/__init__.py
similarity index 97%
rename from bandwidth/voice/bxml/verbs/__init__.py
rename to bandwidth/models/bxml/verbs/__init__.py
index a6cb0dde..fc6ce38b 100644
--- a/bandwidth/voice/bxml/verbs/__init__.py
+++ b/bandwidth/models/bxml/verbs/__init__.py
@@ -1,28 +1,27 @@
+from .bridge import Bridge
+from .conference import Conference
+from .custom_param import CustomParam
from .hangup import Hangup
-from .send_dtmf import SendDtmf
from .gather import Gather
from .pause import Pause
+from .pause_recording import PauseRecording
from .phone_number import PhoneNumber
-from .redirect import Redirect
-from .speak_sentence import SpeakSentence
-from .transfer import Transfer
from .play_audio import PlayAudio
-from .forward import Forward
from .record import Record
-from .pause_recording import PauseRecording
+from .redirect import Redirect
from .resume_recording import ResumeRecording
-from .stop_recording import StopRecording
-from .start_recording import StartRecording
-from .conference import Conference
-from .bridge import Bridge
from .ring import Ring
-from .stop_gather import StopGather
-from .start_gather import StartGather
-from .tag import Tag
+from .send_dtmf import SendDtmf
from .sip_uri import SipUri
+from .speak_sentence import SpeakSentence
+from .start_gather import StartGather
+from .start_recording import StartRecording
from .start_stream import StartStream
-from .stream_param import StreamParam
-from .stop_stream import StopStream
from .start_transcription import StartTranscription
+from .stop_gather import StopGather
+from .stop_stream import StopStream
+from .stop_recording import StopRecording
from .stop_transcription import StopTranscription
-from .custom_param import CustomParam
+from .stream_param import StreamParam
+from .tag import Tag
+from .transfer import Transfer
diff --git a/bandwidth/models/bxml/verbs/bridge.py b/bandwidth/models/bxml/verbs/bridge.py
new file mode 100644
index 00000000..1c3b52c0
--- /dev/null
+++ b/bandwidth/models/bxml/verbs/bridge.py
@@ -0,0 +1,83 @@
+"""
+bridge.py
+
+Bandwidth's Bridge BXML verb
+
+@copyright Bandwidth INC
+"""
+from ..terminal_verb import TerminalVerb
+
+
+class Bridge(TerminalVerb):
+
+ def __init__(
+ self, target_call: str, bridge_complete_url: str=None,
+ bridge_complete_method: str=None,
+ bridge_complete_fallback_url: str=None,
+ bridge_complete_fallback_method: str=None,
+ bridge_target_complete_url: str=None,
+ bridge_target_complete_method: str=None,
+ bridge_target_complete_fallback_url: str=None,
+ bridge_target_complete_fallback_method: str=None,
+ username: str=None, password: str=None,
+ fallback_username: str=None, fallback_password: str=None,
+ tag: str=None
+ ):
+ """Initialize a verb
+
+ Args:
+ target_call (str): String containing the callId of the call to be bridged.
+ bridge_complete_url (str, optional): 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 (str, optional): The HTTP method to use for the request to bridgeCompleteUrl. GET or POST. Default value is POST.
+ bridge_complete_fallback_url (str, optional): 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 (str, optional): The HTTP method to use to deliver the Bridge Complete webhook to bridgeCompleteFallbackUrl. GET or POST. Default value is POST.
+ bridge_target_complete_url (str, optional):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 (str, optional): The HTTP method to use for the request to bridgeTargetCompleteUrl. GET or POST. Default value is POST.
+ bridge_target_complete_fallback_url (str, optional): 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 (str, optional): The HTTP method to use to deliver the Bridge Target Complete webhook to bridgeTargetCompleteFallbackUrl. GET or POST. Default value is POST.
+ username (str, optional): The username to send in the HTTP request to bridgeCompleteUrl and to bridgeTargetCompleteUrl. Defaults to None.
+ password (str, optional): The password to send in the HTTP request to bridgeCompleteUrl and to bridgeTargetCompleteUrl. Defaults to None.
+ fallback_username (str, optional): The username to send in the HTTP request to bridgeCompleteFallbackUrl and to bridgeTargetCompleteFallbackUrl. Defaults to None.
+ fallback_password (str, optional): The password to send in the HTTP request to bridgeCompleteFallbackUrl and to bridgeTargetCompleteFallbackUrl. Defaults to None.
+ tag (str, optional): 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.
+ """
+ self.target_call = target_call
+ self.bridge_complete_url = bridge_complete_url
+ self.bridge_complete_method = bridge_complete_method
+ self.bridge_complete_fallback_url = bridge_complete_fallback_url
+ self.bridge_complete_fallback_method = bridge_complete_fallback_method
+ self.bridge_target_complete_url = bridge_target_complete_url
+ self.bridge_target_complete_method = bridge_target_complete_method
+ self.bridge_target_complete_fallback_url = bridge_target_complete_fallback_url
+ self.bridge_target_complete_fallback_method = bridge_target_complete_fallback_method
+ self.username = username
+ self.password = password
+ self.fallback_username = fallback_username
+ self.fallback_password = fallback_password
+ self.tag = tag
+ super().__init__(
+ tag="Bridge",
+ content=self.target_call,
+ )
+
+ @property
+ def _attributes(self):
+ return {
+ "bridgeCompleteUrl": self.bridge_complete_url,
+ "bridgeCompleteMethod": self.bridge_complete_method,
+ "bridgeCompleteFallbackUrl": self.bridge_complete_fallback_url,
+ "bridgeCompleteFallbackMethod": self.bridge_complete_fallback_method,
+ "bridgeTargetCompleteUrl": self.bridge_target_complete_url,
+ "bridgeTargetCompleteMethod": self.bridge_target_complete_method,
+ "bridgeTargetCompleteFallback_url": self.bridge_target_complete_fallback_url,
+ "bridgeTargetCompleteFallbackMethod": self.bridge_target_complete_fallback_method,
+ "username": self.username,
+ "password": self.password,
+ "fallbackUsername": self.fallback_username,
+ "fallbackPassword": self.fallback_password,
+ "tag": self.tag
+ }
diff --git a/bandwidth/models/bxml/verbs/conference.py b/bandwidth/models/bxml/verbs/conference.py
new file mode 100644
index 00000000..9fbac54c
--- /dev/null
+++ b/bandwidth/models/bxml/verbs/conference.py
@@ -0,0 +1,88 @@
+"""
+conference.py
+
+Bandwidth's Conference BXML verb
+
+@copyright Bandwidth INC
+"""
+from ..terminal_verb import TerminalVerb
+
+
+class Conference(TerminalVerb):
+
+ def __init__(
+ self, name: str, mute: str=None,
+ hold: str=None, call_ids_to_coach: str=None,
+ conference_event_url: str=None, conference_event_method: str=None,
+ conference_event_fallback_url: str=None, conference_event_fallback_method: str=None,
+ username: str=None, password: str=None,
+ fallback_username: str=None, fallback_password: str=None,
+ tag: str=None, callback_timeout: str=None,
+ ):
+ """Initialize a verb
+
+ Args:
+ name (str): The name of the conference. Can contain up to 100 characters of letters, numbers, and the symbols -, _, and .
+ mute (str, optional): 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 (str, optional): 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 (str, optional): 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 (str, optional): 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 (str, optional): The HTTP method to use for the request to conferenceEventUrl. GET or POST. Default value is POST.
+ conference_event_fallback_url (str, optional): 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 (str, optional): The HTTP method to use to deliver the conference webhooks to conferenceEventFallbackUrl. GET or POST. Default value is POST.
+ username (str, optional):The username to send in the HTTP request to conferenceEventUrl.
+ password (str, optional): The password to send in the HTTP request to conferenceEventUrl.
+ fallback_username (str, optional): The username to send in the HTTP request to conferenceEventFallbackUrl.
+ fallback_password (str, optional): The password to send in the HTTP request to conferenceEventFallbackUrl.
+ tag (str, optional): 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 (str, optional): 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.
+
+ Nested Verbs:
+ PlayAudio: (optional)
+ SpeakSentence: (optional)
+ StartRecording: (optional)
+ StopRecording: (optional)
+ PauseRecording: (optional)
+ ResumeRecording: (optional)
+ """
+ self.name = name
+ self.mute = mute
+ self.hold = hold
+ self.call_ids_to_coach = call_ids_to_coach
+ self.conference_event_url = conference_event_url
+ self.conference_event_method = conference_event_method
+ self.conference_event_fallback_url = conference_event_fallback_url
+ self.conference_event_fallback_method = conference_event_fallback_method
+ self.username = username
+ self.password = password
+ self.fallback_username = fallback_username
+ self.fallback_password = fallback_password
+ self.tag = tag
+ self.callback_timeout = callback_timeout
+ super().__init__(
+ tag="Conference"
+ )
+
+ @property
+ def _attributes(self):
+ return {
+ "name": self.name,
+ "mute": self.mute,
+ "hold": self.hold,
+ "callIdsToCoach": self.call_ids_to_coach,
+ "conferenceEventUrl": self.conference_event_url,
+ "conferenceEventMethod": self.conference_event_method,
+ "conferenceEventFallbackUrl": self.conference_event_fallback_url,
+ "conferenceEventFallbackMethod": self.conference_event_fallback_method,
+ "username": self.username,
+ "password": self.password,
+ "fallbackUsername": self.fallback_username,
+ "fallbackPassword": self.fallback_password,
+ "tag": self.tag,
+ "callbackTimeout": self.callback_timeout,
+ }
diff --git a/bandwidth/models/bxml/verbs/custom_param.py b/bandwidth/models/bxml/verbs/custom_param.py
new file mode 100644
index 00000000..b50c464f
--- /dev/null
+++ b/bandwidth/models/bxml/verbs/custom_param.py
@@ -0,0 +1,30 @@
+"""
+custom_param.py
+
+Bandwidth's Custom Param BXML verb
+
+@copyright Bandwidth INC
+"""
+from ..terminal_verb import TerminalVerb
+
+
+class CustomParam(TerminalVerb):
+ def __init__(self, name: str = None, value: str = None):
+ """
+ Initialize a verb
+ :param name: The name of this parameter, up to 256 characters.
+ :param value: The value of this parameter, up to 2048 characters.
+ """
+ self.name = name
+ self.value = value
+
+ super().__init__(
+ tag="CustomParam",
+ )
+
+ @property
+ def _attributes(self):
+ return {
+ "name": self.name,
+ "value": self.value,
+ }
diff --git a/bandwidth/models/bxml/verbs/forward.py b/bandwidth/models/bxml/verbs/forward.py
new file mode 100644
index 00000000..fb624b85
--- /dev/null
+++ b/bandwidth/models/bxml/verbs/forward.py
@@ -0,0 +1,67 @@
+"""
+forward.py
+
+Bandwidth's Forward BXML verb
+
+@copyright Bandwidth INC
+"""
+from ..terminal_verb import TerminalVerb
+
+
+class Forward(TerminalVerb):
+
+ def __init__(
+ self, to: str=None, _from: str=None,
+ call_timeout: str=None, diversion_treatment: str=None,
+ diversion_reason: str=None, uui: str=None
+ ):
+ """Initialize a verb
+
+ Args:
+ to (str): The phone number destination of the call.
+ _from (str, optional): The phone number that the recipient will receive the call from.
+ call_timeout (str, optional): The number of seconds to wait before timing out the call.
+ diversion_treatment (str, optional): 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.
+
+ Defaults to none. 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 (str, optional): 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 is unknown.
+ Defaults to None.
+ uui (str, optional): 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.
+ """
+ self.to = to
+ self._from = _from
+ self.call_timeout = call_timeout
+ self.diversion_treatment = diversion_treatment
+ self.diversion_reason = diversion_reason
+ self.uui = uui
+
+ super().__init__(tag="Forward")
+
+ @property
+ def _attributes(self):
+ return {
+ "to": self.to,
+ "_from": self._from,
+ "callTimeout": self.call_timeout,
+ "diversionTreatment": self.diversion_treatment,
+ "diversionReason": self.diversion_reason,
+ "uui": self.uui,
+ }
diff --git a/bandwidth/models/bxml/verbs/gather.py b/bandwidth/models/bxml/verbs/gather.py
new file mode 100644
index 00000000..740e5e5b
--- /dev/null
+++ b/bandwidth/models/bxml/verbs/gather.py
@@ -0,0 +1,87 @@
+"""
+gather.py
+
+Bandwidth's Gather BXML verb
+
+@copyright Bandwidth INC
+"""
+from typing import Union, List
+from ..verb import Verb
+from .play_audio import PlayAudio
+from .speak_sentence import SpeakSentence
+
+
+class Gather(Verb):
+
+ def __init__(
+ self, audio_verbs: List[Union[PlayAudio, SpeakSentence]] = [],
+ gather_url: str=None, gather_method: str=None,
+ gather_fallback_url: str=None, gather_fallback_method: str=None,
+ username: str=None, password: str=None,
+ fallback_username: str=None, fallback_password: str=None,
+ tag: str=None, terminating_digits: str=None,
+ max_digits: int=None, inter_digit_timeout: int=None,
+ first_digit_timeout: int=None, repeat_count: int=None
+ ):
+ """Initialize a verb
+
+ Args:
+ gather_url (str, optional): URL to send Gather event to and request new BXML. May be a relative URL.
+ gather_method (str, optional): The HTTP method to use for the request to gather_url. GET or POST. Default value is POST.
+ gather_fallback_url (str, optional): 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 (str, optional): The HTTP method to use to deliver the Gather event callback to gather_fallback_url. GET or POST. Default value is POST.
+ username (str, optional): The username to send in the HTTP request to gather_url.
+ password (str, optional): The password to send in the HTTP request to gather_url.
+ fallback_username (str, optional): The username to send in the HTTP request to gather_fallback_url.
+ fallback_password (str, optional): The password to send in the HTTP request to gather_fallback_url.
+ tag (str, optional): 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 (str, optional): When any of these digits are pressed, it will terminate the Gather. Default value is "", which disables this feature.
+ max_digits (int, optional): Max number of digits to collect. Default value is 50. Range: decimal values between 1 - 50.
+ inter_digit_timeout (int, optional): 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 (int, optional): 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 (int, optional): 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.
+
+ Nested Verbs:
+ PlayAudio: (optional) Using the PlayAudio inside the Gather verb will play the media until a digit is received.
+ SpeakSentence: (optional) Using the SpeakSentence inside the Gather verb will speak the text until a digit is received.
+ """
+ self.gather_url = gather_url
+ self.gather_method = gather_method
+ self.gather_fallback_url = gather_fallback_url
+ self.gather_fallback_method = gather_fallback_method
+ self.username = username
+ self.password = password
+ self.fallback_username = fallback_username
+ self.fallback_password = fallback_password
+ self.tag = tag
+ self.terminating_digits = terminating_digits
+ self.max_digits = max_digits
+ self.inter_digit_timeout = inter_digit_timeout
+ self.first_digit_timeout = first_digit_timeout
+ self.repeat_count = repeat_count
+ self.audio_verbs = audio_verbs
+ super().__init__(
+ tag="Gather",
+ nested_verbs=self.audio_verbs)
+
+ @property
+ def _attributes(self):
+ return {
+ "gatherUrl": self.gather_url,
+ "gatherMethod": self.gather_method,
+ "gatherFallbackUrl": self.gather_fallback_url,
+ "gatherFallbackMethod": self.gather_fallback_method,
+ "username": self.username,
+ "password": self.password,
+ "fallbackUsername": self.fallback_username,
+ "fallbackPassword": self.fallback_password,
+ "tag": self.tag,
+ "terminatingDigits": self.terminating_digits,
+ "maxDigits": str(self.max_digits),
+ "interDigitTimeout": str(self.inter_digit_timeout),
+ "firstDigitTimeout": str(self.first_digit_timeout),
+ "repeatCount": str(self.repeat_count),
+ }
diff --git a/bandwidth/models/bxml/verbs/hangup.py b/bandwidth/models/bxml/verbs/hangup.py
new file mode 100644
index 00000000..f6603efa
--- /dev/null
+++ b/bandwidth/models/bxml/verbs/hangup.py
@@ -0,0 +1,19 @@
+"""
+hangup.py
+
+Bandwidth's Hangup BXML verb
+
+@copyright Bandwidth INC
+"""
+from ..terminal_verb import TerminalVerb
+
+
+class Hangup(TerminalVerb):
+
+ def __init__(self):
+ """Initialize a verb
+
+ Args:
+ None
+ """
+ super().__init__(tag="Hangup")
diff --git a/bandwidth/models/bxml/verbs/pause.py b/bandwidth/models/bxml/verbs/pause.py
new file mode 100644
index 00000000..67e82f68
--- /dev/null
+++ b/bandwidth/models/bxml/verbs/pause.py
@@ -0,0 +1,25 @@
+"""
+pause.py
+
+Bandwidth's Pause BXML verb
+
+@copyright Bandwidth INC
+"""
+from ..terminal_verb import TerminalVerb
+
+
+class Pause(TerminalVerb):
+ def __init__(self, duration:int=1):
+ """Initialize a verb
+ Args:
+ duration (str, optional): The time in seconds to pause. Default value is 1.
+ """
+ self.duration = str(duration)
+
+ super().__init__(tag="Pause")
+
+ @property
+ def _attributes(self):
+ return {
+ "duration": self.duration
+ }
diff --git a/bandwidth/models/bxml/verbs/pause_recording.py b/bandwidth/models/bxml/verbs/pause_recording.py
new file mode 100644
index 00000000..b7a7de5e
--- /dev/null
+++ b/bandwidth/models/bxml/verbs/pause_recording.py
@@ -0,0 +1,16 @@
+"""
+pause_recording.py
+
+Bandwidth's PauseRecording BXML verb
+
+@copyright Bandwidth INC
+"""
+from ..terminal_verb import TerminalVerb
+
+
+class PauseRecording(TerminalVerb):
+
+ def __init__(self):
+ """Initialize a verb
+ """
+ super().__init__(tag="PauseRecording")
diff --git a/bandwidth/models/bxml/verbs/phone_number.py b/bandwidth/models/bxml/verbs/phone_number.py
new file mode 100644
index 00000000..381bebe5
--- /dev/null
+++ b/bandwidth/models/bxml/verbs/phone_number.py
@@ -0,0 +1,66 @@
+"""
+phone_number.py
+
+Bandwidth's PhoneNumber BXML verb
+
+@copyright Bandwidth INC
+"""
+from ..terminal_verb import TerminalVerb
+
+
+class PhoneNumber(TerminalVerb):
+
+ def __init__(
+ self, number: str, transfer_answer_url: str=None, transfer_answer_method: str=None,
+ transfer_answer_fallback_url: str=None, transfer_answer_fallback_method: str=None,
+ transfer_disconnect_url: str=None, transfer_disconnect_method: str=None, username: str=None,
+ password: str=None, fallback_username: str=None, fallback_password: str=None, tag: str=None
+ ):
+ """Initialize a verb
+
+ Args:
+ phone_number (str): A phone number to transfer the call to. Value must be in E.164 format (e.g. +15555555555).
+ transfer_answer_url (str, optional): 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 (str, optional): The HTTP method to use for the request to transferAnswerUrl. GET or POST. Default value is POST. Defaults to None.
+ transfer_answer_fallback_url (str, optional): 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 (str, optional): 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 (str, optional): 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 (str, optional): 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 (str, optional): The username to send in the HTTP request to transferAnswerUrl and transferDisconnectUrl. Defaults to Defaults to None.
+ password (str, optional): The password to send in the HTTP request to transferAnswerUrl and transferDisconnectUrl. Defaults to Defaults to None.
+ fallback_username (str, optional): The username to send in the HTTP request to transferAnswerFallbackUrl. Defaults to None.
+ fallback_password (str, optional): The password to send in the HTTP request to transferAnswerFallbackUrl. Defaults to None.
+ tag (str, optional): 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.
+ """
+ self.number = number
+ self.transfer_answer_url = transfer_answer_url
+ self.transfer_answer_method = transfer_answer_method
+ self.transfer_answer_fallback_url = transfer_answer_fallback_url
+ self.transfer_answer_fallback_method = transfer_answer_fallback_method
+ self.transfer_disconnect_url = transfer_disconnect_url
+ self.transfer_disconnect_method = transfer_disconnect_method
+ self.username = username
+ self.password = password
+ self.fallback_username = fallback_username
+ self.fallback_password = fallback_password
+ self.tag = tag
+ super().__init__(
+ tag="PhoneNumber",
+ content=self.number
+ )
+
+ @property
+ def _attributes(self):
+ return {
+ "transferAnswerUrl": self.transfer_answer_url,
+ "transferAnswerMethod": self.transfer_answer_method,
+ "transferAnswerFallbackUrl": self.transfer_answer_fallback_url,
+ "transferAnswerFallbackMethod": self.transfer_answer_fallback_method,
+ "transferDisconnectUrl": self.transfer_disconnect_url,
+ "transferDisconnectMethod": self.transfer_disconnect_method,
+ "username": self.username,
+ "password": self.password,
+ "fallbackUsername": self.fallback_username,
+ "fallbackPassword": self.fallback_password,
+ "tag": self.tag
+ }
diff --git a/bandwidth/models/bxml/verbs/play_audio.py b/bandwidth/models/bxml/verbs/play_audio.py
new file mode 100644
index 00000000..727d1256
--- /dev/null
+++ b/bandwidth/models/bxml/verbs/play_audio.py
@@ -0,0 +1,37 @@
+"""
+play_audio.py
+
+Bandwidth's PlayAudio BXML verb
+
+@copyright Bandwidth INC
+"""
+from ..terminal_verb import TerminalVerb
+
+
+class PlayAudio(TerminalVerb):
+
+ def __init__(
+ self, audio_uri: str,
+ username: str=None, password: str=None
+ ):
+ """Initialize a verb
+
+ Args:
+ audio_uri (str): The URL of the audio file to play. May be a relative URL.
+ username (str, optional): The username to send in the HTTP request to audio_uri.
+ password (str, optional): The password to send in the HTTP request to audio_uri.
+ """
+ self.audio_uri = audio_uri
+ self.username = username
+ self.password = password
+ super().__init__(
+ tag="PlayAudio",
+ content=self.audio_uri,
+ )
+
+ @property
+ def _attributes(self):
+ return {
+ "username": self.username,
+ "password": self.password,
+ }
diff --git a/bandwidth/models/bxml/verbs/record.py b/bandwidth/models/bxml/verbs/record.py
new file mode 100644
index 00000000..6f5f6052
--- /dev/null
+++ b/bandwidth/models/bxml/verbs/record.py
@@ -0,0 +1,91 @@
+"""
+record.py
+
+Bandwidth's Record BXML verb
+
+@copyright Bandwidth INC
+"""
+from ..terminal_verb import TerminalVerb
+
+
+class Record(TerminalVerb):
+
+ def __init__(
+ self, record_complete_url: str=None,
+ record_complete_method: str=None,
+ record_complete_fallback_url: str=None,
+ record_complete_fallback_method: str=None,
+ recording_available_url: str=None,
+ recording_available_method: str=None,
+ transcribe: str=None, transcription_available_url: str=None,
+ transcription_available_method: str=None, username: str=None,
+ password: str=None, fallback_username: str=None,
+ fallback_password: str=None, tag: str=None,
+ terminating_digits: str=None, max_duration: int=None,
+ silence_timeout: str=None, file_format: str=None
+ ):
+ """Initialize a verb
+
+ Args:
+ record_complete_url (str, optional): 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 (str, optional): The HTTP method to use for the request to recordCompleteUrl. GET or POST. Default value is POST. Defaults to None.
+ record_complete_fallback_url (str, optional): 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 (str, optional): 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 (str, optional): 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 (str, optional): The HTTP method to use for the request to recordingAvailableUrl. GET or POST. Default value is POST. Defaults to None.
+ transcribe (str, optional): 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 (str, optional): 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 (str, optional): The HTTP method to use for the request to transcriptionAvailableUrl. GET or POST. Default value is POST. Defaults to None.
+ username (str, optional): 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 (str, optional): 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 (str, optional): 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 (str, optional): 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 (str, optional): 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 (str, optional): When pressed, this digit will terminate the recording. Default value is “#”. This feature can be disabled with "". Defaults to None.
+ max_duration (int, optional): Maximum length of recording (in seconds). Max 10800 (3 hours). Default value is 60. Defaults to None.
+ silence_timeout (str, optional): 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 (str, optional): The audio format that the recording will be saved as: mp3 or wav. Default value is wav. Defaults to None.
+ """
+ self.record_complete_url = record_complete_url
+ self.record_complete_method = record_complete_method
+ self.record_complete_fallback_url = record_complete_fallback_url
+ self.record_complete_fallback_method = record_complete_fallback_method
+ self.recording_available_url = recording_available_url
+ self.recording_available_method = recording_available_method
+ self.transcribe = transcribe
+ self.transcription_available_url = transcription_available_url
+ self.transcription_available_method = transcription_available_method
+ self.username = username
+ self.password = password
+ self.fallback_username = fallback_username
+ self.fallback_password = fallback_password
+ self.tag = tag
+ self.terminating_digits = terminating_digits
+ self.max_duration = max_duration
+ self.silence_timeout = silence_timeout
+ self.file_format = file_format
+
+ super().__init__(tag="Record", content=None)
+
+ @property
+ def _attributes(self):
+ return {
+ "recordCompleteUrl": self.record_complete_url,
+ "recordCompleteMethod": self.record_complete_method,
+ "recordCompleteFallback_url": self.record_complete_fallback_url,
+ "recordCompleteFallback_method": self.record_complete_fallback_method,
+ "recordingAvailableUrl": self.recording_available_url,
+ "recordingAvailableMethod": self.recording_available_method,
+ "transcribe": self.transcribe,
+ "transcriptionAvailableUrl": self.transcription_available_url,
+ "transcriptionAvailableMethod": self.transcription_available_method,
+ "username": self.username,
+ "password": self.password,
+ "fallbackUsername": self.fallback_username,
+ "fallbackPassword": self.fallback_password,
+ "tag": self.tag,
+ "terminatingDigits": self.terminating_digits,
+ "maxDuration": str(self.max_duration),
+ "silenceTimeout": self.silence_timeout,
+ "fileFormat": self.file_format
+ }
diff --git a/bandwidth/models/bxml/verbs/redirect.py b/bandwidth/models/bxml/verbs/redirect.py
new file mode 100644
index 00000000..1b49a742
--- /dev/null
+++ b/bandwidth/models/bxml/verbs/redirect.py
@@ -0,0 +1,56 @@
+"""
+redirect.py
+
+Bandwidth's Redirect BXML verb
+
+@copyright Bandwidth INC
+"""
+from ..terminal_verb import TerminalVerb
+
+
+class Redirect(TerminalVerb):
+
+ def __init__(
+ self, redirect_url: str, redirect_method: str = None,
+ redirect_fallback_url: str = None,
+ redirect_fallback_method: str = None, username: str = None,
+ password: str = None, fallback_username: str = None,
+ fallback_password: str = None, tag: str = None
+ ):
+ """Initialize a verb
+
+ Args:
+ redirect_url (str): 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 (str, optional): The HTTP method to use for the request to redirectUrl. GET or POST. Defaults to None.
+ redirect_fallback_url (str, optional): 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 (str, optional): The HTTP method to use to deliver the Redirect callback to redirectFallbackUrl. GET or POST. Default value is POST. Defaults to None.
+ username (str, optional): The username to send in the HTTP request to redirectUrl. Defaults to None.
+ password (str, optional): The password to send in the HTTP request to redirectUrl. Defaults to None.
+ fallback_username (str, optional): The username to send in the HTTP request to redirectFallbackUrl. Defaults to None.
+ fallback_password (str, optional): The password to send in the HTTP request to redirectFallbackUrl. Defaults to None.
+ tag (str, optional): 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.
+ """
+ self.redirect_url = redirect_url
+ self.redirect_method = redirect_method
+ self.redirect_fallback_url = redirect_fallback_url
+ self.redirect_fallback_method = redirect_fallback_method
+ self.username = username
+ self.password = password
+ self.fallback_username = fallback_username
+ self.fallback_password = fallback_password
+ self.tag = tag
+ super().__init__(tag="Redirect")
+
+ @property
+ def _attributes(self):
+ return {
+ "redirectUrl": self.redirect_url,
+ "redirectMethod": self.redirect_method,
+ "redirectFallbackUrl": self.redirect_fallback_url,
+ "redirectFallbackMethod": self.redirect_fallback_method,
+ "username": self.username,
+ "password": self.password,
+ "fallbackUsername": self.fallback_username,
+ "fallbackPassword": self.fallback_password,
+ "tag": self.tag,
+ }
diff --git a/bandwidth/models/bxml/verbs/resume_recording.py b/bandwidth/models/bxml/verbs/resume_recording.py
new file mode 100644
index 00000000..45fdf166
--- /dev/null
+++ b/bandwidth/models/bxml/verbs/resume_recording.py
@@ -0,0 +1,21 @@
+"""
+record.py
+
+Bandwidth's ResumeRecording BXML verb
+
+@copyright Bandwidth INC
+"""
+from ..terminal_verb import TerminalVerb
+
+
+class ResumeRecording(TerminalVerb):
+
+ def __init__(
+ self
+ ):
+ """Initialize a verb
+
+ Args: There are no args or text content for ResumeRecording
+ """
+
+ super().__init__(tag="ResumeRecording", content=None)
diff --git a/bandwidth/models/bxml/verbs/ring.py b/bandwidth/models/bxml/verbs/ring.py
new file mode 100644
index 00000000..7bdafbc6
--- /dev/null
+++ b/bandwidth/models/bxml/verbs/ring.py
@@ -0,0 +1,32 @@
+"""
+ring.py
+
+Bandwidth's Ring BXML verb
+
+@copyright Bandwidth INC
+"""
+from ..terminal_verb import TerminalVerb
+
+
+class Ring(TerminalVerb):
+
+ def __init__(
+ self, duration: int=None,
+ answer_call: bool=None,
+ ):
+ """Initialize a verb
+
+ Args:
+ duration (int, optional): How many seconds to play ringing on the call. Default value is 5. Range: decimal values between 0.1 - 86400.
+ answer_call (bool, optional): A boolean indicating whether or not to answer the call when Ring is executed on an unanswered incoming call. Default value is 'true'.
+ """
+ self.duration = duration
+ self.answer_call = answer_call
+ super().__init__(tag="Ring")
+
+ @property
+ def _attributes(self):
+ return {
+ "duration": str(self.duration),
+ "answerCall": str(self.answer_call),
+ }
diff --git a/bandwidth/models/bxml/verbs/send_dtmf.py b/bandwidth/models/bxml/verbs/send_dtmf.py
new file mode 100644
index 00000000..13050977
--- /dev/null
+++ b/bandwidth/models/bxml/verbs/send_dtmf.py
@@ -0,0 +1,38 @@
+"""
+send_dtmf.py
+
+Bandwidth's SendDtmf BXML verb
+
+@copyright Bandwidth INC
+"""
+from ..terminal_verb import TerminalVerb
+
+
+class SendDtmf(TerminalVerb):
+
+ def __init__(
+ self, digits: str,
+ tone_duration: int=None,
+ tone_interval: int=None,
+ ):
+ """Initialize a verb
+
+ Args:
+ digits (str): 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.
+ tone_duration (int, optional): The length (in milliseconds) of each DTMF tone. Default value is 200. Range: decimal values between 50 - 5000.
+ tone_interval (int, optional): The duration of silence (in milliseconds) following each DTMF tone. Default value is 400. Range: decimal values between 50 - 5000.
+ """
+ self.digits = digits
+ self.tone_duration = tone_duration
+ self.tone_interval = tone_interval
+ super().__init__(
+ tag="SendDtmf",
+ content=self.digits
+ )
+
+ @property
+ def _attributes(self):
+ return {
+ "toneDuration": str(self.tone_duration),
+ "toneInterval": str(self.tone_interval)
+ }
diff --git a/bandwidth/models/bxml/verbs/sip_uri.py b/bandwidth/models/bxml/verbs/sip_uri.py
new file mode 100644
index 00000000..16452248
--- /dev/null
+++ b/bandwidth/models/bxml/verbs/sip_uri.py
@@ -0,0 +1,69 @@
+"""
+sip_uri.py
+
+Bandwidth's SipUri BXML verb
+
+@copyright Bandwidth INC
+"""
+from ..terminal_verb import TerminalVerb
+
+
+class SipUri(TerminalVerb):
+
+ def __init__(
+ self, uri: str, uui: str=None, transfer_answer_url: str=None, transfer_answer_method: str=None,
+ transfer_answer_fallback_url: str=None, transfer_answer_fallback_method: str=None,
+ transfer_disconnect_url: str=None, transfer_disconnect_method: str=None, username: str=None,
+ password: str=None, fallback_username: str=None, fallback_password: str=None, tag: str=None
+ ):
+ """Initialize a verb
+
+ Args:
+ uri (str): A SIP URI to transfer the call to (e.g. sip:user@server.com)
+ uui (str, optional): he 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 (str, optional): 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 (str, optional): The HTTP method to use for the request to transferAnswerUrl. GET or POST. Default value is POST. Defaults to None.
+ transfer_answer_fallback_url (str, optional): 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 (str, optional): 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 (str, optional): 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 (str, optional): 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 (str, optional): The username to send in the HTTP request to transferAnswerUrl and transferDisconnectUrl. Defaults to Defaults to None.
+ password (str, optional): The password to send in the HTTP request to transferAnswerUrl and transferDisconnectUrl. Defaults to Defaults to None.
+ fallback_username (str, optional): The username to send in the HTTP request to transferAnswerFallbackUrl. Defaults to None.
+ fallback_password (str, optional): The password to send in the HTTP request to transferAnswerFallbackUrl. Defaults to None.
+ tag (str, optional): 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.
+ """
+ self.uri = uri
+ self.uui = uui
+ self.transfer_answer_url = transfer_answer_url
+ self.transfer_answer_method = transfer_answer_method
+ self.transfer_answer_fallback_url = transfer_answer_fallback_url
+ self.transfer_answer_fallback_method = transfer_answer_fallback_method
+ self.transfer_disconnect_url = transfer_disconnect_url
+ self.transfer_disconnect_method = transfer_disconnect_method
+ self.username = username
+ self.password = password
+ self.fallback_username = fallback_username
+ self.fallback_password = fallback_password
+ self.tag = tag
+ super().__init__(
+ tag="SipUri",
+ content=self.uri,
+ )
+
+ @property
+ def _attributes(self):
+ return {
+ "uui": self.uui,
+ "transferAnswerUrl": self.transfer_answer_url,
+ "transferAnswerMethod": self.transfer_answer_method,
+ "transferAnswerFallbackUrl": self.transfer_answer_fallback_url,
+ "transferAnswerFallbackMethod": self.transfer_answer_fallback_method,
+ "transferDisconnectUrl": self.transfer_disconnect_url,
+ "transferDisconnectMethod": self.transfer_disconnect_method,
+ "username": self.username,
+ "password": self.password,
+ "fallbackUsername": self.fallback_username,
+ "fallbackPassword": self.fallback_password,
+ "tag": self.tag
+ }
diff --git a/bandwidth/models/bxml/verbs/speak_sentence.py b/bandwidth/models/bxml/verbs/speak_sentence.py
new file mode 100644
index 00000000..6fd05f44
--- /dev/null
+++ b/bandwidth/models/bxml/verbs/speak_sentence.py
@@ -0,0 +1,42 @@
+"""
+speak_sentence.py
+
+Bandwidth's SpeakSentence BXML verb
+
+@copyright Bandwidth INC
+"""
+from ..terminal_verb import TerminalVerb
+
+
+class SpeakSentence(TerminalVerb):
+
+ def __init__(
+ self, text: str, voice: str=None,
+ gender: str=None, locale: str=None
+ ):
+ """Initialize a verb
+
+ Args:
+ text (str): The text to speak. Cannot be blank. Can be a mixture of plain text and SSML tags.
+ You can find a list of supported SSML tags here: https://dev.bandwidth.com/docs/voice/bxml/speakSentence/#supported-ssml-tags
+ voice (str, optional): Selects the voice of the speaker. Consult the voice column in the below table for valid values.
+ 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 (str, optional): Selects the gender of the speaker. Valid values are "male" or "female". Default "female".
+ locale (str, optional): Selects the locale of the speaker. Consult the locale column in the below table for valid values. Default "en_US"
+ """
+ self.text = text
+ self.voice = voice
+ self.gender = gender
+ self.locale = locale
+ super().__init__(
+ tag="SpeakSentence",
+ content=self.text,
+ )
+
+ @property
+ def _attributes(self):
+ return {
+ "voice": self.voice,
+ "gender": self.gender,
+ "locale": self.locale,
+ }
diff --git a/bandwidth/models/bxml/verbs/start_gather.py b/bandwidth/models/bxml/verbs/start_gather.py
new file mode 100644
index 00000000..560e4c78
--- /dev/null
+++ b/bandwidth/models/bxml/verbs/start_gather.py
@@ -0,0 +1,43 @@
+"""
+start_gather.py
+
+Bandwidth's StartGather BXML verb
+
+@copyright Bandwidth INC
+"""
+from ..terminal_verb import TerminalVerb
+
+
+class StartGather(TerminalVerb):
+
+ def __init__(
+ self, dtmf_url: str, dtmf_method: str=None, username: str=None,
+ password: str=None, tag: str=None,
+ ):
+ """Initialize a verb
+
+ Args:
+ dtmf_url (str): URL to send the DTMF event to. May be a relative URL..
+ dtmf_method (str, optional): The HTTP method to use for the request to dtmfUrl. GET or POST. Default value is POST. Defaults to None.
+ username (str, optional): The username to send in the HTTP request to dtmfUrl. Defaults to None.
+ password (str, optional): The password to send in the HTTP request to dtmfUrl. Defaults to None.
+ tag (str, optional): 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.
+ """
+ self.dtmf_url = dtmf_url
+ self.dtmf_method = dtmf_method
+ self.username = username
+ self.password = password
+ self.tag = tag
+ super().__init__(
+ tag="StartGather"
+ )
+
+ @property
+ def _attributes(self):
+ return {
+ "dtmfUrl": self.dtmf_url,
+ "dtmfMethod": self.dtmf_method,
+ "username": self.username,
+ "password": self.password,
+ "tag": self.tag
+ }
diff --git a/bandwidth/models/bxml/verbs/start_recording.py b/bandwidth/models/bxml/verbs/start_recording.py
new file mode 100644
index 00000000..929d2fca
--- /dev/null
+++ b/bandwidth/models/bxml/verbs/start_recording.py
@@ -0,0 +1,61 @@
+"""
+start_recording.py
+
+Bandwidth's StartRecording BXML verb
+
+@copyright Bandwidth INC
+"""
+from ..terminal_verb import TerminalVerb
+
+
+class StartRecording(TerminalVerb):
+
+ def __init__(
+ self, recording_available_url: str = None,
+ recording_available_method: str = None,
+ transcribe: bool = None, transcription_available_url: str = None,
+ transcription_available_method: str = None, username: str=None,
+ password: str=None, tag: str=None,
+ file_format: str = None, multi_channel: bool = None
+ ):
+ """Initialize a verb
+
+ Args:
+ recording_available_url (str, optional): 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 (str, optional): The HTTP method to use for the request to recordingAvailableUrl. GET or POST. Default value is POST.
+ transcribe (str, optional): 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 (str, optional): 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 (str, optional): The HTTP method to use for the request to transcriptionAvailableUrl. GET or POST. Default value is POST. Defaults to None.
+ username (str, optional): 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 (str, optional): 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.
+ tag (str, optional): 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 (str, optional): The audio format that the recording will be saved as: mp3 or wav. Default value is wav. Defaults to None. max_duration (str, optional): Maximum length of recording (in seconds). Max 10800 (3 hours). Default value is 60. Defaults to None.
+ multi_channel (str, optional): 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.
+
+ """
+ self.recording_available_url = recording_available_url
+ self.recording_available_method = recording_available_method
+ self.transcribe = transcribe
+ self.transcription_available_url = transcription_available_url
+ self.transcription_available_method = transcription_available_method
+ self.username = username
+ self.password = password
+ self.tag = tag
+ self.file_format = file_format
+ self.multi_channel = multi_channel
+ super().__init__(tag="StartRecording")
+
+ @property
+ def _attributes(self):
+ return {
+ "recordingAvailableUrl": self.recording_available_url,
+ "recordingAvailableMethod": self.recording_available_method,
+ "transcribe": str(self.transcribe),
+ "transcriptionAvailableUrl": self.transcription_available_url,
+ "transcriptionAvailableMethod": self.transcription_available_method,
+ "username": self.username,
+ "password": self.password,
+ "tag": self.tag,
+ "fileFormat": self.file_format,
+ "multiChannel": str(self.multi_channel)
+ }
diff --git a/bandwidth/models/bxml/verbs/start_stream.py b/bandwidth/models/bxml/verbs/start_stream.py
new file mode 100644
index 00000000..d44d678b
--- /dev/null
+++ b/bandwidth/models/bxml/verbs/start_stream.py
@@ -0,0 +1,61 @@
+"""
+start_stream.py
+
+Bandwidth's StartStream BXML verb
+
+@copyright Bandwidth INC
+"""
+from typing import List
+
+from ..verb import Verb
+from ..verbs.stream_param import StreamParam
+
+
+class StartStream(Verb):
+
+ def __init__(
+ self, destination: str, stream_params: List[StreamParam] = [],
+ name: str=None, tracks: str=None,
+ stream_event_url: str=None,
+ stream_event_method: str=None,
+ username: str=None, password: str=None,
+ ):
+ """Initialize a verb
+
+ Args:
+ name (str, optional): 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 (str, optional): The part of the call to send a stream from. inbound, outbound or both. Default is inbound.
+ destination (str, optional): 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. See below for more details on the websocket packet format.
+ stream_event_url (str, optional): 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 (str, optional): The HTTP method to use for the request to streamEventUrl. GET or POST. Default value is POST.
+ username (str, optional): The username to send in the HTTP request to streamEventUrl. If specified, the URLs must be TLS-encrypted (i.e., https).
+ password (str, optional): The password to send in the HTTP request to streamEventUrl. If specified, the URLs must be TLS-encrypted (i.e., https).
+
+ Nested Verbs:
+ StreamParam: (optional) You may specify up to 12 elements nested within a tag. These elements define optional user specified parameters that will be sent to the destination URL when the stream is first started.
+
+ """
+ self.destination = destination
+ self.stream_params = stream_params
+ self.name = name
+ self.tracks = tracks
+ self.stream_event_url = stream_event_url
+ self.stream_event_method = stream_event_method
+ self.username = username
+ self.password = password
+ super().__init__(
+ tag="StartStream",
+ nested_verbs=self.stream_params
+ )
+
+ @property
+ def _attributes(self):
+ return {
+ "destination": self.destination,
+ "name": self.name,
+ "tracks": self.tracks,
+ "streamEventUrl": self.stream_event_url,
+ "streamEventMethod": self.stream_event_method,
+ "username": self.username,
+ "password": self.password,
+ }
diff --git a/bandwidth/voice/bxml/verbs/start_transcription.py b/bandwidth/models/bxml/verbs/start_transcription.py
similarity index 56%
rename from bandwidth/voice/bxml/verbs/start_transcription.py
rename to bandwidth/models/bxml/verbs/start_transcription.py
index 75f2accd..670e51cc 100644
--- a/bandwidth/voice/bxml/verbs/start_transcription.py
+++ b/bandwidth/models/bxml/verbs/start_transcription.py
@@ -1,26 +1,19 @@
"""
start_transcription.py
-Representation of Bandwidth's StartTranscription BXML verb
+Bandwidth's Start Transcription BXML verb
-@license MIT
+@copyright Bandwidth INC
"""
-
from typing import List
-from lxml import etree
-
-from .base_verb import AbstractBxmlVerb
-from .custom_param import CustomParam
-
-START_TRANSCRIPTION_TAG = "StartTranscription"
+from ..verb import Verb
+from ..verbs.custom_param import CustomParam
-class StartTranscription(AbstractBxmlVerb):
-
+class StartTranscription(Verb):
def __init__(
- self,
- name: str = None,
+ self, name: str = None,
tracks: str = None,
transcription_event_url: str = None,
transcription_event_method: str = None,
@@ -31,15 +24,15 @@ def __init__(
custom_params: List[CustomParam] = None,
):
"""
- Initializes the StartTranscription class
+ Initialize a verb
:param name: 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.
:param tracks: The part of the call to send a transcription from. inbound, outbound or both. Default is inbound.
:param transcription_event_url: URL to send the associated Webhook events to during this real-time transcription's lifetime. Does not accept BXML. May be a relative URL.
:param transcription_event_method: The HTTP method to use for the request to transcriptionEventUrl. GET or POST. Default value is POST.
:param username: The username to send in the HTTP request to transcriptionEventUrl. If specified, the transcriptionEventUrl must be TLS-encrypted (i.e., https).
:param password: The password to send in the HTTP request to transcriptionEventUrl. If specified, the transcriptionEventUrl must be TLS-encrypted (i.e., https).
- :param destination: 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.
- :param stabilized: Whether to send transcription update events to the specified destination only after they have become stable. Requires destination. Defaults to true.
+ :param destination: 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.
+ :param stabilized: 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.
:param custom_params: These elements define optional user specified parameters that will be sent to the destination URL when the real-time transcription is first started.
"""
self.name = name
@@ -52,25 +45,20 @@ def __init__(
self.stabilized = stabilized
self.custom_params = custom_params
- def to_bxml(self):
- root = etree.Element(START_TRANSCRIPTION_TAG)
- if self.name is not None:
- root.set("name", self.name)
- if self.tracks is not None:
- root.set("tracks", self.tracks)
- if self.transcription_event_url is not None:
- root.set("transcriptionEventUrl", self.transcription_event_url)
- if self.transcription_event_method is not None:
- root.set("transcriptionEventMethod", self.transcription_event_method)
- if self.username is not None:
- root.set("username", self.username)
- if self.password is not None:
- root.set("password", self.password)
- if self.destination is not None:
- root.set("destination", self.destination)
- if self.stabilized is not None:
- root.set("stabilized", str(self.stabilized).lower())
- if self.custom_params is not None:
- for custom_param in self.custom_params:
- root.append(custom_param.to_etree_element())
- return etree.tostring(root).decode()
+ super().__init__(
+ tag="StartTranscription",
+ nested_verbs=self.custom_params
+ )
+
+ @property
+ def _attributes(self):
+ return {
+ "name": self.name,
+ "tracks": self.tracks,
+ "transcriptionEventUrl": self.transcription_event_url,
+ "transcriptionEventMethod": self.transcription_event_method,
+ "username": self.username,
+ "password": self.password,
+ "destination": self.destination,
+ "stabilized": str(self.stabilized),
+ }
diff --git a/bandwidth/models/bxml/verbs/stop_gather.py b/bandwidth/models/bxml/verbs/stop_gather.py
new file mode 100644
index 00000000..73b6b8a3
--- /dev/null
+++ b/bandwidth/models/bxml/verbs/stop_gather.py
@@ -0,0 +1,16 @@
+"""
+stop_gather.py
+
+Bandwidth's StopGather BXML verb
+
+@copyright Bandwidth INC
+"""
+from ..terminal_verb import TerminalVerb
+
+
+class StopGather(TerminalVerb):
+
+ def __init__(self):
+ """Initialize a verb
+ """
+ super().__init__(tag="StopGather", content=None)
diff --git a/bandwidth/models/bxml/verbs/stop_recording.py b/bandwidth/models/bxml/verbs/stop_recording.py
new file mode 100644
index 00000000..651f9caa
--- /dev/null
+++ b/bandwidth/models/bxml/verbs/stop_recording.py
@@ -0,0 +1,19 @@
+"""
+record.py
+
+Bandwidth's StopRecording BXML verb
+
+@copyright Bandwidth INC
+"""
+from ..terminal_verb import TerminalVerb
+
+
+class StopRecording(TerminalVerb):
+
+ def __init__(self):
+ """Initialize a verb
+
+ Args: There are no args or text content for StopRecording
+ """
+
+ super().__init__(tag="StopRecording")
diff --git a/bandwidth/models/bxml/verbs/stop_stream.py b/bandwidth/models/bxml/verbs/stop_stream.py
new file mode 100644
index 00000000..87f7f596
--- /dev/null
+++ b/bandwidth/models/bxml/verbs/stop_stream.py
@@ -0,0 +1,30 @@
+"""
+stop_stream.py
+
+Bandwidth's StopStream BXML verb
+
+@copyright Bandwidth INC
+"""
+from ..terminal_verb import TerminalVerb
+
+
+class StopStream(TerminalVerb):
+
+ def __init__(
+ self, name: str
+ ):
+ """Initialize a verb
+
+ Args:
+ name (str): 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.
+ """
+ self.name = name
+ super().__init__(
+ tag="StopStream",
+ )
+
+ @property
+ def _attributes(self):
+ return {
+ "name": self.name,
+ }
diff --git a/bandwidth/voice/bxml/verbs/stop_transcription.py b/bandwidth/models/bxml/verbs/stop_transcription.py
similarity index 50%
rename from bandwidth/voice/bxml/verbs/stop_transcription.py
rename to bandwidth/models/bxml/verbs/stop_transcription.py
index 8b78aedd..5b9828ad 100644
--- a/bandwidth/voice/bxml/verbs/stop_transcription.py
+++ b/bandwidth/models/bxml/verbs/stop_transcription.py
@@ -1,32 +1,30 @@
"""
stop_transcription.py
-Representation of Bandwidth's StartTranscription BXML verb
+Bandwidth's Stop Transcription BXML verb
-@license MIT
+@copyright Bandwidth INC
"""
+from ..terminal_verb import TerminalVerb
-from lxml import etree
-
-from .base_verb import AbstractBxmlVerb
-
-STOP_TRANSCRIPTION_TAG = "StopTranscription"
-
-
-class StopTranscription(AbstractBxmlVerb):
+class StopTranscription(TerminalVerb):
def __init__(
self,
- name: str = None
+ name: str = None,
):
"""
- Initializes the StopTranscription class
+ Initialize a verb
:param name: 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.
"""
self.name = name
- def to_bxml(self):
- root = etree.Element(STOP_TRANSCRIPTION_TAG)
- if self.name is not None:
- root.set("name", self.name)
- return etree.tostring(root).decode()
+ super().__init__(
+ tag="StopTranscription",
+ )
+
+ @property
+ def _attributes(self):
+ return {
+ "name": self.name,
+ }
diff --git a/bandwidth/models/bxml/verbs/stream_param.py b/bandwidth/models/bxml/verbs/stream_param.py
new file mode 100644
index 00000000..dbd4516d
--- /dev/null
+++ b/bandwidth/models/bxml/verbs/stream_param.py
@@ -0,0 +1,33 @@
+"""
+stream_param.py
+
+Bandwidth's StreamParam BXML verb
+
+@copyright Bandwidth INC
+"""
+from ..terminal_verb import TerminalVerb
+
+
+class StreamParam(TerminalVerb):
+
+ def __init__(
+ self, name: str, value: str
+ ):
+ """Initialize a verb
+
+ Args:
+ name (str): The name of this parameter, up to 256 characters.
+ value (str): The value of this parameter, up to 2048 characters.
+ """
+ self.name = name
+ self.value = value
+ super().__init__(
+ tag="StreamParam"
+ )
+
+ @property
+ def _attributes(self):
+ return {
+ "name": self.name,
+ "value": self.value,
+ }
diff --git a/bandwidth/models/bxml/verbs/tag.py b/bandwidth/models/bxml/verbs/tag.py
new file mode 100644
index 00000000..d2d9b55b
--- /dev/null
+++ b/bandwidth/models/bxml/verbs/tag.py
@@ -0,0 +1,20 @@
+"""
+tag.py
+
+Bandwidth's Tag BXML verb
+
+@copyright Bandwidth INC
+"""
+from ..terminal_verb import TerminalVerb
+
+
+class Tag(TerminalVerb):
+
+ def __init__(self, content=""):
+ """Initialize a verb
+
+ Args:
+ content (str, optional): Custom tag value. Defaults to "".
+ """
+ self.content = content
+ super().__init__(tag="Tag", content=self.content)
diff --git a/bandwidth/models/bxml/verbs/transfer.py b/bandwidth/models/bxml/verbs/transfer.py
new file mode 100644
index 00000000..dae7e88c
--- /dev/null
+++ b/bandwidth/models/bxml/verbs/transfer.py
@@ -0,0 +1,102 @@
+"""
+transfer.py
+
+Bandwidth's Transfer BXML verb
+
+@copyright Bandwidth INC
+"""
+from typing import Union, List
+
+from ..verb import Verb
+from ..verbs.phone_number import PhoneNumber
+from ..verbs.sip_uri import SipUri
+
+
+class Transfer(Verb):
+
+ def __init__(
+ self, transfer_to: List[Union[PhoneNumber, SipUri]] = [],
+ transfer_caller_id: str=None, call_timeout: str=None,
+ transfer_complete_url: str=None, transfer_complete_method: str=None,
+ transfer_complete_fallback_url: str=None,
+ transfer_complete_fallback_method: str=None, username: str=None,
+ password: str=None, fallback_username: str=None,
+ fallback_password: str=None, tag: str=None,
+ diversion_treatment: str=None, diversion_reason: str=None
+ ):
+ """Initialize a verb
+
+ Args:
+ transfer_to (list[PhoneNumber, SipUri], optional): List of recipients to transfer a call to. Defaults to [].
+ transfer_caller_id (str, optional): 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 (str, optional):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 (str, optional): 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 (str, optional): The HTTP method to use for the request to transferCompleteUrl. GET or POST. Default value is POST. Defaults to None.
+ transfer_complete_fallback_url (str, optional): 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 (str, optional): The HTTP method to use to deliver the Transfer Complete callback to transferCompleteFallbackUrl. GET or POST. Default value is POST. Defaults to None.
+ username (str, optional): The username to send in the HTTP request to transferCompleteUrl. Defaults to None.
+ password (str, optional): The password to send in the HTTP request to transferCompleteUrl. Defaults to None.
+ fallback_username (str, optional): The username to send in the HTTP request to transferCompleteFallbackUrl. Defaults to None.
+ fallback_password (str, optional): The password to send in the HTTP request to transferCompleteFallbackUrl. Defaults to None.
+ tag (str, optional): 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 (str, optional): 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.
+
+ Defaults to none. 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 (str, optional): 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 is unknown.
+ Defaults to None.
+ """
+ self.transfer_to = transfer_to
+ self.transfer_caller_id = transfer_caller_id
+ self.call_timeout = call_timeout
+ self.transfer_complete_url = transfer_complete_url
+ self.transfer_complete_method = transfer_complete_method
+ self.transfer_complete_fallback_url = transfer_complete_fallback_url
+ self.transfer_complete_fallback_method = transfer_complete_fallback_method
+ self.username = username
+ self.password = password
+ self.fallback_username = fallback_username
+ self.fallback_password = fallback_password
+ self.tag = tag
+ self.diversion_treatment = diversion_treatment
+ self.diversion_reason = diversion_reason
+ super().__init__(
+ tag="Transfer",
+ nested_verbs=self.transfer_to
+ )
+
+ @property
+ def _attributes(self):
+ return {
+ "transferCallerId": self.transfer_caller_id,
+ "callTimeout": self.call_timeout,
+ "transferCompleteUrl": self.transfer_complete_url,
+ "transferCompleteMethod": self.transfer_complete_method,
+ "transferCompleteFallbackUrl": self.transfer_complete_fallback_url,
+ "transferCompleteFallbackMethod": self.transfer_complete_fallback_method,
+ "username": self.username,
+ "password": self.password,
+ "fallbackUsername": self.fallback_username,
+ "fallbackPassword": self.fallback_password,
+ "tag": self.tag,
+ "diversionTreatment": self.diversion_treatment,
+ "diversionReason": self.diversion_reason
+ }
+
+ def add_transfer_recipient(self, recipient: Union[PhoneNumber, SipUri]):
+ super().add_verb(recipient)
diff --git a/bandwidth/models/call_direction_enum.py b/bandwidth/models/call_direction_enum.py
new file mode 100644
index 00000000..dd817342
--- /dev/null
+++ b/bandwidth/models/call_direction_enum.py
@@ -0,0 +1,41 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+
+
+
+class CallDirectionEnum(str, Enum):
+ """
+ The direction of the call.
+ """
+
+ """
+ allowed enum values
+ """
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
+
+ @classmethod
+ def from_json(cls, json_str: str) -> CallDirectionEnum:
+ """Create an instance of CallDirectionEnum from a JSON string"""
+ return CallDirectionEnum(json.loads(json_str))
+
+
diff --git a/bandwidth/models/call_recording_metadata.py b/bandwidth/models/call_recording_metadata.py
new file mode 100644
index 00000000..c97f4fa6
--- /dev/null
+++ b/bandwidth/models/call_recording_metadata.py
@@ -0,0 +1,134 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictInt, StrictStr
+from bandwidth.models.call_direction_enum import CallDirectionEnum
+from bandwidth.models.file_format_enum import FileFormatEnum
+from bandwidth.models.transcription_metadata import TranscriptionMetadata
+
+class CallRecordingMetadata(BaseModel):
+ """
+ CallRecordingMetadata
+ """
+ application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.")
+ account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.")
+ call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.")
+ parent_call_id: Optional[StrictStr] = Field(None, alias="parentCallId", 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.")
+ recording_id: Optional[StrictStr] = Field(None, alias="recordingId", description="The unique ID of this recording")
+ to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).")
+ var_from: Optional[StrictStr] = Field(None, alias="from", 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.")
+ transfer_caller_id: Optional[StrictStr] = Field(None, alias="transferCallerId", 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.")
+ transfer_to: Optional[StrictStr] = Field(None, alias="transferTo", description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).")
+ duration: Optional[StrictStr] = Field(None, description="The duration of the recording in ISO-8601 format")
+ direction: Optional[CallDirectionEnum] = None
+ channels: Optional[StrictInt] = Field(None, description="Always `1` for conference recordings; multi-channel recordings are not supported on conferences.")
+ start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.")
+ end_time: Optional[datetime] = Field(None, alias="endTime", description="The time that the recording ended in ISO-8601 format")
+ file_format: Optional[FileFormatEnum] = Field(None, alias="fileFormat")
+ status: Optional[StrictStr] = Field(None, description="The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.")
+ media_url: Optional[StrictStr] = Field(None, alias="mediaUrl", description="The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.")
+ transcription: Optional[TranscriptionMetadata] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["applicationId", "accountId", "callId", "parentCallId", "recordingId", "to", "from", "transferCallerId", "transferTo", "duration", "direction", "channels", "startTime", "endTime", "fileFormat", "status", "mediaUrl", "transcription"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> CallRecordingMetadata:
+ """Create an instance of CallRecordingMetadata from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of transcription
+ if self.transcription:
+ _dict['transcription'] = self.transcription.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if media_url (nullable) is None
+ # and __fields_set__ contains the field
+ if self.media_url is None and "media_url" in self.__fields_set__:
+ _dict['mediaUrl'] = None
+
+ # set to None if transcription (nullable) is None
+ # and __fields_set__ contains the field
+ if self.transcription is None and "transcription" in self.__fields_set__:
+ _dict['transcription'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> CallRecordingMetadata:
+ """Create an instance of CallRecordingMetadata from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return CallRecordingMetadata.parse_obj(obj)
+
+ _obj = CallRecordingMetadata.parse_obj({
+ "application_id": obj.get("applicationId"),
+ "account_id": obj.get("accountId"),
+ "call_id": obj.get("callId"),
+ "parent_call_id": obj.get("parentCallId"),
+ "recording_id": obj.get("recordingId"),
+ "to": obj.get("to"),
+ "var_from": obj.get("from"),
+ "transfer_caller_id": obj.get("transferCallerId"),
+ "transfer_to": obj.get("transferTo"),
+ "duration": obj.get("duration"),
+ "direction": obj.get("direction"),
+ "channels": obj.get("channels"),
+ "start_time": obj.get("startTime"),
+ "end_time": obj.get("endTime"),
+ "file_format": obj.get("fileFormat"),
+ "status": obj.get("status"),
+ "media_url": obj.get("mediaUrl"),
+ "transcription": TranscriptionMetadata.from_dict(obj.get("transcription")) if obj.get("transcription") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/call_state.py b/bandwidth/models/call_state.py
new file mode 100644
index 00000000..1f5e525a
--- /dev/null
+++ b/bandwidth/models/call_state.py
@@ -0,0 +1,169 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+from bandwidth.models.call_direction_enum import CallDirectionEnum
+
+class CallState(BaseModel):
+ """
+ CallState
+ """
+ application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The application id associated with the call.")
+ account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The account id associated with the call.")
+ call_id: Optional[StrictStr] = Field(None, alias="callId", description="The programmable voice API call ID.")
+ parent_call_id: Optional[StrictStr] = Field(None, alias="parentCallId", description="The A-leg call id, set only if this call is the B-leg of a [``](/docs/voice/bxml/transfer).")
+ to: Optional[StrictStr] = Field(None, 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.")
+ var_from: Optional[StrictStr] = Field(None, alias="from", description="The phone number that made the call, in E.164 format (e.g. +15555555555).")
+ direction: Optional[CallDirectionEnum] = None
+ state: Optional[StrictStr] = Field(None, 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.")
+ stir_shaken: Optional[Dict[str, StrictStr]] = Field(None, alias="stirShaken", 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).")
+ identity: Optional[StrictStr] = Field(None, 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.")
+ enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="The time this call was placed in queue.")
+ start_time: Optional[datetime] = Field(None, alias="startTime", description="The time the call was initiated, in ISO 8601 format. `null` if the call is still in your queue.")
+ answer_time: Optional[datetime] = Field(None, alias="answerTime", description="Populated once the call has been answered, with the time in ISO 8601 format.")
+ end_time: Optional[datetime] = Field(None, alias="endTime", description="Populated once the call has ended, with the time in ISO 8601 format.")
+ disconnect_cause: Optional[StrictStr] = Field(None, alias="disconnectCause", 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.")
+ error_message: Optional[StrictStr] = Field(None, alias="errorMessage", description="Populated only if the call ended with an error, with text explaining the reason.")
+ error_id: Optional[StrictStr] = Field(None, alias="errorId", description="Populated only if the call ended with an error, with a Bandwidth internal id that references the error event.")
+ last_update: Optional[datetime] = Field(None, alias="lastUpdate", description="The last time the call had a state update, in ISO 8601 format.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["applicationId", "accountId", "callId", "parentCallId", "to", "from", "direction", "state", "stirShaken", "identity", "enqueuedTime", "startTime", "answerTime", "endTime", "disconnectCause", "errorMessage", "errorId", "lastUpdate"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> CallState:
+ """Create an instance of CallState from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if parent_call_id (nullable) is None
+ # and __fields_set__ contains the field
+ if self.parent_call_id is None and "parent_call_id" in self.__fields_set__:
+ _dict['parentCallId'] = None
+
+ # set to None if stir_shaken (nullable) is None
+ # and __fields_set__ contains the field
+ if self.stir_shaken is None and "stir_shaken" in self.__fields_set__:
+ _dict['stirShaken'] = None
+
+ # set to None if identity (nullable) is None
+ # and __fields_set__ contains the field
+ if self.identity is None and "identity" in self.__fields_set__:
+ _dict['identity'] = None
+
+ # set to None if enqueued_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.enqueued_time is None and "enqueued_time" in self.__fields_set__:
+ _dict['enqueuedTime'] = None
+
+ # set to None if start_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.start_time is None and "start_time" in self.__fields_set__:
+ _dict['startTime'] = None
+
+ # set to None if answer_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.answer_time is None and "answer_time" in self.__fields_set__:
+ _dict['answerTime'] = None
+
+ # set to None if end_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.end_time is None and "end_time" in self.__fields_set__:
+ _dict['endTime'] = None
+
+ # set to None if disconnect_cause (nullable) is None
+ # and __fields_set__ contains the field
+ if self.disconnect_cause is None and "disconnect_cause" in self.__fields_set__:
+ _dict['disconnectCause'] = None
+
+ # set to None if error_message (nullable) is None
+ # and __fields_set__ contains the field
+ if self.error_message is None and "error_message" in self.__fields_set__:
+ _dict['errorMessage'] = None
+
+ # set to None if error_id (nullable) is None
+ # and __fields_set__ contains the field
+ if self.error_id is None and "error_id" in self.__fields_set__:
+ _dict['errorId'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> CallState:
+ """Create an instance of CallState from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return CallState.parse_obj(obj)
+
+ _obj = CallState.parse_obj({
+ "application_id": obj.get("applicationId"),
+ "account_id": obj.get("accountId"),
+ "call_id": obj.get("callId"),
+ "parent_call_id": obj.get("parentCallId"),
+ "to": obj.get("to"),
+ "var_from": obj.get("from"),
+ "direction": obj.get("direction"),
+ "state": obj.get("state"),
+ "stir_shaken": obj.get("stirShaken"),
+ "identity": obj.get("identity"),
+ "enqueued_time": obj.get("enqueuedTime"),
+ "start_time": obj.get("startTime"),
+ "answer_time": obj.get("answerTime"),
+ "end_time": obj.get("endTime"),
+ "disconnect_cause": obj.get("disconnectCause"),
+ "error_message": obj.get("errorMessage"),
+ "error_id": obj.get("errorId"),
+ "last_update": obj.get("lastUpdate")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/call_state_enum.py b/bandwidth/models/call_state_enum.py
new file mode 100644
index 00000000..d0c56dd5
--- /dev/null
+++ b/bandwidth/models/call_state_enum.py
@@ -0,0 +1,41 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+
+
+
+class CallStateEnum(str, Enum):
+ """
+ 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
+ """
+
+ """
+ allowed enum values
+ """
+ ACTIVE = 'active'
+ COMPLETED = 'completed'
+
+ @classmethod
+ def from_json(cls, json_str: str) -> CallStateEnum:
+ """Create an instance of CallStateEnum from a JSON string"""
+ return CallStateEnum(json.loads(json_str))
+
+
diff --git a/bandwidth/models/callback_method_enum.py b/bandwidth/models/callback_method_enum.py
new file mode 100644
index 00000000..d5cba1d5
--- /dev/null
+++ b/bandwidth/models/callback_method_enum.py
@@ -0,0 +1,41 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+
+
+
+class CallbackMethodEnum(str, Enum):
+ """
+ The HTTP method to use to deliver the callback. GET or POST. Default value is POST.
+ """
+
+ """
+ allowed enum values
+ """
+ GET = 'GET'
+ POST = 'POST'
+
+ @classmethod
+ def from_json(cls, json_str: str) -> CallbackMethodEnum:
+ """Create an instance of CallbackMethodEnum from a JSON string"""
+ return CallbackMethodEnum(json.loads(json_str))
+
+
diff --git a/bandwidth/models/code_request.py b/bandwidth/models/code_request.py
new file mode 100644
index 00000000..7f714908
--- /dev/null
+++ b/bandwidth/models/code_request.py
@@ -0,0 +1,108 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, conint, constr, validator
+
+class CodeRequest(BaseModel):
+ """
+ CodeRequest
+ """
+ to: constr(strict=True) = Field(..., description="The phone number to send the mfa code to.")
+ var_from: constr(strict=True, max_length=32) = Field(..., alias="from", description="The application phone number, the sender of the mfa code.")
+ application_id: constr(strict=True, max_length=50) = Field(..., alias="applicationId", description="The application unique ID, obtained from Bandwidth.")
+ scope: Optional[constr(strict=True, max_length=25)] = Field(None, description="An optional field to denote what scope or action the mfa code is addressing. If not supplied, defaults to \"2FA\".")
+ message: constr(strict=True, max_length=2048) = Field(..., 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.")
+ digits: conint(strict=True, le=8, ge=4) = Field(..., description="The number of digits for your mfa code. The valid number ranges from 2 to 8, inclusively.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["to", "from", "applicationId", "scope", "message", "digits"]
+
+ @validator('to')
+ def to_validate_regular_expression(cls, value):
+ """Validates the regular expression"""
+ if not re.match(r"^\+[1-9]\d{1,14}$", value):
+ raise ValueError(r"must validate the regular expression /^\+[1-9]\d{1,14}$/")
+ return value
+
+ @validator('var_from')
+ def var_from_validate_regular_expression(cls, value):
+ """Validates the regular expression"""
+ if not re.match(r"^\+[1-9]\d{1,14}$", value):
+ raise ValueError(r"must validate the regular expression /^\+[1-9]\d{1,14}$/")
+ return value
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> CodeRequest:
+ """Create an instance of CodeRequest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> CodeRequest:
+ """Create an instance of CodeRequest from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return CodeRequest.parse_obj(obj)
+
+ _obj = CodeRequest.parse_obj({
+ "to": obj.get("to"),
+ "var_from": obj.get("from"),
+ "application_id": obj.get("applicationId"),
+ "scope": obj.get("scope"),
+ "message": obj.get("message"),
+ "digits": obj.get("digits")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/conference.py b/bandwidth/models/conference.py
new file mode 100644
index 00000000..13dde518
--- /dev/null
+++ b/bandwidth/models/conference.py
@@ -0,0 +1,132 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, List, Optional
+from pydantic import BaseModel, Field, StrictStr, conlist
+from bandwidth.models.callback_method_enum import CallbackMethodEnum
+from bandwidth.models.conference_member import ConferenceMember
+
+class Conference(BaseModel):
+ """
+ Conference
+ """
+ id: Optional[StrictStr] = Field(None, description="The Bandwidth-generated conference ID.")
+ name: Optional[StrictStr] = Field(None, description="The name of the conference, as specified by your application.")
+ created_time: Optional[datetime] = Field(None, alias="createdTime", description="The time the conference was initiated, in ISO 8601 format.")
+ completed_time: Optional[datetime] = Field(None, alias="completedTime", description="The time the conference was terminated, in ISO 8601 format.")
+ conference_event_url: Optional[StrictStr] = Field(None, alias="conferenceEventUrl", description="The URL to send the conference-related events.")
+ conference_event_method: Optional[CallbackMethodEnum] = Field(None, alias="conferenceEventMethod")
+ tag: Optional[StrictStr] = Field(None, description="The custom string attached to the conference that will be sent with callbacks.")
+ active_members: Optional[conlist(ConferenceMember)] = Field(None, alias="activeMembers", 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).")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["id", "name", "createdTime", "completedTime", "conferenceEventUrl", "conferenceEventMethod", "tag", "activeMembers"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Conference:
+ """Create an instance of Conference from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of each item in active_members (list)
+ _items = []
+ if self.active_members:
+ for _item in self.active_members:
+ if _item:
+ _items.append(_item.to_dict())
+ _dict['activeMembers'] = _items
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if completed_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.completed_time is None and "completed_time" in self.__fields_set__:
+ _dict['completedTime'] = None
+
+ # set to None if conference_event_url (nullable) is None
+ # and __fields_set__ contains the field
+ if self.conference_event_url is None and "conference_event_url" in self.__fields_set__:
+ _dict['conferenceEventUrl'] = None
+
+ # set to None if conference_event_method (nullable) is None
+ # and __fields_set__ contains the field
+ if self.conference_event_method is None and "conference_event_method" in self.__fields_set__:
+ _dict['conferenceEventMethod'] = None
+
+ # set to None if tag (nullable) is None
+ # and __fields_set__ contains the field
+ if self.tag is None and "tag" in self.__fields_set__:
+ _dict['tag'] = None
+
+ # set to None if active_members (nullable) is None
+ # and __fields_set__ contains the field
+ if self.active_members is None and "active_members" in self.__fields_set__:
+ _dict['activeMembers'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Conference:
+ """Create an instance of Conference from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return Conference.parse_obj(obj)
+
+ _obj = Conference.parse_obj({
+ "id": obj.get("id"),
+ "name": obj.get("name"),
+ "created_time": obj.get("createdTime"),
+ "completed_time": obj.get("completedTime"),
+ "conference_event_url": obj.get("conferenceEventUrl"),
+ "conference_event_method": obj.get("conferenceEventMethod"),
+ "tag": obj.get("tag"),
+ "active_members": [ConferenceMember.from_dict(_item) for _item in obj.get("activeMembers")] if obj.get("activeMembers") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/conference_completed_callback.py b/bandwidth/models/conference_completed_callback.py
new file mode 100644
index 00000000..6a9e09c3
--- /dev/null
+++ b/bandwidth/models/conference_completed_callback.py
@@ -0,0 +1,97 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class ConferenceCompletedCallback(BaseModel):
+ """
+ The Conference Completed event is fired when the last member leaves the conference. The response to this event may not contain BXML.
+ """
+ event_type: Optional[StrictStr] = Field(None, alias="eventType", 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.")
+ event_time: Optional[datetime] = Field(None, alias="eventTime", 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.")
+ conference_id: Optional[StrictStr] = Field(None, alias="conferenceId", description="The unique, Bandwidth-generated ID of the conference that was recorded")
+ name: Optional[StrictStr] = Field(None, description="The user-specified name of the conference that was recorded")
+ tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["eventType", "eventTime", "conferenceId", "name", "tag"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ConferenceCompletedCallback:
+ """Create an instance of ConferenceCompletedCallback from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if tag (nullable) is None
+ # and __fields_set__ contains the field
+ if self.tag is None and "tag" in self.__fields_set__:
+ _dict['tag'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ConferenceCompletedCallback:
+ """Create an instance of ConferenceCompletedCallback from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return ConferenceCompletedCallback.parse_obj(obj)
+
+ _obj = ConferenceCompletedCallback.parse_obj({
+ "event_type": obj.get("eventType"),
+ "event_time": obj.get("eventTime"),
+ "conference_id": obj.get("conferenceId"),
+ "name": obj.get("name"),
+ "tag": obj.get("tag")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/conference_created_callback.py b/bandwidth/models/conference_created_callback.py
new file mode 100644
index 00000000..0484f5ac
--- /dev/null
+++ b/bandwidth/models/conference_created_callback.py
@@ -0,0 +1,97 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class ConferenceCreatedCallback(BaseModel):
+ """
+ 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.
+ """
+ event_type: Optional[StrictStr] = Field(None, alias="eventType", 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.")
+ event_time: Optional[datetime] = Field(None, alias="eventTime", 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.")
+ conference_id: Optional[StrictStr] = Field(None, alias="conferenceId", description="The unique, Bandwidth-generated ID of the conference that was recorded")
+ name: Optional[StrictStr] = Field(None, description="The user-specified name of the conference that was recorded")
+ tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["eventType", "eventTime", "conferenceId", "name", "tag"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ConferenceCreatedCallback:
+ """Create an instance of ConferenceCreatedCallback from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if tag (nullable) is None
+ # and __fields_set__ contains the field
+ if self.tag is None and "tag" in self.__fields_set__:
+ _dict['tag'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ConferenceCreatedCallback:
+ """Create an instance of ConferenceCreatedCallback from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return ConferenceCreatedCallback.parse_obj(obj)
+
+ _obj = ConferenceCreatedCallback.parse_obj({
+ "event_type": obj.get("eventType"),
+ "event_time": obj.get("eventTime"),
+ "conference_id": obj.get("conferenceId"),
+ "name": obj.get("name"),
+ "tag": obj.get("tag")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/conference_member.py b/bandwidth/models/conference_member.py
new file mode 100644
index 00000000..bc7a494a
--- /dev/null
+++ b/bandwidth/models/conference_member.py
@@ -0,0 +1,99 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, List, Optional
+from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist
+
+class ConferenceMember(BaseModel):
+ """
+ ConferenceMember
+ """
+ call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.")
+ conference_id: Optional[StrictStr] = Field(None, alias="conferenceId", description="The unique, Bandwidth-generated ID of the conference that was recorded")
+ member_url: Optional[StrictStr] = Field(None, alias="memberUrl", 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.")
+ mute: Optional[StrictBool] = Field(None, 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.")
+ hold: Optional[StrictBool] = Field(None, 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.")
+ call_ids_to_coach: Optional[conlist(StrictStr)] = Field(None, alias="callIdsToCoach", 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.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["callId", "conferenceId", "memberUrl", "mute", "hold", "callIdsToCoach"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ConferenceMember:
+ """Create an instance of ConferenceMember from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if call_ids_to_coach (nullable) is None
+ # and __fields_set__ contains the field
+ if self.call_ids_to_coach is None and "call_ids_to_coach" in self.__fields_set__:
+ _dict['callIdsToCoach'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ConferenceMember:
+ """Create an instance of ConferenceMember from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return ConferenceMember.parse_obj(obj)
+
+ _obj = ConferenceMember.parse_obj({
+ "call_id": obj.get("callId"),
+ "conference_id": obj.get("conferenceId"),
+ "member_url": obj.get("memberUrl"),
+ "mute": obj.get("mute"),
+ "hold": obj.get("hold"),
+ "call_ids_to_coach": obj.get("callIdsToCoach")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/conference_member_exit_callback.py b/bandwidth/models/conference_member_exit_callback.py
new file mode 100644
index 00000000..574a2299
--- /dev/null
+++ b/bandwidth/models/conference_member_exit_callback.py
@@ -0,0 +1,103 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class ConferenceMemberExitCallback(BaseModel):
+ """
+ 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.
+ """
+ event_type: Optional[StrictStr] = Field(None, alias="eventType", 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.")
+ event_time: Optional[datetime] = Field(None, alias="eventTime", 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.")
+ conference_id: Optional[StrictStr] = Field(None, alias="conferenceId", description="The unique, Bandwidth-generated ID of the conference that was recorded")
+ name: Optional[StrictStr] = Field(None, description="The user-specified name of the conference that was recorded")
+ var_from: Optional[StrictStr] = Field(None, alias="from", 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.")
+ to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).")
+ call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.")
+ tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["eventType", "eventTime", "conferenceId", "name", "from", "to", "callId", "tag"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ConferenceMemberExitCallback:
+ """Create an instance of ConferenceMemberExitCallback from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if tag (nullable) is None
+ # and __fields_set__ contains the field
+ if self.tag is None and "tag" in self.__fields_set__:
+ _dict['tag'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ConferenceMemberExitCallback:
+ """Create an instance of ConferenceMemberExitCallback from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return ConferenceMemberExitCallback.parse_obj(obj)
+
+ _obj = ConferenceMemberExitCallback.parse_obj({
+ "event_type": obj.get("eventType"),
+ "event_time": obj.get("eventTime"),
+ "conference_id": obj.get("conferenceId"),
+ "name": obj.get("name"),
+ "var_from": obj.get("from"),
+ "to": obj.get("to"),
+ "call_id": obj.get("callId"),
+ "tag": obj.get("tag")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/conference_member_join_callback.py b/bandwidth/models/conference_member_join_callback.py
new file mode 100644
index 00000000..a661501e
--- /dev/null
+++ b/bandwidth/models/conference_member_join_callback.py
@@ -0,0 +1,103 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class ConferenceMemberJoinCallback(BaseModel):
+ """
+ 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.
+ """
+ event_type: Optional[StrictStr] = Field(None, alias="eventType", 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.")
+ event_time: Optional[datetime] = Field(None, alias="eventTime", 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.")
+ conference_id: Optional[StrictStr] = Field(None, alias="conferenceId", description="The unique, Bandwidth-generated ID of the conference that was recorded")
+ name: Optional[StrictStr] = Field(None, description="The user-specified name of the conference that was recorded")
+ var_from: Optional[StrictStr] = Field(None, alias="from", 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.")
+ to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).")
+ call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.")
+ tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["eventType", "eventTime", "conferenceId", "name", "from", "to", "callId", "tag"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ConferenceMemberJoinCallback:
+ """Create an instance of ConferenceMemberJoinCallback from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if tag (nullable) is None
+ # and __fields_set__ contains the field
+ if self.tag is None and "tag" in self.__fields_set__:
+ _dict['tag'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ConferenceMemberJoinCallback:
+ """Create an instance of ConferenceMemberJoinCallback from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return ConferenceMemberJoinCallback.parse_obj(obj)
+
+ _obj = ConferenceMemberJoinCallback.parse_obj({
+ "event_type": obj.get("eventType"),
+ "event_time": obj.get("eventTime"),
+ "conference_id": obj.get("conferenceId"),
+ "name": obj.get("name"),
+ "var_from": obj.get("from"),
+ "to": obj.get("to"),
+ "call_id": obj.get("callId"),
+ "tag": obj.get("tag")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/conference_recording_available_callback.py b/bandwidth/models/conference_recording_available_callback.py
new file mode 100644
index 00000000..9cee981d
--- /dev/null
+++ b/bandwidth/models/conference_recording_available_callback.py
@@ -0,0 +1,121 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictInt, StrictStr
+from bandwidth.models.file_format_enum import FileFormatEnum
+
+class ConferenceRecordingAvailableCallback(BaseModel):
+ """
+ The Conference Recording Available event is sent after a conference recording has been processed. It indicates that the recording is available for download.
+ """
+ event_type: Optional[StrictStr] = Field(None, alias="eventType", 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.")
+ event_time: Optional[datetime] = Field(None, alias="eventTime", 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.")
+ conference_id: Optional[StrictStr] = Field(None, alias="conferenceId", description="The unique, Bandwidth-generated ID of the conference that was recorded")
+ name: Optional[StrictStr] = Field(None, description="The user-specified name of the conference that was recorded")
+ account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.")
+ recording_id: Optional[StrictStr] = Field(None, alias="recordingId", description="The unique ID of this recording")
+ channels: Optional[StrictInt] = Field(None, description="Always `1` for conference recordings; multi-channel recordings are not supported on conferences.")
+ start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.")
+ end_time: Optional[datetime] = Field(None, alias="endTime", description="The time that the recording ended in ISO-8601 format")
+ duration: Optional[StrictStr] = Field(None, description="The duration of the recording in ISO-8601 format")
+ file_format: Optional[FileFormatEnum] = Field(None, alias="fileFormat")
+ media_url: Optional[StrictStr] = Field(None, alias="mediaUrl", description="The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.")
+ tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.")
+ status: Optional[StrictStr] = Field(None, description="The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["eventType", "eventTime", "conferenceId", "name", "accountId", "recordingId", "channels", "startTime", "endTime", "duration", "fileFormat", "mediaUrl", "tag", "status"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ConferenceRecordingAvailableCallback:
+ """Create an instance of ConferenceRecordingAvailableCallback from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if media_url (nullable) is None
+ # and __fields_set__ contains the field
+ if self.media_url is None and "media_url" in self.__fields_set__:
+ _dict['mediaUrl'] = None
+
+ # set to None if tag (nullable) is None
+ # and __fields_set__ contains the field
+ if self.tag is None and "tag" in self.__fields_set__:
+ _dict['tag'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ConferenceRecordingAvailableCallback:
+ """Create an instance of ConferenceRecordingAvailableCallback from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return ConferenceRecordingAvailableCallback.parse_obj(obj)
+
+ _obj = ConferenceRecordingAvailableCallback.parse_obj({
+ "event_type": obj.get("eventType"),
+ "event_time": obj.get("eventTime"),
+ "conference_id": obj.get("conferenceId"),
+ "name": obj.get("name"),
+ "account_id": obj.get("accountId"),
+ "recording_id": obj.get("recordingId"),
+ "channels": obj.get("channels"),
+ "start_time": obj.get("startTime"),
+ "end_time": obj.get("endTime"),
+ "duration": obj.get("duration"),
+ "file_format": obj.get("fileFormat"),
+ "media_url": obj.get("mediaUrl"),
+ "tag": obj.get("tag"),
+ "status": obj.get("status")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/conference_recording_metadata.py b/bandwidth/models/conference_recording_metadata.py
new file mode 100644
index 00000000..7debbe6f
--- /dev/null
+++ b/bandwidth/models/conference_recording_metadata.py
@@ -0,0 +1,110 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictInt, StrictStr
+from bandwidth.models.file_format_enum import FileFormatEnum
+
+class ConferenceRecordingMetadata(BaseModel):
+ """
+ ConferenceRecordingMetadata
+ """
+ account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.")
+ conference_id: Optional[StrictStr] = Field(None, alias="conferenceId", description="The unique, Bandwidth-generated ID of the conference that was recorded")
+ name: Optional[StrictStr] = Field(None, description="The user-specified name of the conference that was recorded")
+ recording_id: Optional[StrictStr] = Field(None, alias="recordingId", description="The unique ID of this recording")
+ duration: Optional[StrictStr] = Field(None, description="The duration of the recording in ISO-8601 format")
+ channels: Optional[StrictInt] = Field(None, description="Always `1` for conference recordings; multi-channel recordings are not supported on conferences.")
+ start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.")
+ end_time: Optional[datetime] = Field(None, alias="endTime", description="The time that the recording ended in ISO-8601 format")
+ file_format: Optional[FileFormatEnum] = Field(None, alias="fileFormat")
+ status: Optional[StrictStr] = Field(None, description="The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.")
+ media_url: Optional[StrictStr] = Field(None, alias="mediaUrl", description="The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["accountId", "conferenceId", "name", "recordingId", "duration", "channels", "startTime", "endTime", "fileFormat", "status", "mediaUrl"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ConferenceRecordingMetadata:
+ """Create an instance of ConferenceRecordingMetadata from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if media_url (nullable) is None
+ # and __fields_set__ contains the field
+ if self.media_url is None and "media_url" in self.__fields_set__:
+ _dict['mediaUrl'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ConferenceRecordingMetadata:
+ """Create an instance of ConferenceRecordingMetadata from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return ConferenceRecordingMetadata.parse_obj(obj)
+
+ _obj = ConferenceRecordingMetadata.parse_obj({
+ "account_id": obj.get("accountId"),
+ "conference_id": obj.get("conferenceId"),
+ "name": obj.get("name"),
+ "recording_id": obj.get("recordingId"),
+ "duration": obj.get("duration"),
+ "channels": obj.get("channels"),
+ "start_time": obj.get("startTime"),
+ "end_time": obj.get("endTime"),
+ "file_format": obj.get("fileFormat"),
+ "status": obj.get("status"),
+ "media_url": obj.get("mediaUrl")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/conference_redirect_callback.py b/bandwidth/models/conference_redirect_callback.py
new file mode 100644
index 00000000..cb8d04c1
--- /dev/null
+++ b/bandwidth/models/conference_redirect_callback.py
@@ -0,0 +1,97 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class ConferenceRedirectCallback(BaseModel):
+ """
+ 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.
+ """
+ event_type: Optional[StrictStr] = Field(None, alias="eventType", 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.")
+ event_time: Optional[datetime] = Field(None, alias="eventTime", 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.")
+ conference_id: Optional[StrictStr] = Field(None, alias="conferenceId", description="The unique, Bandwidth-generated ID of the conference that was recorded")
+ name: Optional[StrictStr] = Field(None, description="The user-specified name of the conference that was recorded")
+ tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["eventType", "eventTime", "conferenceId", "name", "tag"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ConferenceRedirectCallback:
+ """Create an instance of ConferenceRedirectCallback from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if tag (nullable) is None
+ # and __fields_set__ contains the field
+ if self.tag is None and "tag" in self.__fields_set__:
+ _dict['tag'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ConferenceRedirectCallback:
+ """Create an instance of ConferenceRedirectCallback from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return ConferenceRedirectCallback.parse_obj(obj)
+
+ _obj = ConferenceRedirectCallback.parse_obj({
+ "event_type": obj.get("eventType"),
+ "event_time": obj.get("eventTime"),
+ "conference_id": obj.get("conferenceId"),
+ "name": obj.get("name"),
+ "tag": obj.get("tag")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/conference_state_enum.py b/bandwidth/models/conference_state_enum.py
new file mode 100644
index 00000000..fb212608
--- /dev/null
+++ b/bandwidth/models/conference_state_enum.py
@@ -0,0 +1,41 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+
+
+
+class ConferenceStateEnum(str, Enum):
+ """
+ Setting the conference state to `completed` ends the conference and ejects all members.
+ """
+
+ """
+ allowed enum values
+ """
+ ACTIVE = 'active'
+ COMPLETED = 'completed'
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ConferenceStateEnum:
+ """Create an instance of ConferenceStateEnum from a JSON string"""
+ return ConferenceStateEnum(json.loads(json_str))
+
+
diff --git a/bandwidth/models/create_call.py b/bandwidth/models/create_call.py
new file mode 100644
index 00000000..239b6a18
--- /dev/null
+++ b/bandwidth/models/create_call.py
@@ -0,0 +1,202 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional, Union
+from pydantic import BaseModel, Field, StrictStr, confloat, conint, constr
+from bandwidth.models.callback_method_enum import CallbackMethodEnum
+from bandwidth.models.machine_detection_configuration import MachineDetectionConfiguration
+
+class CreateCall(BaseModel):
+ """
+ CreateCall
+ """
+ to: StrictStr = Field(..., description="The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.example`)).")
+ var_from: StrictStr = Field(..., alias="from", 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`).")
+ display_name: Optional[constr(strict=True, max_length=256)] = Field(None, alias="displayName", 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.")
+ uui: Optional[StrictStr] = Field(None, description="A comma-separated list of 'User-To-User' headers to be sent in the INVITE when calling a SIP URI. Each value must end with an 'encoding' parameter as described in RFC 7433. Only 'jwt' and 'base64' encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators.")
+ application_id: StrictStr = Field(..., alias="applicationId", description="The id of the application associated with the `from` number.")
+ answer_url: constr(strict=True, max_length=2048) = Field(..., alias="answerUrl", 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`.")
+ answer_method: Optional[CallbackMethodEnum] = Field(None, alias="answerMethod")
+ username: Optional[constr(strict=True, max_length=1024)] = Field(None, description="Basic auth username.")
+ password: Optional[constr(strict=True, max_length=1024)] = Field(None, description="Basic auth password.")
+ answer_fallback_url: Optional[constr(strict=True, max_length=2048)] = Field(None, alias="answerFallbackUrl", 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`.")
+ answer_fallback_method: Optional[CallbackMethodEnum] = Field(None, alias="answerFallbackMethod")
+ fallback_username: Optional[constr(strict=True, max_length=1024)] = Field(None, alias="fallbackUsername", description="Basic auth username.")
+ fallback_password: Optional[constr(strict=True, max_length=1024)] = Field(None, alias="fallbackPassword", description="Basic auth password.")
+ disconnect_url: Optional[constr(strict=True, max_length=2048)] = Field(None, alias="disconnectUrl", description="The URL to send the Disconnect event to when the call ends. This event does not expect a BXML response.")
+ disconnect_method: Optional[CallbackMethodEnum] = Field(None, alias="disconnectMethod")
+ call_timeout: Optional[Union[confloat(le=300, ge=1, strict=True), conint(le=300, ge=1, strict=True)]] = Field(30, alias="callTimeout", 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.")
+ callback_timeout: Optional[Union[confloat(le=25, ge=1, strict=True), conint(le=25, ge=1, strict=True)]] = Field(15, alias="callbackTimeout", 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.")
+ machine_detection: Optional[MachineDetectionConfiguration] = Field(None, alias="machineDetection")
+ priority: Optional[conint(strict=True, le=5, ge=1)] = Field(5, description="The priority of this call over other calls from your account. For example, if during a call your application needs to place a new call and bridge it with the current call, you might want to create the call with priority 1 so that it will be the next call picked off your queue, ahead of other less time sensitive calls. A lower value means higher priority, so a priority 1 call takes precedence over a priority 2 call.")
+ tag: Optional[constr(strict=True, max_length=256)] = Field(None, description="A custom string that will be sent with all webhooks for this call unless overwritten by a future `` verb or `tag` attribute on another verb, or cleared. May be cleared by setting `tag=\"\"` Max length 256 characters.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["to", "from", "displayName", "uui", "applicationId", "answerUrl", "answerMethod", "username", "password", "answerFallbackUrl", "answerFallbackMethod", "fallbackUsername", "fallbackPassword", "disconnectUrl", "disconnectMethod", "callTimeout", "callbackTimeout", "machineDetection", "priority", "tag"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> CreateCall:
+ """Create an instance of CreateCall from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of machine_detection
+ if self.machine_detection:
+ _dict['machineDetection'] = self.machine_detection.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if display_name (nullable) is None
+ # and __fields_set__ contains the field
+ if self.display_name is None and "display_name" in self.__fields_set__:
+ _dict['displayName'] = None
+
+ # set to None if uui (nullable) is None
+ # and __fields_set__ contains the field
+ if self.uui is None and "uui" in self.__fields_set__:
+ _dict['uui'] = None
+
+ # set to None if answer_method (nullable) is None
+ # and __fields_set__ contains the field
+ if self.answer_method is None and "answer_method" in self.__fields_set__:
+ _dict['answerMethod'] = None
+
+ # set to None if username (nullable) is None
+ # and __fields_set__ contains the field
+ if self.username is None and "username" in self.__fields_set__:
+ _dict['username'] = None
+
+ # set to None if password (nullable) is None
+ # and __fields_set__ contains the field
+ if self.password is None and "password" in self.__fields_set__:
+ _dict['password'] = None
+
+ # set to None if answer_fallback_url (nullable) is None
+ # and __fields_set__ contains the field
+ if self.answer_fallback_url is None and "answer_fallback_url" in self.__fields_set__:
+ _dict['answerFallbackUrl'] = None
+
+ # set to None if answer_fallback_method (nullable) is None
+ # and __fields_set__ contains the field
+ if self.answer_fallback_method is None and "answer_fallback_method" in self.__fields_set__:
+ _dict['answerFallbackMethod'] = None
+
+ # set to None if fallback_username (nullable) is None
+ # and __fields_set__ contains the field
+ if self.fallback_username is None and "fallback_username" in self.__fields_set__:
+ _dict['fallbackUsername'] = None
+
+ # set to None if fallback_password (nullable) is None
+ # and __fields_set__ contains the field
+ if self.fallback_password is None and "fallback_password" in self.__fields_set__:
+ _dict['fallbackPassword'] = None
+
+ # set to None if disconnect_url (nullable) is None
+ # and __fields_set__ contains the field
+ if self.disconnect_url is None and "disconnect_url" in self.__fields_set__:
+ _dict['disconnectUrl'] = None
+
+ # set to None if disconnect_method (nullable) is None
+ # and __fields_set__ contains the field
+ if self.disconnect_method is None and "disconnect_method" in self.__fields_set__:
+ _dict['disconnectMethod'] = None
+
+ # set to None if call_timeout (nullable) is None
+ # and __fields_set__ contains the field
+ if self.call_timeout is None and "call_timeout" in self.__fields_set__:
+ _dict['callTimeout'] = None
+
+ # set to None if callback_timeout (nullable) is None
+ # and __fields_set__ contains the field
+ if self.callback_timeout is None and "callback_timeout" in self.__fields_set__:
+ _dict['callbackTimeout'] = None
+
+ # set to None if priority (nullable) is None
+ # and __fields_set__ contains the field
+ if self.priority is None and "priority" in self.__fields_set__:
+ _dict['priority'] = None
+
+ # set to None if tag (nullable) is None
+ # and __fields_set__ contains the field
+ if self.tag is None and "tag" in self.__fields_set__:
+ _dict['tag'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> CreateCall:
+ """Create an instance of CreateCall from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return CreateCall.parse_obj(obj)
+
+ _obj = CreateCall.parse_obj({
+ "to": obj.get("to"),
+ "var_from": obj.get("from"),
+ "display_name": obj.get("displayName"),
+ "uui": obj.get("uui"),
+ "application_id": obj.get("applicationId"),
+ "answer_url": obj.get("answerUrl"),
+ "answer_method": obj.get("answerMethod"),
+ "username": obj.get("username"),
+ "password": obj.get("password"),
+ "answer_fallback_url": obj.get("answerFallbackUrl"),
+ "answer_fallback_method": obj.get("answerFallbackMethod"),
+ "fallback_username": obj.get("fallbackUsername"),
+ "fallback_password": obj.get("fallbackPassword"),
+ "disconnect_url": obj.get("disconnectUrl"),
+ "disconnect_method": obj.get("disconnectMethod"),
+ "call_timeout": obj.get("callTimeout") if obj.get("callTimeout") is not None else 30,
+ "callback_timeout": obj.get("callbackTimeout") if obj.get("callbackTimeout") is not None else 15,
+ "machine_detection": MachineDetectionConfiguration.from_dict(obj.get("machineDetection")) if obj.get("machineDetection") is not None else None,
+ "priority": obj.get("priority") if obj.get("priority") is not None else 5,
+ "tag": obj.get("tag")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/create_call_response.py b/bandwidth/models/create_call_response.py
new file mode 100644
index 00000000..fc0b097a
--- /dev/null
+++ b/bandwidth/models/create_call_response.py
@@ -0,0 +1,185 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, Optional, Union
+from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, constr
+from bandwidth.models.callback_method_enum import CallbackMethodEnum
+
+class CreateCallResponse(BaseModel):
+ """
+ CreateCallResponse
+ """
+ application_id: StrictStr = Field(..., alias="applicationId", description="The id of the application associated with the `from` number.")
+ account_id: StrictStr = Field(..., alias="accountId", description="The bandwidth account ID associated with the call.")
+ call_id: StrictStr = Field(..., alias="callId", description="Programmable Voice API Call ID.")
+ to: StrictStr = Field(..., description="Recipient of the outgoing call.")
+ var_from: StrictStr = Field(..., alias="from", description="Phone number that created the outbound call.")
+ enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="The time at which the call was accepted into the queue.")
+ call_url: StrictStr = Field(..., alias="callUrl", description="The URL to update this call's state.")
+ call_timeout: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="callTimeout", description="The timeout (in seconds) for the callee to answer the call after it starts ringing.")
+ callback_timeout: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="callbackTimeout", description="This is the timeout (in seconds) to use when delivering webhooks for the call.")
+ tag: Optional[StrictStr] = Field(None, description="Custom tag value.")
+ answer_method: Optional[CallbackMethodEnum] = Field(..., alias="answerMethod")
+ answer_url: StrictStr = Field(..., alias="answerUrl", description="URL to deliver the `answer` event webhook.")
+ answer_fallback_method: Optional[CallbackMethodEnum] = Field(None, alias="answerFallbackMethod")
+ answer_fallback_url: Optional[StrictStr] = Field(None, alias="answerFallbackUrl", description="Fallback URL to deliver the `answer` event webhook.")
+ disconnect_method: Optional[CallbackMethodEnum] = Field(..., alias="disconnectMethod")
+ disconnect_url: Optional[StrictStr] = Field(None, alias="disconnectUrl", description="URL to deliver the `disconnect` event webhook.")
+ username: Optional[constr(strict=True, max_length=1024)] = Field(None, description="Basic auth username.")
+ password: Optional[constr(strict=True, max_length=1024)] = Field(None, description="Basic auth password.")
+ fallback_username: Optional[constr(strict=True, max_length=1024)] = Field(None, alias="fallbackUsername", description="Basic auth username.")
+ fallback_password: Optional[constr(strict=True, max_length=1024)] = Field(None, alias="fallbackPassword", description="Basic auth password.")
+ priority: Optional[StrictInt] = Field(None, description="The priority of this call over other calls from your account.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["applicationId", "accountId", "callId", "to", "from", "enqueuedTime", "callUrl", "callTimeout", "callbackTimeout", "tag", "answerMethod", "answerUrl", "answerFallbackMethod", "answerFallbackUrl", "disconnectMethod", "disconnectUrl", "username", "password", "fallbackUsername", "fallbackPassword", "priority"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> CreateCallResponse:
+ """Create an instance of CreateCallResponse from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if enqueued_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.enqueued_time is None and "enqueued_time" in self.__fields_set__:
+ _dict['enqueuedTime'] = None
+
+ # set to None if tag (nullable) is None
+ # and __fields_set__ contains the field
+ if self.tag is None and "tag" in self.__fields_set__:
+ _dict['tag'] = None
+
+ # set to None if answer_method (nullable) is None
+ # and __fields_set__ contains the field
+ if self.answer_method is None and "answer_method" in self.__fields_set__:
+ _dict['answerMethod'] = None
+
+ # set to None if answer_fallback_method (nullable) is None
+ # and __fields_set__ contains the field
+ if self.answer_fallback_method is None and "answer_fallback_method" in self.__fields_set__:
+ _dict['answerFallbackMethod'] = None
+
+ # set to None if answer_fallback_url (nullable) is None
+ # and __fields_set__ contains the field
+ if self.answer_fallback_url is None and "answer_fallback_url" in self.__fields_set__:
+ _dict['answerFallbackUrl'] = None
+
+ # set to None if disconnect_method (nullable) is None
+ # and __fields_set__ contains the field
+ if self.disconnect_method is None and "disconnect_method" in self.__fields_set__:
+ _dict['disconnectMethod'] = None
+
+ # set to None if disconnect_url (nullable) is None
+ # and __fields_set__ contains the field
+ if self.disconnect_url is None and "disconnect_url" in self.__fields_set__:
+ _dict['disconnectUrl'] = None
+
+ # set to None if username (nullable) is None
+ # and __fields_set__ contains the field
+ if self.username is None and "username" in self.__fields_set__:
+ _dict['username'] = None
+
+ # set to None if password (nullable) is None
+ # and __fields_set__ contains the field
+ if self.password is None and "password" in self.__fields_set__:
+ _dict['password'] = None
+
+ # set to None if fallback_username (nullable) is None
+ # and __fields_set__ contains the field
+ if self.fallback_username is None and "fallback_username" in self.__fields_set__:
+ _dict['fallbackUsername'] = None
+
+ # set to None if fallback_password (nullable) is None
+ # and __fields_set__ contains the field
+ if self.fallback_password is None and "fallback_password" in self.__fields_set__:
+ _dict['fallbackPassword'] = None
+
+ # set to None if priority (nullable) is None
+ # and __fields_set__ contains the field
+ if self.priority is None and "priority" in self.__fields_set__:
+ _dict['priority'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> CreateCallResponse:
+ """Create an instance of CreateCallResponse from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return CreateCallResponse.parse_obj(obj)
+
+ _obj = CreateCallResponse.parse_obj({
+ "application_id": obj.get("applicationId"),
+ "account_id": obj.get("accountId"),
+ "call_id": obj.get("callId"),
+ "to": obj.get("to"),
+ "var_from": obj.get("from"),
+ "enqueued_time": obj.get("enqueuedTime"),
+ "call_url": obj.get("callUrl"),
+ "call_timeout": obj.get("callTimeout"),
+ "callback_timeout": obj.get("callbackTimeout"),
+ "tag": obj.get("tag"),
+ "answer_method": obj.get("answerMethod"),
+ "answer_url": obj.get("answerUrl"),
+ "answer_fallback_method": obj.get("answerFallbackMethod"),
+ "answer_fallback_url": obj.get("answerFallbackUrl"),
+ "disconnect_method": obj.get("disconnectMethod"),
+ "disconnect_url": obj.get("disconnectUrl"),
+ "username": obj.get("username"),
+ "password": obj.get("password"),
+ "fallback_username": obj.get("fallbackUsername"),
+ "fallback_password": obj.get("fallbackPassword"),
+ "priority": obj.get("priority")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/create_lookup_response.py b/bandwidth/models/create_lookup_response.py
new file mode 100644
index 00000000..d025c1fa
--- /dev/null
+++ b/bandwidth/models/create_lookup_response.py
@@ -0,0 +1,87 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+from bandwidth.models.lookup_status_enum import LookupStatusEnum
+
+class CreateLookupResponse(BaseModel):
+ """
+ The request has been accepted for processing but not yet finished and in a terminal state (COMPLETE, PARTIAL_COMPLETE, or FAILED).
+ """
+ request_id: Optional[StrictStr] = Field(None, alias="requestId", description="The phone number lookup request ID from Bandwidth.")
+ status: Optional[LookupStatusEnum] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["requestId", "status"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> CreateLookupResponse:
+ """Create an instance of CreateLookupResponse from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> CreateLookupResponse:
+ """Create an instance of CreateLookupResponse from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return CreateLookupResponse.parse_obj(obj)
+
+ _obj = CreateLookupResponse.parse_obj({
+ "request_id": obj.get("requestId"),
+ "status": obj.get("status")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/create_message_request_error.py b/bandwidth/models/create_message_request_error.py
new file mode 100644
index 00000000..ef0ec458
--- /dev/null
+++ b/bandwidth/models/create_message_request_error.py
@@ -0,0 +1,96 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, List, Optional
+from pydantic import BaseModel, Field, StrictStr, conlist
+from bandwidth.models.field_error import FieldError
+
+class CreateMessageRequestError(BaseModel):
+ """
+ CreateMessageRequestError
+ """
+ type: StrictStr = Field(...)
+ description: StrictStr = Field(...)
+ field_errors: Optional[conlist(FieldError)] = Field(None, alias="fieldErrors")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["type", "description", "fieldErrors"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> CreateMessageRequestError:
+ """Create an instance of CreateMessageRequestError from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of each item in field_errors (list)
+ _items = []
+ if self.field_errors:
+ for _item in self.field_errors:
+ if _item:
+ _items.append(_item.to_dict())
+ _dict['fieldErrors'] = _items
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> CreateMessageRequestError:
+ """Create an instance of CreateMessageRequestError from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return CreateMessageRequestError.parse_obj(obj)
+
+ _obj = CreateMessageRequestError.parse_obj({
+ "type": obj.get("type"),
+ "description": obj.get("description"),
+ "field_errors": [FieldError.from_dict(_item) for _item in obj.get("fieldErrors")] if obj.get("fieldErrors") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/deferred_result.py b/bandwidth/models/deferred_result.py
new file mode 100644
index 00000000..fb79b545
--- /dev/null
+++ b/bandwidth/models/deferred_result.py
@@ -0,0 +1,86 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictBool
+
+class DeferredResult(BaseModel):
+ """
+ DeferredResult
+ """
+ result: Optional[Dict[str, Any]] = None
+ set_or_expired: Optional[StrictBool] = Field(None, alias="setOrExpired")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["result", "setOrExpired"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> DeferredResult:
+ """Create an instance of DeferredResult from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> DeferredResult:
+ """Create an instance of DeferredResult from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return DeferredResult.parse_obj(obj)
+
+ _obj = DeferredResult.parse_obj({
+ "result": obj.get("result"),
+ "set_or_expired": obj.get("setOrExpired")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/disconnect_callback.py b/bandwidth/models/disconnect_callback.py
new file mode 100644
index 00000000..2d2fce0d
--- /dev/null
+++ b/bandwidth/models/disconnect_callback.py
@@ -0,0 +1,142 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+from bandwidth.models.call_direction_enum import CallDirectionEnum
+
+class DisconnectCallback(BaseModel):
+ """
+ The Disconnect event is fired when a call ends, for any reason.
+ """
+ event_type: Optional[StrictStr] = Field(None, alias="eventType", 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.")
+ event_time: Optional[datetime] = Field(None, alias="eventTime", 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.")
+ account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.")
+ application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.")
+ var_from: Optional[StrictStr] = Field(None, alias="from", 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.")
+ to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).")
+ call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.")
+ direction: Optional[CallDirectionEnum] = None
+ call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.")
+ enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.")
+ start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.")
+ answer_time: Optional[datetime] = Field(None, alias="answerTime", description="Time the call was answered, in ISO 8601 format.")
+ end_time: Optional[datetime] = Field(None, alias="endTime", description="The time that the recording ended in ISO-8601 format")
+ cause: Optional[StrictStr] = Field(None, description="Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown.")
+ error_message: Optional[StrictStr] = Field(None, alias="errorMessage", description="Text explaining the reason that caused the call to fail in case of errors.")
+ error_id: Optional[StrictStr] = Field(None, alias="errorId", description="Bandwidth's internal id that references the error event.")
+ tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "callId", "direction", "callUrl", "enqueuedTime", "startTime", "answerTime", "endTime", "cause", "errorMessage", "errorId", "tag"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> DisconnectCallback:
+ """Create an instance of DisconnectCallback from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if enqueued_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.enqueued_time is None and "enqueued_time" in self.__fields_set__:
+ _dict['enqueuedTime'] = None
+
+ # set to None if answer_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.answer_time is None and "answer_time" in self.__fields_set__:
+ _dict['answerTime'] = None
+
+ # set to None if error_message (nullable) is None
+ # and __fields_set__ contains the field
+ if self.error_message is None and "error_message" in self.__fields_set__:
+ _dict['errorMessage'] = None
+
+ # set to None if error_id (nullable) is None
+ # and __fields_set__ contains the field
+ if self.error_id is None and "error_id" in self.__fields_set__:
+ _dict['errorId'] = None
+
+ # set to None if tag (nullable) is None
+ # and __fields_set__ contains the field
+ if self.tag is None and "tag" in self.__fields_set__:
+ _dict['tag'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> DisconnectCallback:
+ """Create an instance of DisconnectCallback from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return DisconnectCallback.parse_obj(obj)
+
+ _obj = DisconnectCallback.parse_obj({
+ "event_type": obj.get("eventType"),
+ "event_time": obj.get("eventTime"),
+ "account_id": obj.get("accountId"),
+ "application_id": obj.get("applicationId"),
+ "var_from": obj.get("from"),
+ "to": obj.get("to"),
+ "call_id": obj.get("callId"),
+ "direction": obj.get("direction"),
+ "call_url": obj.get("callUrl"),
+ "enqueued_time": obj.get("enqueuedTime"),
+ "start_time": obj.get("startTime"),
+ "answer_time": obj.get("answerTime"),
+ "end_time": obj.get("endTime"),
+ "cause": obj.get("cause"),
+ "error_message": obj.get("errorMessage"),
+ "error_id": obj.get("errorId"),
+ "tag": obj.get("tag")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/diversion.py b/bandwidth/models/diversion.py
new file mode 100644
index 00000000..b5ebfbb2
--- /dev/null
+++ b/bandwidth/models/diversion.py
@@ -0,0 +1,96 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class Diversion(BaseModel):
+ """
+ Diversion
+ """
+ reason: Optional[StrictStr] = Field(None, 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.")
+ privacy: Optional[StrictStr] = Field(None, description="off or full")
+ screen: Optional[StrictStr] = Field(None, description="No if the number was provided by the user, yes if the number was provided by the network")
+ counter: Optional[StrictStr] = Field(None, description="The number of diversions that have occurred")
+ limit: Optional[StrictStr] = Field(None, description="The maximum number of diversions allowed for this session")
+ unknown: Optional[StrictStr] = Field(None, description="The normal list of values is not exhaustive. Your application must be tolerant of unlisted keys and unlisted values of those keys.")
+ orig_to: Optional[StrictStr] = Field(None, alias="origTo", description="Always present. Indicates the last telephone number that the call was diverted from.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["reason", "privacy", "screen", "counter", "limit", "unknown", "origTo"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Diversion:
+ """Create an instance of Diversion from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Diversion:
+ """Create an instance of Diversion from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return Diversion.parse_obj(obj)
+
+ _obj = Diversion.parse_obj({
+ "reason": obj.get("reason"),
+ "privacy": obj.get("privacy"),
+ "screen": obj.get("screen"),
+ "counter": obj.get("counter"),
+ "limit": obj.get("limit"),
+ "unknown": obj.get("unknown"),
+ "orig_to": obj.get("origTo")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/dtmf_callback.py b/bandwidth/models/dtmf_callback.py
new file mode 100644
index 00000000..674f2bde
--- /dev/null
+++ b/bandwidth/models/dtmf_callback.py
@@ -0,0 +1,132 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+from bandwidth.models.call_direction_enum import CallDirectionEnum
+
+class DtmfCallback(BaseModel):
+ """
+ The DTMF event is sent for every digit detected after a verb is executed. You may not respond to this event with BXML.
+ """
+ event_type: Optional[StrictStr] = Field(None, alias="eventType", 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.")
+ event_time: Optional[datetime] = Field(None, alias="eventTime", 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.")
+ account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.")
+ application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.")
+ var_from: Optional[StrictStr] = Field(None, alias="from", 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.")
+ to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).")
+ call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.")
+ direction: Optional[CallDirectionEnum] = None
+ digit: Optional[StrictStr] = Field(None, description="The digit collected in the call.")
+ call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.")
+ enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.")
+ start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.")
+ answer_time: Optional[datetime] = Field(None, alias="answerTime", description="Time the call was answered, in ISO 8601 format.")
+ parent_call_id: Optional[StrictStr] = Field(None, alias="parentCallId", 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.")
+ transfer_caller_id: Optional[StrictStr] = Field(None, alias="transferCallerId", 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.")
+ transfer_to: Optional[StrictStr] = Field(None, alias="transferTo", description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).")
+ tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "callId", "direction", "digit", "callUrl", "enqueuedTime", "startTime", "answerTime", "parentCallId", "transferCallerId", "transferTo", "tag"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> DtmfCallback:
+ """Create an instance of DtmfCallback from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if enqueued_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.enqueued_time is None and "enqueued_time" in self.__fields_set__:
+ _dict['enqueuedTime'] = None
+
+ # set to None if answer_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.answer_time is None and "answer_time" in self.__fields_set__:
+ _dict['answerTime'] = None
+
+ # set to None if tag (nullable) is None
+ # and __fields_set__ contains the field
+ if self.tag is None and "tag" in self.__fields_set__:
+ _dict['tag'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> DtmfCallback:
+ """Create an instance of DtmfCallback from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return DtmfCallback.parse_obj(obj)
+
+ _obj = DtmfCallback.parse_obj({
+ "event_type": obj.get("eventType"),
+ "event_time": obj.get("eventTime"),
+ "account_id": obj.get("accountId"),
+ "application_id": obj.get("applicationId"),
+ "var_from": obj.get("from"),
+ "to": obj.get("to"),
+ "call_id": obj.get("callId"),
+ "direction": obj.get("direction"),
+ "digit": obj.get("digit"),
+ "call_url": obj.get("callUrl"),
+ "enqueued_time": obj.get("enqueuedTime"),
+ "start_time": obj.get("startTime"),
+ "answer_time": obj.get("answerTime"),
+ "parent_call_id": obj.get("parentCallId"),
+ "transfer_caller_id": obj.get("transferCallerId"),
+ "transfer_to": obj.get("transferTo"),
+ "tag": obj.get("tag")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/field_error.py b/bandwidth/models/field_error.py
new file mode 100644
index 00000000..203fa03d
--- /dev/null
+++ b/bandwidth/models/field_error.py
@@ -0,0 +1,86 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class FieldError(BaseModel):
+ """
+ FieldError
+ """
+ field_name: Optional[StrictStr] = Field(None, alias="fieldName", description="The name of the field that contains the error")
+ description: Optional[StrictStr] = Field(None, description="The error associated with the field")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["fieldName", "description"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> FieldError:
+ """Create an instance of FieldError from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> FieldError:
+ """Create an instance of FieldError from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return FieldError.parse_obj(obj)
+
+ _obj = FieldError.parse_obj({
+ "field_name": obj.get("fieldName"),
+ "description": obj.get("description")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/file_format_enum.py b/bandwidth/models/file_format_enum.py
new file mode 100644
index 00000000..ab2e801b
--- /dev/null
+++ b/bandwidth/models/file_format_enum.py
@@ -0,0 +1,41 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+
+
+
+class FileFormatEnum(str, Enum):
+ """
+ The format that the recording is stored in.
+ """
+
+ """
+ allowed enum values
+ """
+ MP3 = 'mp3'
+ WAV = 'wav'
+
+ @classmethod
+ def from_json(cls, json_str: str) -> FileFormatEnum:
+ """Create an instance of FileFormatEnum from a JSON string"""
+ return FileFormatEnum(json.loads(json_str))
+
+
diff --git a/bandwidth/models/gather_callback.py b/bandwidth/models/gather_callback.py
new file mode 100644
index 00000000..e0feb0d4
--- /dev/null
+++ b/bandwidth/models/gather_callback.py
@@ -0,0 +1,134 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+from bandwidth.models.call_direction_enum import CallDirectionEnum
+
+class GatherCallback(BaseModel):
+ """
+ The gather event is sent after a verb is executed. Its purpose is to report the gathered digits to the calling application.
+ """
+ event_type: Optional[StrictStr] = Field(None, alias="eventType", 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.")
+ event_time: Optional[datetime] = Field(None, alias="eventTime", 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.")
+ account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.")
+ application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.")
+ var_from: Optional[StrictStr] = Field(None, alias="from", 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.")
+ to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).")
+ direction: Optional[CallDirectionEnum] = None
+ call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.")
+ digits: Optional[StrictStr] = Field(None, 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.")
+ call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.")
+ enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.")
+ start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.")
+ answer_time: Optional[datetime] = Field(None, alias="answerTime", description="Time the call was answered, in ISO 8601 format.")
+ parent_call_id: Optional[StrictStr] = Field(None, alias="parentCallId", 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.")
+ terminating_digit: Optional[StrictStr] = Field(None, alias="terminatingDigit", description="(optional) The digit the user pressed to end the gather. Empty string value if no terminating digit was pressed.")
+ transfer_caller_id: Optional[StrictStr] = Field(None, alias="transferCallerId", 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.")
+ transfer_to: Optional[StrictStr] = Field(None, alias="transferTo", description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).")
+ tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "digits", "callUrl", "enqueuedTime", "startTime", "answerTime", "parentCallId", "terminatingDigit", "transferCallerId", "transferTo", "tag"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> GatherCallback:
+ """Create an instance of GatherCallback from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if enqueued_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.enqueued_time is None and "enqueued_time" in self.__fields_set__:
+ _dict['enqueuedTime'] = None
+
+ # set to None if answer_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.answer_time is None and "answer_time" in self.__fields_set__:
+ _dict['answerTime'] = None
+
+ # set to None if tag (nullable) is None
+ # and __fields_set__ contains the field
+ if self.tag is None and "tag" in self.__fields_set__:
+ _dict['tag'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> GatherCallback:
+ """Create an instance of GatherCallback from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return GatherCallback.parse_obj(obj)
+
+ _obj = GatherCallback.parse_obj({
+ "event_type": obj.get("eventType"),
+ "event_time": obj.get("eventTime"),
+ "account_id": obj.get("accountId"),
+ "application_id": obj.get("applicationId"),
+ "var_from": obj.get("from"),
+ "to": obj.get("to"),
+ "direction": obj.get("direction"),
+ "call_id": obj.get("callId"),
+ "digits": obj.get("digits"),
+ "call_url": obj.get("callUrl"),
+ "enqueued_time": obj.get("enqueuedTime"),
+ "start_time": obj.get("startTime"),
+ "answer_time": obj.get("answerTime"),
+ "parent_call_id": obj.get("parentCallId"),
+ "terminating_digit": obj.get("terminatingDigit"),
+ "transfer_caller_id": obj.get("transferCallerId"),
+ "transfer_to": obj.get("transferTo"),
+ "tag": obj.get("tag")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/inbound_message_callback.py b/bandwidth/models/inbound_message_callback.py
new file mode 100644
index 00000000..4d60dadf
--- /dev/null
+++ b/bandwidth/models/inbound_message_callback.py
@@ -0,0 +1,96 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict
+from pydantic import BaseModel, Field, StrictStr
+from bandwidth.models.inbound_message_callback_message import InboundMessageCallbackMessage
+
+class InboundMessageCallback(BaseModel):
+ """
+ Inbound Message Callback
+ """
+ time: datetime = Field(...)
+ type: StrictStr = Field(...)
+ to: StrictStr = Field(...)
+ description: StrictStr = Field(...)
+ message: InboundMessageCallbackMessage = Field(...)
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["time", "type", "to", "description", "message"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> InboundMessageCallback:
+ """Create an instance of InboundMessageCallback from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of message
+ if self.message:
+ _dict['message'] = self.message.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> InboundMessageCallback:
+ """Create an instance of InboundMessageCallback from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return InboundMessageCallback.parse_obj(obj)
+
+ _obj = InboundMessageCallback.parse_obj({
+ "time": obj.get("time"),
+ "type": obj.get("type"),
+ "to": obj.get("to"),
+ "description": obj.get("description"),
+ "message": InboundMessageCallbackMessage.from_dict(obj.get("message")) if obj.get("message") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/inbound_message_callback_message.py b/bandwidth/models/inbound_message_callback_message.py
new file mode 100644
index 00000000..accb6480
--- /dev/null
+++ b/bandwidth/models/inbound_message_callback_message.py
@@ -0,0 +1,108 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, List, Optional
+from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist
+from bandwidth.models.message_direction_enum import MessageDirectionEnum
+from bandwidth.models.priority_enum import PriorityEnum
+
+class InboundMessageCallbackMessage(BaseModel):
+ """
+ Inbound Message Callback Message Schema
+ """
+ id: StrictStr = Field(...)
+ owner: StrictStr = Field(...)
+ application_id: StrictStr = Field(..., alias="applicationId")
+ time: datetime = Field(...)
+ segment_count: StrictInt = Field(..., alias="segmentCount")
+ direction: MessageDirectionEnum = Field(...)
+ to: conlist(StrictStr, unique_items=True) = Field(...)
+ var_from: StrictStr = Field(..., alias="from")
+ text: StrictStr = Field(...)
+ tag: Optional[StrictStr] = None
+ media: Optional[conlist(StrictStr)] = None
+ priority: Optional[PriorityEnum] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["id", "owner", "applicationId", "time", "segmentCount", "direction", "to", "from", "text", "tag", "media", "priority"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> InboundMessageCallbackMessage:
+ """Create an instance of InboundMessageCallbackMessage from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> InboundMessageCallbackMessage:
+ """Create an instance of InboundMessageCallbackMessage from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return InboundMessageCallbackMessage.parse_obj(obj)
+
+ _obj = InboundMessageCallbackMessage.parse_obj({
+ "id": obj.get("id"),
+ "owner": obj.get("owner"),
+ "application_id": obj.get("applicationId"),
+ "time": obj.get("time"),
+ "segment_count": obj.get("segmentCount"),
+ "direction": obj.get("direction"),
+ "to": obj.get("to"),
+ "var_from": obj.get("from"),
+ "text": obj.get("text"),
+ "tag": obj.get("tag"),
+ "media": obj.get("media"),
+ "priority": obj.get("priority")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/initiate_callback.py b/bandwidth/models/initiate_callback.py
new file mode 100644
index 00000000..955eab7b
--- /dev/null
+++ b/bandwidth/models/initiate_callback.py
@@ -0,0 +1,115 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+from bandwidth.models.call_direction_enum import CallDirectionEnum
+from bandwidth.models.diversion import Diversion
+from bandwidth.models.stir_shaken import StirShaken
+
+class InitiateCallback(BaseModel):
+ """
+ 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.
+ """
+ event_type: Optional[StrictStr] = Field(None, alias="eventType", 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.")
+ event_time: Optional[datetime] = Field(None, alias="eventTime", 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.")
+ account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.")
+ application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.")
+ var_from: Optional[StrictStr] = Field(None, alias="from", 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.")
+ to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).")
+ direction: Optional[CallDirectionEnum] = None
+ call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.")
+ call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.")
+ start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.")
+ diversion: Optional[Diversion] = None
+ stir_shaken: Optional[StirShaken] = Field(None, alias="stirShaken")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "startTime", "diversion", "stirShaken"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> InitiateCallback:
+ """Create an instance of InitiateCallback from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of diversion
+ if self.diversion:
+ _dict['diversion'] = self.diversion.to_dict()
+ # override the default output from pydantic by calling `to_dict()` of stir_shaken
+ if self.stir_shaken:
+ _dict['stirShaken'] = self.stir_shaken.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> InitiateCallback:
+ """Create an instance of InitiateCallback from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return InitiateCallback.parse_obj(obj)
+
+ _obj = InitiateCallback.parse_obj({
+ "event_type": obj.get("eventType"),
+ "event_time": obj.get("eventTime"),
+ "account_id": obj.get("accountId"),
+ "application_id": obj.get("applicationId"),
+ "var_from": obj.get("from"),
+ "to": obj.get("to"),
+ "direction": obj.get("direction"),
+ "call_id": obj.get("callId"),
+ "call_url": obj.get("callUrl"),
+ "start_time": obj.get("startTime"),
+ "diversion": Diversion.from_dict(obj.get("diversion")) if obj.get("diversion") is not None else None,
+ "stir_shaken": StirShaken.from_dict(obj.get("stirShaken")) if obj.get("stirShaken") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/list_message_direction_enum.py b/bandwidth/models/list_message_direction_enum.py
new file mode 100644
index 00000000..f4942d91
--- /dev/null
+++ b/bandwidth/models/list_message_direction_enum.py
@@ -0,0 +1,41 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+
+
+
+class ListMessageDirectionEnum(str, Enum):
+ """
+ The direction of the message. One of INBOUND OUTBOUND.
+ """
+
+ """
+ allowed enum values
+ """
+ INBOUND = 'INBOUND'
+ OUTBOUND = 'OUTBOUND'
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ListMessageDirectionEnum:
+ """Create an instance of ListMessageDirectionEnum from a JSON string"""
+ return ListMessageDirectionEnum(json.loads(json_str))
+
+
diff --git a/bandwidth/models/list_message_item.py b/bandwidth/models/list_message_item.py
new file mode 100644
index 00000000..b87372d5
--- /dev/null
+++ b/bandwidth/models/list_message_item.py
@@ -0,0 +1,149 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictInt, StrictStr
+from bandwidth.models.list_message_direction_enum import ListMessageDirectionEnum
+from bandwidth.models.message_status_enum import MessageStatusEnum
+from bandwidth.models.message_type_enum import MessageTypeEnum
+
+class ListMessageItem(BaseModel):
+ """
+ ListMessageItem
+ """
+ message_id: Optional[StrictStr] = Field(None, alias="messageId", description="The message id")
+ account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The account id associated with this message.")
+ source_tn: Optional[StrictStr] = Field(None, alias="sourceTn", description="The source phone number of the message.")
+ destination_tn: Optional[StrictStr] = Field(None, alias="destinationTn", description="The recipient phone number of the message.")
+ message_status: Optional[MessageStatusEnum] = Field(None, alias="messageStatus")
+ message_direction: Optional[ListMessageDirectionEnum] = Field(None, alias="messageDirection")
+ message_type: Optional[MessageTypeEnum] = Field(None, alias="messageType")
+ segment_count: Optional[StrictInt] = Field(None, alias="segmentCount", description="The number of segments the message was sent as.")
+ error_code: Optional[StrictInt] = Field(None, alias="errorCode", description="The numeric error code of the message.")
+ receive_time: Optional[datetime] = Field(None, alias="receiveTime", description="The ISO 8601 datetime of the message.")
+ carrier_name: Optional[StrictStr] = Field(None, alias="carrierName", description="The name of the carrier. Not currently supported for MMS coming soon.")
+ message_size: Optional[StrictInt] = Field(None, alias="messageSize", description="The size of the message including message content and headers.")
+ message_length: Optional[StrictInt] = Field(None, alias="messageLength", description="The length of the message content.")
+ attachment_count: Optional[StrictInt] = Field(None, alias="attachmentCount", description="The number of attachments the message has.")
+ recipient_count: Optional[StrictInt] = Field(None, alias="recipientCount", description="The number of recipients the message has.")
+ campaign_class: Optional[StrictStr] = Field(None, alias="campaignClass", description="The campaign class of the message if it has one.")
+ campaign_id: Optional[StrictStr] = Field(None, alias="campaignId", description="The campaign ID of the message if it has one.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["messageId", "accountId", "sourceTn", "destinationTn", "messageStatus", "messageDirection", "messageType", "segmentCount", "errorCode", "receiveTime", "carrierName", "messageSize", "messageLength", "attachmentCount", "recipientCount", "campaignClass", "campaignId"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ListMessageItem:
+ """Create an instance of ListMessageItem from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if carrier_name (nullable) is None
+ # and __fields_set__ contains the field
+ if self.carrier_name is None and "carrier_name" in self.__fields_set__:
+ _dict['carrierName'] = None
+
+ # set to None if message_size (nullable) is None
+ # and __fields_set__ contains the field
+ if self.message_size is None and "message_size" in self.__fields_set__:
+ _dict['messageSize'] = None
+
+ # set to None if attachment_count (nullable) is None
+ # and __fields_set__ contains the field
+ if self.attachment_count is None and "attachment_count" in self.__fields_set__:
+ _dict['attachmentCount'] = None
+
+ # set to None if recipient_count (nullable) is None
+ # and __fields_set__ contains the field
+ if self.recipient_count is None and "recipient_count" in self.__fields_set__:
+ _dict['recipientCount'] = None
+
+ # set to None if campaign_class (nullable) is None
+ # and __fields_set__ contains the field
+ if self.campaign_class is None and "campaign_class" in self.__fields_set__:
+ _dict['campaignClass'] = None
+
+ # set to None if campaign_id (nullable) is None
+ # and __fields_set__ contains the field
+ if self.campaign_id is None and "campaign_id" in self.__fields_set__:
+ _dict['campaignId'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ListMessageItem:
+ """Create an instance of ListMessageItem from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return ListMessageItem.parse_obj(obj)
+
+ _obj = ListMessageItem.parse_obj({
+ "message_id": obj.get("messageId"),
+ "account_id": obj.get("accountId"),
+ "source_tn": obj.get("sourceTn"),
+ "destination_tn": obj.get("destinationTn"),
+ "message_status": obj.get("messageStatus"),
+ "message_direction": obj.get("messageDirection"),
+ "message_type": obj.get("messageType"),
+ "segment_count": obj.get("segmentCount"),
+ "error_code": obj.get("errorCode"),
+ "receive_time": obj.get("receiveTime"),
+ "carrier_name": obj.get("carrierName"),
+ "message_size": obj.get("messageSize"),
+ "message_length": obj.get("messageLength"),
+ "attachment_count": obj.get("attachmentCount"),
+ "recipient_count": obj.get("recipientCount"),
+ "campaign_class": obj.get("campaignClass"),
+ "campaign_id": obj.get("campaignId")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/lookup_request.py b/bandwidth/models/lookup_request.py
new file mode 100644
index 00000000..8c3ae281
--- /dev/null
+++ b/bandwidth/models/lookup_request.py
@@ -0,0 +1,84 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, List
+from pydantic import BaseModel, Field, StrictStr, conlist
+
+class LookupRequest(BaseModel):
+ """
+ Create phone number lookup request.
+ """
+ tns: conlist(StrictStr) = Field(...)
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["tns"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> LookupRequest:
+ """Create an instance of LookupRequest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> LookupRequest:
+ """Create an instance of LookupRequest from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return LookupRequest.parse_obj(obj)
+
+ _obj = LookupRequest.parse_obj({
+ "tns": obj.get("tns")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/lookup_result.py b/bandwidth/models/lookup_result.py
new file mode 100644
index 00000000..08046563
--- /dev/null
+++ b/bandwidth/models/lookup_result.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictInt, StrictStr
+
+class LookupResult(BaseModel):
+ """
+ Carrier information results for the specified telephone number.
+ """
+ response_code: Optional[StrictInt] = Field(None, alias="Response Code", description="Our vendor's response code.")
+ message: Optional[StrictStr] = Field(None, alias="Message", description="Message associated with the response code.")
+ e_164_format: Optional[StrictStr] = Field(None, alias="E.164 Format", description="The telephone number in E.164 format.")
+ formatted: Optional[StrictStr] = Field(None, alias="Formatted", description="The formatted version of the telephone number.")
+ country: Optional[StrictStr] = Field(None, alias="Country", description="The country of the telephone number.")
+ line_type: Optional[StrictStr] = Field(None, alias="Line Type", description="The line type of the telephone number.")
+ line_provider: Optional[StrictStr] = Field(None, alias="Line Provider", description="The messaging service provider of the telephone number.")
+ mobile_country_code: Optional[StrictStr] = Field(None, alias="Mobile Country Code", description="The first half of the Home Network Identity (HNI).")
+ mobile_network_code: Optional[StrictStr] = Field(None, alias="Mobile Network Code", description="The second half of the HNI.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["Response Code", "Message", "E.164 Format", "Formatted", "Country", "Line Type", "Line Provider", "Mobile Country Code", "Mobile Network Code"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> LookupResult:
+ """Create an instance of LookupResult from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> LookupResult:
+ """Create an instance of LookupResult from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return LookupResult.parse_obj(obj)
+
+ _obj = LookupResult.parse_obj({
+ "response_code": obj.get("Response Code"),
+ "message": obj.get("Message"),
+ "e_164_format": obj.get("E.164 Format"),
+ "formatted": obj.get("Formatted"),
+ "country": obj.get("Country"),
+ "line_type": obj.get("Line Type"),
+ "line_provider": obj.get("Line Provider"),
+ "mobile_country_code": obj.get("Mobile Country Code"),
+ "mobile_network_code": obj.get("Mobile Network Code")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/lookup_status.py b/bandwidth/models/lookup_status.py
new file mode 100644
index 00000000..6b15872e
--- /dev/null
+++ b/bandwidth/models/lookup_status.py
@@ -0,0 +1,99 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, List, Optional
+from pydantic import BaseModel, Field, StrictStr, conlist
+from bandwidth.models.lookup_result import LookupResult
+from bandwidth.models.lookup_status_enum import LookupStatusEnum
+
+class LookupStatus(BaseModel):
+ """
+ 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.
+ """
+ request_id: Optional[StrictStr] = Field(None, alias="requestId", description="The requestId.")
+ status: Optional[LookupStatusEnum] = None
+ result: Optional[conlist(LookupResult)] = Field(None, description="The carrier information results for the specified telephone number.")
+ failed_telephone_numbers: Optional[conlist(StrictStr)] = Field(None, alias="failedTelephoneNumbers", description="The telephone numbers whose lookup failed.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["requestId", "status", "result", "failedTelephoneNumbers"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> LookupStatus:
+ """Create an instance of LookupStatus from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of each item in result (list)
+ _items = []
+ if self.result:
+ for _item in self.result:
+ if _item:
+ _items.append(_item.to_dict())
+ _dict['result'] = _items
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> LookupStatus:
+ """Create an instance of LookupStatus from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return LookupStatus.parse_obj(obj)
+
+ _obj = LookupStatus.parse_obj({
+ "request_id": obj.get("requestId"),
+ "status": obj.get("status"),
+ "result": [LookupResult.from_dict(_item) for _item in obj.get("result")] if obj.get("result") is not None else None,
+ "failed_telephone_numbers": obj.get("failedTelephoneNumbers")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/lookup_status_enum.py b/bandwidth/models/lookup_status_enum.py
new file mode 100644
index 00000000..2de98f4c
--- /dev/null
+++ b/bandwidth/models/lookup_status_enum.py
@@ -0,0 +1,43 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+
+
+
+class LookupStatusEnum(str, Enum):
+ """
+ The status of the request (IN_PROGRESS, COMPLETE, PARTIAL_COMPLETE, or FAILED).
+ """
+
+ """
+ allowed enum values
+ """
+ IN_PROGRESS = 'IN_PROGRESS'
+ COMPLETE = 'COMPLETE'
+ PARTIAL_COMPLETE = 'PARTIAL_COMPLETE'
+ FAILED = 'FAILED'
+
+ @classmethod
+ def from_json(cls, json_str: str) -> LookupStatusEnum:
+ """Create an instance of LookupStatusEnum from a JSON string"""
+ return LookupStatusEnum(json.loads(json_str))
+
+
diff --git a/bandwidth/models/machine_detection_complete_callback.py b/bandwidth/models/machine_detection_complete_callback.py
new file mode 100644
index 00000000..fe95ff99
--- /dev/null
+++ b/bandwidth/models/machine_detection_complete_callback.py
@@ -0,0 +1,135 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+from bandwidth.models.call_direction_enum import CallDirectionEnum
+from bandwidth.models.machine_detection_result import MachineDetectionResult
+
+class MachineDetectionCompleteCallback(BaseModel):
+ """
+ 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.
+ """
+ event_type: Optional[StrictStr] = Field(None, alias="eventType", 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.")
+ event_time: Optional[datetime] = Field(None, alias="eventTime", 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.")
+ account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.")
+ application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.")
+ var_from: Optional[StrictStr] = Field(None, alias="from", 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.")
+ to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).")
+ direction: Optional[CallDirectionEnum] = None
+ call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.")
+ call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.")
+ enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.")
+ start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.")
+ answer_time: Optional[datetime] = Field(None, alias="answerTime", description="Time the call was answered, in ISO 8601 format.")
+ tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.")
+ machine_detection_result: Optional[MachineDetectionResult] = Field(None, alias="machineDetectionResult")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "enqueuedTime", "startTime", "answerTime", "tag", "machineDetectionResult"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> MachineDetectionCompleteCallback:
+ """Create an instance of MachineDetectionCompleteCallback from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of machine_detection_result
+ if self.machine_detection_result:
+ _dict['machineDetectionResult'] = self.machine_detection_result.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if enqueued_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.enqueued_time is None and "enqueued_time" in self.__fields_set__:
+ _dict['enqueuedTime'] = None
+
+ # set to None if answer_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.answer_time is None and "answer_time" in self.__fields_set__:
+ _dict['answerTime'] = None
+
+ # set to None if tag (nullable) is None
+ # and __fields_set__ contains the field
+ if self.tag is None and "tag" in self.__fields_set__:
+ _dict['tag'] = None
+
+ # set to None if machine_detection_result (nullable) is None
+ # and __fields_set__ contains the field
+ if self.machine_detection_result is None and "machine_detection_result" in self.__fields_set__:
+ _dict['machineDetectionResult'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> MachineDetectionCompleteCallback:
+ """Create an instance of MachineDetectionCompleteCallback from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return MachineDetectionCompleteCallback.parse_obj(obj)
+
+ _obj = MachineDetectionCompleteCallback.parse_obj({
+ "event_type": obj.get("eventType"),
+ "event_time": obj.get("eventTime"),
+ "account_id": obj.get("accountId"),
+ "application_id": obj.get("applicationId"),
+ "var_from": obj.get("from"),
+ "to": obj.get("to"),
+ "direction": obj.get("direction"),
+ "call_id": obj.get("callId"),
+ "call_url": obj.get("callUrl"),
+ "enqueued_time": obj.get("enqueuedTime"),
+ "start_time": obj.get("startTime"),
+ "answer_time": obj.get("answerTime"),
+ "tag": obj.get("tag"),
+ "machine_detection_result": MachineDetectionResult.from_dict(obj.get("machineDetectionResult")) if obj.get("machineDetectionResult") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/machine_detection_configuration.py b/bandwidth/models/machine_detection_configuration.py
new file mode 100644
index 00000000..6019fa1c
--- /dev/null
+++ b/bandwidth/models/machine_detection_configuration.py
@@ -0,0 +1,184 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional, Union
+from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, constr
+from bandwidth.models.callback_method_enum import CallbackMethodEnum
+from bandwidth.models.machine_detection_mode_enum import MachineDetectionModeEnum
+
+class MachineDetectionConfiguration(BaseModel):
+ """
+ The machine detection request used to perform machine detection on the call.
+ """
+ mode: Optional[MachineDetectionModeEnum] = None
+ detection_timeout: Optional[Union[StrictFloat, StrictInt]] = Field(15, alias="detectionTimeout", 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.")
+ silence_timeout: Optional[Union[StrictFloat, StrictInt]] = Field(10, alias="silenceTimeout", description="If no speech is detected in this period, a callback with a 'silence' result is sent.")
+ speech_threshold: Optional[Union[StrictFloat, StrictInt]] = Field(10, alias="speechThreshold", 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'.")
+ speech_end_threshold: Optional[Union[StrictFloat, StrictInt]] = Field(5, alias="speechEndThreshold", description="Amount of silence (in seconds) before assuming the callee has finished speaking.")
+ machine_speech_end_threshold: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="machineSpeechEndThreshold", 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.")
+ delay_result: Optional[StrictBool] = Field(False, alias="delayResult", 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.")
+ callback_url: Optional[constr(strict=True, max_length=2048)] = Field(None, alias="callbackUrl", description="The URL to send the 'machineDetectionComplete' webhook when the detection is completed. Only for 'async' mode.")
+ callback_method: Optional[CallbackMethodEnum] = Field(None, alias="callbackMethod")
+ username: Optional[constr(strict=True, max_length=1024)] = Field(None, description="Basic auth username.")
+ password: Optional[constr(strict=True, max_length=1024)] = Field(None, description="Basic auth password.")
+ fallback_url: Optional[constr(strict=True, max_length=2048)] = Field(None, alias="fallbackUrl", description="A fallback URL which, if provided, will be used to retry the machine detection complete webhook delivery in case `callbackUrl` fails to respond")
+ fallback_method: Optional[CallbackMethodEnum] = Field(None, alias="fallbackMethod")
+ fallback_username: Optional[constr(strict=True, max_length=1024)] = Field(None, alias="fallbackUsername", description="Basic auth username.")
+ fallback_password: Optional[constr(strict=True, max_length=1024)] = Field(None, alias="fallbackPassword", description="Basic auth password.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["mode", "detectionTimeout", "silenceTimeout", "speechThreshold", "speechEndThreshold", "machineSpeechEndThreshold", "delayResult", "callbackUrl", "callbackMethod", "username", "password", "fallbackUrl", "fallbackMethod", "fallbackUsername", "fallbackPassword"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> MachineDetectionConfiguration:
+ """Create an instance of MachineDetectionConfiguration from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if detection_timeout (nullable) is None
+ # and __fields_set__ contains the field
+ if self.detection_timeout is None and "detection_timeout" in self.__fields_set__:
+ _dict['detectionTimeout'] = None
+
+ # set to None if silence_timeout (nullable) is None
+ # and __fields_set__ contains the field
+ if self.silence_timeout is None and "silence_timeout" in self.__fields_set__:
+ _dict['silenceTimeout'] = None
+
+ # set to None if speech_threshold (nullable) is None
+ # and __fields_set__ contains the field
+ if self.speech_threshold is None and "speech_threshold" in self.__fields_set__:
+ _dict['speechThreshold'] = None
+
+ # set to None if speech_end_threshold (nullable) is None
+ # and __fields_set__ contains the field
+ if self.speech_end_threshold is None and "speech_end_threshold" in self.__fields_set__:
+ _dict['speechEndThreshold'] = None
+
+ # set to None if machine_speech_end_threshold (nullable) is None
+ # and __fields_set__ contains the field
+ if self.machine_speech_end_threshold is None and "machine_speech_end_threshold" in self.__fields_set__:
+ _dict['machineSpeechEndThreshold'] = None
+
+ # set to None if delay_result (nullable) is None
+ # and __fields_set__ contains the field
+ if self.delay_result is None and "delay_result" in self.__fields_set__:
+ _dict['delayResult'] = None
+
+ # set to None if callback_url (nullable) is None
+ # and __fields_set__ contains the field
+ if self.callback_url is None and "callback_url" in self.__fields_set__:
+ _dict['callbackUrl'] = None
+
+ # set to None if callback_method (nullable) is None
+ # and __fields_set__ contains the field
+ if self.callback_method is None and "callback_method" in self.__fields_set__:
+ _dict['callbackMethod'] = None
+
+ # set to None if username (nullable) is None
+ # and __fields_set__ contains the field
+ if self.username is None and "username" in self.__fields_set__:
+ _dict['username'] = None
+
+ # set to None if password (nullable) is None
+ # and __fields_set__ contains the field
+ if self.password is None and "password" in self.__fields_set__:
+ _dict['password'] = None
+
+ # set to None if fallback_url (nullable) is None
+ # and __fields_set__ contains the field
+ if self.fallback_url is None and "fallback_url" in self.__fields_set__:
+ _dict['fallbackUrl'] = None
+
+ # set to None if fallback_method (nullable) is None
+ # and __fields_set__ contains the field
+ if self.fallback_method is None and "fallback_method" in self.__fields_set__:
+ _dict['fallbackMethod'] = None
+
+ # set to None if fallback_username (nullable) is None
+ # and __fields_set__ contains the field
+ if self.fallback_username is None and "fallback_username" in self.__fields_set__:
+ _dict['fallbackUsername'] = None
+
+ # set to None if fallback_password (nullable) is None
+ # and __fields_set__ contains the field
+ if self.fallback_password is None and "fallback_password" in self.__fields_set__:
+ _dict['fallbackPassword'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> MachineDetectionConfiguration:
+ """Create an instance of MachineDetectionConfiguration from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return MachineDetectionConfiguration.parse_obj(obj)
+
+ _obj = MachineDetectionConfiguration.parse_obj({
+ "mode": obj.get("mode"),
+ "detection_timeout": obj.get("detectionTimeout") if obj.get("detectionTimeout") is not None else 15,
+ "silence_timeout": obj.get("silenceTimeout") if obj.get("silenceTimeout") is not None else 10,
+ "speech_threshold": obj.get("speechThreshold") if obj.get("speechThreshold") is not None else 10,
+ "speech_end_threshold": obj.get("speechEndThreshold") if obj.get("speechEndThreshold") is not None else 5,
+ "machine_speech_end_threshold": obj.get("machineSpeechEndThreshold"),
+ "delay_result": obj.get("delayResult") if obj.get("delayResult") is not None else False,
+ "callback_url": obj.get("callbackUrl"),
+ "callback_method": obj.get("callbackMethod"),
+ "username": obj.get("username"),
+ "password": obj.get("password"),
+ "fallback_url": obj.get("fallbackUrl"),
+ "fallback_method": obj.get("fallbackMethod"),
+ "fallback_username": obj.get("fallbackUsername"),
+ "fallback_password": obj.get("fallbackPassword")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/machine_detection_mode_enum.py b/bandwidth/models/machine_detection_mode_enum.py
new file mode 100644
index 00000000..c203e900
--- /dev/null
+++ b/bandwidth/models/machine_detection_mode_enum.py
@@ -0,0 +1,41 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+
+
+
+class MachineDetectionModeEnum(str, Enum):
+ """
+ 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.
+ """
+
+ """
+ allowed enum values
+ """
+ SYNC = 'sync'
+ ASYNC = 'async'
+
+ @classmethod
+ def from_json(cls, json_str: str) -> MachineDetectionModeEnum:
+ """Create an instance of MachineDetectionModeEnum from a JSON string"""
+ return MachineDetectionModeEnum(json.loads(json_str))
+
+
diff --git a/bandwidth/models/machine_detection_result.py b/bandwidth/models/machine_detection_result.py
new file mode 100644
index 00000000..8b659c89
--- /dev/null
+++ b/bandwidth/models/machine_detection_result.py
@@ -0,0 +1,86 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class MachineDetectionResult(BaseModel):
+ """
+ (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
+ """
+ value: Optional[StrictStr] = Field(None, description="Possible values are answering-machine, human, silence, timeout, or error.")
+ duration: Optional[StrictStr] = Field(None, description="The amount of time it took to determine the result.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["value", "duration"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> MachineDetectionResult:
+ """Create an instance of MachineDetectionResult from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> MachineDetectionResult:
+ """Create an instance of MachineDetectionResult from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return MachineDetectionResult.parse_obj(obj)
+
+ _obj = MachineDetectionResult.parse_obj({
+ "value": obj.get("value"),
+ "duration": obj.get("duration")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/media.py b/bandwidth/models/media.py
new file mode 100644
index 00000000..b05a12a9
--- /dev/null
+++ b/bandwidth/models/media.py
@@ -0,0 +1,88 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictInt, StrictStr
+
+class Media(BaseModel):
+ """
+ Media
+ """
+ content: Optional[StrictStr] = None
+ content_length: Optional[StrictInt] = Field(None, alias="contentLength")
+ media_name: Optional[StrictStr] = Field(None, alias="mediaName")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["content", "contentLength", "mediaName"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Media:
+ """Create an instance of Media from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Media:
+ """Create an instance of Media from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return Media.parse_obj(obj)
+
+ _obj = Media.parse_obj({
+ "content": obj.get("content"),
+ "content_length": obj.get("contentLength"),
+ "media_name": obj.get("mediaName")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/message.py b/bandwidth/models/message.py
new file mode 100644
index 00000000..566b3008
--- /dev/null
+++ b/bandwidth/models/message.py
@@ -0,0 +1,110 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, List, Optional
+from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist
+from bandwidth.models.message_direction_enum import MessageDirectionEnum
+from bandwidth.models.priority_enum import PriorityEnum
+
+class Message(BaseModel):
+ """
+ Message
+ """
+ id: Optional[StrictStr] = Field(None, description="The id of the message.")
+ owner: Optional[StrictStr] = Field(None, description="The Bandwidth phone number associated with the message.")
+ application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The application ID associated with the message.")
+ time: Optional[datetime] = Field(None, description="The datetime stamp of the message in ISO 8601")
+ segment_count: Optional[StrictInt] = Field(None, alias="segmentCount", description="The number of segments the original message from the user is broken into before sending over to carrier networks.")
+ direction: Optional[MessageDirectionEnum] = None
+ to: Optional[conlist(StrictStr, unique_items=True)] = Field(None, description="The phone number recipients of the message.")
+ var_from: Optional[StrictStr] = Field(None, alias="from", description="The phone number the message was sent from.")
+ media: Optional[conlist(StrictStr, unique_items=True)] = Field(None, 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.")
+ text: Optional[StrictStr] = Field(None, description="The contents of the message.")
+ tag: Optional[StrictStr] = Field(None, description="The custom string set by the user.")
+ priority: Optional[PriorityEnum] = None
+ expiration: Optional[datetime] = Field(None, description="The expiration date-time set by the user.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["id", "owner", "applicationId", "time", "segmentCount", "direction", "to", "from", "media", "text", "tag", "priority", "expiration"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Message:
+ """Create an instance of Message from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Message:
+ """Create an instance of Message from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return Message.parse_obj(obj)
+
+ _obj = Message.parse_obj({
+ "id": obj.get("id"),
+ "owner": obj.get("owner"),
+ "application_id": obj.get("applicationId"),
+ "time": obj.get("time"),
+ "segment_count": obj.get("segmentCount"),
+ "direction": obj.get("direction"),
+ "to": obj.get("to"),
+ "var_from": obj.get("from"),
+ "media": obj.get("media"),
+ "text": obj.get("text"),
+ "tag": obj.get("tag"),
+ "priority": obj.get("priority"),
+ "expiration": obj.get("expiration")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/message_delivered_callback.py b/bandwidth/models/message_delivered_callback.py
new file mode 100644
index 00000000..e5e8d822
--- /dev/null
+++ b/bandwidth/models/message_delivered_callback.py
@@ -0,0 +1,96 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict
+from pydantic import BaseModel, Field, StrictStr
+from bandwidth.models.message_delivered_callback_message import MessageDeliveredCallbackMessage
+
+class MessageDeliveredCallback(BaseModel):
+ """
+ Message Delivered Callback
+ """
+ time: datetime = Field(...)
+ type: StrictStr = Field(...)
+ to: StrictStr = Field(...)
+ description: StrictStr = Field(...)
+ message: MessageDeliveredCallbackMessage = Field(...)
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["time", "type", "to", "description", "message"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> MessageDeliveredCallback:
+ """Create an instance of MessageDeliveredCallback from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of message
+ if self.message:
+ _dict['message'] = self.message.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> MessageDeliveredCallback:
+ """Create an instance of MessageDeliveredCallback from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return MessageDeliveredCallback.parse_obj(obj)
+
+ _obj = MessageDeliveredCallback.parse_obj({
+ "time": obj.get("time"),
+ "type": obj.get("type"),
+ "to": obj.get("to"),
+ "description": obj.get("description"),
+ "message": MessageDeliveredCallbackMessage.from_dict(obj.get("message")) if obj.get("message") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/message_delivered_callback_message.py b/bandwidth/models/message_delivered_callback_message.py
new file mode 100644
index 00000000..2cc697f8
--- /dev/null
+++ b/bandwidth/models/message_delivered_callback_message.py
@@ -0,0 +1,108 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, List, Optional
+from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist
+from bandwidth.models.message_direction_enum import MessageDirectionEnum
+from bandwidth.models.priority_enum import PriorityEnum
+
+class MessageDeliveredCallbackMessage(BaseModel):
+ """
+ Message Delivered Callback Message Schema
+ """
+ id: StrictStr = Field(...)
+ owner: StrictStr = Field(...)
+ application_id: StrictStr = Field(..., alias="applicationId")
+ time: datetime = Field(...)
+ segment_count: StrictInt = Field(..., alias="segmentCount")
+ direction: MessageDirectionEnum = Field(...)
+ to: conlist(StrictStr, unique_items=True) = Field(...)
+ var_from: StrictStr = Field(..., alias="from")
+ text: StrictStr = Field(...)
+ tag: StrictStr = Field(...)
+ media: Optional[conlist(StrictStr)] = None
+ priority: Optional[PriorityEnum] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["id", "owner", "applicationId", "time", "segmentCount", "direction", "to", "from", "text", "tag", "media", "priority"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> MessageDeliveredCallbackMessage:
+ """Create an instance of MessageDeliveredCallbackMessage from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> MessageDeliveredCallbackMessage:
+ """Create an instance of MessageDeliveredCallbackMessage from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return MessageDeliveredCallbackMessage.parse_obj(obj)
+
+ _obj = MessageDeliveredCallbackMessage.parse_obj({
+ "id": obj.get("id"),
+ "owner": obj.get("owner"),
+ "application_id": obj.get("applicationId"),
+ "time": obj.get("time"),
+ "segment_count": obj.get("segmentCount"),
+ "direction": obj.get("direction"),
+ "to": obj.get("to"),
+ "var_from": obj.get("from"),
+ "text": obj.get("text"),
+ "tag": obj.get("tag"),
+ "media": obj.get("media"),
+ "priority": obj.get("priority")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/message_direction_enum.py b/bandwidth/models/message_direction_enum.py
new file mode 100644
index 00000000..41ad5fce
--- /dev/null
+++ b/bandwidth/models/message_direction_enum.py
@@ -0,0 +1,41 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+
+
+
+class MessageDirectionEnum(str, Enum):
+ """
+ The direction of the message. One of in out.
+ """
+
+ """
+ allowed enum values
+ """
+ IN = 'in'
+ OUT = 'out'
+
+ @classmethod
+ def from_json(cls, json_str: str) -> MessageDirectionEnum:
+ """Create an instance of MessageDirectionEnum from a JSON string"""
+ return MessageDirectionEnum(json.loads(json_str))
+
+
diff --git a/bandwidth/models/message_failed_callback.py b/bandwidth/models/message_failed_callback.py
new file mode 100644
index 00000000..9e708a0f
--- /dev/null
+++ b/bandwidth/models/message_failed_callback.py
@@ -0,0 +1,98 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict
+from pydantic import BaseModel, Field, StrictInt, StrictStr
+from bandwidth.models.message_failed_callback_message import MessageFailedCallbackMessage
+
+class MessageFailedCallback(BaseModel):
+ """
+ Message Failed Callback
+ """
+ time: datetime = Field(...)
+ type: StrictStr = Field(...)
+ to: StrictStr = Field(...)
+ description: StrictStr = Field(...)
+ message: MessageFailedCallbackMessage = Field(...)
+ error_code: StrictInt = Field(..., alias="errorCode")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["time", "type", "to", "description", "message", "errorCode"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> MessageFailedCallback:
+ """Create an instance of MessageFailedCallback from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of message
+ if self.message:
+ _dict['message'] = self.message.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> MessageFailedCallback:
+ """Create an instance of MessageFailedCallback from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return MessageFailedCallback.parse_obj(obj)
+
+ _obj = MessageFailedCallback.parse_obj({
+ "time": obj.get("time"),
+ "type": obj.get("type"),
+ "to": obj.get("to"),
+ "description": obj.get("description"),
+ "message": MessageFailedCallbackMessage.from_dict(obj.get("message")) if obj.get("message") is not None else None,
+ "error_code": obj.get("errorCode")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/message_failed_callback_message.py b/bandwidth/models/message_failed_callback_message.py
new file mode 100644
index 00000000..90155f61
--- /dev/null
+++ b/bandwidth/models/message_failed_callback_message.py
@@ -0,0 +1,108 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, List, Optional
+from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist
+from bandwidth.models.message_direction_enum import MessageDirectionEnum
+from bandwidth.models.priority_enum import PriorityEnum
+
+class MessageFailedCallbackMessage(BaseModel):
+ """
+ Message Failed Callback Message Schema
+ """
+ id: StrictStr = Field(...)
+ owner: StrictStr = Field(...)
+ application_id: StrictStr = Field(..., alias="applicationId")
+ time: datetime = Field(...)
+ segment_count: StrictInt = Field(..., alias="segmentCount")
+ direction: MessageDirectionEnum = Field(...)
+ to: conlist(StrictStr, unique_items=True) = Field(...)
+ var_from: StrictStr = Field(..., alias="from")
+ text: StrictStr = Field(...)
+ tag: StrictStr = Field(...)
+ media: Optional[conlist(StrictStr)] = None
+ priority: PriorityEnum = Field(...)
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["id", "owner", "applicationId", "time", "segmentCount", "direction", "to", "from", "text", "tag", "media", "priority"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> MessageFailedCallbackMessage:
+ """Create an instance of MessageFailedCallbackMessage from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> MessageFailedCallbackMessage:
+ """Create an instance of MessageFailedCallbackMessage from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return MessageFailedCallbackMessage.parse_obj(obj)
+
+ _obj = MessageFailedCallbackMessage.parse_obj({
+ "id": obj.get("id"),
+ "owner": obj.get("owner"),
+ "application_id": obj.get("applicationId"),
+ "time": obj.get("time"),
+ "segment_count": obj.get("segmentCount"),
+ "direction": obj.get("direction"),
+ "to": obj.get("to"),
+ "var_from": obj.get("from"),
+ "text": obj.get("text"),
+ "tag": obj.get("tag"),
+ "media": obj.get("media"),
+ "priority": obj.get("priority")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/message_request.py b/bandwidth/models/message_request.py
new file mode 100644
index 00000000..8808fc40
--- /dev/null
+++ b/bandwidth/models/message_request.py
@@ -0,0 +1,99 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, List, Optional
+from pydantic import BaseModel, Field, StrictStr, conlist, constr
+from bandwidth.models.priority_enum import PriorityEnum
+
+class MessageRequest(BaseModel):
+ """
+ MessageRequest
+ """
+ application_id: StrictStr = Field(..., alias="applicationId", description="The ID of the Application your from number is associated with in the Bandwidth Phone Number Dashboard.")
+ to: conlist(StrictStr, unique_items=True) = Field(..., description="The phone number(s) the message should be sent to in E164 format.")
+ var_from: StrictStr = Field(..., alias="from", description="One of your telephone numbers the message should come from in E164 format.")
+ text: Optional[constr(strict=True, max_length=2048)] = Field(None, description="The contents of the text message. Must be 2048 characters or less.")
+ media: Optional[conlist(constr(strict=True, max_length=4096))] = Field(None, description="A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters.")
+ tag: Optional[StrictStr] = Field(None, description="A custom string that will be included in callback events of the message. Max 1024 characters.")
+ priority: Optional[PriorityEnum] = None
+ expiration: Optional[datetime] = Field(None, 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. Must be a date-time in the future. Not supported on MMS.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["applicationId", "to", "from", "text", "media", "tag", "priority", "expiration"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> MessageRequest:
+ """Create an instance of MessageRequest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> MessageRequest:
+ """Create an instance of MessageRequest from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return MessageRequest.parse_obj(obj)
+
+ _obj = MessageRequest.parse_obj({
+ "application_id": obj.get("applicationId"),
+ "to": obj.get("to"),
+ "var_from": obj.get("from"),
+ "text": obj.get("text"),
+ "media": obj.get("media"),
+ "tag": obj.get("tag"),
+ "priority": obj.get("priority"),
+ "expiration": obj.get("expiration")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/message_sending_callback.py b/bandwidth/models/message_sending_callback.py
new file mode 100644
index 00000000..c4de877d
--- /dev/null
+++ b/bandwidth/models/message_sending_callback.py
@@ -0,0 +1,96 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict
+from pydantic import BaseModel, Field, StrictStr
+from bandwidth.models.message_sending_callback_message import MessageSendingCallbackMessage
+
+class MessageSendingCallback(BaseModel):
+ """
+ Message Sending Callback
+ """
+ time: datetime = Field(...)
+ type: StrictStr = Field(...)
+ to: StrictStr = Field(...)
+ description: StrictStr = Field(...)
+ message: MessageSendingCallbackMessage = Field(...)
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["time", "type", "to", "description", "message"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> MessageSendingCallback:
+ """Create an instance of MessageSendingCallback from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of message
+ if self.message:
+ _dict['message'] = self.message.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> MessageSendingCallback:
+ """Create an instance of MessageSendingCallback from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return MessageSendingCallback.parse_obj(obj)
+
+ _obj = MessageSendingCallback.parse_obj({
+ "time": obj.get("time"),
+ "type": obj.get("type"),
+ "to": obj.get("to"),
+ "description": obj.get("description"),
+ "message": MessageSendingCallbackMessage.from_dict(obj.get("message")) if obj.get("message") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/message_sending_callback_message.py b/bandwidth/models/message_sending_callback_message.py
new file mode 100644
index 00000000..7a1250b4
--- /dev/null
+++ b/bandwidth/models/message_sending_callback_message.py
@@ -0,0 +1,108 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, List, Optional
+from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist
+from bandwidth.models.message_direction_enum import MessageDirectionEnum
+from bandwidth.models.priority_enum import PriorityEnum
+
+class MessageSendingCallbackMessage(BaseModel):
+ """
+ Message Sending Callback Message Schema
+ """
+ id: StrictStr = Field(...)
+ owner: StrictStr = Field(...)
+ application_id: StrictStr = Field(..., alias="applicationId")
+ time: datetime = Field(...)
+ segment_count: StrictInt = Field(..., alias="segmentCount")
+ direction: MessageDirectionEnum = Field(...)
+ to: conlist(StrictStr, unique_items=True) = Field(...)
+ var_from: StrictStr = Field(..., alias="from")
+ text: StrictStr = Field(...)
+ tag: Optional[StrictStr] = None
+ media: conlist(StrictStr) = Field(...)
+ priority: PriorityEnum = Field(...)
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["id", "owner", "applicationId", "time", "segmentCount", "direction", "to", "from", "text", "tag", "media", "priority"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> MessageSendingCallbackMessage:
+ """Create an instance of MessageSendingCallbackMessage from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> MessageSendingCallbackMessage:
+ """Create an instance of MessageSendingCallbackMessage from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return MessageSendingCallbackMessage.parse_obj(obj)
+
+ _obj = MessageSendingCallbackMessage.parse_obj({
+ "id": obj.get("id"),
+ "owner": obj.get("owner"),
+ "application_id": obj.get("applicationId"),
+ "time": obj.get("time"),
+ "segment_count": obj.get("segmentCount"),
+ "direction": obj.get("direction"),
+ "to": obj.get("to"),
+ "var_from": obj.get("from"),
+ "text": obj.get("text"),
+ "tag": obj.get("tag"),
+ "media": obj.get("media"),
+ "priority": obj.get("priority")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/message_status_enum.py b/bandwidth/models/message_status_enum.py
new file mode 100644
index 00000000..08e85f78
--- /dev/null
+++ b/bandwidth/models/message_status_enum.py
@@ -0,0 +1,47 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+
+
+
+class MessageStatusEnum(str, Enum):
+ """
+ The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED.
+ """
+
+ """
+ allowed enum values
+ """
+ RECEIVED = 'RECEIVED'
+ QUEUED = 'QUEUED'
+ SENDING = 'SENDING'
+ SENT = 'SENT'
+ FAILED = 'FAILED'
+ DELIVERED = 'DELIVERED'
+ ACCEPTED = 'ACCEPTED'
+ UNDELIVERED = 'UNDELIVERED'
+
+ @classmethod
+ def from_json(cls, json_str: str) -> MessageStatusEnum:
+ """Create an instance of MessageStatusEnum from a JSON string"""
+ return MessageStatusEnum(json.loads(json_str))
+
+
diff --git a/bandwidth/models/message_type_enum.py b/bandwidth/models/message_type_enum.py
new file mode 100644
index 00000000..7e7bca41
--- /dev/null
+++ b/bandwidth/models/message_type_enum.py
@@ -0,0 +1,41 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+
+
+
+class MessageTypeEnum(str, Enum):
+ """
+ The type of message. Either SMS or MMS.
+ """
+
+ """
+ allowed enum values
+ """
+ SMS = 'sms'
+ MMS = 'mms'
+
+ @classmethod
+ def from_json(cls, json_str: str) -> MessageTypeEnum:
+ """Create an instance of MessageTypeEnum from a JSON string"""
+ return MessageTypeEnum(json.loads(json_str))
+
+
diff --git a/bandwidth/models/messages_list.py b/bandwidth/models/messages_list.py
new file mode 100644
index 00000000..2bd0f4f4
--- /dev/null
+++ b/bandwidth/models/messages_list.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, List, Optional
+from pydantic import BaseModel, Field, StrictInt, conlist
+from bandwidth.models.list_message_item import ListMessageItem
+from bandwidth.models.page_info import PageInfo
+
+class MessagesList(BaseModel):
+ """
+ MessagesList
+ """
+ total_count: Optional[StrictInt] = Field(None, alias="totalCount", 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.")
+ page_info: Optional[PageInfo] = Field(None, alias="pageInfo")
+ messages: Optional[conlist(ListMessageItem)] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["totalCount", "pageInfo", "messages"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> MessagesList:
+ """Create an instance of MessagesList from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of page_info
+ if self.page_info:
+ _dict['pageInfo'] = self.page_info.to_dict()
+ # override the default output from pydantic by calling `to_dict()` of each item in messages (list)
+ _items = []
+ if self.messages:
+ for _item in self.messages:
+ if _item:
+ _items.append(_item.to_dict())
+ _dict['messages'] = _items
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> MessagesList:
+ """Create an instance of MessagesList from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return MessagesList.parse_obj(obj)
+
+ _obj = MessagesList.parse_obj({
+ "total_count": obj.get("totalCount"),
+ "page_info": PageInfo.from_dict(obj.get("pageInfo")) if obj.get("pageInfo") is not None else None,
+ "messages": [ListMessageItem.from_dict(_item) for _item in obj.get("messages")] if obj.get("messages") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/messaging_code_response.py b/bandwidth/models/messaging_code_response.py
new file mode 100644
index 00000000..8d2a4405
--- /dev/null
+++ b/bandwidth/models/messaging_code_response.py
@@ -0,0 +1,84 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class MessagingCodeResponse(BaseModel):
+ """
+ MessagingCodeResponse
+ """
+ message_id: Optional[StrictStr] = Field(None, alias="messageId", description="Messaging API Message ID.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["messageId"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> MessagingCodeResponse:
+ """Create an instance of MessagingCodeResponse from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> MessagingCodeResponse:
+ """Create an instance of MessagingCodeResponse from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return MessagingCodeResponse.parse_obj(obj)
+
+ _obj = MessagingCodeResponse.parse_obj({
+ "message_id": obj.get("messageId")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/messaging_request_error.py b/bandwidth/models/messaging_request_error.py
new file mode 100644
index 00000000..d4c09716
--- /dev/null
+++ b/bandwidth/models/messaging_request_error.py
@@ -0,0 +1,86 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict
+from pydantic import BaseModel, Field, StrictStr
+
+class MessagingRequestError(BaseModel):
+ """
+ MessagingRequestError
+ """
+ type: StrictStr = Field(...)
+ description: StrictStr = Field(...)
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["type", "description"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> MessagingRequestError:
+ """Create an instance of MessagingRequestError from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> MessagingRequestError:
+ """Create an instance of MessagingRequestError from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return MessagingRequestError.parse_obj(obj)
+
+ _obj = MessagingRequestError.parse_obj({
+ "type": obj.get("type"),
+ "description": obj.get("description")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/mfa_forbidden_request_error.py b/bandwidth/models/mfa_forbidden_request_error.py
new file mode 100644
index 00000000..7cf9c507
--- /dev/null
+++ b/bandwidth/models/mfa_forbidden_request_error.py
@@ -0,0 +1,84 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class MfaForbiddenRequestError(BaseModel):
+ """
+ MfaForbiddenRequestError
+ """
+ message: Optional[StrictStr] = Field(None, description="The message containing the reason behind the request being forbidden.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["message"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> MfaForbiddenRequestError:
+ """Create an instance of MfaForbiddenRequestError from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> MfaForbiddenRequestError:
+ """Create an instance of MfaForbiddenRequestError from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return MfaForbiddenRequestError.parse_obj(obj)
+
+ _obj = MfaForbiddenRequestError.parse_obj({
+ "message": obj.get("message")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/mfa_request_error.py b/bandwidth/models/mfa_request_error.py
new file mode 100644
index 00000000..46c67736
--- /dev/null
+++ b/bandwidth/models/mfa_request_error.py
@@ -0,0 +1,86 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class MfaRequestError(BaseModel):
+ """
+ MfaRequestError
+ """
+ error: Optional[StrictStr] = Field(None, description="A message describing the error with your request.")
+ request_id: Optional[StrictStr] = Field(None, alias="requestId", description="The associated requestId from AWS.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["error", "requestId"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> MfaRequestError:
+ """Create an instance of MfaRequestError from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> MfaRequestError:
+ """Create an instance of MfaRequestError from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return MfaRequestError.parse_obj(obj)
+
+ _obj = MfaRequestError.parse_obj({
+ "error": obj.get("error"),
+ "request_id": obj.get("requestId")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/mfa_unauthorized_request_error.py b/bandwidth/models/mfa_unauthorized_request_error.py
new file mode 100644
index 00000000..74c61eab
--- /dev/null
+++ b/bandwidth/models/mfa_unauthorized_request_error.py
@@ -0,0 +1,84 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class MfaUnauthorizedRequestError(BaseModel):
+ """
+ MfaUnauthorizedRequestError
+ """
+ message: Optional[StrictStr] = Field(None, description="Unauthorized")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["message"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> MfaUnauthorizedRequestError:
+ """Create an instance of MfaUnauthorizedRequestError from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> MfaUnauthorizedRequestError:
+ """Create an instance of MfaUnauthorizedRequestError from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return MfaUnauthorizedRequestError.parse_obj(obj)
+
+ _obj = MfaUnauthorizedRequestError.parse_obj({
+ "message": obj.get("message")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/page_info.py b/bandwidth/models/page_info.py
new file mode 100644
index 00000000..2593411a
--- /dev/null
+++ b/bandwidth/models/page_info.py
@@ -0,0 +1,90 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class PageInfo(BaseModel):
+ """
+ PageInfo
+ """
+ prev_page: Optional[StrictStr] = Field(None, alias="prevPage", description="The link to the previous page for pagination.")
+ next_page: Optional[StrictStr] = Field(None, alias="nextPage", description="The link to the next page for pagination.")
+ prev_page_token: Optional[StrictStr] = Field(None, alias="prevPageToken", description="The isolated pagination token for the previous page.")
+ next_page_token: Optional[StrictStr] = Field(None, alias="nextPageToken", description="The isolated pagination token for the next page.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["prevPage", "nextPage", "prevPageToken", "nextPageToken"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> PageInfo:
+ """Create an instance of PageInfo from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> PageInfo:
+ """Create an instance of PageInfo from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return PageInfo.parse_obj(obj)
+
+ _obj = PageInfo.parse_obj({
+ "prev_page": obj.get("prevPage"),
+ "next_page": obj.get("nextPage"),
+ "prev_page_token": obj.get("prevPageToken"),
+ "next_page_token": obj.get("nextPageToken")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/priority_enum.py b/bandwidth/models/priority_enum.py
new file mode 100644
index 00000000..372dbfee
--- /dev/null
+++ b/bandwidth/models/priority_enum.py
@@ -0,0 +1,41 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+
+
+
+class PriorityEnum(str, Enum):
+ """
+ The priority specified by the user. Not supported on MMS.
+ """
+
+ """
+ allowed enum values
+ """
+ DEFAULT = 'default'
+ HIGH = 'high'
+
+ @classmethod
+ def from_json(cls, json_str: str) -> PriorityEnum:
+ """Create an instance of PriorityEnum from a JSON string"""
+ return PriorityEnum(json.loads(json_str))
+
+
diff --git a/bandwidth/models/recording_available_callback.py b/bandwidth/models/recording_available_callback.py
new file mode 100644
index 00000000..bfd63eec
--- /dev/null
+++ b/bandwidth/models/recording_available_callback.py
@@ -0,0 +1,143 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+from bandwidth.models.call_direction_enum import CallDirectionEnum
+from bandwidth.models.file_format_enum import FileFormatEnum
+
+class RecordingAvailableCallback(BaseModel):
+ """
+ The Recording Available event is sent after a recording has been processed. It indicates that the recording is available for download.
+ """
+ event_type: Optional[StrictStr] = Field(None, alias="eventType", 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.")
+ event_time: Optional[datetime] = Field(None, alias="eventTime", 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.")
+ account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.")
+ application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.")
+ var_from: Optional[StrictStr] = Field(None, alias="from", 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.")
+ to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).")
+ direction: Optional[CallDirectionEnum] = None
+ call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.")
+ call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.")
+ parent_call_id: Optional[StrictStr] = Field(None, alias="parentCallId", 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.")
+ recording_id: Optional[StrictStr] = Field(None, alias="recordingId", description="The unique ID of this recording")
+ media_url: Optional[StrictStr] = Field(None, alias="mediaUrl", description="The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.")
+ enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.")
+ start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.")
+ end_time: Optional[datetime] = Field(None, alias="endTime", description="The time that the recording ended in ISO-8601 format")
+ duration: Optional[StrictStr] = Field(None, description="The duration of the recording in ISO-8601 format")
+ file_format: Optional[FileFormatEnum] = Field(None, alias="fileFormat")
+ channels: Optional[StrictStr] = Field(None, description="The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.")
+ tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.")
+ status: Optional[StrictStr] = Field(None, description="The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.")
+ transfer_caller_id: Optional[StrictStr] = Field(None, alias="transferCallerId", 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.")
+ transfer_to: Optional[StrictStr] = Field(None, alias="transferTo", description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "parentCallId", "recordingId", "mediaUrl", "enqueuedTime", "startTime", "endTime", "duration", "fileFormat", "channels", "tag", "status", "transferCallerId", "transferTo"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> RecordingAvailableCallback:
+ """Create an instance of RecordingAvailableCallback from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if media_url (nullable) is None
+ # and __fields_set__ contains the field
+ if self.media_url is None and "media_url" in self.__fields_set__:
+ _dict['mediaUrl'] = None
+
+ # set to None if enqueued_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.enqueued_time is None and "enqueued_time" in self.__fields_set__:
+ _dict['enqueuedTime'] = None
+
+ # set to None if tag (nullable) is None
+ # and __fields_set__ contains the field
+ if self.tag is None and "tag" in self.__fields_set__:
+ _dict['tag'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> RecordingAvailableCallback:
+ """Create an instance of RecordingAvailableCallback from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return RecordingAvailableCallback.parse_obj(obj)
+
+ _obj = RecordingAvailableCallback.parse_obj({
+ "event_type": obj.get("eventType"),
+ "event_time": obj.get("eventTime"),
+ "account_id": obj.get("accountId"),
+ "application_id": obj.get("applicationId"),
+ "var_from": obj.get("from"),
+ "to": obj.get("to"),
+ "direction": obj.get("direction"),
+ "call_id": obj.get("callId"),
+ "call_url": obj.get("callUrl"),
+ "parent_call_id": obj.get("parentCallId"),
+ "recording_id": obj.get("recordingId"),
+ "media_url": obj.get("mediaUrl"),
+ "enqueued_time": obj.get("enqueuedTime"),
+ "start_time": obj.get("startTime"),
+ "end_time": obj.get("endTime"),
+ "duration": obj.get("duration"),
+ "file_format": obj.get("fileFormat"),
+ "channels": obj.get("channels"),
+ "tag": obj.get("tag"),
+ "status": obj.get("status"),
+ "transfer_caller_id": obj.get("transferCallerId"),
+ "transfer_to": obj.get("transferTo")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/recording_complete_callback.py b/bandwidth/models/recording_complete_callback.py
new file mode 100644
index 00000000..e475ee7e
--- /dev/null
+++ b/bandwidth/models/recording_complete_callback.py
@@ -0,0 +1,148 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictInt, StrictStr
+from bandwidth.models.call_direction_enum import CallDirectionEnum
+from bandwidth.models.file_format_enum import FileFormatEnum
+
+class RecordingCompleteCallback(BaseModel):
+ """
+ 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.
+ """
+ event_type: Optional[StrictStr] = Field(None, alias="eventType", 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.")
+ event_time: Optional[datetime] = Field(None, alias="eventTime", 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.")
+ account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.")
+ application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.")
+ var_from: Optional[StrictStr] = Field(None, alias="from", 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.")
+ to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).")
+ direction: Optional[CallDirectionEnum] = None
+ call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.")
+ call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.")
+ parent_call_id: Optional[StrictStr] = Field(None, alias="parentCallId", 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.")
+ recording_id: Optional[StrictStr] = Field(None, alias="recordingId", description="The unique ID of this recording")
+ media_url: Optional[StrictStr] = Field(None, alias="mediaUrl", description="The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.")
+ enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.")
+ start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.")
+ answer_time: Optional[datetime] = Field(None, alias="answerTime", description="Time the call was answered, in ISO 8601 format.")
+ end_time: Optional[datetime] = Field(None, alias="endTime", description="The time that the recording ended in ISO-8601 format")
+ duration: Optional[StrictStr] = Field(None, description="The duration of the recording in ISO-8601 format")
+ file_format: Optional[FileFormatEnum] = Field(None, alias="fileFormat")
+ channels: Optional[StrictInt] = Field(None, description="Always `1` for conference recordings; multi-channel recordings are not supported on conferences.")
+ tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.")
+ transfer_caller_id: Optional[StrictStr] = Field(None, alias="transferCallerId", 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.")
+ transfer_to: Optional[StrictStr] = Field(None, alias="transferTo", description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "parentCallId", "recordingId", "mediaUrl", "enqueuedTime", "startTime", "answerTime", "endTime", "duration", "fileFormat", "channels", "tag", "transferCallerId", "transferTo"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> RecordingCompleteCallback:
+ """Create an instance of RecordingCompleteCallback from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if media_url (nullable) is None
+ # and __fields_set__ contains the field
+ if self.media_url is None and "media_url" in self.__fields_set__:
+ _dict['mediaUrl'] = None
+
+ # set to None if enqueued_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.enqueued_time is None and "enqueued_time" in self.__fields_set__:
+ _dict['enqueuedTime'] = None
+
+ # set to None if answer_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.answer_time is None and "answer_time" in self.__fields_set__:
+ _dict['answerTime'] = None
+
+ # set to None if tag (nullable) is None
+ # and __fields_set__ contains the field
+ if self.tag is None and "tag" in self.__fields_set__:
+ _dict['tag'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> RecordingCompleteCallback:
+ """Create an instance of RecordingCompleteCallback from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return RecordingCompleteCallback.parse_obj(obj)
+
+ _obj = RecordingCompleteCallback.parse_obj({
+ "event_type": obj.get("eventType"),
+ "event_time": obj.get("eventTime"),
+ "account_id": obj.get("accountId"),
+ "application_id": obj.get("applicationId"),
+ "var_from": obj.get("from"),
+ "to": obj.get("to"),
+ "direction": obj.get("direction"),
+ "call_id": obj.get("callId"),
+ "call_url": obj.get("callUrl"),
+ "parent_call_id": obj.get("parentCallId"),
+ "recording_id": obj.get("recordingId"),
+ "media_url": obj.get("mediaUrl"),
+ "enqueued_time": obj.get("enqueuedTime"),
+ "start_time": obj.get("startTime"),
+ "answer_time": obj.get("answerTime"),
+ "end_time": obj.get("endTime"),
+ "duration": obj.get("duration"),
+ "file_format": obj.get("fileFormat"),
+ "channels": obj.get("channels"),
+ "tag": obj.get("tag"),
+ "transfer_caller_id": obj.get("transferCallerId"),
+ "transfer_to": obj.get("transferTo")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/recording_state_enum.py b/bandwidth/models/recording_state_enum.py
new file mode 100644
index 00000000..8a34f09f
--- /dev/null
+++ b/bandwidth/models/recording_state_enum.py
@@ -0,0 +1,41 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+
+
+
+class RecordingStateEnum(str, Enum):
+ """
+ The recording state. Possible values: `paused` to pause an active recording `recording` to resume a paused recording
+ """
+
+ """
+ allowed enum values
+ """
+ PAUSED = 'paused'
+ RECORDING = 'recording'
+
+ @classmethod
+ def from_json(cls, json_str: str) -> RecordingStateEnum:
+ """Create an instance of RecordingStateEnum from a JSON string"""
+ return RecordingStateEnum(json.loads(json_str))
+
+
diff --git a/bandwidth/models/redirect_callback.py b/bandwidth/models/redirect_callback.py
new file mode 100644
index 00000000..acd681cd
--- /dev/null
+++ b/bandwidth/models/redirect_callback.py
@@ -0,0 +1,130 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+from bandwidth.models.call_direction_enum import CallDirectionEnum
+
+class RedirectCallback(BaseModel):
+ """
+ The Redirect event is fired when a verb is executed. Its purpose is to get the next set of verbs from the calling application.
+ """
+ event_type: Optional[StrictStr] = Field(None, alias="eventType", 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.")
+ event_time: Optional[datetime] = Field(None, alias="eventTime", 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.")
+ account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.")
+ application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.")
+ var_from: Optional[StrictStr] = Field(None, alias="from", 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.")
+ to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).")
+ direction: Optional[CallDirectionEnum] = None
+ call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.")
+ call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.")
+ parent_call_id: Optional[StrictStr] = Field(None, alias="parentCallId", 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.")
+ enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.")
+ start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.")
+ answer_time: Optional[datetime] = Field(None, alias="answerTime", description="Time the call was answered, in ISO 8601 format.")
+ tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.")
+ transfer_caller_id: Optional[StrictStr] = Field(None, alias="transferCallerId", 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.")
+ transfer_to: Optional[StrictStr] = Field(None, alias="transferTo", description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "parentCallId", "enqueuedTime", "startTime", "answerTime", "tag", "transferCallerId", "transferTo"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> RedirectCallback:
+ """Create an instance of RedirectCallback from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if enqueued_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.enqueued_time is None and "enqueued_time" in self.__fields_set__:
+ _dict['enqueuedTime'] = None
+
+ # set to None if answer_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.answer_time is None and "answer_time" in self.__fields_set__:
+ _dict['answerTime'] = None
+
+ # set to None if tag (nullable) is None
+ # and __fields_set__ contains the field
+ if self.tag is None and "tag" in self.__fields_set__:
+ _dict['tag'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> RedirectCallback:
+ """Create an instance of RedirectCallback from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return RedirectCallback.parse_obj(obj)
+
+ _obj = RedirectCallback.parse_obj({
+ "event_type": obj.get("eventType"),
+ "event_time": obj.get("eventTime"),
+ "account_id": obj.get("accountId"),
+ "application_id": obj.get("applicationId"),
+ "var_from": obj.get("from"),
+ "to": obj.get("to"),
+ "direction": obj.get("direction"),
+ "call_id": obj.get("callId"),
+ "call_url": obj.get("callUrl"),
+ "parent_call_id": obj.get("parentCallId"),
+ "enqueued_time": obj.get("enqueuedTime"),
+ "start_time": obj.get("startTime"),
+ "answer_time": obj.get("answerTime"),
+ "tag": obj.get("tag"),
+ "transfer_caller_id": obj.get("transferCallerId"),
+ "transfer_to": obj.get("transferTo")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/redirect_method_enum.py b/bandwidth/models/redirect_method_enum.py
new file mode 100644
index 00000000..312860ce
--- /dev/null
+++ b/bandwidth/models/redirect_method_enum.py
@@ -0,0 +1,41 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+
+
+
+class RedirectMethodEnum(str, Enum):
+ """
+ The HTTP method to use for the request to `redirectUrl`. GET or POST. Default value is POST.
Not allowed if `state` is `completed`.
+ """
+
+ """
+ allowed enum values
+ """
+ GET = 'GET'
+ POST = 'POST'
+
+ @classmethod
+ def from_json(cls, json_str: str) -> RedirectMethodEnum:
+ """Create an instance of RedirectMethodEnum from a JSON string"""
+ return RedirectMethodEnum(json.loads(json_str))
+
+
diff --git a/bandwidth/models/stir_shaken.py b/bandwidth/models/stir_shaken.py
new file mode 100644
index 00000000..e2959922
--- /dev/null
+++ b/bandwidth/models/stir_shaken.py
@@ -0,0 +1,88 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class StirShaken(BaseModel):
+ """
+ StirShaken
+ """
+ verstat: Optional[StrictStr] = Field(None, description="(optional) The verification status indicating whether the verification was successful or not. Possible values are TN-Verification-Passed and TN-Verification-Failed.")
+ attestation_indicator: Optional[StrictStr] = Field(None, alias="attestationIndicator", description="(optional) The attestation level verified by Bandwidth. Possible values are A (full), B (partial) or C (gateway).")
+ originating_id: Optional[StrictStr] = Field(None, alias="originatingId", description="(optional) A unique origination identifier.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["verstat", "attestationIndicator", "originatingId"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> StirShaken:
+ """Create an instance of StirShaken from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> StirShaken:
+ """Create an instance of StirShaken from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return StirShaken.parse_obj(obj)
+
+ _obj = StirShaken.parse_obj({
+ "verstat": obj.get("verstat"),
+ "attestation_indicator": obj.get("attestationIndicator"),
+ "originating_id": obj.get("originatingId")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/tag.py b/bandwidth/models/tag.py
new file mode 100644
index 00000000..d7afeff1
--- /dev/null
+++ b/bandwidth/models/tag.py
@@ -0,0 +1,86 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, StrictStr
+
+class Tag(BaseModel):
+ """
+ Tag
+ """
+ key: Optional[StrictStr] = None
+ value: Optional[StrictStr] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["key", "value"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Tag:
+ """Create an instance of Tag from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Tag:
+ """Create an instance of Tag from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return Tag.parse_obj(obj)
+
+ _obj = Tag.parse_obj({
+ "key": obj.get("key"),
+ "value": obj.get("value")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/tn_lookup_request_error.py b/bandwidth/models/tn_lookup_request_error.py
new file mode 100644
index 00000000..cb714510
--- /dev/null
+++ b/bandwidth/models/tn_lookup_request_error.py
@@ -0,0 +1,84 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class TnLookupRequestError(BaseModel):
+ """
+ TnLookupRequestError
+ """
+ message: Optional[StrictStr] = Field(None, description="A description of what validation error occurred.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["message"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> TnLookupRequestError:
+ """Create an instance of TnLookupRequestError from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> TnLookupRequestError:
+ """Create an instance of TnLookupRequestError from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return TnLookupRequestError.parse_obj(obj)
+
+ _obj = TnLookupRequestError.parse_obj({
+ "message": obj.get("message")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/transcribe_recording.py b/bandwidth/models/transcribe_recording.py
new file mode 100644
index 00000000..4b94cd93
--- /dev/null
+++ b/bandwidth/models/transcribe_recording.py
@@ -0,0 +1,127 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional, Union
+from pydantic import BaseModel, Field, StrictBool, StrictStr, confloat, conint, constr
+from bandwidth.models.callback_method_enum import CallbackMethodEnum
+
+class TranscribeRecording(BaseModel):
+ """
+ TranscribeRecording
+ """
+ callback_url: Optional[StrictStr] = Field(None, alias="callbackUrl", 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.")
+ callback_method: Optional[CallbackMethodEnum] = Field(None, alias="callbackMethod")
+ username: Optional[constr(strict=True, max_length=1024)] = Field(None, description="Basic auth username.")
+ password: Optional[constr(strict=True, max_length=1024)] = Field(None, description="Basic auth password.")
+ tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.")
+ callback_timeout: Optional[Union[confloat(le=25, ge=1, strict=True), conint(le=25, ge=1, strict=True)]] = Field(15, alias="callbackTimeout", 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.")
+ detect_language: Optional[StrictBool] = Field(False, alias="detectLanguage", 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.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["callbackUrl", "callbackMethod", "username", "password", "tag", "callbackTimeout", "detectLanguage"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> TranscribeRecording:
+ """Create an instance of TranscribeRecording from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if callback_method (nullable) is None
+ # and __fields_set__ contains the field
+ if self.callback_method is None and "callback_method" in self.__fields_set__:
+ _dict['callbackMethod'] = None
+
+ # set to None if username (nullable) is None
+ # and __fields_set__ contains the field
+ if self.username is None and "username" in self.__fields_set__:
+ _dict['username'] = None
+
+ # set to None if password (nullable) is None
+ # and __fields_set__ contains the field
+ if self.password is None and "password" in self.__fields_set__:
+ _dict['password'] = None
+
+ # set to None if tag (nullable) is None
+ # and __fields_set__ contains the field
+ if self.tag is None and "tag" in self.__fields_set__:
+ _dict['tag'] = None
+
+ # set to None if callback_timeout (nullable) is None
+ # and __fields_set__ contains the field
+ if self.callback_timeout is None and "callback_timeout" in self.__fields_set__:
+ _dict['callbackTimeout'] = None
+
+ # set to None if detect_language (nullable) is None
+ # and __fields_set__ contains the field
+ if self.detect_language is None and "detect_language" in self.__fields_set__:
+ _dict['detectLanguage'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> TranscribeRecording:
+ """Create an instance of TranscribeRecording from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return TranscribeRecording.parse_obj(obj)
+
+ _obj = TranscribeRecording.parse_obj({
+ "callback_url": obj.get("callbackUrl"),
+ "callback_method": obj.get("callbackMethod"),
+ "username": obj.get("username"),
+ "password": obj.get("password"),
+ "tag": obj.get("tag"),
+ "callback_timeout": obj.get("callbackTimeout") if obj.get("callbackTimeout") is not None else 15,
+ "detect_language": obj.get("detectLanguage") if obj.get("detectLanguage") is not None else False
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/transcription.py b/bandwidth/models/transcription.py
new file mode 100644
index 00000000..a33bd243
--- /dev/null
+++ b/bandwidth/models/transcription.py
@@ -0,0 +1,86 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional, Union
+from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr
+
+class Transcription(BaseModel):
+ """
+ Transcription
+ """
+ text: Optional[StrictStr] = Field(None, description="The transcribed text")
+ confidence: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="The confidence on the recognized content, ranging from `0.0` to `1.0` with `1.0` being the highest confidence.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["text", "confidence"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Transcription:
+ """Create an instance of Transcription from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Transcription:
+ """Create an instance of Transcription from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return Transcription.parse_obj(obj)
+
+ _obj = Transcription.parse_obj({
+ "text": obj.get("text"),
+ "confidence": obj.get("confidence")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/transcription_available_callback.py b/bandwidth/models/transcription_available_callback.py
new file mode 100644
index 00000000..ed6c54a5
--- /dev/null
+++ b/bandwidth/models/transcription_available_callback.py
@@ -0,0 +1,145 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+from bandwidth.models.call_direction_enum import CallDirectionEnum
+from bandwidth.models.file_format_enum import FileFormatEnum
+from bandwidth.models.transcription import Transcription
+
+class TranscriptionAvailableCallback(BaseModel):
+ """
+ The Transcription Available event is sent when the recording transcription is available to be downloaded.
+ """
+ event_type: Optional[StrictStr] = Field(None, alias="eventType", 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.")
+ event_time: Optional[datetime] = Field(None, alias="eventTime", 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.")
+ account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.")
+ application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.")
+ var_from: Optional[StrictStr] = Field(None, alias="from", 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.")
+ to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).")
+ direction: Optional[CallDirectionEnum] = None
+ call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.")
+ call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.")
+ media_url: Optional[StrictStr] = Field(None, alias="mediaUrl", description="The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.")
+ parent_call_id: Optional[StrictStr] = Field(None, alias="parentCallId", 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.")
+ recording_id: Optional[StrictStr] = Field(None, alias="recordingId", description="The unique ID of this recording")
+ enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.")
+ start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.")
+ end_time: Optional[datetime] = Field(None, alias="endTime", description="The time that the recording ended in ISO-8601 format")
+ duration: Optional[StrictStr] = Field(None, description="The duration of the recording in ISO-8601 format")
+ file_format: Optional[FileFormatEnum] = Field(None, alias="fileFormat")
+ tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.")
+ transcription: Optional[Transcription] = None
+ transfer_caller_id: Optional[StrictStr] = Field(None, alias="transferCallerId", 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.")
+ transfer_to: Optional[StrictStr] = Field(None, alias="transferTo", description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "mediaUrl", "parentCallId", "recordingId", "enqueuedTime", "startTime", "endTime", "duration", "fileFormat", "tag", "transcription", "transferCallerId", "transferTo"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> TranscriptionAvailableCallback:
+ """Create an instance of TranscriptionAvailableCallback from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of transcription
+ if self.transcription:
+ _dict['transcription'] = self.transcription.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if media_url (nullable) is None
+ # and __fields_set__ contains the field
+ if self.media_url is None and "media_url" in self.__fields_set__:
+ _dict['mediaUrl'] = None
+
+ # set to None if enqueued_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.enqueued_time is None and "enqueued_time" in self.__fields_set__:
+ _dict['enqueuedTime'] = None
+
+ # set to None if tag (nullable) is None
+ # and __fields_set__ contains the field
+ if self.tag is None and "tag" in self.__fields_set__:
+ _dict['tag'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> TranscriptionAvailableCallback:
+ """Create an instance of TranscriptionAvailableCallback from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return TranscriptionAvailableCallback.parse_obj(obj)
+
+ _obj = TranscriptionAvailableCallback.parse_obj({
+ "event_type": obj.get("eventType"),
+ "event_time": obj.get("eventTime"),
+ "account_id": obj.get("accountId"),
+ "application_id": obj.get("applicationId"),
+ "var_from": obj.get("from"),
+ "to": obj.get("to"),
+ "direction": obj.get("direction"),
+ "call_id": obj.get("callId"),
+ "call_url": obj.get("callUrl"),
+ "media_url": obj.get("mediaUrl"),
+ "parent_call_id": obj.get("parentCallId"),
+ "recording_id": obj.get("recordingId"),
+ "enqueued_time": obj.get("enqueuedTime"),
+ "start_time": obj.get("startTime"),
+ "end_time": obj.get("endTime"),
+ "duration": obj.get("duration"),
+ "file_format": obj.get("fileFormat"),
+ "tag": obj.get("tag"),
+ "transcription": Transcription.from_dict(obj.get("transcription")) if obj.get("transcription") is not None else None,
+ "transfer_caller_id": obj.get("transferCallerId"),
+ "transfer_to": obj.get("transferTo")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/transcription_list.py b/bandwidth/models/transcription_list.py
new file mode 100644
index 00000000..0fa0c972
--- /dev/null
+++ b/bandwidth/models/transcription_list.py
@@ -0,0 +1,92 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, List, Optional
+from pydantic import BaseModel, conlist
+from bandwidth.models.transcription import Transcription
+
+class TranscriptionList(BaseModel):
+ """
+ TranscriptionList
+ """
+ transcripts: Optional[conlist(Transcription)] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["transcripts"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> TranscriptionList:
+ """Create an instance of TranscriptionList from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of each item in transcripts (list)
+ _items = []
+ if self.transcripts:
+ for _item in self.transcripts:
+ if _item:
+ _items.append(_item.to_dict())
+ _dict['transcripts'] = _items
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> TranscriptionList:
+ """Create an instance of TranscriptionList from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return TranscriptionList.parse_obj(obj)
+
+ _obj = TranscriptionList.parse_obj({
+ "transcripts": [Transcription.from_dict(_item) for _item in obj.get("transcripts")] if obj.get("transcripts") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/transcription_metadata.py b/bandwidth/models/transcription_metadata.py
new file mode 100644
index 00000000..b6ed77ed
--- /dev/null
+++ b/bandwidth/models/transcription_metadata.py
@@ -0,0 +1,90 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class TranscriptionMetadata(BaseModel):
+ """
+ If the recording was transcribed, metadata about the transcription
+ """
+ id: Optional[StrictStr] = Field(None, description="The unique transcription ID")
+ status: Optional[StrictStr] = Field(None, description="The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.")
+ completed_time: Optional[StrictStr] = Field(None, alias="completedTime", description="The time that the transcription was completed")
+ url: Optional[StrictStr] = Field(None, description="The URL of the [transcription](#operation/getCallTranscription)")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["id", "status", "completedTime", "url"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> TranscriptionMetadata:
+ """Create an instance of TranscriptionMetadata from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> TranscriptionMetadata:
+ """Create an instance of TranscriptionMetadata from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return TranscriptionMetadata.parse_obj(obj)
+
+ _obj = TranscriptionMetadata.parse_obj({
+ "id": obj.get("id"),
+ "status": obj.get("status"),
+ "completed_time": obj.get("completedTime"),
+ "url": obj.get("url")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/transfer_answer_callback.py b/bandwidth/models/transfer_answer_callback.py
new file mode 100644
index 00000000..825f65fc
--- /dev/null
+++ b/bandwidth/models/transfer_answer_callback.py
@@ -0,0 +1,128 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+from bandwidth.models.call_direction_enum import CallDirectionEnum
+
+class TransferAnswerCallback(BaseModel):
+ """
+ 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.
+ """
+ event_type: Optional[StrictStr] = Field(None, alias="eventType", 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.")
+ event_time: Optional[datetime] = Field(None, alias="eventTime", 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.")
+ account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.")
+ application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.")
+ var_from: Optional[StrictStr] = Field(None, alias="from", 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.")
+ to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).")
+ direction: Optional[CallDirectionEnum] = None
+ call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.")
+ call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.")
+ enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.")
+ start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.")
+ answer_time: Optional[datetime] = Field(None, alias="answerTime", description="Time the call was answered, in ISO 8601 format.")
+ tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.")
+ transfer_caller_id: Optional[StrictStr] = Field(None, alias="transferCallerId", 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.")
+ transfer_to: Optional[StrictStr] = Field(None, alias="transferTo", description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "enqueuedTime", "startTime", "answerTime", "tag", "transferCallerId", "transferTo"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> TransferAnswerCallback:
+ """Create an instance of TransferAnswerCallback from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if enqueued_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.enqueued_time is None and "enqueued_time" in self.__fields_set__:
+ _dict['enqueuedTime'] = None
+
+ # set to None if answer_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.answer_time is None and "answer_time" in self.__fields_set__:
+ _dict['answerTime'] = None
+
+ # set to None if tag (nullable) is None
+ # and __fields_set__ contains the field
+ if self.tag is None and "tag" in self.__fields_set__:
+ _dict['tag'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> TransferAnswerCallback:
+ """Create an instance of TransferAnswerCallback from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return TransferAnswerCallback.parse_obj(obj)
+
+ _obj = TransferAnswerCallback.parse_obj({
+ "event_type": obj.get("eventType"),
+ "event_time": obj.get("eventTime"),
+ "account_id": obj.get("accountId"),
+ "application_id": obj.get("applicationId"),
+ "var_from": obj.get("from"),
+ "to": obj.get("to"),
+ "direction": obj.get("direction"),
+ "call_id": obj.get("callId"),
+ "call_url": obj.get("callUrl"),
+ "enqueued_time": obj.get("enqueuedTime"),
+ "start_time": obj.get("startTime"),
+ "answer_time": obj.get("answerTime"),
+ "tag": obj.get("tag"),
+ "transfer_caller_id": obj.get("transferCallerId"),
+ "transfer_to": obj.get("transferTo")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/transfer_complete_callback.py b/bandwidth/models/transfer_complete_callback.py
new file mode 100644
index 00000000..126a3ba9
--- /dev/null
+++ b/bandwidth/models/transfer_complete_callback.py
@@ -0,0 +1,144 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+from bandwidth.models.call_direction_enum import CallDirectionEnum
+
+class TransferCompleteCallback(BaseModel):
+ """
+ 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.
+ """
+ event_type: Optional[StrictStr] = Field(None, alias="eventType", 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.")
+ event_time: Optional[datetime] = Field(None, alias="eventTime", 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.")
+ account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.")
+ application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.")
+ var_from: Optional[StrictStr] = Field(None, alias="from", 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.")
+ to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).")
+ direction: Optional[CallDirectionEnum] = None
+ call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.")
+ call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.")
+ enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.")
+ start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.")
+ answer_time: Optional[datetime] = Field(None, alias="answerTime", description="Time the call was answered, in ISO 8601 format.")
+ tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.")
+ transfer_caller_id: Optional[StrictStr] = Field(None, alias="transferCallerId", 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.")
+ transfer_to: Optional[StrictStr] = Field(None, alias="transferTo", description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).")
+ cause: Optional[StrictStr] = Field(None, description="Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown.")
+ error_message: Optional[StrictStr] = Field(None, alias="errorMessage", description="Text explaining the reason that caused the call to fail in case of errors.")
+ error_id: Optional[StrictStr] = Field(None, alias="errorId", description="Bandwidth's internal id that references the error event.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "enqueuedTime", "startTime", "answerTime", "tag", "transferCallerId", "transferTo", "cause", "errorMessage", "errorId"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> TransferCompleteCallback:
+ """Create an instance of TransferCompleteCallback from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if enqueued_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.enqueued_time is None and "enqueued_time" in self.__fields_set__:
+ _dict['enqueuedTime'] = None
+
+ # set to None if answer_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.answer_time is None and "answer_time" in self.__fields_set__:
+ _dict['answerTime'] = None
+
+ # set to None if tag (nullable) is None
+ # and __fields_set__ contains the field
+ if self.tag is None and "tag" in self.__fields_set__:
+ _dict['tag'] = None
+
+ # set to None if error_message (nullable) is None
+ # and __fields_set__ contains the field
+ if self.error_message is None and "error_message" in self.__fields_set__:
+ _dict['errorMessage'] = None
+
+ # set to None if error_id (nullable) is None
+ # and __fields_set__ contains the field
+ if self.error_id is None and "error_id" in self.__fields_set__:
+ _dict['errorId'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> TransferCompleteCallback:
+ """Create an instance of TransferCompleteCallback from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return TransferCompleteCallback.parse_obj(obj)
+
+ _obj = TransferCompleteCallback.parse_obj({
+ "event_type": obj.get("eventType"),
+ "event_time": obj.get("eventTime"),
+ "account_id": obj.get("accountId"),
+ "application_id": obj.get("applicationId"),
+ "var_from": obj.get("from"),
+ "to": obj.get("to"),
+ "direction": obj.get("direction"),
+ "call_id": obj.get("callId"),
+ "call_url": obj.get("callUrl"),
+ "enqueued_time": obj.get("enqueuedTime"),
+ "start_time": obj.get("startTime"),
+ "answer_time": obj.get("answerTime"),
+ "tag": obj.get("tag"),
+ "transfer_caller_id": obj.get("transferCallerId"),
+ "transfer_to": obj.get("transferTo"),
+ "cause": obj.get("cause"),
+ "error_message": obj.get("errorMessage"),
+ "error_id": obj.get("errorId")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/transfer_disconnect_callback.py b/bandwidth/models/transfer_disconnect_callback.py
new file mode 100644
index 00000000..04853420
--- /dev/null
+++ b/bandwidth/models/transfer_disconnect_callback.py
@@ -0,0 +1,148 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+from bandwidth.models.call_direction_enum import CallDirectionEnum
+
+class TransferDisconnectCallback(BaseModel):
+ """
+ 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.
+ """
+ event_type: Optional[StrictStr] = Field(None, alias="eventType", 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.")
+ event_time: Optional[datetime] = Field(None, alias="eventTime", 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.")
+ account_id: Optional[StrictStr] = Field(None, alias="accountId", description="The user account associated with the call.")
+ application_id: Optional[StrictStr] = Field(None, alias="applicationId", description="The id of the application associated with the call.")
+ var_from: Optional[StrictStr] = Field(None, alias="from", 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.")
+ to: Optional[StrictStr] = Field(None, description="The phone number that received the call, in E.164 format (e.g. +15555555555).")
+ direction: Optional[CallDirectionEnum] = None
+ call_id: Optional[StrictStr] = Field(None, alias="callId", description="The call id associated with the event.")
+ call_url: Optional[StrictStr] = Field(None, alias="callUrl", description="The URL of the call associated with the event.")
+ parent_call_id: Optional[StrictStr] = Field(None, alias="parentCallId", 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.")
+ enqueued_time: Optional[datetime] = Field(None, alias="enqueuedTime", description="(optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.")
+ start_time: Optional[datetime] = Field(None, alias="startTime", description="Time the call was started, in ISO 8601 format.")
+ answer_time: Optional[datetime] = Field(None, alias="answerTime", description="Time the call was answered, in ISO 8601 format.")
+ end_time: Optional[datetime] = Field(None, alias="endTime", description="The time that the recording ended in ISO-8601 format")
+ tag: Optional[StrictStr] = Field(None, description="(optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.")
+ transfer_caller_id: Optional[StrictStr] = Field(None, alias="transferCallerId", 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.")
+ transfer_to: Optional[StrictStr] = Field(None, alias="transferTo", description="The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).")
+ cause: Optional[StrictStr] = Field(None, description="Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown.")
+ error_message: Optional[StrictStr] = Field(None, alias="errorMessage", description="Text explaining the reason that caused the call to fail in case of errors.")
+ error_id: Optional[StrictStr] = Field(None, alias="errorId", description="Bandwidth's internal id that references the error event.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["eventType", "eventTime", "accountId", "applicationId", "from", "to", "direction", "callId", "callUrl", "parentCallId", "enqueuedTime", "startTime", "answerTime", "endTime", "tag", "transferCallerId", "transferTo", "cause", "errorMessage", "errorId"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> TransferDisconnectCallback:
+ """Create an instance of TransferDisconnectCallback from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if enqueued_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.enqueued_time is None and "enqueued_time" in self.__fields_set__:
+ _dict['enqueuedTime'] = None
+
+ # set to None if answer_time (nullable) is None
+ # and __fields_set__ contains the field
+ if self.answer_time is None and "answer_time" in self.__fields_set__:
+ _dict['answerTime'] = None
+
+ # set to None if tag (nullable) is None
+ # and __fields_set__ contains the field
+ if self.tag is None and "tag" in self.__fields_set__:
+ _dict['tag'] = None
+
+ # set to None if error_message (nullable) is None
+ # and __fields_set__ contains the field
+ if self.error_message is None and "error_message" in self.__fields_set__:
+ _dict['errorMessage'] = None
+
+ # set to None if error_id (nullable) is None
+ # and __fields_set__ contains the field
+ if self.error_id is None and "error_id" in self.__fields_set__:
+ _dict['errorId'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> TransferDisconnectCallback:
+ """Create an instance of TransferDisconnectCallback from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return TransferDisconnectCallback.parse_obj(obj)
+
+ _obj = TransferDisconnectCallback.parse_obj({
+ "event_type": obj.get("eventType"),
+ "event_time": obj.get("eventTime"),
+ "account_id": obj.get("accountId"),
+ "application_id": obj.get("applicationId"),
+ "var_from": obj.get("from"),
+ "to": obj.get("to"),
+ "direction": obj.get("direction"),
+ "call_id": obj.get("callId"),
+ "call_url": obj.get("callUrl"),
+ "parent_call_id": obj.get("parentCallId"),
+ "enqueued_time": obj.get("enqueuedTime"),
+ "start_time": obj.get("startTime"),
+ "answer_time": obj.get("answerTime"),
+ "end_time": obj.get("endTime"),
+ "tag": obj.get("tag"),
+ "transfer_caller_id": obj.get("transferCallerId"),
+ "transfer_to": obj.get("transferTo"),
+ "cause": obj.get("cause"),
+ "error_message": obj.get("errorMessage"),
+ "error_id": obj.get("errorId")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/update_call.py b/bandwidth/models/update_call.py
new file mode 100644
index 00000000..12502a96
--- /dev/null
+++ b/bandwidth/models/update_call.py
@@ -0,0 +1,154 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr, constr
+from bandwidth.models.call_state_enum import CallStateEnum
+from bandwidth.models.redirect_method_enum import RedirectMethodEnum
+
+class UpdateCall(BaseModel):
+ """
+ UpdateCall
+ """
+ state: Optional[CallStateEnum] = None
+ redirect_url: Optional[StrictStr] = Field(None, alias="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`.")
+ redirect_method: Optional[RedirectMethodEnum] = Field(None, alias="redirectMethod")
+ username: Optional[constr(strict=True, max_length=1024)] = Field(None, description="Basic auth username.")
+ password: Optional[constr(strict=True, max_length=1024)] = Field(None, description="Basic auth password.")
+ redirect_fallback_url: Optional[StrictStr] = Field(None, alias="redirectFallbackUrl", description="A fallback url which, if provided, will be used to retry the redirect callback delivery in case `redirectUrl` fails to respond.")
+ redirect_fallback_method: Optional[RedirectMethodEnum] = Field(None, alias="redirectFallbackMethod")
+ fallback_username: Optional[constr(strict=True, max_length=1024)] = Field(None, alias="fallbackUsername", description="Basic auth username.")
+ fallback_password: Optional[constr(strict=True, max_length=1024)] = Field(None, alias="fallbackPassword", description="Basic auth password.")
+ tag: Optional[constr(strict=True, max_length=256)] = Field(None, description="A custom string that will be sent with this and all future callbacks unless overwritten by a future `tag` attribute or [``](/docs/voice/bxml/tag) verb, or cleared. May be cleared by setting `tag=\"\"`. Max length 256 characters. Not allowed if `state` is `completed`.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["state", "redirectUrl", "redirectMethod", "username", "password", "redirectFallbackUrl", "redirectFallbackMethod", "fallbackUsername", "fallbackPassword", "tag"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> UpdateCall:
+ """Create an instance of UpdateCall from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if state (nullable) is None
+ # and __fields_set__ contains the field
+ if self.state is None and "state" in self.__fields_set__:
+ _dict['state'] = None
+
+ # set to None if redirect_url (nullable) is None
+ # and __fields_set__ contains the field
+ if self.redirect_url is None and "redirect_url" in self.__fields_set__:
+ _dict['redirectUrl'] = None
+
+ # set to None if redirect_method (nullable) is None
+ # and __fields_set__ contains the field
+ if self.redirect_method is None and "redirect_method" in self.__fields_set__:
+ _dict['redirectMethod'] = None
+
+ # set to None if username (nullable) is None
+ # and __fields_set__ contains the field
+ if self.username is None and "username" in self.__fields_set__:
+ _dict['username'] = None
+
+ # set to None if password (nullable) is None
+ # and __fields_set__ contains the field
+ if self.password is None and "password" in self.__fields_set__:
+ _dict['password'] = None
+
+ # set to None if redirect_fallback_url (nullable) is None
+ # and __fields_set__ contains the field
+ if self.redirect_fallback_url is None and "redirect_fallback_url" in self.__fields_set__:
+ _dict['redirectFallbackUrl'] = None
+
+ # set to None if redirect_fallback_method (nullable) is None
+ # and __fields_set__ contains the field
+ if self.redirect_fallback_method is None and "redirect_fallback_method" in self.__fields_set__:
+ _dict['redirectFallbackMethod'] = None
+
+ # set to None if fallback_username (nullable) is None
+ # and __fields_set__ contains the field
+ if self.fallback_username is None and "fallback_username" in self.__fields_set__:
+ _dict['fallbackUsername'] = None
+
+ # set to None if fallback_password (nullable) is None
+ # and __fields_set__ contains the field
+ if self.fallback_password is None and "fallback_password" in self.__fields_set__:
+ _dict['fallbackPassword'] = None
+
+ # set to None if tag (nullable) is None
+ # and __fields_set__ contains the field
+ if self.tag is None and "tag" in self.__fields_set__:
+ _dict['tag'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> UpdateCall:
+ """Create an instance of UpdateCall from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return UpdateCall.parse_obj(obj)
+
+ _obj = UpdateCall.parse_obj({
+ "state": obj.get("state"),
+ "redirect_url": obj.get("redirectUrl"),
+ "redirect_method": obj.get("redirectMethod"),
+ "username": obj.get("username"),
+ "password": obj.get("password"),
+ "redirect_fallback_url": obj.get("redirectFallbackUrl"),
+ "redirect_fallback_method": obj.get("redirectFallbackMethod"),
+ "fallback_username": obj.get("fallbackUsername"),
+ "fallback_password": obj.get("fallbackPassword"),
+ "tag": obj.get("tag")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/update_call_recording.py b/bandwidth/models/update_call_recording.py
new file mode 100644
index 00000000..3edf7933
--- /dev/null
+++ b/bandwidth/models/update_call_recording.py
@@ -0,0 +1,85 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict
+from pydantic import BaseModel, Field
+from bandwidth.models.recording_state_enum import RecordingStateEnum
+
+class UpdateCallRecording(BaseModel):
+ """
+ UpdateCallRecording
+ """
+ state: RecordingStateEnum = Field(...)
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["state"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> UpdateCallRecording:
+ """Create an instance of UpdateCallRecording from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> UpdateCallRecording:
+ """Create an instance of UpdateCallRecording from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return UpdateCallRecording.parse_obj(obj)
+
+ _obj = UpdateCallRecording.parse_obj({
+ "state": obj.get("state")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/update_conference.py b/bandwidth/models/update_conference.py
new file mode 100644
index 00000000..77e3050f
--- /dev/null
+++ b/bandwidth/models/update_conference.py
@@ -0,0 +1,147 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr, constr
+from bandwidth.models.conference_state_enum import ConferenceStateEnum
+from bandwidth.models.redirect_method_enum import RedirectMethodEnum
+
+class UpdateConference(BaseModel):
+ """
+ UpdateConference
+ """
+ status: Optional[ConferenceStateEnum] = None
+ redirect_url: Optional[StrictStr] = Field(None, alias="redirectUrl", 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`.")
+ redirect_method: Optional[RedirectMethodEnum] = Field(None, alias="redirectMethod")
+ username: Optional[constr(strict=True, max_length=1024)] = Field(None, description="Basic auth username.")
+ password: Optional[constr(strict=True, max_length=1024)] = Field(None, description="Basic auth password.")
+ redirect_fallback_url: Optional[StrictStr] = Field(None, alias="redirectFallbackUrl", 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`.")
+ redirect_fallback_method: Optional[RedirectMethodEnum] = Field(None, alias="redirectFallbackMethod")
+ fallback_username: Optional[constr(strict=True, max_length=1024)] = Field(None, alias="fallbackUsername", description="Basic auth username.")
+ fallback_password: Optional[constr(strict=True, max_length=1024)] = Field(None, alias="fallbackPassword", description="Basic auth password.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["status", "redirectUrl", "redirectMethod", "username", "password", "redirectFallbackUrl", "redirectFallbackMethod", "fallbackUsername", "fallbackPassword"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> UpdateConference:
+ """Create an instance of UpdateConference from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if status (nullable) is None
+ # and __fields_set__ contains the field
+ if self.status is None and "status" in self.__fields_set__:
+ _dict['status'] = None
+
+ # set to None if redirect_url (nullable) is None
+ # and __fields_set__ contains the field
+ if self.redirect_url is None and "redirect_url" in self.__fields_set__:
+ _dict['redirectUrl'] = None
+
+ # set to None if redirect_method (nullable) is None
+ # and __fields_set__ contains the field
+ if self.redirect_method is None and "redirect_method" in self.__fields_set__:
+ _dict['redirectMethod'] = None
+
+ # set to None if username (nullable) is None
+ # and __fields_set__ contains the field
+ if self.username is None and "username" in self.__fields_set__:
+ _dict['username'] = None
+
+ # set to None if password (nullable) is None
+ # and __fields_set__ contains the field
+ if self.password is None and "password" in self.__fields_set__:
+ _dict['password'] = None
+
+ # set to None if redirect_fallback_url (nullable) is None
+ # and __fields_set__ contains the field
+ if self.redirect_fallback_url is None and "redirect_fallback_url" in self.__fields_set__:
+ _dict['redirectFallbackUrl'] = None
+
+ # set to None if redirect_fallback_method (nullable) is None
+ # and __fields_set__ contains the field
+ if self.redirect_fallback_method is None and "redirect_fallback_method" in self.__fields_set__:
+ _dict['redirectFallbackMethod'] = None
+
+ # set to None if fallback_username (nullable) is None
+ # and __fields_set__ contains the field
+ if self.fallback_username is None and "fallback_username" in self.__fields_set__:
+ _dict['fallbackUsername'] = None
+
+ # set to None if fallback_password (nullable) is None
+ # and __fields_set__ contains the field
+ if self.fallback_password is None and "fallback_password" in self.__fields_set__:
+ _dict['fallbackPassword'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> UpdateConference:
+ """Create an instance of UpdateConference from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return UpdateConference.parse_obj(obj)
+
+ _obj = UpdateConference.parse_obj({
+ "status": obj.get("status"),
+ "redirect_url": obj.get("redirectUrl"),
+ "redirect_method": obj.get("redirectMethod"),
+ "username": obj.get("username"),
+ "password": obj.get("password"),
+ "redirect_fallback_url": obj.get("redirectFallbackUrl"),
+ "redirect_fallback_method": obj.get("redirectFallbackMethod"),
+ "fallback_username": obj.get("fallbackUsername"),
+ "fallback_password": obj.get("fallbackPassword")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/update_conference_member.py b/bandwidth/models/update_conference_member.py
new file mode 100644
index 00000000..6bd47612
--- /dev/null
+++ b/bandwidth/models/update_conference_member.py
@@ -0,0 +1,93 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, List, Optional
+from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist
+
+class UpdateConferenceMember(BaseModel):
+ """
+ UpdateConferenceMember
+ """
+ mute: Optional[StrictBool] = Field(None, 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.")
+ hold: Optional[StrictBool] = Field(None, 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.")
+ call_ids_to_coach: Optional[conlist(StrictStr)] = Field(None, alias="callIdsToCoach", 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.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["mute", "hold", "callIdsToCoach"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> UpdateConferenceMember:
+ """Create an instance of UpdateConferenceMember from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if call_ids_to_coach (nullable) is None
+ # and __fields_set__ contains the field
+ if self.call_ids_to_coach is None and "call_ids_to_coach" in self.__fields_set__:
+ _dict['callIdsToCoach'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> UpdateConferenceMember:
+ """Create an instance of UpdateConferenceMember from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return UpdateConferenceMember.parse_obj(obj)
+
+ _obj = UpdateConferenceMember.parse_obj({
+ "mute": obj.get("mute"),
+ "hold": obj.get("hold"),
+ "call_ids_to_coach": obj.get("callIdsToCoach")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/verify_code_request.py b/bandwidth/models/verify_code_request.py
new file mode 100644
index 00000000..a45802e9
--- /dev/null
+++ b/bandwidth/models/verify_code_request.py
@@ -0,0 +1,97 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional, Union
+from pydantic import BaseModel, Field, StrictStr, confloat, conint, constr, validator
+
+class VerifyCodeRequest(BaseModel):
+ """
+ VerifyCodeRequest
+ """
+ to: constr(strict=True) = Field(..., description="The phone number to send the mfa code to.")
+ scope: Optional[StrictStr] = Field(None, description="An optional field to denote what scope or action the mfa code is addressing. If not supplied, defaults to \"2FA\".")
+ expiration_time_in_minutes: Union[confloat(le=15, ge=1, strict=True), conint(le=15, ge=1, strict=True)] = Field(..., alias="expirationTimeInMinutes", 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.")
+ code: constr(strict=True, max_length=8, min_length=4) = Field(..., description="The generated mfa code to check if valid.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["to", "scope", "expirationTimeInMinutes", "code"]
+
+ @validator('to')
+ def to_validate_regular_expression(cls, value):
+ """Validates the regular expression"""
+ if not re.match(r"^\+[1-9]\d{1,14}$", value):
+ raise ValueError(r"must validate the regular expression /^\+[1-9]\d{1,14}$/")
+ return value
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> VerifyCodeRequest:
+ """Create an instance of VerifyCodeRequest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> VerifyCodeRequest:
+ """Create an instance of VerifyCodeRequest from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return VerifyCodeRequest.parse_obj(obj)
+
+ _obj = VerifyCodeRequest.parse_obj({
+ "to": obj.get("to"),
+ "scope": obj.get("scope"),
+ "expiration_time_in_minutes": obj.get("expirationTimeInMinutes"),
+ "code": obj.get("code")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/verify_code_response.py b/bandwidth/models/verify_code_response.py
new file mode 100644
index 00000000..f935d5f2
--- /dev/null
+++ b/bandwidth/models/verify_code_response.py
@@ -0,0 +1,84 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictBool
+
+class VerifyCodeResponse(BaseModel):
+ """
+ VerifyCodeResponse
+ """
+ valid: Optional[StrictBool] = Field(None, description="Whether or not the supplied code is valid.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["valid"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> VerifyCodeResponse:
+ """Create an instance of VerifyCodeResponse from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> VerifyCodeResponse:
+ """Create an instance of VerifyCodeResponse from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return VerifyCodeResponse.parse_obj(obj)
+
+ _obj = VerifyCodeResponse.parse_obj({
+ "valid": obj.get("valid")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/voice_api_error.py b/bandwidth/models/voice_api_error.py
new file mode 100644
index 00000000..65fd3eba
--- /dev/null
+++ b/bandwidth/models/voice_api_error.py
@@ -0,0 +1,93 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, StrictStr
+
+class VoiceApiError(BaseModel):
+ """
+ VoiceApiError
+ """
+ type: Optional[StrictStr] = None
+ description: Optional[StrictStr] = None
+ id: Optional[StrictStr] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["type", "description", "id"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> VoiceApiError:
+ """Create an instance of VoiceApiError from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if id (nullable) is None
+ # and __fields_set__ contains the field
+ if self.id is None and "id" in self.__fields_set__:
+ _dict['id'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> VoiceApiError:
+ """Create an instance of VoiceApiError from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return VoiceApiError.parse_obj(obj)
+
+ _obj = VoiceApiError.parse_obj({
+ "type": obj.get("type"),
+ "description": obj.get("description"),
+ "id": obj.get("id")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/models/voice_code_response.py b/bandwidth/models/voice_code_response.py
new file mode 100644
index 00000000..8704a2ba
--- /dev/null
+++ b/bandwidth/models/voice_code_response.py
@@ -0,0 +1,84 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+
+class VoiceCodeResponse(BaseModel):
+ """
+ VoiceCodeResponse
+ """
+ call_id: Optional[StrictStr] = Field(None, alias="callId", description="Programmable Voice API Call ID.")
+ additional_properties: Dict[str, Any] = {}
+ __properties = ["callId"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> VoiceCodeResponse:
+ """Create an instance of VoiceCodeResponse from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ "additional_properties"
+ },
+ exclude_none=True)
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> VoiceCodeResponse:
+ """Create an instance of VoiceCodeResponse from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return VoiceCodeResponse.parse_obj(obj)
+
+ _obj = VoiceCodeResponse.parse_obj({
+ "call_id": obj.get("callId")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/bandwidth/multifactorauth/__init__.py b/bandwidth/multifactorauth/__init__.py
deleted file mode 100644
index ba8fd824..00000000
--- a/bandwidth/multifactorauth/__init__.py
+++ /dev/null
@@ -1,6 +0,0 @@
-__all__ = [
- 'controllers',
- 'exceptions',
- 'models',
- 'multi_factor_auth_client',
-]
diff --git a/bandwidth/multifactorauth/controllers/__init__.py b/bandwidth/multifactorauth/controllers/__init__.py
deleted file mode 100644
index e7f5add1..00000000
--- a/bandwidth/multifactorauth/controllers/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-__all__ = [
- 'base_controller',
- 'mfa_controller',
-]
diff --git a/bandwidth/multifactorauth/controllers/base_controller.py b/bandwidth/multifactorauth/controllers/base_controller.py
deleted file mode 100644
index ec1c6e23..00000000
--- a/bandwidth/multifactorauth/controllers/base_controller.py
+++ /dev/null
@@ -1,95 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-from bandwidth.api_helper import APIHelper
-from bandwidth.exceptions.api_exception import APIException
-
-
-class BaseController(object):
-
- """All controllers inherit from this base class.
-
- Attributes:
- config (Configuration): The HttpClient which a specific controller
- instance will use. By default all the controller objects share
- the same HttpClient. A user can use his own custom HttpClient
- as well.
- http_call_back (HttpCallBack): An object which holds call back
- methods to be called before and after the execution of an HttpRequest.
- global_headers (dict): The global headers of the API which are sent with
- every request.
-
- """
-
- def global_headers(self):
- return {
- 'user-agent': 'python-sdk'
- }
-
- def __init__(self, config, call_back=None):
- self._config = config
- self._http_call_back = call_back
-
- @property
- def config(self):
- return self._config
-
- @property
- def http_call_back(self):
- return self._http_call_back
-
- def validate_parameters(self, **kwargs):
- """Validates required parameters of an endpoint.
-
- Args:
- kwargs (dict): A dictionary of the required parameters.
-
- """
- for name, value in kwargs.items():
- if value is None:
- raise ValueError("Required parameter {} cannot be None.".format(name))
-
- def execute_request(self, request, binary=False):
- """Executes an HttpRequest.
-
- Args:
- request (HttpRequest): The HttpRequest to execute.
- binary (bool): A flag which should be set to True if
- a binary response is expected.
-
- Returns:
- HttpResponse: The HttpResponse received.
-
- """
- # Invoke the on before request HttpCallBack if specified
- if self.http_call_back is not None:
- self.http_call_back.on_before_request(request)
-
- # Add global headers to request
- request.headers = APIHelper.merge_dicts(self.global_headers(), request.headers)
-
- # Invoke the API call to fetch the response.
- func = self.config.http_client.execute_as_binary if binary else self.config.http_client.execute_as_string
- response = func(request)
-
- # Invoke the on after response HttpCallBack if specified
- if self.http_call_back is not None:
- self.http_call_back.on_after_response(response)
-
- return response
-
- def validate_response(self, response):
- """Validates an HTTP response by checking for global errors.
-
- Args:
- response (HttpResponse): The HttpResponse of the API call.
-
- """
- if (response.status_code < 200) or (response.status_code > 208): # [200,208] = HTTP OK
- raise APIException('HTTP response not OK.', response)
diff --git a/bandwidth/multifactorauth/controllers/mfa_controller.py b/bandwidth/multifactorauth/controllers/mfa_controller.py
deleted file mode 100644
index dc4b6be0..00000000
--- a/bandwidth/multifactorauth/controllers/mfa_controller.py
+++ /dev/null
@@ -1,211 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-from bandwidth.api_helper import APIHelper
-from bandwidth.configuration import Server
-from bandwidth.http.api_response import ApiResponse
-from bandwidth.multifactorauth.controllers.base_controller import BaseController
-from bandwidth.http.auth.multi_factor_auth_basic_auth import MultiFactorAuthBasicAuth
-from bandwidth.multifactorauth.models.two_factor_voice_response import TwoFactorVoiceResponse
-from bandwidth.multifactorauth.models.two_factor_messaging_response import TwoFactorMessagingResponse
-from bandwidth.multifactorauth.models.two_factor_verify_code_response import TwoFactorVerifyCodeResponse
-from bandwidth.multifactorauth.exceptions.error_with_request_exception import ErrorWithRequestException
-from bandwidth.multifactorauth.exceptions.unauthorized_request_exception import UnauthorizedRequestException
-from bandwidth.multifactorauth.exceptions.forbidden_request_exception import ForbiddenRequestException
-
-
-class MFAController(BaseController):
-
- """A Controller to access Endpoints in the bandwidth API."""
-
- def __init__(self, config, call_back=None):
- super(MFAController, self).__init__(config, call_back)
-
- def create_voice_two_factor(self,
- account_id,
- body):
- """Does a POST request to /accounts/{accountId}/code/voice.
-
- Multi-Factor authentication with Bandwidth Voice services. Allows for
- a user to send an MFA code via a phone call.
-
- Args:
- account_id (string): Bandwidth Account ID with Voice service
- enabled
- body (TwoFactorCodeRequestSchema): TODO: type description here.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers.
- successful operation
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/accounts/{accountId}/code/voice'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.MULTIFACTORAUTHDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'accept': 'application/json',
- 'content-type': 'application/json; charset=utf-8'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.post(_query_url, headers=_headers, parameters=APIHelper.json_serialize(body))
- MultiFactorAuthBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise ErrorWithRequestException('If there is any issue with values passed in by the user', _response)
- elif _response.status_code == 401:
- raise UnauthorizedRequestException('Authentication is either incorrect or not present', _response)
- elif _response.status_code == 403:
- raise ForbiddenRequestException('The user is not authorized to access this resource', _response)
- elif _response.status_code == 500:
- raise ErrorWithRequestException('An internal server error occurred', _response)
- self.validate_response(_response)
-
- decoded = APIHelper.json_deserialize(_response.text, TwoFactorVoiceResponse.from_dictionary)
- _result = ApiResponse(_response, body=decoded)
- return _result
-
- def create_messaging_two_factor(self,
- account_id,
- body):
- """Does a POST request to /accounts/{accountId}/code/messaging.
-
- Multi-Factor authentication with Bandwidth Messaging services. Allows
- a user to send an MFA code via a text message (SMS).
-
- Args:
- account_id (string): Bandwidth Account ID with Messaging service
- enabled
- body (TwoFactorCodeRequestSchema): TODO: type description here.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers.
- successful operation
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/accounts/{accountId}/code/messaging'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.MULTIFACTORAUTHDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'accept': 'application/json',
- 'content-type': 'application/json; charset=utf-8'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.post(_query_url, headers=_headers, parameters=APIHelper.json_serialize(body))
- MultiFactorAuthBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise ErrorWithRequestException('If there is any issue with values passed in by the user', _response)
- elif _response.status_code == 401:
- raise UnauthorizedRequestException('Authentication is either incorrect or not present', _response)
- elif _response.status_code == 403:
- raise ForbiddenRequestException('The user is not authorized to access this resource', _response)
- elif _response.status_code == 500:
- raise ErrorWithRequestException('An internal server error occurred', _response)
- self.validate_response(_response)
-
- decoded = APIHelper.json_deserialize(_response.text, TwoFactorMessagingResponse.from_dictionary)
- _result = ApiResponse(_response, body=decoded)
- return _result
-
- def create_verify_two_factor(self,
- account_id,
- body):
- """Does a POST request to /accounts/{accountId}/code/verify.
-
- Allows a user to verify an MFA code.
-
- Args:
- account_id (string): Bandwidth Account ID with Two-Factor enabled
- body (TwoFactorVerifyRequestSchema): TODO: type description here.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers.
- successful operation
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/accounts/{accountId}/code/verify'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.MULTIFACTORAUTHDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'accept': 'application/json',
- 'content-type': 'application/json; charset=utf-8'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.post(_query_url, headers=_headers, parameters=APIHelper.json_serialize(body))
- MultiFactorAuthBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise ErrorWithRequestException('If there is any issue with values passed in by the user', _response)
- elif _response.status_code == 401:
- raise UnauthorizedRequestException('Authentication is either incorrect or not present', _response)
- elif _response.status_code == 403:
- raise ForbiddenRequestException('The user is not authorized to access this resource', _response)
- elif _response.status_code == 429:
- raise ErrorWithRequestException('The user has made too many bad requests and is temporarily locked out', _response)
- elif _response.status_code == 500:
- raise ErrorWithRequestException('An internal server error occurred', _response)
- self.validate_response(_response)
-
- decoded = APIHelper.json_deserialize(_response.text, TwoFactorVerifyCodeResponse.from_dictionary)
- _result = ApiResponse(_response, body=decoded)
- return _result
diff --git a/bandwidth/multifactorauth/exceptions/__init__.py b/bandwidth/multifactorauth/exceptions/__init__.py
deleted file mode 100644
index 1b04875f..00000000
--- a/bandwidth/multifactorauth/exceptions/__init__.py
+++ /dev/null
@@ -1,5 +0,0 @@
-__all__ = [
- 'error_with_request_exception',
- 'unauthorized_request_exception',
- 'forbidden_request_exception',
-]
diff --git a/bandwidth/multifactorauth/exceptions/error_with_request_exception.py b/bandwidth/multifactorauth/exceptions/error_with_request_exception.py
deleted file mode 100644
index 366058d0..00000000
--- a/bandwidth/multifactorauth/exceptions/error_with_request_exception.py
+++ /dev/null
@@ -1,39 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-from bandwidth.api_helper import APIHelper
-import bandwidth.exceptions.api_exception
-
-
-class ErrorWithRequestException(bandwidth.exceptions.api_exception.APIException):
- def __init__(self, reason, response):
- """Constructor for the ErrorWithRequestException class
-
- Args:
- reason (string): The reason (or error message) for the Exception
- to be raised.
- response (HttpResponse): The HttpResponse of the API call.
-
- """
- super(ErrorWithRequestException, self).__init__(reason, response)
- dictionary = APIHelper.json_deserialize(self.response.text)
- if isinstance(dictionary, dict):
- self.unbox(dictionary)
-
- def unbox(self, dictionary):
- """Populates the properties of this object by extracting them from a dictionary.
-
- Args:
- dictionary (dictionary): A dictionary representation of the object as
- obtained from the deserialization of the server's response. The keys
- MUST match property names in the API description.
-
- """
- self.error = dictionary.get('error')
- self.request_id = dictionary.get('requestId')
diff --git a/bandwidth/multifactorauth/exceptions/forbidden_request_exception.py b/bandwidth/multifactorauth/exceptions/forbidden_request_exception.py
deleted file mode 100644
index 68bfb7e7..00000000
--- a/bandwidth/multifactorauth/exceptions/forbidden_request_exception.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-from bandwidth.api_helper import APIHelper
-import bandwidth.exceptions.api_exception
-
-
-class ForbiddenRequestException(bandwidth.exceptions.api_exception.APIException):
- def __init__(self, reason, response):
- """Constructor for the ForbiddenRequestException class
-
- Args:
- reason (string): The reason (or error message) for the Exception
- to be raised.
- response (HttpResponse): The HttpResponse of the API call.
-
- """
- super(ForbiddenRequestException, self).__init__(reason, response)
- dictionary = APIHelper.json_deserialize(self.response.text)
- if isinstance(dictionary, dict):
- self.unbox(dictionary)
-
- def unbox(self, dictionary):
- """Populates the properties of this object by extracting them from a dictionary.
-
- Args:
- dictionary (dictionary): A dictionary representation of the object as
- obtained from the deserialization of the server's response. The keys
- MUST match property names in the API description.
-
- """
- self.message = dictionary.get('Message')
diff --git a/bandwidth/multifactorauth/exceptions/unauthorized_request_exception.py b/bandwidth/multifactorauth/exceptions/unauthorized_request_exception.py
deleted file mode 100644
index b25af305..00000000
--- a/bandwidth/multifactorauth/exceptions/unauthorized_request_exception.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-from bandwidth.api_helper import APIHelper
-import bandwidth.exceptions.api_exception
-
-
-class UnauthorizedRequestException(bandwidth.exceptions.api_exception.APIException):
- def __init__(self, reason, response):
- """Constructor for the UnauthorizedRequestException class
-
- Args:
- reason (string): The reason (or error message) for the Exception
- to be raised.
- response (HttpResponse): The HttpResponse of the API call.
-
- """
- super(UnauthorizedRequestException, self).__init__(reason, response)
- dictionary = APIHelper.json_deserialize(self.response.text)
- if isinstance(dictionary, dict):
- self.unbox(dictionary)
-
- def unbox(self, dictionary):
- """Populates the properties of this object by extracting them from a dictionary.
-
- Args:
- dictionary (dictionary): A dictionary representation of the object as
- obtained from the deserialization of the server's response. The keys
- MUST match property names in the API description.
-
- """
- self.message = dictionary.get('message')
diff --git a/bandwidth/multifactorauth/models/__init__.py b/bandwidth/multifactorauth/models/__init__.py
deleted file mode 100644
index a22a5a11..00000000
--- a/bandwidth/multifactorauth/models/__init__.py
+++ /dev/null
@@ -1,7 +0,0 @@
-__all__ = [
- 'two_factor_code_request_schema',
- 'two_factor_voice_response',
- 'two_factor_messaging_response',
- 'two_factor_verify_request_schema',
- 'two_factor_verify_code_response',
-]
diff --git a/bandwidth/multifactorauth/models/two_factor_code_request_schema.py b/bandwidth/multifactorauth/models/two_factor_code_request_schema.py
deleted file mode 100644
index c83351e5..00000000
--- a/bandwidth/multifactorauth/models/two_factor_code_request_schema.py
+++ /dev/null
@@ -1,96 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class TwoFactorCodeRequestSchema(object):
-
- """Implementation of the 'TwoFactorCodeRequestSchema' model.
-
- TODO: type model description here.
-
- Attributes:
- to (string): The phone number to send the 2fa code to.
- mfrom (string): The application phone number, the sender of the 2fa
- code.
- application_id (string): The application unique ID, obtained from
- Bandwidth.
- scope (string): An optional field to denote what scope or action the
- 2fa code is addressing. If not supplied, defaults to "2FA".
- message (string): 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.
- digits (float): The number of digits for your 2fa code. The valid
- number ranges from 2 to 8, inclusively.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "to": 'to',
- "mfrom": 'from',
- "application_id": 'applicationId',
- "message": 'message',
- "digits": 'digits',
- "scope": 'scope'
- }
-
- def __init__(self,
- to=None,
- mfrom=None,
- application_id=None,
- message=None,
- digits=None,
- scope=None):
- """Constructor for the TwoFactorCodeRequestSchema class"""
-
- # Initialize members of the class
- self.to = to
- self.mfrom = mfrom
- self.application_id = application_id
- self.scope = scope
- self.message = message
- self.digits = digits
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- to = dictionary.get('to')
- mfrom = dictionary.get('from')
- application_id = dictionary.get('applicationId')
- message = dictionary.get('message')
- digits = dictionary.get('digits')
- scope = dictionary.get('scope')
-
- # Return an object of this model
- return cls(to,
- mfrom,
- application_id,
- message,
- digits,
- scope)
diff --git a/bandwidth/multifactorauth/models/two_factor_messaging_response.py b/bandwidth/multifactorauth/models/two_factor_messaging_response.py
deleted file mode 100644
index 5fdaa8db..00000000
--- a/bandwidth/multifactorauth/models/two_factor_messaging_response.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class TwoFactorMessagingResponse(object):
-
- """Implementation of the 'TwoFactorMessagingResponse' model.
-
- TODO: type model description here.
-
- Attributes:
- message_id (string): TODO: type description here.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "message_id": 'messageId'
- }
-
- def __init__(self,
- message_id=None):
- """Constructor for the TwoFactorMessagingResponse class"""
-
- # Initialize members of the class
- self.message_id = message_id
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- message_id = dictionary.get('messageId')
-
- # Return an object of this model
- return cls(message_id)
diff --git a/bandwidth/multifactorauth/models/two_factor_verify_code_response.py b/bandwidth/multifactorauth/models/two_factor_verify_code_response.py
deleted file mode 100644
index 85c1b820..00000000
--- a/bandwidth/multifactorauth/models/two_factor_verify_code_response.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class TwoFactorVerifyCodeResponse(object):
-
- """Implementation of the 'TwoFactorVerifyCodeResponse' model.
-
- TODO: type model description here.
-
- Attributes:
- valid (bool): TODO: type description here.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "valid": 'valid'
- }
-
- def __init__(self,
- valid=None):
- """Constructor for the TwoFactorVerifyCodeResponse class"""
-
- # Initialize members of the class
- self.valid = valid
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- valid = dictionary.get('valid')
-
- # Return an object of this model
- return cls(valid)
diff --git a/bandwidth/multifactorauth/models/two_factor_verify_request_schema.py b/bandwidth/multifactorauth/models/two_factor_verify_request_schema.py
deleted file mode 100644
index 9ab79af6..00000000
--- a/bandwidth/multifactorauth/models/two_factor_verify_request_schema.py
+++ /dev/null
@@ -1,85 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class TwoFactorVerifyRequestSchema(object):
-
- """Implementation of the 'TwoFactorVerifyRequestSchema' model.
-
- TODO: type model description here.
-
- Attributes:
- to (string): The phone number to send the 2fa code to.
- application_id (string): The application unique ID, obtained from
- Bandwidth.
- scope (string): An optional field to denote what scope or action the
- 2fa code is addressing. If not supplied, defaults to "2FA".
- expiration_time_in_minutes (float): 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.
- code (string): The generated 2fa code to check if valid
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "to": 'to',
- "application_id": 'applicationId',
- "expiration_time_in_minutes": 'expirationTimeInMinutes',
- "code": 'code',
- "scope": 'scope'
- }
-
- def __init__(self,
- to=None,
- application_id=None,
- expiration_time_in_minutes=None,
- code=None,
- scope=None):
- """Constructor for the TwoFactorVerifyRequestSchema class"""
-
- # Initialize members of the class
- self.to = to
- self.application_id = application_id
- self.scope = scope
- self.expiration_time_in_minutes = expiration_time_in_minutes
- self.code = code
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- to = dictionary.get('to')
- application_id = dictionary.get('applicationId')
- expiration_time_in_minutes = dictionary.get('expirationTimeInMinutes')
- code = dictionary.get('code')
- scope = dictionary.get('scope')
-
- # Return an object of this model
- return cls(to,
- application_id,
- expiration_time_in_minutes,
- code,
- scope)
diff --git a/bandwidth/multifactorauth/models/two_factor_voice_response.py b/bandwidth/multifactorauth/models/two_factor_voice_response.py
deleted file mode 100644
index da63ba9e..00000000
--- a/bandwidth/multifactorauth/models/two_factor_voice_response.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class TwoFactorVoiceResponse(object):
-
- """Implementation of the 'TwoFactorVoiceResponse' model.
-
- TODO: type model description here.
-
- Attributes:
- call_id (string): TODO: type description here.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "call_id": 'callId'
- }
-
- def __init__(self,
- call_id=None):
- """Constructor for the TwoFactorVoiceResponse class"""
-
- # Initialize members of the class
- self.call_id = call_id
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- call_id = dictionary.get('callId')
-
- # Return an object of this model
- return cls(call_id)
diff --git a/bandwidth/multifactorauth/multi_factor_auth_client.py b/bandwidth/multifactorauth/multi_factor_auth_client.py
deleted file mode 100644
index 1b3b62ee..00000000
--- a/bandwidth/multifactorauth/multi_factor_auth_client.py
+++ /dev/null
@@ -1,56 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-from bandwidth.decorators import lazy_property
-from bandwidth.configuration import Configuration
-from bandwidth.configuration import Environment
-from bandwidth.multifactorauth.controllers.mfa_controller import MFAController
-
-
-class MultiFactorAuthClient(object):
-
- @lazy_property
- def mfa(self):
- return MFAController(self.config)
-
- def __init__(self, timeout=60, max_retries=0, 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=['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=None):
- if config is None:
- self.config = Configuration(timeout=timeout,
- max_retries=max_retries,
- 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:
- self.config = config
diff --git a/bandwidth/phonenumberlookup/__init__.py b/bandwidth/phonenumberlookup/__init__.py
deleted file mode 100644
index e0ec0dad..00000000
--- a/bandwidth/phonenumberlookup/__init__.py
+++ /dev/null
@@ -1,6 +0,0 @@
-__all__ = [
- 'controllers',
- 'exceptions',
- 'models',
- 'phone_number_lookup_client',
-]
diff --git a/bandwidth/phonenumberlookup/controllers/__init__.py b/bandwidth/phonenumberlookup/controllers/__init__.py
deleted file mode 100644
index c1660224..00000000
--- a/bandwidth/phonenumberlookup/controllers/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-__all__ = [
- 'base_controller',
- 'api_controller',
-]
diff --git a/bandwidth/phonenumberlookup/controllers/api_controller.py b/bandwidth/phonenumberlookup/controllers/api_controller.py
deleted file mode 100644
index 9914dacc..00000000
--- a/bandwidth/phonenumberlookup/controllers/api_controller.py
+++ /dev/null
@@ -1,553 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-from bandwidth.api_helper import APIHelper
-from bandwidth.configuration import Server
-from bandwidth.http.api_response import ApiResponse
-from bandwidth.phonenumberlookup.controllers.base_controller import BaseController
-from bandwidth.http.auth.phone_number_lookup_basic_auth import PhoneNumberLookupBasicAuth
-from bandwidth.phonenumberlookup.models.order_response import OrderResponse
-from bandwidth.phonenumberlookup.models.order_status import OrderStatus
-from bandwidth.phonenumberlookup.exceptions.accounts_tnlookup_400_error_exception import AccountsTnlookup400ErrorException
-from bandwidth.exceptions.api_exception import APIException
-
-
-class APIController(BaseController):
-
- """A Controller to access Endpoints in the bandwidth API."""
-
- def __init__(self, config, call_back=None):
- super(APIController, self).__init__(config, call_back)
-
- def create_lookup_request(self,
- account_id,
- body):
- """Does a POST request to /accounts/{accountId}/tnlookup.
-
- Create a TN Lookup Order.
-
- Args:
- account_id (string): The ID of the Bandwidth account that the user
- belongs to.
- body (OrderRequest): TODO: type description here.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers. The
- request has been accepted for processing but not yet finished
- and in a terminal state (COMPLETE, PARTIAL_COMPLETE, or
- FAILED)
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/accounts/{accountId}/tnlookup'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.PHONENUMBERLOOKUPDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'accept': 'application/json',
- 'content-type': 'application/json; charset=utf-8'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.post(_query_url, headers=_headers, parameters=APIHelper.json_serialize(body))
- PhoneNumberLookupBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise AccountsTnlookup400ErrorException('Bad Request. Ensure that your request payload is properly formatted and that the telephone numbers used are valid.', _response)
- elif _response.status_code == 401:
- raise APIException('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)
- elif _response.status_code == 415:
- raise APIException('Invalid content-type. Ensure that your content-type header is set to application/json.', _response)
- elif _response.status_code == 429:
- raise APIException('Too Many Requests. Reduce the amount of requests that you are sending in order to avoid receiving this status code.', _response)
- elif _response.status_code == 500:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 501:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 502:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 503:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 504:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 505:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 506:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 507:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 508:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 509:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 510:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 511:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 512:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 513:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 514:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 515:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 516:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 517:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 518:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 519:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 520:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 521:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 522:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 523:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 524:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 525:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 526:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 527:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 528:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 529:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 530:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 531:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 532:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 533:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 534:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 535:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 536:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 537:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 538:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 539:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 540:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 541:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 542:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 543:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 544:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 545:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 546:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 547:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 548:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 549:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 550:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 551:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 552:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 553:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 554:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 555:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 556:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 557:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 558:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 559:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 560:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 561:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 562:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 563:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 564:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 565:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 566:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 567:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 568:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 569:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 570:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 571:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 572:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 573:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 574:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 575:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 576:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 577:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 578:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 579:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 580:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 581:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 582:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 583:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 584:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 585:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 586:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 587:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 588:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 589:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 590:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 591:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 592:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 593:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 594:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 595:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 596:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 597:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 598:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 599:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- self.validate_response(_response)
-
- decoded = APIHelper.json_deserialize(_response.text, OrderResponse.from_dictionary)
- _result = ApiResponse(_response, body=decoded)
- return _result
-
- def get_lookup_request_status(self,
- account_id,
- request_id):
- """Does a GET request to /accounts/{accountId}/tnlookup/{requestId}.
-
- Query an existing TN Lookup Order.
-
- Args:
- account_id (string): The ID of the Bandwidth account that the user
- belongs to.
- request_id (string): TODO: type description here.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers. 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.
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/accounts/{accountId}/tnlookup/{requestId}'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'requestId': {'value': request_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.PHONENUMBERLOOKUPDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'accept': 'application/json'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.get(_query_url, headers=_headers)
- PhoneNumberLookupBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise APIException('Bad Request. Ensure that you have set the requestId as a URL path parameter.', _response)
- elif _response.status_code == 401:
- raise APIException('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)
- elif _response.status_code == 404:
- raise APIException('RequestId not found. Ensure that the requestId used in the URL path is valid and maps to a previous request that was submitted.', _response)
- elif _response.status_code == 429:
- raise APIException('Too Many Requests. Reduce the amount of requests that you are sending in order to avoid receiving this status code.', _response)
- elif _response.status_code == 500:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 501:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 502:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 503:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 504:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 505:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 506:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 507:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 508:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 509:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 510:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 511:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 512:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 513:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 514:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 515:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 516:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 517:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 518:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 519:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 520:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 521:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 522:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 523:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 524:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 525:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 526:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 527:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 528:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 529:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 530:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 531:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 532:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 533:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 534:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 535:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 536:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 537:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 538:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 539:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 540:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 541:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 542:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 543:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 544:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 545:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 546:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 547:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 548:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 549:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 550:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 551:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 552:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 553:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 554:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 555:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 556:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 557:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 558:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 559:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 560:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 561:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 562:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 563:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 564:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 565:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 566:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 567:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 568:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 569:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 570:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 571:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 572:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 573:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 574:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 575:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 576:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 577:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 578:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 579:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 580:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 581:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 582:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 583:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 584:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 585:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 586:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 587:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 588:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 589:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 590:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 591:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 592:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 593:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 594:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 595:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 596:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 597:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 598:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- elif _response.status_code == 599:
- raise APIException('Unexpected error. Please contact Bandwidth Support if your requests are receiving this status code for an extended period of time.', _response)
- self.validate_response(_response)
-
- decoded = APIHelper.json_deserialize(_response.text, OrderStatus.from_dictionary)
- _result = ApiResponse(_response, body=decoded)
- return _result
diff --git a/bandwidth/phonenumberlookup/controllers/base_controller.py b/bandwidth/phonenumberlookup/controllers/base_controller.py
deleted file mode 100644
index ec1c6e23..00000000
--- a/bandwidth/phonenumberlookup/controllers/base_controller.py
+++ /dev/null
@@ -1,95 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-from bandwidth.api_helper import APIHelper
-from bandwidth.exceptions.api_exception import APIException
-
-
-class BaseController(object):
-
- """All controllers inherit from this base class.
-
- Attributes:
- config (Configuration): The HttpClient which a specific controller
- instance will use. By default all the controller objects share
- the same HttpClient. A user can use his own custom HttpClient
- as well.
- http_call_back (HttpCallBack): An object which holds call back
- methods to be called before and after the execution of an HttpRequest.
- global_headers (dict): The global headers of the API which are sent with
- every request.
-
- """
-
- def global_headers(self):
- return {
- 'user-agent': 'python-sdk'
- }
-
- def __init__(self, config, call_back=None):
- self._config = config
- self._http_call_back = call_back
-
- @property
- def config(self):
- return self._config
-
- @property
- def http_call_back(self):
- return self._http_call_back
-
- def validate_parameters(self, **kwargs):
- """Validates required parameters of an endpoint.
-
- Args:
- kwargs (dict): A dictionary of the required parameters.
-
- """
- for name, value in kwargs.items():
- if value is None:
- raise ValueError("Required parameter {} cannot be None.".format(name))
-
- def execute_request(self, request, binary=False):
- """Executes an HttpRequest.
-
- Args:
- request (HttpRequest): The HttpRequest to execute.
- binary (bool): A flag which should be set to True if
- a binary response is expected.
-
- Returns:
- HttpResponse: The HttpResponse received.
-
- """
- # Invoke the on before request HttpCallBack if specified
- if self.http_call_back is not None:
- self.http_call_back.on_before_request(request)
-
- # Add global headers to request
- request.headers = APIHelper.merge_dicts(self.global_headers(), request.headers)
-
- # Invoke the API call to fetch the response.
- func = self.config.http_client.execute_as_binary if binary else self.config.http_client.execute_as_string
- response = func(request)
-
- # Invoke the on after response HttpCallBack if specified
- if self.http_call_back is not None:
- self.http_call_back.on_after_response(response)
-
- return response
-
- def validate_response(self, response):
- """Validates an HTTP response by checking for global errors.
-
- Args:
- response (HttpResponse): The HttpResponse of the API call.
-
- """
- if (response.status_code < 200) or (response.status_code > 208): # [200,208] = HTTP OK
- raise APIException('HTTP response not OK.', response)
diff --git a/bandwidth/phonenumberlookup/exceptions/__init__.py b/bandwidth/phonenumberlookup/exceptions/__init__.py
deleted file mode 100644
index 09cf873f..00000000
--- a/bandwidth/phonenumberlookup/exceptions/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-__all__ = [
- 'accounts_tnlookup_400_error_exception',
-]
diff --git a/bandwidth/phonenumberlookup/exceptions/accounts_tnlookup_400_error_exception.py b/bandwidth/phonenumberlookup/exceptions/accounts_tnlookup_400_error_exception.py
deleted file mode 100644
index ba4332d4..00000000
--- a/bandwidth/phonenumberlookup/exceptions/accounts_tnlookup_400_error_exception.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-from bandwidth.api_helper import APIHelper
-import bandwidth.exceptions.api_exception
-
-
-class AccountsTnlookup400ErrorException(bandwidth.exceptions.api_exception.APIException):
- def __init__(self, reason, response):
- """Constructor for the AccountsTnlookup400ErrorException class
-
- Args:
- reason (string): The reason (or error message) for the Exception
- to be raised.
- response (HttpResponse): The HttpResponse of the API call.
-
- """
- super(AccountsTnlookup400ErrorException, self).__init__(reason, response)
- dictionary = APIHelper.json_deserialize(self.response.text)
- if isinstance(dictionary, dict):
- self.unbox(dictionary)
-
- def unbox(self, dictionary):
- """Populates the properties of this object by extracting them from a dictionary.
-
- Args:
- dictionary (dictionary): A dictionary representation of the object as
- obtained from the deserialization of the server's response. The keys
- MUST match property names in the API description.
-
- """
- self.message = dictionary.get('message')
diff --git a/bandwidth/phonenumberlookup/models/__init__.py b/bandwidth/phonenumberlookup/models/__init__.py
deleted file mode 100644
index 013be73e..00000000
--- a/bandwidth/phonenumberlookup/models/__init__.py
+++ /dev/null
@@ -1,6 +0,0 @@
-__all__ = [
- 'order_request',
- 'order_response',
- 'order_status',
- 'result',
-]
diff --git a/bandwidth/phonenumberlookup/models/order_request.py b/bandwidth/phonenumberlookup/models/order_request.py
deleted file mode 100644
index fe9052db..00000000
--- a/bandwidth/phonenumberlookup/models/order_request.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class OrderRequest(object):
-
- """Implementation of the 'OrderRequest' model.
-
- Create TN Lookup Request
-
- Attributes:
- tns (list of string): TODO: type description here.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "tns": 'tns'
- }
-
- def __init__(self,
- tns=None):
- """Constructor for the OrderRequest class"""
-
- # Initialize members of the class
- self.tns = tns
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- tns = dictionary.get('tns')
-
- # Return an object of this model
- return cls(tns)
diff --git a/bandwidth/phonenumberlookup/models/order_response.py b/bandwidth/phonenumberlookup/models/order_response.py
deleted file mode 100644
index 1607be77..00000000
--- a/bandwidth/phonenumberlookup/models/order_response.py
+++ /dev/null
@@ -1,62 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class OrderResponse(object):
-
- """Implementation of the 'OrderResponse' model.
-
- The request has been accepted for processing but not yet finished and in a
- terminal state (COMPLETE, PARTIAL_COMPLETE, or FAILED)
-
- Attributes:
- request_id (string): TODO: type description here.
- status (string): TODO: type description here.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "request_id": 'requestId',
- "status": 'status'
- }
-
- def __init__(self,
- request_id=None,
- status=None):
- """Constructor for the OrderResponse class"""
-
- # Initialize members of the class
- self.request_id = request_id
- self.status = status
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- request_id = dictionary.get('requestId')
- status = dictionary.get('status')
-
- # Return an object of this model
- return cls(request_id,
- status)
diff --git a/bandwidth/phonenumberlookup/models/order_status.py b/bandwidth/phonenumberlookup/models/order_status.py
deleted file mode 100644
index 221455fc..00000000
--- a/bandwidth/phonenumberlookup/models/order_status.py
+++ /dev/null
@@ -1,83 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-from bandwidth.phonenumberlookup.models.result import Result
-
-
-class OrderStatus(object):
-
- """Implementation of the 'OrderStatus' model.
-
- 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.
-
- Attributes:
- request_id (string): The requestId.
- status (string): The status of the request (IN_PROGRESS, COMPLETE,
- PARTIAL_COMPLETE, or FAILED).
- failed_telephone_numbers (list of string): The telephone numbers whose
- lookup failed
- result (list of Result): The carrier information results for the
- specified telephone number.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "request_id": 'requestId',
- "status": 'status',
- "failed_telephone_numbers": 'failedTelephoneNumbers',
- "result": 'result'
- }
-
- def __init__(self,
- request_id=None,
- status=None,
- failed_telephone_numbers=None,
- result=None):
- """Constructor for the OrderStatus class"""
-
- # Initialize members of the class
- self.request_id = request_id
- self.status = status
- self.failed_telephone_numbers = failed_telephone_numbers
- self.result = result
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- request_id = dictionary.get('requestId')
- status = dictionary.get('status')
- failed_telephone_numbers = dictionary.get('failedTelephoneNumbers')
- result = None
- if dictionary.get('result') is not None:
- result = [Result.from_dictionary(x) for x in dictionary.get('result')]
-
- # Return an object of this model
- return cls(request_id,
- status,
- failed_telephone_numbers,
- result)
diff --git a/bandwidth/phonenumberlookup/models/result.py b/bandwidth/phonenumberlookup/models/result.py
deleted file mode 100644
index ecdbaf14..00000000
--- a/bandwidth/phonenumberlookup/models/result.py
+++ /dev/null
@@ -1,104 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class Result(object):
-
- """Implementation of the 'Result' model.
-
- TODO: type model description here.
-
- Attributes:
- response_code (int): Our vendor's response code.
- message (string): Message associated with the response code.
- e_164_format (string): The telephone number in E.164 format.
- formatted (string): The formatted version of the telephone number.
- country (string): The country of the telephone number.
- line_type (string): The line type of the telephone number.
- line_provider (string): The service provider of the telephone number.
- mobile_country_code (string): The first half of the Home Network
- Identity (HNI).
- mobile_network_code (string): The second half of the HNI.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "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'
- }
-
- def __init__(self,
- response_code=None,
- message=None,
- e_164_format=None,
- formatted=None,
- country=None,
- line_type=None,
- line_provider=None,
- mobile_country_code=None,
- mobile_network_code=None):
- """Constructor for the Result class"""
-
- # Initialize members of the class
- self.response_code = response_code
- self.message = message
- self.e_164_format = e_164_format
- self.formatted = formatted
- self.country = country
- self.line_type = line_type
- self.line_provider = line_provider
- self.mobile_country_code = mobile_country_code
- self.mobile_network_code = mobile_network_code
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- response_code = dictionary.get('Response Code')
- message = dictionary.get('Message')
- e_164_format = dictionary.get('E.164 Format')
- formatted = dictionary.get('Formatted')
- country = dictionary.get('Country')
- line_type = dictionary.get('Line Type')
- line_provider = dictionary.get('Line Provider')
- mobile_country_code = dictionary.get('Mobile Country Code')
- mobile_network_code = dictionary.get('Mobile Network Code')
-
- # Return an object of this model
- return cls(response_code,
- message,
- e_164_format,
- formatted,
- country,
- line_type,
- line_provider,
- mobile_country_code,
- mobile_network_code)
diff --git a/bandwidth/phonenumberlookup/phone_number_lookup_client.py b/bandwidth/phonenumberlookup/phone_number_lookup_client.py
deleted file mode 100644
index 6a187ca6..00000000
--- a/bandwidth/phonenumberlookup/phone_number_lookup_client.py
+++ /dev/null
@@ -1,57 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-from bandwidth.decorators import lazy_property
-from bandwidth.configuration import Configuration
-from bandwidth.configuration import Environment
-from bandwidth.phonenumberlookup.controllers.api_controller\
- import APIController
-
-
-class PhoneNumberLookupClient(object):
-
- @lazy_property
- def client(self):
- return APIController(self.config)
-
- def __init__(self, timeout=60, max_retries=0, 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=['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=None):
- if config is None:
- self.config = Configuration(timeout=timeout,
- max_retries=max_retries,
- 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:
- self.config = config
diff --git a/bandwidth/tests/__init__.py b/bandwidth/py.typed
similarity index 100%
rename from bandwidth/tests/__init__.py
rename to bandwidth/py.typed
diff --git a/bandwidth/rest.py b/bandwidth/rest.py
new file mode 100644
index 00000000..d8fd7794
--- /dev/null
+++ b/bandwidth/rest.py
@@ -0,0 +1,304 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import io
+import json
+import logging
+import re
+import ssl
+
+from urllib.parse import urlencode, quote_plus
+import urllib3
+
+from bandwidth.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError, BadRequestException
+
+
+logger = logging.getLogger(__name__)
+
+
+class RESTResponse(io.IOBase):
+
+ def __init__(self, resp):
+ self.urllib3_response = resp
+ self.status = resp.status
+ self.reason = resp.reason
+ self.data = resp.data
+
+ def getheaders(self):
+ """Returns a dictionary of the response headers."""
+ return self.urllib3_response.headers
+
+ def getheader(self, name, default=None):
+ """Returns a given response header."""
+ return self.urllib3_response.headers.get(name, default)
+
+
+class RESTClientObject(object):
+
+ def __init__(self, configuration, pools_size=4, maxsize=None):
+ # urllib3.PoolManager will pass all kw parameters to connectionpool
+ # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501
+ # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501
+ # maxsize is the number of requests to host that are allowed in parallel # noqa: E501
+ # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501
+
+ # cert_reqs
+ if configuration.verify_ssl:
+ cert_reqs = ssl.CERT_REQUIRED
+ else:
+ cert_reqs = ssl.CERT_NONE
+
+ addition_pool_args = {}
+ if configuration.assert_hostname is not None:
+ addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501
+
+ if configuration.retries is not None:
+ addition_pool_args['retries'] = configuration.retries
+
+ if configuration.tls_server_name:
+ addition_pool_args['server_hostname'] = configuration.tls_server_name
+
+
+ if configuration.socket_options is not None:
+ addition_pool_args['socket_options'] = configuration.socket_options
+
+ if maxsize is None:
+ if configuration.connection_pool_maxsize is not None:
+ maxsize = configuration.connection_pool_maxsize
+ else:
+ maxsize = 4
+
+ # https pool manager
+ if configuration.proxy:
+ self.pool_manager = urllib3.ProxyManager(
+ num_pools=pools_size,
+ maxsize=maxsize,
+ cert_reqs=cert_reqs,
+ ca_certs=configuration.ssl_ca_cert,
+ cert_file=configuration.cert_file,
+ key_file=configuration.key_file,
+ proxy_url=configuration.proxy,
+ proxy_headers=configuration.proxy_headers,
+ **addition_pool_args
+ )
+ else:
+ self.pool_manager = urllib3.PoolManager(
+ num_pools=pools_size,
+ maxsize=maxsize,
+ cert_reqs=cert_reqs,
+ ca_certs=configuration.ssl_ca_cert,
+ cert_file=configuration.cert_file,
+ key_file=configuration.key_file,
+ **addition_pool_args
+ )
+
+ def request(self, method, url, query_params=None, headers=None,
+ body=None, post_params=None, _preload_content=True,
+ _request_timeout=None):
+ """Perform requests.
+
+ :param method: http request method
+ :param url: http request url
+ :param query_params: query parameters in the url
+ :param headers: http request headers
+ :param body: request json body, for `application/json`
+ :param post_params: request post parameters,
+ `application/x-www-form-urlencoded`
+ and `multipart/form-data`
+ :param _preload_content: if False, the urllib3.HTTPResponse object will
+ be returned without reading/decoding response
+ data. Default is True.
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ """
+ method = method.upper()
+ assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT',
+ 'PATCH', 'OPTIONS']
+
+ if post_params and body:
+ raise ApiValueError(
+ "body parameter cannot be used with post_params parameter."
+ )
+
+ post_params = post_params or {}
+ headers = headers or {}
+ # url already contains the URL query string
+ # so reset query_params to empty dict
+ query_params = {}
+
+ timeout = None
+ if _request_timeout:
+ if isinstance(_request_timeout, (int,float)): # noqa: E501,F821
+ timeout = urllib3.Timeout(total=_request_timeout)
+ elif (isinstance(_request_timeout, tuple) and
+ len(_request_timeout) == 2):
+ timeout = urllib3.Timeout(
+ connect=_request_timeout[0], read=_request_timeout[1])
+
+ try:
+ # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
+ if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
+
+ # no content type provided or payload is json
+ if not headers.get('Content-Type') or re.search('json', headers['Content-Type'], re.IGNORECASE):
+ request_body = None
+ if body is not None:
+ request_body = json.dumps(body)
+ r = self.pool_manager.request(
+ method, url,
+ body=request_body,
+ preload_content=_preload_content,
+ timeout=timeout,
+ headers=headers)
+ elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501
+ r = self.pool_manager.request(
+ method, url,
+ fields=post_params,
+ encode_multipart=False,
+ preload_content=_preload_content,
+ timeout=timeout,
+ headers=headers)
+ elif headers['Content-Type'] == 'multipart/form-data':
+ # must del headers['Content-Type'], or the correct
+ # Content-Type which generated by urllib3 will be
+ # overwritten.
+ del headers['Content-Type']
+ r = self.pool_manager.request(
+ method, url,
+ fields=post_params,
+ encode_multipart=True,
+ preload_content=_preload_content,
+ timeout=timeout,
+ headers=headers)
+ # Pass a `string` parameter directly in the body to support
+ # other content types than Json when `body` argument is
+ # provided in serialized form
+ elif isinstance(body, str) or isinstance(body, bytes):
+ request_body = body
+ r = self.pool_manager.request(
+ method, url,
+ body=request_body,
+ preload_content=_preload_content,
+ timeout=timeout,
+ headers=headers)
+ else:
+ # Cannot generate the request from given parameters
+ msg = """Cannot prepare a request message for provided
+ arguments. Please check that your arguments match
+ declared content type."""
+ raise ApiException(status=0, reason=msg)
+ # For `GET`, `HEAD`
+ else:
+ r = self.pool_manager.request(method, url,
+ fields={},
+ preload_content=_preload_content,
+ timeout=timeout,
+ headers=headers)
+ except urllib3.exceptions.SSLError as e:
+ msg = "{0}\n{1}".format(type(e).__name__, str(e))
+ raise ApiException(status=0, reason=msg)
+
+ if _preload_content:
+ r = RESTResponse(r)
+
+ # log response body
+ logger.debug("response body: %s", r.data)
+
+ if not 200 <= r.status <= 299:
+ if r.status == 400:
+ raise BadRequestException(http_resp=r)
+
+ if r.status == 401:
+ raise UnauthorizedException(http_resp=r)
+
+ if r.status == 403:
+ raise ForbiddenException(http_resp=r)
+
+ if r.status == 404:
+ raise NotFoundException(http_resp=r)
+
+ if 500 <= r.status <= 599:
+ raise ServiceException(http_resp=r)
+
+ raise ApiException(http_resp=r)
+
+ return r
+
+ def get_request(self, url, headers=None, query_params=None, _preload_content=True,
+ _request_timeout=None):
+ return self.request("GET", url,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ query_params=query_params)
+
+ def head_request(self, url, headers=None, query_params=None, _preload_content=True,
+ _request_timeout=None):
+ return self.request("HEAD", url,
+ headers=headers,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ query_params=query_params)
+
+ def options_request(self, url, headers=None, query_params=None, post_params=None,
+ body=None, _preload_content=True, _request_timeout=None):
+ return self.request("OPTIONS", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+
+ def delete_request(self, url, headers=None, query_params=None, body=None,
+ _preload_content=True, _request_timeout=None):
+ return self.request("DELETE", url,
+ headers=headers,
+ query_params=query_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+
+ def post_request(self, url, headers=None, query_params=None, post_params=None,
+ body=None, _preload_content=True, _request_timeout=None):
+ return self.request("POST", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+
+ def put_request(self, url, headers=None, query_params=None, post_params=None,
+ body=None, _preload_content=True, _request_timeout=None):
+ return self.request("PUT", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
+
+ def patch_request(self, url, headers=None, query_params=None, post_params=None,
+ body=None, _preload_content=True, _request_timeout=None):
+ return self.request("PATCH", url,
+ headers=headers,
+ query_params=query_params,
+ post_params=post_params,
+ _preload_content=_preload_content,
+ _request_timeout=_request_timeout,
+ body=body)
diff --git a/bandwidth/tests/test_api.py b/bandwidth/tests/test_api.py
deleted file mode 100644
index 1e4017d7..00000000
--- a/bandwidth/tests/test_api.py
+++ /dev/null
@@ -1,675 +0,0 @@
-"""
-test_api.py
-
-Integration tests for API requests
-
-@copyright Bandwidth Inc.
-"""
-import os
-import time
-import pytest
-import dateutil.parser
-import uuid
-from random import seed
-from random import randint
-from bandwidth.bandwidth_client import BandwidthClient
-from bandwidth.messaging.exceptions.messaging_exception import MessagingException
-from bandwidth.exceptions.api_exception import APIException
-from bandwidth.messaging.models.message_request import MessageRequest
-from bandwidth.voice.exceptions.api_error_exception import ApiErrorException
-from bandwidth.voice.models.create_call_request import CreateCallRequest
-from bandwidth.voice.models.machine_detection_configuration import MachineDetectionConfiguration
-from bandwidth.voice.models.callback_method_enum import CallbackMethodEnum
-from bandwidth.voice.models.mode_enum import ModeEnum
-from bandwidth.multifactorauth.models.two_factor_code_request_schema import TwoFactorCodeRequestSchema
-from bandwidth.multifactorauth.models.two_factor_verify_request_schema import TwoFactorVerifyRequestSchema
-from bandwidth.webrtc.models.session import Session
-from bandwidth.webrtc.models.participant import Participant
-from bandwidth.phonenumberlookup.models.order_request import OrderRequest
-
-# prints the print statements to console if test fails
-[pytest]
-log_cli = True
-
-# seed the random number generator
-seed(randint(10, 500))
-
-try:
- BW_USERNAME = os.environ["BW_USERNAME"]
- BW_PASSWORD = os.environ["BW_PASSWORD"]
- BW_ACCOUNT_ID = os.environ["BW_ACCOUNT_ID"]
- BW_VOICE_APPLICATION_ID = os.environ["BW_VOICE_APPLICATION_ID"]
- BW_MESSAGING_APPLICATION_ID = os.environ["BW_MESSAGING_APPLICATION_ID"]
- BASE_CALLBACK_URL = os.environ["BASE_CALLBACK_URL"]
- BW_NUMBER = os.environ["BW_NUMBER"]
- USER_NUMBER = os.environ["USER_NUMBER"]
-except KeyError as e:
- raise Exception("Environmental variables not found")
-
-
-@pytest.fixture()
-def messaging_client():
- bandwidth_client = BandwidthClient(
- messaging_basic_auth_user_name=BW_USERNAME,
- messaging_basic_auth_password=BW_PASSWORD,
- )
- messaging_client = bandwidth_client.messaging_client.client
- return messaging_client
-
-
-@pytest.fixture()
-def voice_client():
- bandwidth_client = BandwidthClient(
- voice_basic_auth_user_name=BW_USERNAME,
- voice_basic_auth_password=BW_PASSWORD,
- )
- voice_client = bandwidth_client.voice_client.client
- return voice_client
-
-
-@pytest.fixture()
-def mfa_client():
- bandwidth_client = BandwidthClient(
- multi_factor_auth_basic_auth_user_name=BW_USERNAME,
- multi_factor_auth_basic_auth_password=BW_PASSWORD,
- )
- mfa_client = bandwidth_client.multi_factor_auth_client.mfa
- return mfa_client
-
-
-@pytest.fixture()
-def web_rtc_client():
- bandwidth_client = BandwidthClient(
- web_rtc_basic_auth_user_name=BW_USERNAME,
- web_rtc_basic_auth_password=BW_PASSWORD,
- )
- web_rtc_client = bandwidth_client.web_rtc_client.client
- return web_rtc_client
-
-
-@pytest.fixture()
-def tn_lookup_client():
- bandwidth_client = BandwidthClient(
- phone_number_lookup_basic_auth_user_name=BW_USERNAME,
- phone_number_lookup_basic_auth_password=BW_PASSWORD,
- )
- tn_lookup_client = bandwidth_client.phone_number_lookup_client.client
- return tn_lookup_client
-
-
-class TestApi:
- """
- Class that holds basic monitoring tests for the Python SDK. Makes requests to cover JSON call and response,
- error handling, and binary string uploads and downloads
- """
- def test_successful_create_message(self, messaging_client):
- """Create valid request to send an SMS using the Messaging API.
-
- Args:
- messaging_client: Contains the basic auth credentials needed to authenticate.
-
- """
- message_body = MessageRequest()
- message_body.application_id = BW_MESSAGING_APPLICATION_ID
- message_body.to = [USER_NUMBER]
- message_body.mfrom = BW_NUMBER
- message_body.text = "Python Monitoring"
- create_response = messaging_client.create_message(BW_ACCOUNT_ID, message_body)
- create_response_body = create_response.body
-
- print(vars(create_response))
-
- assert (create_response.status_code == 202)
- assert len(create_response_body.id) == 29 # asserts `messageId` returned and matches expected length (29)
- # asserts `owner` matches `mfrom` number and `BW_NUMBER`
- assert create_response_body.owner == create_response_body.mfrom == BW_NUMBER
- assert create_response_body.application_id == BW_MESSAGING_APPLICATION_ID
-
- # asserts the date string is valid ISO
- assert dateutil.parser.isoparse(str(create_response_body.time))
- assert type(create_response_body.segment_count) is int
- assert create_response_body.to == [USER_NUMBER]
- assert create_response_body.media == message_body.media
- assert create_response_body.text == message_body.text
- assert create_response_body.tag == message_body.tag
- assert create_response_body.priority == message_body.priority
-
- def test_failed_create_message(self, messaging_client):
- """Create invalid request to send an SMS using the Messaging API.
-
- Args:
- messaging_client: Contains the basic auth credentials needed to authenticate.
-
- """
- with pytest.raises(MessagingException): # asserts that a messaging exception is raised
- message_body = MessageRequest()
- message_body.application_id = BW_MESSAGING_APPLICATION_ID
- message_body.to = ["+1invalid"]
- message_body.mfrom = BW_NUMBER
- message_body.text = "Python Monitoring"
-
- create_response = messaging_client.create_message(BW_ACCOUNT_ID, message_body)
- create_response_body = create_response.body
-
- print(vars(create_response))
-
- assert create_response.status_code == 400
- assert type(create_response_body.type) == "request-validation"
- assert type(create_response_body.description) is str
-
- def test_successful_media_upload_download(self, messaging_client):
- """Upload a binary string and then download it and confirm both files match.
-
- Args:
- messaging_client: Contains the basic auth credentials needed to authenticate.
-
- """
- media_file_name = f'text-media-id-{uuid.uuid4()}'
- media_file = b'12345'
- messaging_client.upload_media(BW_ACCOUNT_ID, media_file_name, media_file, 'text/plain')
- upload_response = messaging_client.get_media(BW_ACCOUNT_ID, media_file_name)
- downloaded_media = upload_response.body
-
- print(vars(upload_response))
-
- assert upload_response.status_code == 200 # assert successful status
- assert downloaded_media == media_file # assert the binary strings match
-
- def test_failed_media_download(self, messaging_client):
- """Attempt to download media that doesnt exist and validate a 404 is returned from the API.
-
- Args:
- messaging_client: Contains the basic auth credentials needed to authenticate.
-
- """
- with pytest.raises(MessagingException): # asserts that a messaging exception is raised
- media_file_name = 'invalid_python_monitoring'
- get_response = messaging_client.get_media(BW_ACCOUNT_ID, media_file_name)
- get_response_body = get_response.body
-
- print(vars(get_response))
-
- assert get_response.status_code == 404 # assert status code
- assert get_response_body.type == "object-not-found"
- assert type(get_response_body.description) is str
-
- def test_successful_create_and_get_call(self, voice_client):
- """Create a successful call and get status of the same call.
-
- Args:
- voice_client: Contains the basic auth credentials needed to authenticate.
-
- """
- machine_detection_parameters = MachineDetectionConfiguration()
- machine_detection_parameters.mode = ModeEnum.ASYNC
- machine_detection_parameters.callback_url = BASE_CALLBACK_URL + "/callbacks/machineDetection"
- machine_detection_parameters.callback_method = CallbackMethodEnum.POST
- machine_detection_parameters.detection_timeout = 5.0
- machine_detection_parameters.silence_timeout = 5.0
- machine_detection_parameters.speech_threshold = 5.0
- machine_detection_parameters.speech_end_threshold = 5.0
- machine_detection_parameters.machine_speech_end_threshold = 3.2
- machine_detection_parameters.delay_result = True
-
- call_body = CreateCallRequest()
- call_body.mfrom = BW_NUMBER
- call_body.to = USER_NUMBER
- call_body.application_id = BW_VOICE_APPLICATION_ID
- call_body.answer_url = BASE_CALLBACK_URL + '/callbacks/answer'
- call_body.answer_method = CallbackMethodEnum.POST
- call_body.disconnect_url = BASE_CALLBACK_URL + '/callbacks/disconnect'
- call_body.disconnect_method = CallbackMethodEnum.GET
- call_body.machine_detection = machine_detection_parameters
-
- create_response = voice_client.create_call(BW_ACCOUNT_ID, call_body)
- create_response_body = create_response.body
- time.sleep(2)
- try:
- get_response = voice_client.get_call(BW_ACCOUNT_ID, create_response.body.call_id)
- get_response_body = get_response.body
- print(vars(get_response))
- assert get_response.status_code == 200
- assert get_response_body.call_id == create_response_body.call_id
- assert get_response_body.application_id == BW_VOICE_APPLICATION_ID
- assert get_response_body.account_id == BW_ACCOUNT_ID
- if get_response_body.start_time:
- assert dateutil.parser.isoparse(str(get_response_body.start_time))
- assert dateutil.parser.isoparse(str(get_response_body.enqueued_time))
- assert dateutil.parser.isoparse(str(get_response_body.last_update))
- if get_response_body.answer_time: # may be null dependent on timing
- assert dateutil.parser.isoparse(str(get_response_body.answer_time))
- if get_response_body.end_time: # may be null dependent on timing
- assert dateutil.parser.isoparse(str(get_response_body.end_time))
- if get_response_body.disconnect_cause == "error":
- assert type(get_response_body.error_message) is str
- assert len(get_response_body.error_id) == 36
- except ApiErrorException as e:
- if e.response_code != 404:
- raise e
-
- print(vars(create_response))
- assert create_response.status_code == 201
- assert len(create_response_body.call_id) == 47 # assert request created and id matches expected length (47)
- assert create_response_body.account_id == BW_ACCOUNT_ID
- assert create_response_body.application_id == BW_VOICE_APPLICATION_ID
- assert create_response_body.to == USER_NUMBER
- assert create_response_body.mfrom == BW_NUMBER
- assert create_response_body.call_url == "https://voice.bandwidth.com/api/v2/accounts/" + \
- BW_ACCOUNT_ID + "/calls/" + create_response_body.call_id
- assert dateutil.parser.isoparse(str(create_response_body.enqueued_time)) # assert that str(enqueued_time) is datetime
- assert type(create_response_body.call_timeout) is float
- assert type(create_response_body.callback_timeout) is float
- assert create_response_body.answer_method == "POST"
- assert create_response_body.disconnect_method == "GET"
-
- def test_failed_create_and_failed_get_call(self, voice_client):
- """Create a failed call and get status of a call that doesnt exist.
-
- Args:
- voice_client: Contains the basic auth credentials needed to authenticate.
-
- """
- call_body = CreateCallRequest()
- call_body.mfrom = BW_NUMBER
- call_body.to = "+12345"
- call_body.application_id = BW_VOICE_APPLICATION_ID
- call_body.answer_url = BASE_CALLBACK_URL + '/callbacks/answer'
-
- with pytest.raises(APIException):
- create_response = voice_client.create_call(BW_ACCOUNT_ID, call_body)
- create_response_body = create_response.body
-
- get_response = voice_client.get_call(BW_ACCOUNT_ID, "c-fake-call-id")
- get_response_body = get_response.body
-
- print(vars(create_response))
- print(vars(get_response))
-
- assert create_response.status_code == 400
- assert type(create_response_body.type) is str
- assert type(create_response_body.description) is str
- assert get_response.status_code == 404
- assert type(get_response_body.type) is str
- assert type(get_response_body.description) is str
- if get_response_body.id:
- assert type(get_response_body.id) is str
-
-
- def test_createCall_with_priority(self, voice_client):
- """Create a successful voice api call with priority set
-
- Args:
- voice_client: Contains the basic auth credentials needed to authenticate.
-
- """
- call_body = CreateCallRequest()
- call_body.mfrom = BW_NUMBER
- call_body.to = USER_NUMBER
- call_body.application_id = BW_VOICE_APPLICATION_ID
- call_body.answer_url = BASE_CALLBACK_URL + '/callbacks/answer'
- call_body.answer_method = CallbackMethodEnum.POST
- call_body.disconnect_url = BASE_CALLBACK_URL + '/callbacks/disconnect'
- call_body.disconnect_method = CallbackMethodEnum.GET
- call_body.priority = 1
-
- create_response = voice_client.create_call(BW_ACCOUNT_ID, call_body)
- create_response_body = create_response.body
-
- print(vars(create_response))
-
- assert create_response.status_code == 201
- assert len(create_response_body.call_id) == 47 # assert request created and id matches expected length (47)
- assert create_response_body.account_id == BW_ACCOUNT_ID
- assert create_response_body.application_id == BW_VOICE_APPLICATION_ID
- assert create_response_body.to == USER_NUMBER
- assert create_response_body.mfrom == BW_NUMBER
- assert create_response_body.call_url == "https://voice.bandwidth.com/api/v2/accounts/" + \
- BW_ACCOUNT_ID + "/calls/" + create_response_body.call_id
- assert dateutil.parser.isoparse(str(create_response_body.enqueued_time)) # assert that str(enqueued_time) is datetime
- assert type(create_response_body.call_timeout) is float
- assert type(create_response_body.callback_timeout) is float
- assert create_response_body.answer_method == "POST"
- assert create_response_body.disconnect_method == "GET"
- assert create_response_body.priority == 1
-
-
- def test_successful_mfa_messaging(self, mfa_client):
- """Create a successful messaging MFA request.
-
- Args:
- mfa_client: Contains the basic auth credentials needed to authenticate.
-
- """
- body = TwoFactorCodeRequestSchema(
- mfrom=BW_NUMBER,
- to=USER_NUMBER,
- application_id=BW_MESSAGING_APPLICATION_ID,
- scope="scope",
- digits=6,
- message="Your temporary {NAME} {SCOPE} code is {CODE}"
- )
- create_response = mfa_client.create_messaging_two_factor(BW_ACCOUNT_ID, body)
- create_response_body = create_response.body
-
- print(vars(create_response))
-
- assert create_response.status_code == 200
- assert len(create_response_body.message_id) == 29
-
- @pytest.mark.skip(reason="API accepts invalid numbers for to/from field")
- def test_failed_mfa_messaging(self, mfa_client):
- """Create a failed messaging MFA request.
-
- Args:
- mfa_client: Contains the basic auth credentials needed to authenticate.
-
- """
- body = TwoFactorCodeRequestSchema(
- mfrom=BW_NUMBER,
- to="+12345",
- application_id=BW_MESSAGING_APPLICATION_ID,
- scope="scope",
- digits=6,
- message="Your temporary {NAME} {SCOPE} code is {CODE}"
- )
-
- with pytest.raises(APIException):
- create_response = mfa_client.create_messaging_two_factor(BW_ACCOUNT_ID, body)
- create_response_body = create_response.body
-
- print(vars(create_response))
-
- assert create_response.status_code == 400
- assert type(create_response_body.error) is str
- assert type(create_response_body.request_id) is str
-
- def test_successful_mfa_voice(self, mfa_client):
- """Create a successful voice MFA request.
-
- Args:
- mfa_client: Contains the basic auth credentials needed to authenticate.
-
- """
- body = TwoFactorCodeRequestSchema(
- mfrom=BW_NUMBER,
- to=USER_NUMBER,
- application_id=BW_VOICE_APPLICATION_ID,
- scope="scope",
- digits=6,
- message="Your temporary {NAME} {SCOPE} code is {CODE}"
- )
- create_response = mfa_client.create_voice_two_factor(BW_ACCOUNT_ID, body)
- create_response_body = create_response.body
-
- print(vars(create_response))
-
- assert create_response.status_code == 200
- assert len(create_response_body.call_id) == 47
-
- def test_failed_mfa_voice(self, mfa_client):
- """Create a failed voice MFA request.
-
- Args:
- mfa_client: Contains the basic auth credentials needed to authenticate.
-
- """
- body = TwoFactorCodeRequestSchema(
- mfrom=BW_NUMBER,
- to="+12345",
- application_id=BW_MESSAGING_APPLICATION_ID,
- scope="scope",
- digits=6,
- message="Your temporary {NAME} {SCOPE} code is {CODE}"
- )
-
- with pytest.raises(APIException):
- create_response = mfa_client.create_voice_two_factor(BW_ACCOUNT_ID, body)
- create_response_body = create_response.body
-
- print(vars(create_response))
-
- assert create_response.status_code == 400
- assert type(create_response_body.error) is str
- assert type(create_response_body.request_id) is str
-
- @pytest.mark.skip(reason="No way to currently test a successful code unless we ingest callbacks")
- def test_successful_mfa_verify(self, mfa_client):
- """
-
- Args:
- mfa_client: Contains the basic auth credentials needed to authenticate.
-
- """
- # TODO: Set the to number to a randomly generated number to avoid rate limiting
- body = TwoFactorVerifyRequestSchema(
- to="+1" + str(randint(1111111111, 9999999999)),
- application_id=BW_VOICE_APPLICATION_ID,
- scope="scope",
- code="123456",
- expiration_time_in_minutes=3
- )
- verify_response = mfa_client.create_verify_two_factor(BW_ACCOUNT_ID, body)
- verify_response_body = verify_response.body
-
- print(vars(verify_response))
-
- assert verify_response.status_code == 200
- assert (isinstance(verify_response_body.valid, bool))
- assert verify_response_body.valid is True
-
- def test_failed_mfa_verify(self, mfa_client):
- """Test an invalid MFA code.
-
- Args:
- mfa_client: Contains the basic auth credentials needed to authenticate.
-
- """
- # TODO: Set the to number to a randomly generated number to avoid rate limiting
- body = TwoFactorVerifyRequestSchema(
- to="+1" + str(randint(1111111111, 9999999999)),
- application_id=BW_VOICE_APPLICATION_ID,
- scope="scope",
- code="123456",
- expiration_time_in_minutes=3
- )
-
- print(body.to)
-
- verify_response = mfa_client.create_verify_two_factor(BW_ACCOUNT_ID, body)
- verify_response_body = verify_response.body
-
- print(vars(verify_response))
-
- assert verify_response.status_code == 200
- assert isinstance(verify_response_body.valid, bool)
- assert verify_response_body.valid is False
-
- def test_successful_web_rtc_create_get_and_delete_session(self, web_rtc_client):
- """Successfully create, get, and delete a WebRTC session.
-
- Args:
- web_rtc_client: Contains the basic auth credentials needed to authenticate.
-
- """
- body = Session(
- tag="DevX Integration Testing"
- )
- create_response = web_rtc_client.create_session(BW_ACCOUNT_ID, body)
- create_response_body = create_response.body
-
- get_response = web_rtc_client.get_session(BW_ACCOUNT_ID, create_response_body.id)
- get_response_body = get_response.body
-
- delete_response = web_rtc_client.delete_session(BW_ACCOUNT_ID, create_response_body.id)
-
- print(vars(create_response))
- print(vars(get_response))
- print(vars(delete_response))
-
- assert create_response.status_code == 200
- assert type(create_response_body.id) is str
- assert type(create_response_body.tag) is str and create_response_body.tag == "DevX Integration Testing"
-
- assert get_response.status_code == 200
- assert get_response_body.id == create_response_body.id
- assert type(get_response_body.tag) is str and create_response_body.tag == "DevX Integration Testing"
-
- assert delete_response.status_code == 204
-
- @pytest.mark.skip(reason="No way to force a 400 here as the sdk normalizes any tag value to a string and the body \
- is optional")
- def test_failed_web_rtc_create_get_and_delete_session(self, web_rtc_client):
- """
-
- Args:
- web_rtc_client: Contains the basic auth credentials needed to authenticate.
-
- """
- body = Session(
- tag="DevX Integration Testing",
- )
-
- with pytest.raises(APIException):
- create_response = web_rtc_client.create_session(BW_ACCOUNT_ID, body)
- create_response_body = create_response.body
-
- get_response = web_rtc_client.get_session(BW_ACCOUNT_ID, "Some-ID-That-Doesnt-Exist")
- get_response_body = get_response.body
-
- delete_response = web_rtc_client.delete_session(BW_ACCOUNT_ID, "Some-ID-That-Doesnt-Exist")
-
- print(vars(create_response))
- print(vars(get_response))
- print(vars(delete_response))
-
- assert create_response.status_code == 200
- assert type(create_response_body.id) is str
- assert type(create_response_body.tag) is str and create_response_body.tag == "DevX Integration Testing"
-
- assert get_response.status_code == 404
- assert type(get_response_body.code) is int
- assert type(get_response_body.message) is str
-
- assert delete_response.status_code == 404
-
- def test_successful_web_rtc_create_get_and_delete_participant(self, web_rtc_client):
- """Successfully create, get, and delete a WebRTC participant.
-
- Args:
- web_rtc_client: Contains the basic auth credentials needed to authenticate.
-
- """
- body = Participant()
- body.publish_permissions = ["AUDIO", "VIDEO"]
- body.device_api_version = "V3"
-
- create_response = web_rtc_client.create_participant(BW_ACCOUNT_ID, body)
- create_response_body = create_response.body
-
- get_response = web_rtc_client.get_participant(BW_ACCOUNT_ID, create_response_body.participant.id)
- get_response_body = get_response.body
-
- delete_response = web_rtc_client.delete_participant(BW_ACCOUNT_ID, create_response_body.participant.id)
-
- print(vars(create_response))
- print(vars(get_response))
- print(vars(delete_response))
-
- assert create_response.status_code == 200
- assert type(create_response_body.participant.id) is str
- assert len(create_response_body.participant.id) is 36
- assert set(create_response_body.participant.publish_permissions) == set(body.publish_permissions)
- assert create_response_body.participant.device_api_version == body.device_api_version
-
- assert get_response.status_code == 200
- assert type(get_response_body.id) is str
- assert len(get_response_body.id) is 36
- assert set(get_response_body.publish_permissions) == set(body.publish_permissions)
- assert get_response_body.device_api_version == body.device_api_version
-
- assert delete_response.status_code == 204
-
- def test_failed_web_rtc_create_get_and_delete_participant(self, web_rtc_client):
- """
-
- Args:
- web_rtc_client: Contains the basic auth credentials needed to authenticate.
-
- """
- body = Participant()
- body.publish_permissions = ["AUDIO", "VIDEO", "SOME OTHER INVALID PERMISSION"]
- body.device_api_version = "V3"
-
- with pytest.raises(APIException):
- create_response = web_rtc_client.create_participant(BW_ACCOUNT_ID, body)
- create_response_body = create_response.body
-
- get_response = web_rtc_client.get_participant(BW_ACCOUNT_ID, "Some-ID-That-Doesnt-Exist")
- get_response_body = get_response.body
-
- delete_response = web_rtc_client.delete_participant(BW_ACCOUNT_ID, "Some-ID-That-Doesnt-Exist")
-
- print(vars(create_response))
- print(vars(get_response))
- print(vars(delete_response))
-
- assert create_response.status_code == 400
- assert type(create_response_body.code) is int
- assert type(create_response_body.message) is str
-
- assert get_response.status_code == 404
- assert type(get_response_body.code) is int
- assert type(get_response_body.message) is str
-
- assert delete_response.status_code == 404
-
- def test_successful_create_and_get_tn_lookup(self, tn_lookup_client):
- """
-
- Args:
- tn_lookup_client: Contains the basic auth credentials needed to authenticate.
-
- """
- body = OrderRequest()
- body.tns = [BW_NUMBER]
- create_response = tn_lookup_client.create_lookup_request(BW_ACCOUNT_ID, body)
- create_response_body = create_response.body
-
- get_response = tn_lookup_client.get_lookup_request_status(BW_ACCOUNT_ID, create_response_body.request_id)
- get_response_body = get_response.body
-
- print(vars(create_response))
- print(vars(get_response))
-
- assert create_response.status_code == 202
- assert len(create_response_body.request_id) is 36
- assert type(create_response_body.request_id) is str
- assert type(create_response_body.status) is str
-
- assert get_response.status_code == 200
- assert get_response_body.request_id == create_response_body.request_id
- assert type(get_response_body.status) is str
- if get_response_body.result:
- result = get_response_body.result[0]
- assert type(result.response_code) is int
-
- def test_failed_create_and_get_tn_lookup(self, tn_lookup_client):
- """
-
- Args:
- tn_lookup_client: Contains the basic auth credentials needed to authenticate.
-
- """
- body = OrderRequest()
- body.tns = ["+12345"]
-
- with pytest.raises(APIException):
- create_response = tn_lookup_client.create_lookup_request(BW_ACCOUNT_ID, body)
-
- get_response = tn_lookup_client.get_lookup_request_status(BW_ACCOUNT_ID, "Some-ID-That-Doesnt-Exist")
-
- print(vars(create_response))
- print(vars(get_response))
-
- assert create_response.status_code == 400
- assert get_response.status_code == 404
diff --git a/bandwidth/tests/test_bxml.py b/bandwidth/tests/test_bxml.py
deleted file mode 100644
index e5060314..00000000
--- a/bandwidth/tests/test_bxml.py
+++ /dev/null
@@ -1,487 +0,0 @@
-"""
-test_bxml.py
-
-Unit tests for BXML
-
-@copyright Bandwidth Inc.
-"""
-from bandwidth.voice.bxml.response import Response
-from bandwidth.voice.bxml.bxml import Bxml
-from bandwidth.voice.bxml.verbs import *
-from bandwidth.webrtc.utils import *
-
-
-class TestBxml:
- """
- Class for the BXML tests
- """
-
- def test_forward_xml_with_optional_fields(self):
- response = Response()
- forward = Forward(
- to="+10987654321",
- from_="+11234567890",
- call_timeout=100,
- diversion_treatment="propagate",
- diversion_reason="away"
- )
- response.add_verb(forward)
- expected_bxml = ''
- assert response.to_bxml() == expected_bxml
-
- def test_gather_no_nested(self):
- response = Response()
- gather = Gather(
- gather_url="https://gather.url/nextBXML",
- gather_method="POST",
- terminating_digits="#",
- tag="tag",
- max_digits=20,
- inter_digit_timeout=50,
- username="user",
- password="password",
- first_digit_timeout=10,
- repeat_count=3,
- gather_fallback_url="https://test.com",
- gather_fallback_method="GET",
- fallback_username="fuser",
- fallback_password="fpass"
- )
- response.add_verb(gather)
- expected_bxml = ''
- assert response.to_bxml() == expected_bxml
-
- def test_gather_with_speak_sentence(self):
- response = Response()
- speak_sentence = SpeakSentence(
- sentence="Phrase.",
- voice="kate",
- locale="en_US",
- gender="female"
- )
- gather = Gather(
- gather_url="https://gather.url/nextBXML",
- gather_method="POST",
- terminating_digits="#",
- tag="tag",
- max_digits=20,
- inter_digit_timeout=50,
- username="user",
- password="password",
- first_digit_timeout=10,
- repeat_count=3,
- speak_sentence=speak_sentence
- )
- expected_bxml = 'Phrase.'
- response.add_verb(gather)
- assert response.to_bxml() == expected_bxml
-
- def test_gather_play_audio(self):
- response = Response()
- play_audio_1 = PlayAudio(url="https://audio.url/audio1.wav")
- gather = Gather(
- gather_url="https://gather.url/nextBXML",
- gather_method="POST",
- terminating_digits="#",
- tag="tag",
- max_digits=20,
- inter_digit_timeout=50,
- username="user",
- password="password",
- first_digit_timeout=10,
- repeat_count=3,
- play_audio=play_audio_1
- )
- expected_bxml = 'https://audio.url/audio1.wav'
- response.add_verb(gather)
- assert response.to_bxml() == expected_bxml
-
- def test_hangup(self):
- response = Response()
- hang_up = Hangup()
- response.add_verb(hang_up)
- expected_bxml = ''
- assert response.to_bxml() == expected_bxml
-
- def test_pause(self):
- response = Response()
- pause = Pause(duration=400)
- response.add_verb(pause)
- expected_bxml = ''
- assert response.to_bxml() == expected_bxml
-
- def test_pause_recording(self):
- response = Response()
- pause_recording = PauseRecording()
- response.add_verb(pause_recording)
- expected_bxml = ''
- assert response.to_bxml() == expected_bxml
-
- def test_play_audio(self):
- response = Response()
- play_audio_1 = PlayAudio(
- url="https://audio.url/audio1.wav",
- username="user",
- password="pass"
- )
- response.add_verb(play_audio_1)
- expected_bxml = 'https://audio.url/audio1.wav'
- assert response.to_bxml() == expected_bxml
-
- def test_record(self):
- response = Response()
- record = Record(
- tag="tag",
- username="user",
- password="pass",
- record_complete_url="https://record.url.server/record",
- record_complete_method="POST",
- recording_available_url="https://record.url.server/available",
- recording_available_method="GET",
- terminating_digits="#",
- max_duration=90,
- file_format="mp3",
- detect_language=True,
- transcribe=False,
- transcription_available_url="https://transcribe.url.server/available",
- transcription_available_method="POST",
- silence_timeout=90,
- record_complete_fallback_url="https://test.com",
- record_complete_fallback_method="GET",
- fallback_username="fuser",
- fallback_password="fpass"
- )
- response.add_verb(record)
- expected_bxml = ''
- assert response.to_bxml() == expected_bxml
-
- def test_redirect(self):
- response = Response()
- redirect = Redirect(
- redirect_url="http://flow.url/newFlow",
- redirect_method="POST",
- tag="tag",
- username="user",
- password="pass",
- redirect_fallback_url="https://test.com",
- redirect_fallback_method="GET",
- fallback_username="fuser",
- fallback_password="fpass"
- )
- response.add_verb(redirect)
- expected_bxml = ''
- assert response.to_bxml() == expected_bxml
-
- def test_resume_recording(self):
- response = Response()
- resume_recording = ResumeRecording()
- response.add_verb(resume_recording)
- expected_bxml = ''
- assert (response.to_bxml() == expected_bxml)
-
- def test_dtmf(self):
- response = Response()
- send_dtmf = SendDtmf(
- dtmf="1234",
- tone_duration=200,
- tone_interval=450
- )
- expected_bxml = '1234'
- response.add_verb(send_dtmf)
- assert response.to_bxml() == expected_bxml
-
- def test_speak_sentence(self):
- response = Response()
- speak_sentence = SpeakSentence(
- sentence="Phrase.",
- voice="kate",
- locale="en_US",
- gender="female"
- )
- expected_bxml = 'Phrase.'
- response.add_verb(speak_sentence)
- assert response.to_bxml() == expected_bxml
-
- def test_speak_sentence_SSML(self):
- response = Response()
- speak_sentence = SpeakSentence(
- sentence='Hydrogen is the most abundant element in the universe.',
- voice="kate",
- locale="en_US",
- gender="female"
- )
- expected_bxml = 'Hydrogen is the most abundant element in the universe.'
- response.add_verb(speak_sentence)
- assert response.to_bxml() == expected_bxml
-
- def test_start_recording(self):
- response = Response()
- record = StartRecording(
- tag="tag",
- username="user",
- password="pass",
- recording_available_url="https://record.url.server/available",
- recording_available_method="GET",
- file_format="mp3",
- multi_channel=True,
- transcribe=False,
- transcription_available_url="https://transcribe.url.server/available",
- transcription_available_method="POST"
- )
- response.add_verb(record)
- expected_bxml = ''
- assert response.to_bxml() == expected_bxml
-
- def test_stop_recording(self):
- response = Response()
- stop_recording = StopRecording()
- response.add_verb(stop_recording)
- expected_bxml = ''
- assert response.to_bxml() == expected_bxml
-
- def test_transfer(self):
- response = Response()
- phone1 = PhoneNumber(
- number="+11234567891",
- transfer_answer_url="https://transfer.com/answer",
- transfer_answer_method="POST",
- username="user",
- password="pass",
- tag="tag",
- transfer_disconnect_method="POST",
- transfer_disconnect_url="https://transfer.com/disconnect",
- transfer_answer_fallback_url="https://test.com",
- transfer_answer_fallback_method="GET",
- fallback_username="fuser",
- fallback_password="fpass"
- )
- phone1_bxml = '+11234567891'
- phone2 = PhoneNumber(number="+11234567892")
- phone2_bxml = '+11234567892'
- transfer = Transfer(
- transfer_caller_id="+15555555555",
- call_timeout=50,
- tag="tag",
- transfer_complete_url="https://transcribe.url.server/complete",
- transfer_complete_method="POST",
- username="user",
- password="pass",
- diversion_treatment="propagate",
- diversion_reason="away",
- phone_numbers=[phone1, phone2],
- transfer_complete_fallback_url="https://test.com",
- transfer_complete_fallback_method="GET",
- fallback_username="fusern",
- fallback_password="fpassw"
- )
- response.add_verb(transfer)
- expected_bxml = f'{phone1_bxml}{phone2_bxml}'
-
- print(response.to_bxml())
- print(expected_bxml)
-
- assert response.to_bxml() == expected_bxml
-
- def test_conference(self):
- conference = Conference(
- "my-conference",
- mute=False,
- hold=True,
- call_ids_to_coach="c-123,c-345",
- conference_event_url="https://test.com",
- conference_event_method="GET",
- 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 = Response()
- response.add_verb(conference)
- expected_bxml = 'my-conference'
- assert response.to_bxml() == expected_bxml
-
- def test_conference_coach_array(self):
- conference = Conference(
- "my-conference", call_ids_to_coach=["c-123", "c-456"])
- response = Response()
- response.add_verb(conference)
- expected_bxml = 'my-conference'
- assert response.to_bxml() == expected_bxml
-
- def test_bridge(self):
- bridge = Bridge("c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d",
- bridge_complete_url="https://test.com",
- bridge_complete_method="GET",
- bridge_target_complete_url="https://test2.com",
- bridge_target_complete_method="POST",
- 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 = Response()
- response.add_verb(bridge)
- expected_bxml = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d'
- assert response.to_bxml() == expected_bxml
-
- def test_ring(self):
- ring = Ring(
- duration=5,
- answer_call=False
- )
-
- response = Response()
- response.add_verb(ring)
- expected_bxml = ''
- assert (response.to_bxml() == expected_bxml)
-
- def test_start_gather(self):
- startGather = StartGather(
- dtmfUrl="https://test.com",
- dtmfMethod="POST",
- username="user",
- password="pass",
- tag="custom tag"
- )
-
- response = Response()
- response.add_verb(startGather)
- expected_bxml = ''
- assert response.to_bxml() == expected_bxml
-
- def test_stop_gather(self):
- stopGather = StopGather()
-
- response = Response()
- response.add_verb(stopGather)
- expected_bxml = ''
- assert response.to_bxml() == expected_bxml
-
- def test_gather_speak_sentence_ssml(self):
- response = Response()
- speak_sentence = SpeakSentence(
- sentence='Hello. Your number is asdf, lets play a game. What is 10 + 3. Press the pound key when finished.'
- )
- gather = Gather(
- speak_sentence=speak_sentence
- )
- expected_bxml = 'Hello. Your number is asdf, lets play a game. What is 10 + 3. Press the pound key when finished.'
- response.add_verb(gather)
- assert response.to_bxml() == expected_bxml
-
- def test_empty_bxml_verb(self):
- expected_bxml = ''
-
- bxml = Bxml()
- assert bxml.to_bxml() == expected_bxml
-
- def test_bxml_speak_sentence_pause(self):
- expected_bxml = 'Wee Woo'
- bxml = Bxml()
- speak_sentence = SpeakSentence(
- voice="Julie",
- sentence="Wee Woo"
- )
- pause = Pause(10)
- bxml.add_verb(speak_sentence)
- bxml.add_verb(pause)
- assert bxml.to_bxml() == expected_bxml
-
- def test_generate_transfer_bxml(self):
- expected = 'sip:sipx.webrtc.bandwidth.com:5060'
- actual = generate_transfer_bxml(
- 'asdf', 'c-93d6f3c0-be584596-0b74-4fa2-8015-d8ede84bd1a4')
- assert actual == expected
-
- def test_generate_transfer_bxml_verb(self):
- expected = 'sip:sipx.webrtc.bandwidth.com:5060'
- actual = generate_transfer_bxml_verb(
- 'asdf', 'c-93d6f3c0-be584596-0b74-4fa2-8015-d8ede84bd1a4')
- assert actual == expected
-
- def test_start_stream_bxml_verb(self):
- expected = ''
- response = Response()
- stream_param_1 = StreamParam(
- name="name1",
- value="value1"
- )
- stream_param_2 = StreamParam(
- name="name2",
- value="value2"
- )
- start_stream = StartStream(
- destination='https://www.test.com/stream',
- name='test_stream',
- tracks='inbound',
- streamEventUrl='https://www.test.com/event',
- streamEventMethod='POST',
- username='username',
- password='password',
- streamParams=[stream_param_1, stream_param_2]
- )
-
- response.add_verb(start_stream)
- actual = response.to_bxml()
-
- assert expected == actual
-
- def test_stop_stream_bxml_verb(self):
- expected = ''
- response = Response()
- stop_stream = StopStream(
- name='test_stream'
- )
- response.add_verb(stop_stream)
- actual = response.to_bxml()
-
- assert expected == actual
-
- def test_start_transcription_bxml_verb(self):
- expected = ''
- response = Response()
- custom_param_1 = CustomParam(
- name="name1",
- value="value1"
- )
- custom_param_2 = CustomParam(
- name="name2",
- value="value2"
- )
- custom_params = [custom_param_1, custom_param_2]
- start_transcription = StartTranscription(
- name='name',
- tracks='both',
- transcription_event_url='https://www.test.com/transcription',
- transcription_event_method='POST',
- username='username',
- password='password',
- destination='https://www.test.com/transcribeCallback',
- stabilized=True,
- custom_params=custom_params
- )
- response.add_verb(start_transcription)
- actual = response.to_bxml()
-
- assert expected == actual
-
- def test_stop_transcription_bxml(self):
- expected= ''
- response = Response()
- stop_transcription = StopTranscription(
- name='name'
- )
- response.add_verb(stop_transcription)
- actual = response.to_bxml()
-
- assert expected == actual
diff --git a/bandwidth/utilities/__init__.py b/bandwidth/utilities/__init__.py
deleted file mode 100644
index 6ade54ba..00000000
--- a/bandwidth/utilities/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-__all__ = [
- 'file_wrapper.py',
-]
diff --git a/bandwidth/utilities/file_wrapper.py b/bandwidth/utilities/file_wrapper.py
deleted file mode 100644
index a1964905..00000000
--- a/bandwidth/utilities/file_wrapper.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class FileWrapper():
-
- """A wrapper to allow passing in content type for file uploads."""
-
- def __init__(self, file, content_type='application/octet-stream'):
- self._file_stream = file
- self._content_type = content_type
-
- @property
- def file_stream(self):
- return self._file_stream
-
- @property
- def content_type(self):
- return self._content_type
diff --git a/bandwidth/voice/__init__.py b/bandwidth/voice/__init__.py
deleted file mode 100644
index 57e1ef1e..00000000
--- a/bandwidth/voice/__init__.py
+++ /dev/null
@@ -1,7 +0,0 @@
-__all__ = [
- 'bxml',
- 'controllers',
- 'exceptions',
- 'models',
- 'voice_client',
-]
diff --git a/bandwidth/voice/bxml/__init__.py b/bandwidth/voice/bxml/__init__.py
deleted file mode 100644
index a9b3480d..00000000
--- a/bandwidth/voice/bxml/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-from . import response
-from . import bxml
-from . import verbs
diff --git a/bandwidth/voice/bxml/bxml.py b/bandwidth/voice/bxml/bxml.py
deleted file mode 100644
index 3d0bbb36..00000000
--- a/bandwidth/voice/bxml/bxml.py
+++ /dev/null
@@ -1,42 +0,0 @@
-"""
-bxml.py
-
-Class that allows user to generate BXML programatically in python
-BXML is the parent element
-
-@copyright Bandwidth INC
-"""
-
-BXML_TAG = "Bxml"
-XML_HEADER = ''
-
-
-class Bxml:
-
- def __init__(self):
- """
- Creates the Bxml class
- """
- self.verbs = []
-
- def add_verb(self, verb):
- """
- Adds the Verb to the already existing verbs
-
- :param Verb verb: The Verb to add
- """
- self.verbs.append(verb)
-
- def to_bxml(self):
- """
- Converts the Bxml class to its XML representation
-
- :rtype str: The XML representation of the Bxml class
- """
- xml_string = XML_HEADER
- xml_string += '<' + BXML_TAG + '>'
- for verb in self.verbs:
- xml_string += verb.to_bxml()
- xml_string += '' + BXML_TAG + '>'
-
- return xml_string
diff --git a/bandwidth/voice/bxml/response.py b/bandwidth/voice/bxml/response.py
deleted file mode 100644
index b3280225..00000000
--- a/bandwidth/voice/bxml/response.py
+++ /dev/null
@@ -1,41 +0,0 @@
-"""
-response.py
-
-Class that allows user to generate BXML programatically in python
-
-@copyright Bandwidth INC
-"""
-
-RESPONSE_TAG = "Response"
-XML_HEADER = ''
-
-
-class Response:
-
- def __init__(self):
- """
- Creates the Response class
- """
- self.verbs = []
-
- def add_verb(self, verb):
- """
- Adds the Verb to the already existing verbs
-
- :param Verb verb: The Verb to add
- """
- self.verbs.append(verb)
-
- def to_bxml(self):
- """
- Converts the Response class to its XML representation
-
- :rtype str: The XML representation of the Response class
- """
- xml_string = XML_HEADER
- xml_string += '<' + RESPONSE_TAG + '>'
- for verb in self.verbs:
- xml_string += verb.to_bxml()
- xml_string += '' + RESPONSE_TAG + '>'
-
- return xml_string
diff --git a/bandwidth/voice/bxml/verbs/base_verb.py b/bandwidth/voice/bxml/verbs/base_verb.py
deleted file mode 100644
index 37879636..00000000
--- a/bandwidth/voice/bxml/verbs/base_verb.py
+++ /dev/null
@@ -1,21 +0,0 @@
-"""
-base_verb.py
-
-Defines the abstract class for all BXML verbs
-
-@copyright Bandwidth INC
-"""
-
-from abc import ABC, abstractmethod
-
-
-class AbstractBxmlVerb(ABC):
-
- @abstractmethod
- def to_bxml(self):
- """
- Converts the class into its xml representation
-
- :return str: The string xml representation
- """
- pass
diff --git a/bandwidth/voice/bxml/verbs/bridge.py b/bandwidth/voice/bxml/verbs/bridge.py
deleted file mode 100644
index c65bbbbb..00000000
--- a/bandwidth/voice/bxml/verbs/bridge.py
+++ /dev/null
@@ -1,87 +0,0 @@
-"""
-bridge.py
-
-Representation of Bandwidth's speak sentence BXML verb
-
-@copyright Bandwidth INC
-"""
-
-from lxml import etree
-
-from .base_verb import AbstractBxmlVerb
-
-import re
-
-BRIDGE_TAG = "Bridge"
-
-class Bridge(AbstractBxmlVerb):
-
- def __init__(self, call_id, bridge_complete_url=None, bridge_complete_method=None,
- bridge_target_complete_url=None, bridge_target_complete_method=None,
- username=None, password=None, tag=None, bridge_complete_fallback_url=None,
- bridge_complete_fallback_method=None, bridge_target_complete_fallback_url=None,
- bridge_target_complete_fallback_method=None, fallback_username=None,
- fallback_password=None):
- """
- Initializes the Bridge class with the following parameters
-
- :param str call_id: The call to bridge
- :param str bridge_complete_url: URL to send the bridge complete event to
- :param str bridge_complete_method: HTTP method to send the bridge complete event
- :param str bridge_target_complete_url: URL to send the bridge target complete event to
- :param str bridge_target_complete_method: HTTP method to send the bridge target complete event
- :param str username: HTTP basic auth username for events
- :param str password: HTTP basic auth password for events
- :param str tag: Custom tag to include in callbacks
- :param str bridge_complete_fallback_url: Fallback url for bridge complete events
- :param str bridge_complete_fallback_method: HTTP method for bridge complete fallback
- :param str bridge_target_complete_fallback_url: Fallback url for bridge target complete events
- :param str bridge_target_complete_fallback_method: HTTP method for bridge target complete fallback
- :param str fallback_username: Basic auth username for fallback events
- :param str fallback_password: Basic auth password for fallback events
- """
- self.call_id = call_id
- self.bridge_complete_url = bridge_complete_url
- self.bridge_complete_method = bridge_complete_method
- self.bridge_target_complete_url = bridge_target_complete_url
- self.bridge_target_complete_method = bridge_target_complete_method
- self.username = username
- self.password = password
- self.tag = tag
- self.bridge_complete_fallback_url = bridge_complete_fallback_url
- self.bridge_complete_fallback_method = bridge_complete_fallback_method
- self.bridge_target_complete_fallback_url = bridge_target_complete_fallback_url
- self.bridge_target_complete_fallback_method = bridge_target_complete_fallback_method
- self.fallback_username = fallback_username
- self.fallback_password = fallback_password
-
- def to_bxml(self):
- root = etree.Element(BRIDGE_TAG)
- root.text = self.call_id
- if self.bridge_complete_url is not None:
- root.set("bridgeCompleteUrl", self.bridge_complete_url)
- if self.bridge_complete_method is not None:
- root.set("bridgeCompleteMethod", self.bridge_complete_method)
- if self.bridge_target_complete_url is not None:
- root.set("bridgeTargetCompleteUrl", self.bridge_target_complete_url)
- if self.bridge_target_complete_method is not None:
- root.set("bridgeTargetCompleteMethod", self.bridge_target_complete_method)
- if self.username is not None:
- root.set("username", self.username)
- if self.password is not None:
- root.set("password", self.password)
- if self.tag is not None:
- root.set("tag", self.tag)
- if self.bridge_complete_fallback_url is not None:
- root.set("bridgeCompleteFallbackUrl", self.bridge_complete_fallback_url)
- if self.bridge_complete_fallback_method is not None:
- root.set("bridgeCompleteFallbackMethod", self.bridge_complete_fallback_method)
- if self.bridge_target_complete_fallback_url is not None:
- root.set("bridgeTargetCompleteFallbackUrl", self.bridge_target_complete_fallback_url)
- if self.bridge_target_complete_fallback_method is not None:
- root.set("bridgeTargetCompleteFallbackMethod", self.bridge_target_complete_fallback_method)
- if self.fallback_username is not None:
- root.set("fallbackUsername", self.fallback_username)
- if self.fallback_password is not None:
- root.set("fallbackPassword", self.fallback_password)
- return etree.tostring(root).decode()
diff --git a/bandwidth/voice/bxml/verbs/conference.py b/bandwidth/voice/bxml/verbs/conference.py
deleted file mode 100644
index 7a36c9eb..00000000
--- a/bandwidth/voice/bxml/verbs/conference.py
+++ /dev/null
@@ -1,90 +0,0 @@
-"""
-conference.py
-
-Representation of Bandwidth's conference BXML verb
-
-@copyright Bandwidth INC
-"""
-
-from lxml import etree
-
-from .base_verb import AbstractBxmlVerb
-
-CONFERENCE_TAG = "Conference"
-
-
-class Conference(AbstractBxmlVerb):
-
- def __init__(self, conference_name, mute=None, hold=None, call_ids_to_coach=None,
- conference_event_url=None, conference_event_method=None,
- username=None, password=None, tag=None, conference_event_fallback_url=None,
- conference_event_fallback_method=None, fallback_username=None,
- fallback_password=None):
- """
- Init for Conference
-
- :param str conference_name: The name of the conference
- :param boolean mute: Determines if conference members should be on mute
- :param boolean hold: Determines if conference members should be on hold
- :param string|list call_ids_to_coach: A string of comma separated call IDs to coach, or an array of call IDs to coach
- :param string conference_event_url: The url to receive conference events
- :param string conference_event_method: The HTTP method to send conference events
- :param string username: Basic auth username for events
- :param string password: Basic auth password for events
- :param string tag: Custom tag to be included in events
- :param string conference_event_fallback_url: Fallback URL for conference events
- :param string conference_event_fallback_method: HTTP method for fallback URL requests
- :param string fallback_username: Basic auth username for fallback requests
- :param string fallback_password: Basic auth password for fallback requests
- """
- self.conference_name = conference_name
- self.mute = mute
- self.hold = hold
- self.call_ids_to_coach = call_ids_to_coach
- self.conference_event_url = conference_event_url
- self.conference_event_method = conference_event_method
- self.username = username
- self.password = password
- self.tag = tag
- self.conference_event_fallback_url = conference_event_fallback_url
- self.conference_event_fallback_method = conference_event_fallback_method
- self.fallback_username = fallback_username
- self.fallback_password = fallback_password
-
- def to_bxml(self):
- root = etree.Element(CONFERENCE_TAG)
- root.text = self.conference_name
-
- if self.mute is not None:
- strn = "true" if self.mute else "false"
- root.set("mute", strn)
- if self.hold is not None:
- strn = "true" if self.hold else "false"
- root.set("hold", strn)
- if self.call_ids_to_coach is not None:
- strn = None
- if isinstance(self.call_ids_to_coach, str):
- strn = self.call_ids_to_coach
- else:
- strn = ",".join(self.call_ids_to_coach)
- root.set("callIdsToCoach", strn)
- if self.conference_event_url is not None:
- root.set("conferenceEventUrl", self.conference_event_url)
- if self.conference_event_method is not None:
- root.set("conferenceEventMethod", self.conference_event_method)
- if self.tag is not None:
- root.set("tag", self.tag)
- if self.username is not None:
- root.set("username", self.username)
- if self.password is not None:
- root.set("password", self.password)
- if self.conference_event_fallback_url is not None:
- root.set("conferenceEventFallbackUrl", self.conference_event_fallback_url)
- if self.conference_event_fallback_method is not None:
- root.set("conferenceEventFallbackMethod", self.conference_event_fallback_method)
- if self.fallback_username is not None:
- root.set("fallbackUsername", self.fallback_username)
- if self.fallback_password is not None:
- root.set("fallbackPassword", self.fallback_password)
-
- return etree.tostring(root).decode()
diff --git a/bandwidth/voice/bxml/verbs/custom_param.py b/bandwidth/voice/bxml/verbs/custom_param.py
deleted file mode 100644
index 67f3bd11..00000000
--- a/bandwidth/voice/bxml/verbs/custom_param.py
+++ /dev/null
@@ -1,38 +0,0 @@
-"""
-custom_param.py
-
-Representation of Bandwidth's StartTranscription BXML verb
-
-@license MIT
-"""
-
-from lxml import etree
-
-from .base_verb import AbstractBxmlVerb
-
-CUSTOM_PARAM_TAG = "CustomParam"
-
-
-class CustomParam(AbstractBxmlVerb):
- def __init__(
- self,
- name: str,
- value: str,
- ):
- """
- Initializes the CustomParam class
- :param name: The name of this parameter, up to 256 characters.
- :param value: The value of this parameter, up to 2048 characters.
- """
- self.name = name
- self.value = value
-
- def to_etree_element(self):
- root = etree.Element(CUSTOM_PARAM_TAG)
- root.set("name", self.name)
- root.set("value", self.value)
- return root
-
- def to_bxml(self):
- root = etree.Element(CUSTOM_PARAM_TAG)
- return etree.tostring(root).decode()
diff --git a/bandwidth/voice/bxml/verbs/forward.py b/bandwidth/voice/bxml/verbs/forward.py
deleted file mode 100644
index 1ea510c6..00000000
--- a/bandwidth/voice/bxml/verbs/forward.py
+++ /dev/null
@@ -1,46 +0,0 @@
-"""
-forward.py
-
-Representation of Bandwidth's forward BXML verb
-
-@copyright Bandwidth INC
-"""
-
-from lxml import etree
-
-from .base_verb import AbstractBxmlVerb
-
-FORWARD_TAG = "Forward"
-
-
-class Forward(AbstractBxmlVerb):
-
- def __init__(self, to=None, from_=None, call_timeout=None, diversion_treatment=None, diversion_reason=None):
- """
- Initializes the Forward class with the following parameters
-
- :param str to: The phone number destination of the call
- :param str from_: The phone number that the recipient will receive the call from
- :param int call_timeout: The number of seconds to wait before timing out the call
- :param str diversion_treatment: The diversion treatment for the call
- :param str diversion_reason: The diversion reason for the call
- """
- self.to = to
- self.from_ = from_
- self.call_timeout = call_timeout
- self.diversion_treatment = diversion_treatment
- self.diversion_reason = diversion_reason
-
- def to_bxml(self):
- root = etree.Element(FORWARD_TAG)
- if self.to is not None:
- root.set("to", self.to)
- if self.call_timeout is not None:
- root.set("callTimeout", str(self.call_timeout))
- if self.from_ is not None:
- root.set("from", self.from_)
- if self.diversion_treatment is not None:
- root.set("diversionTreatment", self.diversion_treatment)
- if self.diversion_reason is not None:
- root.set("diversionReason", self.diversion_reason)
- return etree.tostring(root).decode()
diff --git a/bandwidth/voice/bxml/verbs/gather.py b/bandwidth/voice/bxml/verbs/gather.py
deleted file mode 100644
index 1a094a99..00000000
--- a/bandwidth/voice/bxml/verbs/gather.py
+++ /dev/null
@@ -1,103 +0,0 @@
-"""
-gather.py
-
-Representation of Bandwidth's gather BXML verb
-
-@copyright Bandwidth INC
-"""
-
-from lxml import etree
-
-from .base_verb import AbstractBxmlVerb
-from .speak_sentence import SSML_REGEX
-
-import re
-
-GATHER_TAG = "Gather"
-
-
-class Gather(AbstractBxmlVerb):
-
- def __init__(self, gather_url=None, gather_method=None, terminating_digits=None, tag=None, max_digits=None,
- inter_digit_timeout=None, username=None, password=None, first_digit_timeout=None,
- play_audio=None, speak_sentence=None, repeat_count=None, nested_verbs=None,
- gather_fallback_url=None, gather_fallback_method=None, fallback_username=None,
- fallback_password=None):
- """
- Initializes the Gather class with the following parameters
-
- :param str gather_url: The url to receive the gather callback
- :param str gather_method: The HTTP method used to send the gather callback
- :param str terminating_digits: The digits used to terminate the gather
- :param str tag: Custom string included in callbacks
- :param int max_digits: Max digits to press in the gather
- :param int inter_digit_timeout: Seconds allowed between digit presses before terminating the gather
- :param str username: The username for callback http authentication
- :param str password: The password for callback http authentication
- :param int first_digit_timeout: Seconds allowed before the first digit press before terminating the gather
- :param PlayAudio play_audio: The PlayAudio tag to include in the gather
- :param SpeakSentence speak_sentence: The SpeakSentence tag to include in the gather
- :param int repeat_count: The number of times to repeat the audio prompt
- :param list nested_verbs: The list of verbs to nest in the gather
- :param str gather_fallback_url: Fallback url for gather events
- :param str gather_fallback_method: HTTP method for fallback requests
- :param str fallback_username: Basic auth username for fallback requests
- :param str fallback_password: Basic auth password for fallback requests
- """
-
- self.gather_url = gather_url
- self.gather_method = gather_method
- self.terminating_digits = terminating_digits
- self.tag = tag
- self.max_digits = max_digits
- self.inter_digit_timeout = inter_digit_timeout
- self.username = username
- self.password = password
- self.first_digit_timeout = first_digit_timeout
- self.play_audio = play_audio
- self.speak_sentence = speak_sentence
- self.repeat_count = repeat_count
- self.nested_verbs = nested_verbs
- self.gather_fallback_url = gather_fallback_url
- self.gather_fallback_method = gather_fallback_method
- self.fallback_username = fallback_username
- self.fallback_password = fallback_password
-
- def to_bxml(self):
- root = etree.Element(GATHER_TAG)
- if self.gather_url is not None:
- root.set("gatherUrl", self.gather_url)
- if self.gather_method is not None:
- root.set("gatherMethod", self.gather_method)
- if self.terminating_digits is not None:
- root.set("terminatingDigits", self.terminating_digits)
- if self.tag is not None:
- root.set("tag", self.tag)
- if self.max_digits is not None:
- root.set("maxDigits", str(self.max_digits))
- if self.inter_digit_timeout is not None:
- root.set("interDigitTimeout", str(self.inter_digit_timeout))
- if self.username is not None:
- root.set("username", self.username)
- if self.password is not None:
- root.set("password", self.password)
- if self.first_digit_timeout is not None:
- root.set("firstDigitTimeout", str(self.first_digit_timeout))
- if self.repeat_count is not None:
- root.set("repeatCount", str(self.repeat_count))
- if self.gather_fallback_url is not None:
- root.set("gatherFallbackUrl", self.gather_fallback_url)
- if self.gather_fallback_method is not None:
- root.set("gatherFallbackMethod", self.gather_fallback_method)
- if self.fallback_username is not None:
- root.set("fallbackUsername", self.fallback_username)
- if self.fallback_password is not None:
- root.set("fallbackPassword", self.fallback_password)
- if self.play_audio is not None:
- root.append(self.play_audio.to_etree_element())
- if self.speak_sentence is not None:
- root.append(self.speak_sentence.to_etree_element())
- if self.nested_verbs is not None:
- for verb in self.nested_verbs:
- root.append(verb.to_etree_element())
- return re.sub(SSML_REGEX, r"<\1>", etree.tostring(root).decode())
diff --git a/bandwidth/voice/bxml/verbs/hangup.py b/bandwidth/voice/bxml/verbs/hangup.py
deleted file mode 100644
index 99e2e203..00000000
--- a/bandwidth/voice/bxml/verbs/hangup.py
+++ /dev/null
@@ -1,15 +0,0 @@
-"""
-hangup.py
-
-Representation of Bandwidth's hangup BXML verb
-
-@copyright Bandwidth INC
-"""
-
-from .base_verb import AbstractBxmlVerb
-
-
-class Hangup(AbstractBxmlVerb):
-
- def to_bxml(self):
- return ""
diff --git a/bandwidth/voice/bxml/verbs/pause.py b/bandwidth/voice/bxml/verbs/pause.py
deleted file mode 100644
index 827358e2..00000000
--- a/bandwidth/voice/bxml/verbs/pause.py
+++ /dev/null
@@ -1,30 +0,0 @@
-"""
-pause.py
-
-Representation of Bandwidth's pause BXML verb
-
-@copyright Bandwidth INC
-"""
-
-from lxml import etree
-
-from .base_verb import AbstractBxmlVerb
-
-PAUSE_TAG = "Pause"
-
-
-class Pause(AbstractBxmlVerb):
-
- def __init__(self, duration):
- """
- Initializes the Pause class with the duration parameter
-
- :param float duration: The time in seconds to pause
- """
- self.duration = duration
-
- def to_bxml(self):
- root = etree.Element(PAUSE_TAG)
- if self.duration is not None:
- root.set("duration", str(self.duration))
- return etree.tostring(root).decode()
diff --git a/bandwidth/voice/bxml/verbs/pause_recording.py b/bandwidth/voice/bxml/verbs/pause_recording.py
deleted file mode 100644
index 8aacf4a2..00000000
--- a/bandwidth/voice/bxml/verbs/pause_recording.py
+++ /dev/null
@@ -1,15 +0,0 @@
-"""
-pause_recording.py
-
-Representation of Bandwidth's PauseRecording BXML verb
-
-@copyright Bandwidth INC
-"""
-
-from .base_verb import AbstractBxmlVerb
-
-
-class PauseRecording(AbstractBxmlVerb):
-
- def to_bxml(self):
- return ""
diff --git a/bandwidth/voice/bxml/verbs/phone_number.py b/bandwidth/voice/bxml/verbs/phone_number.py
deleted file mode 100644
index a1b0937f..00000000
--- a/bandwidth/voice/bxml/verbs/phone_number.py
+++ /dev/null
@@ -1,85 +0,0 @@
-"""
-phone_number.py
-
-Representation of Bandwidth's phone number BXML verb
-
-@copyright Bandwidth INC
-"""
-
-from lxml import etree
-
-from .base_verb import AbstractBxmlVerb
-
-PHONE_NUMBER_TAG = "PhoneNumber"
-
-
-class PhoneNumber(AbstractBxmlVerb):
-
- def __init__(self, number=None, transfer_answer_url=None, transfer_answer_method=None,
- username=None, password=None, tag=None, transfer_disconnect_url=None, transfer_disconnect_method=None,
- transfer_answer_fallback_url=None, transfer_answer_fallback_method=None,
- fallback_username=None, fallback_password=None):
- """
- Initializes the PhoneNumber class with the following parameters
-
- :param str number: The phone number
- :param str transfer_answer_url: The url to send the transfer event to
- :param str transfer_answer_method: The http method of the transfer event request
- :param str transfer_disconnect_url: The url to send the transfer disconnect event to
- :param str transfer_disconnect_method: The http method of the transfer disconnect event request
- :param str username: The username to authenticate on the transfer event url
- :param str password: The password to authenticate on the transfer event url
- :param str tag: Custom string sent in the callback
- :param str transfer_answer_fallback_url: URL for fallback events
- :param str transfer_answer_fallback_method: HTTP method for fallback events
- :param str fallback_username: Basic auth username for fallback events
- :param str fallback_password: Basic auth password for fallback events
- """
- self.number = number
- self.transfer_answer_url = transfer_answer_url
- self.transfer_answer_method = transfer_answer_method
- self.username = username
- self.password = password
- self.tag = tag
- self.transfer_disconnect_method = transfer_disconnect_method
- self.transfer_disconnect_url = transfer_disconnect_url
- self.transfer_answer_fallback_url = transfer_answer_fallback_url
- self.transfer_answer_fallback_method = transfer_answer_fallback_method
- self.fallback_username = fallback_username
- self.fallback_password = fallback_password
-
- def to_etree_element(self):
- """
- Converts the class into an etree element. Used for other verb classes to build xml
-
- :return etree.Element: The etree Element representing this class
- """
- root = etree.Element(PHONE_NUMBER_TAG)
- if self.number is not None:
- root.text = self.number
- if self.transfer_answer_url is not None:
- root.set("transferAnswerUrl", self.transfer_answer_url)
- if self.transfer_answer_method is not None:
- root.set("transferAnswerMethod", self.transfer_answer_method)
- if self.username is not None:
- root.set("username", self.username)
- if self.password is not None:
- root.set("password", self.password)
- if self.tag is not None:
- root.set("tag", self.tag)
- if self.transfer_disconnect_method is not None:
- root.set("transferDisconnectMethod", self.transfer_disconnect_method)
- if self.transfer_disconnect_url is not None:
- root.set("transferDisconnectUrl", self.transfer_disconnect_url)
- if self.transfer_answer_fallback_url is not None:
- root.set("transferAnswerFallbackUrl", self.transfer_answer_fallback_url)
- if self.transfer_answer_fallback_method is not None:
- root.set("transferAnswerFallbackMethod", self.transfer_answer_fallback_method)
- if self.fallback_username is not None:
- root.set("fallbackUsername", self.fallback_username)
- if self.fallback_password is not None:
- root.set("fallbackPassword", self.fallback_password)
- return root
-
- def to_bxml(self):
- return etree.tostring(self.to_etree_element()).decode()
diff --git a/bandwidth/voice/bxml/verbs/play_audio.py b/bandwidth/voice/bxml/verbs/play_audio.py
deleted file mode 100644
index b5d19227..00000000
--- a/bandwidth/voice/bxml/verbs/play_audio.py
+++ /dev/null
@@ -1,46 +0,0 @@
-"""
-play_audio.py
-
-Representation of Bandwidth's play audio BXML verb
-
-@copyright Bandwidth INC
-"""
-
-from lxml import etree
-
-from .base_verb import AbstractBxmlVerb
-
-PLAY_AUDIO_TAG = "PlayAudio"
-
-
-class PlayAudio(AbstractBxmlVerb):
-
- def __init__(self, url=None, username=None, password=None):
- """
- Initializes the PlayAudio class with the following parameters
-
- :param str url: The url of the audio to play
- :param str username: The username to authenticate on the url
- :param str password: The password to authenticate on the url
- """
- self.url = url
- self.username = username
- self.password = password
-
- def to_etree_element(self):
- """
- Converts the class into an etree element. Used for other verb classes to build xml
-
- :return etree.Element: The etree Element representing this class
- """
- root = etree.Element(PLAY_AUDIO_TAG)
- if self.url is not None:
- root.text = self.url
- if self.username is not None:
- root.set("username", self.username)
- if self.password is not None:
- root.set("password", self.password)
- return root
-
- def to_bxml(self):
- return etree.tostring(self.to_etree_element()).decode()
diff --git a/bandwidth/voice/bxml/verbs/record.py b/bandwidth/voice/bxml/verbs/record.py
deleted file mode 100644
index 007c65d5..00000000
--- a/bandwidth/voice/bxml/verbs/record.py
+++ /dev/null
@@ -1,110 +0,0 @@
-"""
-record.py
-
-Representation of Bandwidth's redirect BXML verb
-
-@copyright Bandwidth INC
-"""
-
-from lxml import etree
-
-from .base_verb import AbstractBxmlVerb
-
-RECORD_TAG = "Record"
-
-
-class Record(AbstractBxmlVerb):
-
- def __init__(self, tag=None, username=None, password=None, record_complete_url=None, record_complete_method=None,
- recording_available_url=None, recording_available_method=None, terminating_digits=None, max_duration=None,
- file_format=None, detect_language=None, transcribe=None, transcription_available_url=None, transcription_available_method=None,
- silence_timeout=None, record_complete_fallback_url=None, record_complete_fallback_method=None,
- fallback_username=None, fallback_password=None):
- """
- Initializes the Record class with the following parameters
-
- :param str tag: Optional tag to include in the callback
- :param str username: Username for http authentication on the redirect url
- :param str password: Password for http authentication on the redirect url
- :param str record_complete_url: URL for record complete callback
- :param str record_complete_method: HTTP method for record complete callback
- :param str recording_available_url: URL for record available callback
- :param str recording_available_method: HTTP method for record available callback
- :param str terminating_digits: Digits to terminate the recording
- :param int max_duration: Max duration to record in seconds
- :param str file_format: The file format to save the recording in
- :param bool detect_language: Indicates 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.
- :param bool transcribe: True to transcribe the recording on completion, False otherwise
- :param str transcription_available_url: URL to send the transcriptionAvailable event to.
- :param str transcription_available_method: The HTTP method to use for the request to transcriptionAvailableUrl. GET or POST
- :param int silence_timeout: Number of seconds of silence that ends the recording
- :param str record_complete_fallback_url: URL for fallback events
- :param str record_complete_fallback_method: HTTP method for fallback events
- :param str fallback_username: Basic auth username for fallback events
- :param str fallback_password: Basic auth password for fallback events
- """
- self.tag = tag
- self.username = username
- self.password = password
- self.record_complete_url = record_complete_url
- self.record_complete_method = record_complete_method
- self.recording_available_url = recording_available_url
- self.recording_available_method = recording_available_method
- self.terminating_digits = terminating_digits
- self.max_duration = max_duration
- self.file_format = file_format
- self.detect_language = detect_language
- self.transcribe = transcribe
- self.transcription_available_url = transcription_available_url
- self.transcription_available_method = transcription_available_method
- self.silence_timeout = silence_timeout
- self.record_complete_fallback_url = record_complete_fallback_url
- self.record_complete_fallback_method = record_complete_fallback_method
- self.fallback_username = fallback_username
- self.fallback_password = fallback_password
-
- def to_bxml(self):
- root = etree.Element(RECORD_TAG)
- if self.tag is not None:
- root.set("tag", self.tag)
- if self.username is not None:
- root.set("username", self.username)
- if self.password is not None:
- root.set("password", self.password)
- if self.record_complete_url is not None:
- root.set("recordCompleteUrl", self.record_complete_url)
- if self.record_complete_method is not None:
- root.set("recordCompleteMethod", self.record_complete_method)
- if self.recording_available_url is not None:
- root.set("recordingAvailableUrl", self.recording_available_url)
- if self.recording_available_method is not None:
- root.set("recordingAvailableMethod", self.recording_available_method)
- if self.terminating_digits is not None:
- root.set("terminatingDigits", self.terminating_digits)
- if self.max_duration is not None:
- root.set("maxDuration", str(self.max_duration))
- if self.file_format is not None:
- root.set("fileFormat", self.file_format)
- if self.detect_language is not None:
- #Convert True to "true", or False to "false"
- strn = "true" if self.detect_language else "false"
- root.set("detectLanguage", strn)
- if self.transcribe is not None:
- #Convert True to "true", or False to "false"
- strn = "true" if self.transcribe else "false"
- root.set("transcribe", strn)
- if self.transcription_available_url is not None:
- root.set("transcriptionAvailableUrl", self.transcription_available_url)
- if self.transcription_available_method is not None:
- root.set("transcriptionAvailableMethod", self.transcription_available_method)
- if self.silence_timeout is not None:
- root.set("silenceTimeout", str(self.silence_timeout))
- if self.record_complete_fallback_url is not None:
- root.set("recordCompleteFallbackUrl", self.record_complete_fallback_url)
- if self.record_complete_fallback_method is not None:
- root.set("recordCompleteFallbackMethod", self.record_complete_fallback_method)
- if self.fallback_username is not None:
- root.set("fallbackUsername", self.fallback_username)
- if self.fallback_password is not None:
- root.set("fallbackPassword", self.fallback_password)
- return etree.tostring(root).decode()
diff --git a/bandwidth/voice/bxml/verbs/redirect.py b/bandwidth/voice/bxml/verbs/redirect.py
deleted file mode 100644
index 51047009..00000000
--- a/bandwidth/voice/bxml/verbs/redirect.py
+++ /dev/null
@@ -1,64 +0,0 @@
-"""
-redirect.py
-
-Representation of Bandwidth's redirect BXML verb
-
-@copyright Bandwidth INC
-"""
-
-from lxml import etree
-
-from .base_verb import AbstractBxmlVerb
-
-REDIRECT_TAG = "Redirect"
-
-
-class Redirect(AbstractBxmlVerb):
-
- def __init__(self, redirect_url=None, redirect_method=None, tag=None, username=None, password=None,
- redirect_fallback_url=None, redirect_fallback_method=None,
- fallback_username=None, fallback_password=None):
- """
- Initializes the Redirect class with the following parameters
-
- :param str redirect_url: The url to retrieve the next BXML
- :param str redirect_method: The HTTP method used to retrieve the next url
- :param str tag: Optional tag to include in the callback
- :param str username: Username for http authentication on the redirect url
- :param str password: Password for http authentication on the redirect url
- :param str redirect_fallback_url: URL for fallback events
- :param str redirect_fallback_method: HTTP method for fallback events
- :param str fallback_username: Basic auth username for fallback events
- :param str fallback_password: Basic auth password for fallback events
- """
- self.redirect_url = redirect_url
- self.redirect_method = redirect_method
- self.tag = tag
- self.username = username
- self.password = password
- self.redirect_fallback_url = redirect_fallback_url
- self.redirect_fallback_method = redirect_fallback_method
- self.fallback_username = fallback_username
- self.fallback_password = fallback_password
-
- def to_bxml(self):
- root = etree.Element(REDIRECT_TAG)
- if self.redirect_url is not None:
- root.set("redirectUrl", self.redirect_url)
- if self.redirect_method is not None:
- root.set("redirectMethod", self.redirect_method)
- if self.tag is not None:
- root.set("tag", self.tag)
- if self.username is not None:
- root.set("username", self.username)
- if self.password is not None:
- root.set("password", self.password)
- if self.redirect_fallback_url is not None:
- root.set("redirectFallbackUrl", self.redirect_fallback_url)
- if self.redirect_fallback_method is not None:
- root.set("redirectFallbackMethod", self.redirect_fallback_method)
- if self.fallback_username is not None:
- root.set("fallbackUsername", self.fallback_username)
- if self.fallback_password is not None:
- root.set("fallbackPassword", self.fallback_password)
- return etree.tostring(root).decode()
diff --git a/bandwidth/voice/bxml/verbs/resume_recording.py b/bandwidth/voice/bxml/verbs/resume_recording.py
deleted file mode 100644
index c445648b..00000000
--- a/bandwidth/voice/bxml/verbs/resume_recording.py
+++ /dev/null
@@ -1,15 +0,0 @@
-"""
-resume_recording.py
-
-Representation of Bandwidth's ResumeRecording BXML verb
-
-@copyright Bandwidth INC
-"""
-
-from .base_verb import AbstractBxmlVerb
-
-
-class ResumeRecording(AbstractBxmlVerb):
-
- def to_bxml(self):
- return ""
diff --git a/bandwidth/voice/bxml/verbs/ring.py b/bandwidth/voice/bxml/verbs/ring.py
deleted file mode 100644
index 5aa144d6..00000000
--- a/bandwidth/voice/bxml/verbs/ring.py
+++ /dev/null
@@ -1,34 +0,0 @@
-"""
-ring.py
-
-Representation of Bandwidth's ring BXML verb
-
-@copyright Bandwidth INC
-"""
-
-from lxml import etree
-
-from .base_verb import AbstractBxmlVerb
-
-RING_TAG = "Ring"
-
-
-class Ring(AbstractBxmlVerb):
-
- def __init__(self, duration=None, answer_call=None):
- """
- Initializes the Ring class with the duration parameter
-
- :param float duration: The time in seconds to ring
- :param boolean answer_call: Whether or not to accept the incoming call while playing the ring
- """
- self.duration = duration
- self.answer_call = answer_call
-
- def to_bxml(self):
- root = etree.Element(RING_TAG)
- if self.duration is not None:
- root.set("duration", str(self.duration))
- if self.answer_call is not None:
- root.set("answerCall", str(self.answer_call))
- return etree.tostring(root).decode()
diff --git a/bandwidth/voice/bxml/verbs/send_dtmf.py b/bandwidth/voice/bxml/verbs/send_dtmf.py
deleted file mode 100644
index fafa197d..00000000
--- a/bandwidth/voice/bxml/verbs/send_dtmf.py
+++ /dev/null
@@ -1,38 +0,0 @@
-"""
-send_dtmf.py
-
-Representation of Bandwidth's send dtmf BXML verb
-
-@copyright Bandwidth INC
-"""
-
-from lxml import etree
-
-from .base_verb import AbstractBxmlVerb
-
-SEND_DTMF_TAG = "SendDtmf"
-
-
-class SendDtmf(AbstractBxmlVerb):
-
- def __init__(self, dtmf, tone_duration=None, tone_interval=None):
- """
- Initializes the SendDtmf class with the dtmf parameter
-
- :param str dtmf: The dtmf to build the SendDtmf verb
- :param double tone_duration: The length in milliseconds of each DTMF tone
- :param double tone_interval: The duration of silence in milliseconds following each DTMF tone
- """
- self.dtmf = dtmf
- self.tone_duration = tone_duration
- self.tone_interval = tone_interval
-
- def to_bxml(self):
- root = etree.Element(SEND_DTMF_TAG)
- root.text = self.dtmf
- if self.tone_duration is not None:
- root.set("toneDuration", str(self.tone_duration))
- if self.tone_interval is not None:
- root.set("toneInterval", str(self.tone_interval))
-
- return etree.tostring(root).decode()
diff --git a/bandwidth/voice/bxml/verbs/sip_uri.py b/bandwidth/voice/bxml/verbs/sip_uri.py
deleted file mode 100644
index 37b73361..00000000
--- a/bandwidth/voice/bxml/verbs/sip_uri.py
+++ /dev/null
@@ -1,90 +0,0 @@
-"""
-sip_uri.py
-
-Representation of Bandwidth's sip uri BXML verb
-
-@copyright Bandwidth INC
-"""
-
-from lxml import etree
-
-from .base_verb import AbstractBxmlVerb
-
-SIP_URI_TAG = "SipUri"
-
-
-class SipUri(AbstractBxmlVerb):
-
- def __init__(self, uri=None, transfer_answer_url=None, transfer_answer_method=None,
- username=None, password=None, tag=None, uui=None,
- transfer_disconnect_url=None, transfer_disconnect_method=None,
- transfer_answer_fallback_url=None, transfer_answer_fallback_method=None,
- fallback_username=None, fallback_password=None):
- """
- Initializes the SipUri class with the following parameters
-
- :param str uri: The sip uri
- :param str transfer_answer_url: The url to send the transfer event to
- :param str transfer_answer_method: The http method of the transfer event request
- :param str transfer_disconnect_url: The url to send the transfer disconnect event to
- :param str transfer_disconnect_method: The http method of the transfer disconnect event request
- :param str username: The username to authenticate on the transfer event url
- :param str password: The password to authenticate on the transfer event url
- :param str tag: Custom string sent in the callback
- :param str uui: The value of the `User-To-User` header to send within the initial `INVITE`
- :param str transfer_answer_fallback_url: URL for fallback events
- :param str transfer_answer_fallback_method: HTTP method for fallback events
- :param str fallback_username: Basic auth username for fallback events
- :param str fallback_password: Basic auth password for fallback events
- """
- self.uri = uri
- self.transfer_answer_url = transfer_answer_url
- self.transfer_answer_method = transfer_answer_method
- self.username = username
- self.password = password
- self.tag = tag
- self.uui = uui
- self.transfer_disconnect_method = transfer_disconnect_method
- self.transfer_disconnect_url = transfer_disconnect_url
- self.transfer_answer_fallback_url = transfer_answer_fallback_url
- self.transfer_answer_fallback_method = transfer_answer_fallback_method
- self.fallback_username = fallback_username
- self.fallback_password = fallback_password
-
- def to_etree_element(self):
- """
- Converts the class into an etree element. Used for other verb classes to build xml
-
- :return etree.Element: The etree Element representing this class
- """
- root = etree.Element(SIP_URI_TAG)
- if self.uri is not None:
- root.text = self.uri
- if self.transfer_answer_url is not None:
- root.set("transferAnswerUrl", self.transfer_answer_url)
- if self.transfer_answer_method is not None:
- root.set("transferAnswerMethod", self.transfer_answer_method)
- if self.username is not None:
- root.set("username", self.username)
- if self.password is not None:
- root.set("password", self.password)
- if self.tag is not None:
- root.set("tag", self.tag)
- if self.uui is not None:
- root.set("uui", self.uui)
- if self.transfer_disconnect_method is not None:
- root.set("transferDisconnectMethod", self.transfer_disconnect_method)
- if self.transfer_disconnect_url is not None:
- root.set("transferDisconnectUrl", self.transfer_disconnect_url)
- if self.transfer_answer_fallback_url is not None:
- root.set("transferAnswerFallbackUrl", self.transfer_answer_fallback_url)
- if self.transfer_answer_fallback_method is not None:
- root.set("transferAnswerFallbackMethod", self.transfer_answer_fallback_method)
- if self.fallback_username is not None:
- root.set("fallbackUsername", self.fallback_username)
- if self.fallback_password is not None:
- root.set("fallbackPassword", self.fallback_password)
- return root
-
- def to_bxml(self):
- return etree.tostring(self.to_etree_element()).decode()
diff --git a/bandwidth/voice/bxml/verbs/speak_sentence.py b/bandwidth/voice/bxml/verbs/speak_sentence.py
deleted file mode 100644
index 36d3a7f0..00000000
--- a/bandwidth/voice/bxml/verbs/speak_sentence.py
+++ /dev/null
@@ -1,52 +0,0 @@
-"""
-speak_sentence.py
-
-Representation of Bandwidth's speak sentence BXML verb
-
-@copyright Bandwidth INC
-"""
-
-from lxml import etree
-
-from .base_verb import AbstractBxmlVerb
-
-import re
-
-SPEAK_SENTENCE_TAG = "SpeakSentence"
-SSML_REGEX = r"<([a-zA-Z//].*?)>"
-
-class SpeakSentence(AbstractBxmlVerb):
-
- def __init__(self, sentence=None, voice=None, locale=None, gender=None):
- """
- Initializes the SpeakSentence class with the following parameters
-
- :param str sentence: The sentence to speak
- :param str voice: The voice to speak the sentence
- :param str locale: The locale of the voice
- :param str gender: The gender of the voice
- """
- self.sentence = sentence
- self.voice = voice
- self.locale = locale
- self.gender = gender
-
- def to_etree_element(self):
- """
- Converts the class into an etree element. Used for other verb classes to build xml
-
- :return etree.Element: The etree Element representing this class
- """
- root = etree.Element(SPEAK_SENTENCE_TAG)
- if self.sentence is not None:
- root.text = self.sentence
- if self.voice is not None:
- root.set("voice", self.voice)
- if self.locale is not None:
- root.set("locale", self.locale)
- if self.gender is not None:
- root.set("gender", self.gender)
- return root
-
- def to_bxml(self):
- return re.sub(SSML_REGEX, r"<\1>", etree.tostring(self.to_etree_element()).decode())
diff --git a/bandwidth/voice/bxml/verbs/start_gather.py b/bandwidth/voice/bxml/verbs/start_gather.py
deleted file mode 100644
index 68efa542..00000000
--- a/bandwidth/voice/bxml/verbs/start_gather.py
+++ /dev/null
@@ -1,47 +0,0 @@
-"""
-startGather.py
-
-Representation of Bandwidth's startGather BXML verb
-
-@copyright Bandwidth INC
-"""
-
-from lxml import etree
-
-from .base_verb import AbstractBxmlVerb
-
-START_GATHER_TAG = "StartGather"
-
-
-class StartGather(AbstractBxmlVerb):
-
- def __init__(self, dtmfUrl=None, dtmfMethod=None, username=None, password=None, tag=None):
- """
- Initializes the Gather class with the following parameters
-
- :param str dtmfUrl: The url to receive the dtmf event
- :param str dtmfMethod: The HTTP method used to send the gather dtmfUrl event
- :param str username: The username for callback http authentication
- :param str password: The password for callback http authentication
- :param str tag:
- """
-
- self.dtmfUrl = dtmfUrl
- self.dtmfMethod = dtmfMethod
- self.username = username
- self.password = password
- self.tag = tag
-
- def to_bxml(self):
- root = etree.Element(START_GATHER_TAG)
- if self.dtmfUrl is not None:
- root.set("dtmfUrl", self.dtmfUrl)
- if self.dtmfMethod is not None:
- root.set("dtmfMethod", self.dtmfMethod)
- if self.username is not None:
- root.set("username", self.username)
- if self.password is not None:
- root.set("password", self.password)
- if self.tag is not None:
- root.set("tag", self.tag)
- return etree.tostring(root).decode()
diff --git a/bandwidth/voice/bxml/verbs/start_recording.py b/bandwidth/voice/bxml/verbs/start_recording.py
deleted file mode 100644
index 716eb904..00000000
--- a/bandwidth/voice/bxml/verbs/start_recording.py
+++ /dev/null
@@ -1,77 +0,0 @@
-"""
-start_recording.py
-
-Representation of Bandwidth's StartRecording BXML verb
-
-@copyright Bandwidth INC
-"""
-
-from lxml import etree
-
-from .base_verb import AbstractBxmlVerb
-
-START_RECORDING_TAG = "StartRecording"
-
-
-class StartRecording(AbstractBxmlVerb):
-
- def __init__(self, tag=None, username=None, password=None, recording_available_url=None, recording_available_method=None,
- file_format=None, multi_channel=None, detect_language=None, transcribe=None, transcription_available_url=None, transcription_available_method=None):
- """
- Initializes the Record class with the following parameters
-
- :param str tag: Optional tag to include in the callback
- :param str username: Username for http authentication on the redirect url
- :param str password: Password for http authentication on the redirect url
- :param str recording_available_url: URL for record available callback
- :param str recording_available_method: HTTP method for record available callback
- :param str file_format: The file format to save the recording in
- :param bool multi_channel: Whether or not to record the channels separately (default is false, 1 recording)
- :param bool detect_language: Indicates 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.
- :param bool transcribe: True to transcribe the recording on completion, False otherwise
- :param str transcription_available_url: URL to send the transcriptionAvailable event to.
- :param str transcription_available_method: The HTTP method to use for the request to transcriptionAvailableUrl. GET or POST
- """
- self.tag = tag
- self.username = username
- self.password = password
- self.recording_available_url = recording_available_url
- self.recording_available_method = recording_available_method
- self.file_format = file_format
- self.multi_channel = multi_channel
- self.detect_language = detect_language
- self.transcribe = transcribe
- self.transcription_available_url = transcription_available_url
- self.transcription_available_method = transcription_available_method
-
- def to_bxml(self):
- root = etree.Element(START_RECORDING_TAG)
- if self.tag is not None:
- root.set("tag", self.tag)
- if self.username is not None:
- root.set("username", self.username)
- if self.password is not None:
- root.set("password", self.password)
- if self.recording_available_url is not None:
- root.set("recordingAvailableUrl", self.recording_available_url)
- if self.recording_available_method is not None:
- root.set("recordingAvailableMethod", self.recording_available_method)
- if self.file_format is not None:
- root.set("fileFormat", self.file_format)
- if self.multi_channel is not None:
- #Convert True to "true", or False to "false"
- strn = "true" if self.multi_channel else "false"
- root.set("multiChannel", strn)
- if self.detect_language is not None:
- #Convert True to "true", or False to "false"
- strn = "true" if self.detect_language else "false"
- root.set("detectLanguage", strn)
- if self.transcribe is not None:
- #Convert True to "true", or False to "false"
- strn = "true" if self.transcribe else "false"
- root.set("transcribe", strn)
- if self.transcription_available_url is not None:
- root.set("transcriptionAvailableUrl", self.transcription_available_url)
- if self.transcription_available_method is not None:
- root.set("transcriptionAvailableMethod", self.transcription_available_method)
- return etree.tostring(root).decode()
diff --git a/bandwidth/voice/bxml/verbs/start_stream.py b/bandwidth/voice/bxml/verbs/start_stream.py
deleted file mode 100644
index 41166ff0..00000000
--- a/bandwidth/voice/bxml/verbs/start_stream.py
+++ /dev/null
@@ -1,65 +0,0 @@
-"""
-start_stream.py
-
-Representation of Bandwidth's start stream BXML verb
-
-@copyright Bandwidth INC
-"""
-
-from lxml import etree
-
-from .base_verb import AbstractBxmlVerb
-
-START_STREAM_TAG = "StartStream"
-
-
-class StartStream(AbstractBxmlVerb):
-
- def __init__(self, destination, name=None, tracks=None, streamEventUrl=None, streamEventMethod=None, username=None, password=None, streamParams=None):
- """
- Initializes the StartStream class with the following parameters
-
- :param str destination: A websocket URI to send the stream to
- :param str name: A name to refer to this stream by
- :param str tracks: The part of the call to send a stream from. `inbound`, `outbound` or `both`.
- :param str streamEventUrl: URL to send the associated Webhook events to during this stream's lifetime
- :param str streamEventMethod: The HTTP method to use for the request to `streamEventUrl`. `GET` or `POST`
- :param str username: The username to send in the HTTP request to `streamEventUrl`
- :param str password: The password to send in the HTTP request to `streamEventUrl`
- """
- self.destination = destination
- self.name = name
- self.tracks = tracks
- self.streamEventUrl = streamEventUrl
- self.streamEventMethod = streamEventMethod
- self.username = username
- self.password = password
- self.stream_params = streamParams
-
- def to_etree_element(self):
- """
- Converts the class into an etree element. Used for other verb classes to build xml
-
- :return etree.Element: The etree Element representing this class
- """
- root = etree.Element(START_STREAM_TAG)
- root.set("destination", self.destination)
- if self.name is not None:
- root.set("name", self.name)
- if self.tracks is not None:
- root.set("tracks", self.tracks)
- if self.streamEventUrl is not None:
- root.set("streamEventUrl", self.streamEventUrl)
- if self.streamEventMethod is not None:
- root.set("streamEventMethod", self.streamEventMethod)
- if self.username is not None:
- root.set("username", self.username)
- if self.password is not None:
- root.set("password", self.password)
- if self.stream_params is not None:
- for stream_param in self.stream_params:
- root.append(stream_param.to_etree_element())
- return root
-
- def to_bxml(self):
- return etree.tostring(self.to_etree_element()).decode()
diff --git a/bandwidth/voice/bxml/verbs/stop_gather.py b/bandwidth/voice/bxml/verbs/stop_gather.py
deleted file mode 100644
index 6ad39862..00000000
--- a/bandwidth/voice/bxml/verbs/stop_gather.py
+++ /dev/null
@@ -1,15 +0,0 @@
-"""
-stopGather.py
-
-Representation of Bandwidth's stopGather BXML verb
-
-@copyright Bandwidth INC
-"""
-
-from .base_verb import AbstractBxmlVerb
-
-
-class StopGather(AbstractBxmlVerb):
-
- def to_bxml(self):
- return ""
diff --git a/bandwidth/voice/bxml/verbs/stop_recording.py b/bandwidth/voice/bxml/verbs/stop_recording.py
deleted file mode 100644
index 0231eae1..00000000
--- a/bandwidth/voice/bxml/verbs/stop_recording.py
+++ /dev/null
@@ -1,15 +0,0 @@
-"""
-stop_recording.py
-
-Representation of Bandwidth's StopRecording BXML verb
-
-@copyright Bandwidth INC
-"""
-
-from .base_verb import AbstractBxmlVerb
-
-
-class StopRecording(AbstractBxmlVerb):
-
- def to_bxml(self):
- return ""
diff --git a/bandwidth/voice/bxml/verbs/stop_stream.py b/bandwidth/voice/bxml/verbs/stop_stream.py
deleted file mode 100644
index cb7c9e84..00000000
--- a/bandwidth/voice/bxml/verbs/stop_stream.py
+++ /dev/null
@@ -1,37 +0,0 @@
-"""
-start_stream.py
-
-Representation of Bandwidth's start stream BXML verb
-
-@copyright Bandwidth INC
-"""
-
-from lxml import etree
-
-from .base_verb import AbstractBxmlVerb
-
-STOP_STREAM_TAG = "StopStream"
-
-
-class StopStream(AbstractBxmlVerb):
-
- def __init__(self, name):
- """
- Initializes the StopStream class with the following parameters
-
- :param str name: The name of the stream to stop
- """
- self.name = name
-
- def to_etree_element(self):
- """
- Converts the class into an etree element. Used for other verb classes to build xml
-
- :return etree.Element: The etree Element representing this class
- """
- root = etree.Element(STOP_STREAM_TAG)
- root.set("name", self.name)
- return root
-
- def to_bxml(self):
- return etree.tostring(self.to_etree_element()).decode()
diff --git a/bandwidth/voice/bxml/verbs/stream_param.py b/bandwidth/voice/bxml/verbs/stream_param.py
deleted file mode 100644
index 8d5e6e3a..00000000
--- a/bandwidth/voice/bxml/verbs/stream_param.py
+++ /dev/null
@@ -1,40 +0,0 @@
-"""
-start_stream.py
-
-Representation of Bandwidth's start stream BXML verb
-
-@copyright Bandwidth INC
-"""
-
-from lxml import etree
-
-from .base_verb import AbstractBxmlVerb
-
-STREAM_PARAM_TAG = "StreamParam"
-
-
-class StreamParam(AbstractBxmlVerb):
-
- def __init__(self, name, value):
- """
- Initializes the StreamParam class with the following parameters
-
- :param str name: The name of this parameter, up to 256 characters.
- :param str value: The value of this parameter, up to 2048 characters.
- """
- self.name = name
- self.value = value
-
- def to_etree_element(self):
- """
- Converts the class into an etree element. Used for other verb classes to build xml
-
- :return etree.Element: The etree Element representing this class
- """
- root = etree.Element(STREAM_PARAM_TAG)
- root.set("name", self.name)
- root.set("value", self.value)
- return root
-
- def to_bxml(self):
- return etree.tostring(self.to_etree_element()).decode()
diff --git a/bandwidth/voice/bxml/verbs/tag.py b/bandwidth/voice/bxml/verbs/tag.py
deleted file mode 100644
index 06fcd28c..00000000
--- a/bandwidth/voice/bxml/verbs/tag.py
+++ /dev/null
@@ -1,38 +0,0 @@
-"""
-play_audio.py
-
-Representation of Bandwidth's play audio BXML verb
-
-@copyright Bandwidth INC
-"""
-
-from lxml import etree
-
-from .base_verb import AbstractBxmlVerb
-
-TAG_TAG = "Tag"
-
-
-class Tag(AbstractBxmlVerb):
-
- def __init__(self, tag=None):
- """
- Initializes the Tag class with the following parameters
-
- :param str tag: The tag to set the call to
- """
- self.tag = tag
-
- def to_etree_element(self):
- """
- Converts the class into an etree element. Used for other verb classes to build xml
-
- :return etree.Element: The etree Element representing this class
- """
- root = etree.Element(TAG_TAG)
- if self.tag is not None:
- root.text = self.tag
- return root
-
- def to_bxml(self):
- return etree.tostring(self.to_etree_element()).decode()
diff --git a/bandwidth/voice/bxml/verbs/transfer.py b/bandwidth/voice/bxml/verbs/transfer.py
deleted file mode 100644
index be67fd10..00000000
--- a/bandwidth/voice/bxml/verbs/transfer.py
+++ /dev/null
@@ -1,92 +0,0 @@
-"""
-transfer.py
-
-Representation of Bandwidth's transfer BXML verb
-
-@copyright Bandwidth INC
-"""
-
-from lxml import etree
-
-from .base_verb import AbstractBxmlVerb
-
-TRANSFER_TAG = "Transfer"
-
-
-class Transfer(AbstractBxmlVerb):
-
- def __init__(self, transfer_caller_id=None, call_timeout=None, tag=None, transfer_complete_url=None,
- transfer_complete_method=None, username=None, password=None, diversion_treatment=None,
- diversion_reason=None, phone_numbers=None, sip_uris=None,
- transfer_complete_fallback_url=None, transfer_complete_fallback_method=None,
- fallback_username=None, fallback_password=None):
- """
- Initializes the Transfer class with the following parameters
-
- :param str transfer_caller_id: The phone number to make the transfer
- :param int call_timeout: The number of seconds to wait before timing out the transfer
- :param str tag: Custom tag to be included in callbacks
- :param str transfer_complete_url: The url to receive the transfer complete callback
- :param str transfer_complete_method: The HTTP method used to send the transfer complete callback
- :param str username: The username to authenticate on the transfer complete url
- :param str password: The password to authenticate on the transfer complete url
- :param str diversion_treatment: The diversion treatment for the call
- :param str diversion_reason: The diversion reason for the call
- :param list phone_numbers: The numbers to receive the transferred call
- :param list sip_uris: The sip uris to receive the transferred call
- :param str transfer_complete_fallback_url: URL for fallback events
- :param str transfer_complete_fallback_method: HTTP method for fallback events
- :param str fallback_username: Basic auth username for fallback events
- :param str fallback_password: Basic auth password for fallback events
- """
- self.transfer_caller_id = transfer_caller_id
- self.call_timeout = call_timeout
- self.tag = tag
- self.transfer_complete_url = transfer_complete_url
- self.transfer_complete_method = transfer_complete_method
- self.username = username
- self.password = password
- self.diversion_treatment = diversion_treatment
- self.diversion_reason = diversion_reason
- self.phone_numbers = phone_numbers
- self.sip_uris = sip_uris
- self.transfer_complete_fallback_url = transfer_complete_fallback_url
- self.transfer_complete_fallback_method = transfer_complete_fallback_method
- self.fallback_username = fallback_username
- self.fallback_password = fallback_password
-
- def to_bxml(self):
- root = etree.Element(TRANSFER_TAG)
- if self.transfer_caller_id is not None:
- root.set("transferCallerId", self.transfer_caller_id)
- if self.call_timeout is not None:
- root.set("callTimeout", str(self.call_timeout))
- if self.tag is not None:
- root.set("tag", self.tag)
- if self.transfer_complete_url is not None:
- root.set("transferCompleteUrl", self.transfer_complete_url)
- if self.transfer_complete_method is not None:
- root.set("transferCompleteMethod", self.transfer_complete_method)
- if self.username is not None:
- root.set("username", self.username)
- if self.password is not None:
- root.set("password", self.password)
- if self.diversion_treatment is not None:
- root.set("diversionTreatment", self.diversion_treatment)
- if self.diversion_reason is not None:
- root.set("diversionReason", self.diversion_reason)
- if self.transfer_complete_fallback_url is not None:
- root.set("transferCompleteFallbackUrl", self.transfer_complete_fallback_url)
- if self.transfer_complete_fallback_method is not None:
- root.set("transferCompleteFallbackMethod", self.transfer_complete_fallback_method)
- if self.fallback_username is not None:
- root.set("fallbackUsername", self.fallback_username)
- if self.fallback_password is not None:
- root.set("fallbackPassword", self.fallback_password)
- if self.phone_numbers is not None:
- for phone_number in self.phone_numbers:
- root.append(phone_number.to_etree_element())
- if self.sip_uris is not None:
- for sip_uri in self.sip_uris:
- root.append(sip_uri.to_etree_element())
- return etree.tostring(root).decode()
diff --git a/bandwidth/voice/controllers/__init__.py b/bandwidth/voice/controllers/__init__.py
deleted file mode 100644
index c1660224..00000000
--- a/bandwidth/voice/controllers/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-__all__ = [
- 'base_controller',
- 'api_controller',
-]
diff --git a/bandwidth/voice/controllers/api_controller.py b/bandwidth/voice/controllers/api_controller.py
deleted file mode 100644
index fda732ff..00000000
--- a/bandwidth/voice/controllers/api_controller.py
+++ /dev/null
@@ -1,1506 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-from bandwidth.api_helper import APIHelper
-from bandwidth.configuration import Server
-from bandwidth.http.api_response import ApiResponse
-from bandwidth.voice.controllers.base_controller import BaseController
-from bandwidth.http.auth.voice_basic_auth import VoiceBasicAuth
-from bandwidth.voice.models.create_call_response import CreateCallResponse
-from bandwidth.voice.models.call_state import CallState
-from bandwidth.voice.models.call_recording_metadata import CallRecordingMetadata
-from bandwidth.voice.models.transcription_response import TranscriptionResponse
-from bandwidth.voice.models.conference_state import ConferenceState
-from bandwidth.voice.models.conference_member_state import ConferenceMemberState
-from bandwidth.voice.models.conference_recording_metadata import ConferenceRecordingMetadata
-from bandwidth.voice.exceptions.api_error_exception import ApiErrorException
-from bandwidth.exceptions.api_exception import APIException
-
-
-class APIController(BaseController):
-
- """A Controller to access Endpoints in the bandwidth API."""
-
- def __init__(self, config, call_back=None):
- super(APIController, self).__init__(config, call_back)
-
- def create_call(self,
- account_id,
- body):
- """Does a POST request to /api/v2/accounts/{accountId}/calls.
-
- Creates an outbound phone call.
-
- Args:
- account_id (string): TODO: type description here.
- body (CreateCallRequest): TODO: type description here.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers. Call
- successfully created
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/api/v2/accounts/{accountId}/calls'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'accept': 'application/json',
- 'content-type': 'application/json; charset=utf-8'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.post(_query_url, headers=_headers, parameters=APIHelper.json_serialize(body))
- VoiceBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise ApiErrorException('Something\'s not quite right... Your request is invalid. Please fix it before trying again.', _response)
- elif _response.status_code == 401:
- raise APIException('Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.', _response)
- elif _response.status_code == 403:
- raise ApiErrorException('User unauthorized to perform this action.', _response)
- elif _response.status_code == 404:
- raise ApiErrorException('The resource specified cannot be found or does not belong to you.', _response)
- elif _response.status_code == 415:
- raise ApiErrorException('We don\'t support that media type. If a request body is required, please send it to us as `application/json`.', _response)
- elif _response.status_code == 429:
- raise ApiErrorException('You\'re sending requests to this endpoint too frequently. Please slow your request rate down and try again.', _response)
- elif _response.status_code == 500:
- raise ApiErrorException('Something unexpected happened. Please try again.', _response)
- self.validate_response(_response)
-
- decoded = APIHelper.json_deserialize(_response.text, CreateCallResponse.from_dictionary)
- _result = ApiResponse(_response, body=decoded)
- return _result
-
- def get_call(self,
- account_id,
- call_id):
- """Does a GET request to /api/v2/accounts/{accountId}/calls/{callId}.
-
- Returns near-realtime metadata about the specified call.
-
- Args:
- account_id (string): TODO: type description here.
- call_id (string): TODO: type description here.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers. Call
- found
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/api/v2/accounts/{accountId}/calls/{callId}'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'callId': {'value': call_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'accept': 'application/json'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.get(_query_url, headers=_headers)
- VoiceBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise ApiErrorException('Something\'s not quite right... Your request is invalid. Please fix it before trying again.', _response)
- elif _response.status_code == 401:
- raise APIException('Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.', _response)
- elif _response.status_code == 403:
- raise ApiErrorException('User unauthorized to perform this action.', _response)
- elif _response.status_code == 404:
- raise ApiErrorException('The resource specified cannot be found or does not belong to you.', _response)
- elif _response.status_code == 415:
- raise ApiErrorException('We don\'t support that media type. If a request body is required, please send it to us as `application/json`.', _response)
- elif _response.status_code == 429:
- raise ApiErrorException('You\'re sending requests to this endpoint too frequently. Please slow your request rate down and try again.', _response)
- elif _response.status_code == 500:
- raise ApiErrorException('Something unexpected happened. Please try again.', _response)
- self.validate_response(_response)
-
- decoded = APIHelper.json_deserialize(_response.text, CallState.from_dictionary)
- _result = ApiResponse(_response, body=decoded)
- return _result
-
- def modify_call(self,
- account_id,
- call_id,
- body):
- """Does a POST request to /api/v2/accounts/{accountId}/calls/{callId}.
-
- Interrupts and replaces an active call's BXML document.
-
- Args:
- account_id (string): TODO: type description here.
- call_id (string): TODO: type description here.
- body (ModifyCallRequest): TODO: type description here.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers. Call
- successfully modified
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/api/v2/accounts/{accountId}/calls/{callId}'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'callId': {'value': call_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'content-type': 'application/json; charset=utf-8'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.post(_query_url, headers=_headers, parameters=APIHelper.json_serialize(body))
- VoiceBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise ApiErrorException('Something\'s not quite right... Your request is invalid. Please fix it before trying again.', _response)
- elif _response.status_code == 401:
- raise APIException('Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.', _response)
- elif _response.status_code == 403:
- raise ApiErrorException('User unauthorized to perform this action.', _response)
- elif _response.status_code == 404:
- raise ApiErrorException('The resource specified cannot be found or does not belong to you.', _response)
- elif _response.status_code == 415:
- raise ApiErrorException('We don\'t support that media type. If a request body is required, please send it to us as `application/json`.', _response)
- elif _response.status_code == 429:
- raise ApiErrorException('You\'re sending requests to this endpoint too frequently. Please slow your request rate down and try again.', _response)
- elif _response.status_code == 500:
- raise ApiErrorException('Something unexpected happened. Please try again.', _response)
- self.validate_response(_response)
-
- # Return appropriate type
- return ApiResponse(_response)
-
- def modify_call_bxml(self, account_id, call_id, body):
- """Does a PUT request to /api/v2/accounts/{accountId}/calls/{callId}/bxml.
-
- Interrupts and replaces an active call's BXML document, sending the new BXML.
-
- Args:
- account_id (string): Bandwidth Account ID. Ex: "99001234"
- call_id (string): ID of the call for which you wish to replace the active BXML instructions.
- body (string): XML string in valid BXML format
- """
-
- # Prepare query URL
- _url_path = '/api/v2/accounts/{accountId}/calls/{callId}/bxml'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'callId': {'value': call_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'content-type': 'application/xml; charset=utf-8'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.put(_query_url, headers=_headers, parameters=body)
- VoiceBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise ApiErrorException('Something\'s not quite right... Your request is invalid. Please fix it before trying again.', _response)
- elif _response.status_code == 401:
- raise APIException('Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.', _response)
- elif _response.status_code == 403:
- raise ApiErrorException('User unauthorized to perform this action.', _response)
- elif _response.status_code == 404:
- raise ApiErrorException('The resource specified cannot be found or does not belong to you.', _response)
- elif _response.status_code == 415:
- raise ApiErrorException('We don\'t support that media type. If a request body is required, please send it to us as `application/json`.', _response)
- elif _response.status_code == 429:
- raise ApiErrorException('You\'re sending requests to this endpoint too frequently. Please slow your request rate down and try again.', _response)
- elif _response.status_code == 500:
- raise ApiErrorException('Something unexpected happened. Please try again.', _response)
- self.validate_response(_response)
-
- def modify_call_recording_state(self,
- account_id,
- call_id,
- body):
- """Does a PUT request to /api/v2/accounts/{accountId}/calls/{callId}/recording.
-
- Pauses or resumes a recording.
-
- Args:
- account_id (string): TODO: type description here.
- call_id (string): TODO: type description here.
- body (ModifyCallRecordingRequest): TODO: type description here.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers. Recording
- state successfully modified
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/api/v2/accounts/{accountId}/calls/{callId}/recording'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'callId': {'value': call_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'content-type': 'application/json; charset=utf-8'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.put(_query_url, headers=_headers, parameters=APIHelper.json_serialize(body))
- VoiceBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise ApiErrorException('Something\'s not quite right... Your request is invalid. Please fix it before trying again.', _response)
- elif _response.status_code == 401:
- raise APIException('Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.', _response)
- elif _response.status_code == 403:
- raise ApiErrorException('User unauthorized to perform this action.', _response)
- elif _response.status_code == 404:
- raise ApiErrorException('The resource specified cannot be found or does not belong to you.', _response)
- elif _response.status_code == 415:
- raise ApiErrorException('We don\'t support that media type. If a request body is required, please send it to us as `application/json`.', _response)
- elif _response.status_code == 429:
- raise ApiErrorException('You\'re sending requests to this endpoint too frequently. Please slow your request rate down and try again.', _response)
- elif _response.status_code == 500:
- raise ApiErrorException('Something unexpected happened. Please try again.', _response)
- self.validate_response(_response)
-
- # Return appropriate type
- return ApiResponse(_response)
-
- def get_call_recordings(self,
- account_id,
- call_id):
- """Does a GET request to /api/v2/accounts/{accountId}/calls/{callId}/recordings.
-
- Returns a (potentially empty) list of metadata for the recordings that
- took place during the specified call.
-
- Args:
- account_id (string): TODO: type description here.
- call_id (string): TODO: type description here.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers.
- Recordings retrieved successfully
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/api/v2/accounts/{accountId}/calls/{callId}/recordings'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'callId': {'value': call_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'accept': 'application/json'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.get(_query_url, headers=_headers)
- VoiceBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise ApiErrorException('Something\'s not quite right... Your request is invalid. Please fix it before trying again.', _response)
- elif _response.status_code == 401:
- raise APIException('Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.', _response)
- elif _response.status_code == 403:
- raise ApiErrorException('User unauthorized to perform this action.', _response)
- elif _response.status_code == 404:
- raise ApiErrorException('The resource specified cannot be found or does not belong to you.', _response)
- elif _response.status_code == 415:
- raise ApiErrorException('We don\'t support that media type. If a request body is required, please send it to us as `application/json`.', _response)
- elif _response.status_code == 429:
- raise ApiErrorException('You\'re sending requests to this endpoint too frequently. Please slow your request rate down and try again.', _response)
- elif _response.status_code == 500:
- raise ApiErrorException('Something unexpected happened. Please try again.', _response)
- self.validate_response(_response)
-
- decoded = APIHelper.json_deserialize(_response.text, CallRecordingMetadata.from_dictionary)
- _result = ApiResponse(_response, body=decoded)
- return _result
-
- def get_call_recording(self,
- account_id,
- call_id,
- recording_id):
- """Does a GET request to /api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}.
-
- Returns metadata for the specified recording.
-
- Args:
- account_id (string): TODO: type description here.
- call_id (string): TODO: type description here.
- recording_id (string): TODO: type description here.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers. Recording
- found
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'callId': {'value': call_id, 'encode': False},
- 'recordingId': {'value': recording_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'accept': 'application/json'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.get(_query_url, headers=_headers)
- VoiceBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise ApiErrorException('Something\'s not quite right... Your request is invalid. Please fix it before trying again.', _response)
- elif _response.status_code == 401:
- raise APIException('Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.', _response)
- elif _response.status_code == 403:
- raise ApiErrorException('User unauthorized to perform this action.', _response)
- elif _response.status_code == 404:
- raise ApiErrorException('The resource specified cannot be found or does not belong to you.', _response)
- elif _response.status_code == 415:
- raise ApiErrorException('We don\'t support that media type. If a request body is required, please send it to us as `application/json`.', _response)
- elif _response.status_code == 429:
- raise ApiErrorException('You\'re sending requests to this endpoint too frequently. Please slow your request rate down and try again.', _response)
- elif _response.status_code == 500:
- raise ApiErrorException('Something unexpected happened. Please try again.', _response)
- self.validate_response(_response)
-
- decoded = APIHelper.json_deserialize(_response.text, CallRecordingMetadata.from_dictionary)
- _result = ApiResponse(_response, body=decoded)
- return _result
-
- def delete_recording(self,
- account_id,
- call_id,
- recording_id):
- """Does a DELETE request to /api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}.
-
- Deletes the specified recording.
-
- Args:
- account_id (string): TODO: type description here.
- call_id (string): TODO: type description here.
- recording_id (string): TODO: type description here.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers. The
- recording was successfully deleted
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'callId': {'value': call_id, 'encode': False},
- 'recordingId': {'value': recording_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare and execute request
- _request = self.config.http_client.delete(_query_url)
- VoiceBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise ApiErrorException('Something\'s not quite right... Your request is invalid. Please fix it before trying again.', _response)
- elif _response.status_code == 401:
- raise APIException('Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.', _response)
- elif _response.status_code == 403:
- raise ApiErrorException('User unauthorized to perform this action.', _response)
- elif _response.status_code == 404:
- raise ApiErrorException('The resource specified cannot be found or does not belong to you.', _response)
- elif _response.status_code == 415:
- raise ApiErrorException('We don\'t support that media type. If a request body is required, please send it to us as `application/json`.', _response)
- elif _response.status_code == 429:
- raise ApiErrorException('You\'re sending requests to this endpoint too frequently. Please slow your request rate down and try again.', _response)
- elif _response.status_code == 500:
- raise ApiErrorException('Something unexpected happened. Please try again.', _response)
- self.validate_response(_response)
-
- # Return appropriate type
- return ApiResponse(_response)
-
- def get_download_call_recording(self,
- account_id,
- call_id,
- recording_id):
- """Does a GET request to /api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media.
-
- Downloads the specified recording.
-
- Args:
- account_id (string): TODO: type description here.
- call_id (string): TODO: type description here.
- recording_id (string): TODO: type description here.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers. Media
- found
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'callId': {'value': call_id, 'encode': False},
- 'recordingId': {'value': recording_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'accept': 'application/json'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.get(_query_url, headers=_headers)
- VoiceBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise ApiErrorException('Something\'s not quite right... Your request is invalid. Please fix it before trying again.', _response)
- elif _response.status_code == 401:
- raise APIException('Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.', _response)
- elif _response.status_code == 403:
- raise ApiErrorException('User unauthorized to perform this action.', _response)
- elif _response.status_code == 404:
- raise ApiErrorException('The resource specified cannot be found or does not belong to you.', _response)
- elif _response.status_code == 415:
- raise ApiErrorException('We don\'t support that media type. If a request body is required, please send it to us as `application/json`.', _response)
- elif _response.status_code == 429:
- raise ApiErrorException('You\'re sending requests to this endpoint too frequently. Please slow your request rate down and try again.', _response)
- elif _response.status_code == 500:
- raise ApiErrorException('Something unexpected happened. Please try again.', _response)
- self.validate_response(_response)
- if (_response.text is not None) or (not str(_response.text)):
- decoded = APIHelper.json_deserialize(_response.text)
- _result = ApiResponse(_response, body=decoded)
- return _result
-
- def delete_recording_media(self,
- account_id,
- call_id,
- recording_id):
- """Does a DELETE request to /api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media.
-
- Deletes the specified recording's media.
-
- Args:
- account_id (string): TODO: type description here.
- call_id (string): TODO: type description here.
- recording_id (string): TODO: type description here.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers. The
- recording media was successfully deleted
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'callId': {'value': call_id, 'encode': False},
- 'recordingId': {'value': recording_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare and execute request
- _request = self.config.http_client.delete(_query_url)
- VoiceBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise ApiErrorException('Something\'s not quite right... Your request is invalid. Please fix it before trying again.', _response)
- elif _response.status_code == 401:
- raise APIException('Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.', _response)
- elif _response.status_code == 403:
- raise ApiErrorException('User unauthorized to perform this action.', _response)
- elif _response.status_code == 404:
- raise ApiErrorException('The resource specified cannot be found or does not belong to you.', _response)
- elif _response.status_code == 415:
- raise ApiErrorException('We don\'t support that media type. If a request body is required, please send it to us as `application/json`.', _response)
- elif _response.status_code == 429:
- raise ApiErrorException('You\'re sending requests to this endpoint too frequently. Please slow your request rate down and try again.', _response)
- elif _response.status_code == 500:
- raise ApiErrorException('Something unexpected happened. Please try again.', _response)
- self.validate_response(_response)
-
- # Return appropriate type
- return ApiResponse(_response)
-
- def get_call_transcription(self,
- account_id,
- call_id,
- recording_id):
- """Does a GET request to /api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription.
-
- Downloads the specified transcription.
-
- Args:
- account_id (string): TODO: type description here.
- call_id (string): TODO: type description here.
- recording_id (string): TODO: type description here.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers.
- Transcription found
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'callId': {'value': call_id, 'encode': False},
- 'recordingId': {'value': recording_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'accept': 'application/json'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.get(_query_url, headers=_headers)
- VoiceBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise ApiErrorException('Something\'s not quite right... Your request is invalid. Please fix it before trying again.', _response)
- elif _response.status_code == 401:
- raise APIException('Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.', _response)
- elif _response.status_code == 403:
- raise ApiErrorException('User unauthorized to perform this action.', _response)
- elif _response.status_code == 404:
- raise ApiErrorException('The resource specified cannot be found or does not belong to you.', _response)
- elif _response.status_code == 415:
- raise ApiErrorException('We don\'t support that media type. If a request body is required, please send it to us as `application/json`.', _response)
- elif _response.status_code == 429:
- raise ApiErrorException('You\'re sending requests to this endpoint too frequently. Please slow your request rate down and try again.', _response)
- elif _response.status_code == 500:
- raise ApiErrorException('Something unexpected happened. Please try again.', _response)
- self.validate_response(_response)
-
- decoded = APIHelper.json_deserialize(_response.text, TranscriptionResponse.from_dictionary)
- _result = ApiResponse(_response, body=decoded)
- return _result
-
- def create_transcribe_call_recording(self,
- account_id,
- call_id,
- recording_id,
- body):
- """Does a POST request to /api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription.
-
- Requests that the specified recording be transcribed.
-
- Args:
- account_id (string): TODO: type description here.
- call_id (string): TODO: type description here.
- recording_id (string): TODO: type description here.
- body (TranscribeRecordingRequest): TODO: type description here.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers.
- Transcription successfully requested
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'callId': {'value': call_id, 'encode': False},
- 'recordingId': {'value': recording_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'content-type': 'application/json; charset=utf-8'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.post(_query_url, headers=_headers, parameters=APIHelper.json_serialize(body))
- VoiceBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise ApiErrorException('Something\'s not quite right... Your request is invalid. Please fix it before trying again.', _response)
- elif _response.status_code == 401:
- raise APIException('Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.', _response)
- elif _response.status_code == 403:
- raise ApiErrorException('User unauthorized to perform this action.', _response)
- elif _response.status_code == 404:
- raise ApiErrorException('The resource specified cannot be found or does not belong to you.', _response)
- elif _response.status_code == 410:
- raise ApiErrorException('The media for this recording has been deleted, so we can\'t transcribe it', _response)
- elif _response.status_code == 415:
- raise ApiErrorException('We don\'t support that media type. If a request body is required, please send it to us as `application/json`.', _response)
- elif _response.status_code == 429:
- raise ApiErrorException('You\'re sending requests to this endpoint too frequently. Please slow your request rate down and try again.', _response)
- elif _response.status_code == 500:
- raise ApiErrorException('Something unexpected happened. Please try again.', _response)
- self.validate_response(_response)
-
- # Return appropriate type
- return ApiResponse(_response)
-
- def delete_call_transcription(self,
- account_id,
- call_id,
- recording_id):
- """Does a DELETE request to /api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription.
-
- Deletes the specified recording's transcription.
-
- Args:
- account_id (string): TODO: type description here.
- call_id (string): TODO: type description here.
- recording_id (string): TODO: type description here.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers. The
- transcription was successfully deleted
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/api/v2/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'callId': {'value': call_id, 'encode': False},
- 'recordingId': {'value': recording_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare and execute request
- _request = self.config.http_client.delete(_query_url)
- VoiceBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise ApiErrorException('Something\'s not quite right... Your request is invalid. Please fix it before trying again.', _response)
- elif _response.status_code == 401:
- raise APIException('Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.', _response)
- elif _response.status_code == 403:
- raise ApiErrorException('User unauthorized to perform this action.', _response)
- elif _response.status_code == 404:
- raise ApiErrorException('The resource specified cannot be found or does not belong to you.', _response)
- elif _response.status_code == 415:
- raise ApiErrorException('We don\'t support that media type. If a request body is required, please send it to us as `application/json`.', _response)
- elif _response.status_code == 429:
- raise ApiErrorException('You\'re sending requests to this endpoint too frequently. Please slow your request rate down and try again.', _response)
- elif _response.status_code == 500:
- raise ApiErrorException('Something unexpected happened. Please try again.', _response)
- self.validate_response(_response)
-
- # Return appropriate type
- return ApiResponse(_response)
-
- def get_conferences(self,
- account_id,
- name=None,
- min_created_time=None,
- max_created_time=None,
- page_size=1000,
- page_token=None):
- """Does a GET request to /api/v2/accounts/{accountId}/conferences.
-
- Returns information about the conferences in the account.
-
- Args:
- account_id (string): TODO: type description here.
- name (string, optional): TODO: type description here.
- min_created_time (string, optional): TODO: type description here.
- max_created_time (string, optional): TODO: type description here.
- page_size (int, optional): TODO: type description here. Example:
- 1000
- page_token (string, optional): TODO: type description here.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers.
- Conferences retrieved successfully
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/api/v2/accounts/{accountId}/conferences'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT)
- _query_builder += _url_path
- _query_parameters = {
- 'name': name,
- 'minCreatedTime': min_created_time,
- 'maxCreatedTime': max_created_time,
- 'pageSize': page_size,
- 'pageToken': page_token
- }
- _query_builder = APIHelper.append_url_with_query_parameters(
- _query_builder,
- _query_parameters
- )
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'accept': 'application/json'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.get(_query_url, headers=_headers)
- VoiceBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise ApiErrorException('Something\'s not quite right... Your request is invalid. Please fix it before trying again.', _response)
- elif _response.status_code == 401:
- raise APIException('Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.', _response)
- elif _response.status_code == 403:
- raise ApiErrorException('User unauthorized to perform this action.', _response)
- elif _response.status_code == 404:
- raise ApiErrorException('The resource specified cannot be found or does not belong to you.', _response)
- elif _response.status_code == 415:
- raise ApiErrorException('We don\'t support that media type. If a request body is required, please send it to us as `application/json`.', _response)
- elif _response.status_code == 429:
- raise ApiErrorException('You\'re sending requests to this endpoint too frequently. Please slow your request rate down and try again.', _response)
- elif _response.status_code == 500:
- raise ApiErrorException('Something unexpected happened. Please try again.', _response)
- self.validate_response(_response)
-
- decoded = APIHelper.json_deserialize(_response.text, ConferenceState.from_dictionary)
- _result = ApiResponse(_response, body=decoded)
- return _result
-
- def get_conference(self,
- account_id,
- conference_id):
- """Does a GET request to /api/v2/accounts/{accountId}/conferences/{conferenceId}.
-
- Returns information about the specified conference.
-
- Args:
- account_id (string): TODO: type description here.
- conference_id (string): TODO: type description here.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers.
- Conference found
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/api/v2/accounts/{accountId}/conferences/{conferenceId}'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'conferenceId': {'value': conference_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'accept': 'application/json'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.get(_query_url, headers=_headers)
- VoiceBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise ApiErrorException('Something\'s not quite right... Your request is invalid. Please fix it before trying again.', _response)
- elif _response.status_code == 401:
- raise APIException('Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.', _response)
- elif _response.status_code == 403:
- raise ApiErrorException('User unauthorized to perform this action.', _response)
- elif _response.status_code == 404:
- raise ApiErrorException('The resource specified cannot be found or does not belong to you.', _response)
- elif _response.status_code == 415:
- raise ApiErrorException('We don\'t support that media type. If a request body is required, please send it to us as `application/json`.', _response)
- elif _response.status_code == 429:
- raise ApiErrorException('You\'re sending requests to this endpoint too frequently. Please slow your request rate down and try again.', _response)
- elif _response.status_code == 500:
- raise ApiErrorException('Something unexpected happened. Please try again.', _response)
- self.validate_response(_response)
-
- decoded = APIHelper.json_deserialize(_response.text, ConferenceState.from_dictionary)
- _result = ApiResponse(_response, body=decoded)
- return _result
-
- def modify_conference(self,
- account_id,
- conference_id,
- body):
- """Does a POST request to /api/v2/accounts/{accountId}/conferences/{conferenceId}.
-
- Modify the conference state.
-
- Args:
- account_id (string): TODO: type description here.
- conference_id (string): TODO: type description here.
- body (ModifyConferenceRequest): TODO: type description here.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers.
- Conference successfully modified
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/api/v2/accounts/{accountId}/conferences/{conferenceId}'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'conferenceId': {'value': conference_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'content-type': 'application/json; charset=utf-8'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.post(_query_url, headers=_headers, parameters=APIHelper.json_serialize(body))
- VoiceBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise ApiErrorException('Something\'s not quite right... Your request is invalid. Please fix it before trying again.', _response)
- elif _response.status_code == 401:
- raise APIException('Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.', _response)
- elif _response.status_code == 403:
- raise ApiErrorException('User unauthorized to perform this action.', _response)
- elif _response.status_code == 404:
- raise ApiErrorException('The resource specified cannot be found or does not belong to you.', _response)
- elif _response.status_code == 415:
- raise ApiErrorException('We don\'t support that media type. If a request body is required, please send it to us as `application/json`.', _response)
- elif _response.status_code == 429:
- raise ApiErrorException('You\'re sending requests to this endpoint too frequently. Please slow your request rate down and try again.', _response)
- elif _response.status_code == 500:
- raise ApiErrorException('Something unexpected happened. Please try again.', _response)
- self.validate_response(_response)
-
- # Return appropriate type
- return ApiResponse(_response)
-
- def modify_conference_member(self,
- account_id,
- conference_id,
- call_id,
- body):
- """Does a PUT request to /api/v2/accounts/{accountId}/conferences/{conferenceId}/members/{callId}.
-
- Updates settings for a particular conference member.
-
- Args:
- account_id (string): TODO: type description here.
- conference_id (string): TODO: type description here.
- call_id (string): TODO: type description here.
- body (ConferenceMemberState): TODO: type description here.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers.
- Conference member successfully modified
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/api/v2/accounts/{accountId}/conferences/{conferenceId}/members/{callId}'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'conferenceId': {'value': conference_id, 'encode': False},
- 'callId': {'value': call_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'content-type': 'application/json; charset=utf-8'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.put(_query_url, headers=_headers, parameters=APIHelper.json_serialize(body))
- VoiceBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise ApiErrorException('Something\'s not quite right... Your request is invalid. Please fix it before trying again.', _response)
- elif _response.status_code == 401:
- raise APIException('Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.', _response)
- elif _response.status_code == 403:
- raise ApiErrorException('User unauthorized to perform this action.', _response)
- elif _response.status_code == 404:
- raise ApiErrorException('The resource specified cannot be found or does not belong to you.', _response)
- elif _response.status_code == 415:
- raise ApiErrorException('We don\'t support that media type. If a request body is required, please send it to us as `application/json`.', _response)
- elif _response.status_code == 429:
- raise ApiErrorException('You\'re sending requests to this endpoint too frequently. Please slow your request rate down and try again.', _response)
- elif _response.status_code == 500:
- raise ApiErrorException('Something unexpected happened. Please try again.', _response)
- self.validate_response(_response)
-
- # Return appropriate type
- return ApiResponse(_response)
-
- def get_conference_member(self,
- account_id,
- conference_id,
- member_id):
- """Does a GET request to /api/v2/accounts/{accountId}/conferences/{conferenceId}/members/{memberId}.
-
- Returns information about the specified conference member.
-
- Args:
- account_id (string): TODO: type description here.
- conference_id (string): TODO: type description here.
- member_id (string): TODO: type description here.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers.
- Conference member found
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/api/v2/accounts/{accountId}/conferences/{conferenceId}/members/{memberId}'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'conferenceId': {'value': conference_id, 'encode': False},
- 'memberId': {'value': member_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'accept': 'application/json'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.get(_query_url, headers=_headers)
- VoiceBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise ApiErrorException('Something\'s not quite right... Your request is invalid. Please fix it before trying again.', _response)
- elif _response.status_code == 401:
- raise APIException('Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.', _response)
- elif _response.status_code == 403:
- raise ApiErrorException('User unauthorized to perform this action.', _response)
- elif _response.status_code == 404:
- raise ApiErrorException('The resource specified cannot be found or does not belong to you.', _response)
- elif _response.status_code == 415:
- raise ApiErrorException('We don\'t support that media type. If a request body is required, please send it to us as `application/json`.', _response)
- elif _response.status_code == 429:
- raise ApiErrorException('You\'re sending requests to this endpoint too frequently. Please slow your request rate down and try again.', _response)
- elif _response.status_code == 500:
- raise ApiErrorException('Something unexpected happened. Please try again.', _response)
- self.validate_response(_response)
-
- decoded = APIHelper.json_deserialize(_response.text, ConferenceMemberState.from_dictionary)
- _result = ApiResponse(_response, body=decoded)
- return _result
-
- def get_conference_recordings(self,
- account_id,
- conference_id):
- """Does a GET request to /api/v2/accounts/{accountId}/conferences/{conferenceId}/recordings.
-
- Returns a (potentially empty) list of metadata for the recordings that
- took place during the specified conference
-
- Args:
- account_id (string): TODO: type description here.
- conference_id (string): TODO: type description here.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers.
- Recordings retrieved successfully
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/api/v2/accounts/{accountId}/conferences/{conferenceId}/recordings'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'conferenceId': {'value': conference_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'accept': 'application/json'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.get(_query_url, headers=_headers)
- VoiceBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise ApiErrorException('Something\'s not quite right... Your request is invalid. Please fix it before trying again.', _response)
- elif _response.status_code == 401:
- raise APIException('Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.', _response)
- elif _response.status_code == 403:
- raise ApiErrorException('User unauthorized to perform this action.', _response)
- elif _response.status_code == 404:
- raise ApiErrorException('The resource specified cannot be found or does not belong to you.', _response)
- elif _response.status_code == 415:
- raise ApiErrorException('We don\'t support that media type. If a request body is required, please send it to us as `application/json`.', _response)
- elif _response.status_code == 429:
- raise ApiErrorException('You\'re sending requests to this endpoint too frequently. Please slow your request rate down and try again.', _response)
- elif _response.status_code == 500:
- raise ApiErrorException('Something unexpected happened. Please try again.', _response)
- self.validate_response(_response)
-
- decoded = APIHelper.json_deserialize(_response.text, ConferenceRecordingMetadata.from_dictionary)
- _result = ApiResponse(_response, body=decoded)
- return _result
-
- def get_conference_recording(self,
- account_id,
- conference_id,
- recording_id):
- """Does a GET request to /api/v2/accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}.
-
- Returns metadata for the specified recording.
-
- Args:
- account_id (string): TODO: type description here.
- conference_id (string): TODO: type description here.
- recording_id (string): TODO: type description here.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers. Recording
- found
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/api/v2/accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'conferenceId': {'value': conference_id, 'encode': False},
- 'recordingId': {'value': recording_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'accept': 'application/json'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.get(_query_url, headers=_headers)
- VoiceBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise ApiErrorException('Something\'s not quite right... Your request is invalid. Please fix it before trying again.', _response)
- elif _response.status_code == 401:
- raise APIException('Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.', _response)
- elif _response.status_code == 403:
- raise ApiErrorException('User unauthorized to perform this action.', _response)
- elif _response.status_code == 404:
- raise ApiErrorException('The resource specified cannot be found or does not belong to you.', _response)
- elif _response.status_code == 415:
- raise ApiErrorException('We don\'t support that media type. If a request body is required, please send it to us as `application/json`.', _response)
- elif _response.status_code == 429:
- raise ApiErrorException('You\'re sending requests to this endpoint too frequently. Please slow your request rate down and try again.', _response)
- elif _response.status_code == 500:
- raise ApiErrorException('Something unexpected happened. Please try again.', _response)
- self.validate_response(_response)
-
- decoded = APIHelper.json_deserialize(_response.text, CallRecordingMetadata.from_dictionary)
- _result = ApiResponse(_response, body=decoded)
- return _result
-
- def get_download_conference_recording(self,
- account_id,
- conference_id,
- recording_id):
- """Does a GET request to /api/v2/accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}/media.
-
- Downloads the specified recording.
-
- Args:
- account_id (string): TODO: type description here.
- conference_id (string): TODO: type description here.
- recording_id (string): TODO: type description here.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers. Media
- found
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/api/v2/accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}/media'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'conferenceId': {'value': conference_id, 'encode': False},
- 'recordingId': {'value': recording_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'accept': 'application/json'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.get(_query_url, headers=_headers)
- VoiceBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise ApiErrorException('Something\'s not quite right... Your request is invalid. Please fix it before trying again.', _response)
- elif _response.status_code == 401:
- raise APIException('Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.', _response)
- elif _response.status_code == 403:
- raise ApiErrorException('User unauthorized to perform this action.', _response)
- elif _response.status_code == 404:
- raise ApiErrorException('The resource specified cannot be found or does not belong to you.', _response)
- elif _response.status_code == 415:
- raise ApiErrorException('We don\'t support that media type. If a request body is required, please send it to us as `application/json`.', _response)
- elif _response.status_code == 429:
- raise ApiErrorException('You\'re sending requests to this endpoint too frequently. Please slow your request rate down and try again.', _response)
- elif _response.status_code == 500:
- raise ApiErrorException('Something unexpected happened. Please try again.', _response)
- self.validate_response(_response)
- if (_response.text is not None) or (not str(_response.text)):
- decoded = APIHelper.json_deserialize(_response.text)
- _result = ApiResponse(_response, body=decoded)
- return _result
-
- def get_query_call_recordings(self,
- account_id,
- mfrom=None,
- to=None,
- min_start_time=None,
- max_start_time=None):
- """Does a GET request to /api/v2/accounts/{accountId}/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.
-
- Args:
- account_id (string): TODO: type description here.
- mfrom (string, optional): TODO: type description here.
- to (string, optional): TODO: type description here.
- min_start_time (string, optional): TODO: type description here.
- max_start_time (string, optional): TODO: type description here.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers.
- Recordings retrieved successfully.
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/api/v2/accounts/{accountId}/recordings'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.VOICEDEFAULT)
- _query_builder += _url_path
- _query_parameters = {
- 'from': mfrom,
- 'to': to,
- 'minStartTime': min_start_time,
- 'maxStartTime': max_start_time
- }
- _query_builder = APIHelper.append_url_with_query_parameters(
- _query_builder,
- _query_parameters
- )
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'accept': 'application/json'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.get(_query_url, headers=_headers)
- VoiceBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise ApiErrorException('Something\'s not quite right... Your request is invalid. Please fix it before trying again.', _response)
- elif _response.status_code == 401:
- raise APIException('Your credentials are invalid. Please use your Bandwidth dashboard credentials to authenticate to the API.', _response)
- elif _response.status_code == 403:
- raise ApiErrorException('User unauthorized to perform this action.', _response)
- elif _response.status_code == 404:
- raise ApiErrorException('The resource specified cannot be found or does not belong to you.', _response)
- elif _response.status_code == 415:
- raise ApiErrorException('We don\'t support that media type. If a request body is required, please send it to us as `application/json`.', _response)
- elif _response.status_code == 429:
- raise ApiErrorException('You\'re sending requests to this endpoint too frequently. Please slow your request rate down and try again.', _response)
- elif _response.status_code == 500:
- raise ApiErrorException('Something unexpected happened. Please try again.', _response)
- self.validate_response(_response)
-
- decoded = APIHelper.json_deserialize(_response.text, CallRecordingMetadata.from_dictionary)
- _result = ApiResponse(_response, body=decoded)
- return _result
diff --git a/bandwidth/voice/controllers/base_controller.py b/bandwidth/voice/controllers/base_controller.py
deleted file mode 100644
index ec1c6e23..00000000
--- a/bandwidth/voice/controllers/base_controller.py
+++ /dev/null
@@ -1,95 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-from bandwidth.api_helper import APIHelper
-from bandwidth.exceptions.api_exception import APIException
-
-
-class BaseController(object):
-
- """All controllers inherit from this base class.
-
- Attributes:
- config (Configuration): The HttpClient which a specific controller
- instance will use. By default all the controller objects share
- the same HttpClient. A user can use his own custom HttpClient
- as well.
- http_call_back (HttpCallBack): An object which holds call back
- methods to be called before and after the execution of an HttpRequest.
- global_headers (dict): The global headers of the API which are sent with
- every request.
-
- """
-
- def global_headers(self):
- return {
- 'user-agent': 'python-sdk'
- }
-
- def __init__(self, config, call_back=None):
- self._config = config
- self._http_call_back = call_back
-
- @property
- def config(self):
- return self._config
-
- @property
- def http_call_back(self):
- return self._http_call_back
-
- def validate_parameters(self, **kwargs):
- """Validates required parameters of an endpoint.
-
- Args:
- kwargs (dict): A dictionary of the required parameters.
-
- """
- for name, value in kwargs.items():
- if value is None:
- raise ValueError("Required parameter {} cannot be None.".format(name))
-
- def execute_request(self, request, binary=False):
- """Executes an HttpRequest.
-
- Args:
- request (HttpRequest): The HttpRequest to execute.
- binary (bool): A flag which should be set to True if
- a binary response is expected.
-
- Returns:
- HttpResponse: The HttpResponse received.
-
- """
- # Invoke the on before request HttpCallBack if specified
- if self.http_call_back is not None:
- self.http_call_back.on_before_request(request)
-
- # Add global headers to request
- request.headers = APIHelper.merge_dicts(self.global_headers(), request.headers)
-
- # Invoke the API call to fetch the response.
- func = self.config.http_client.execute_as_binary if binary else self.config.http_client.execute_as_string
- response = func(request)
-
- # Invoke the on after response HttpCallBack if specified
- if self.http_call_back is not None:
- self.http_call_back.on_after_response(response)
-
- return response
-
- def validate_response(self, response):
- """Validates an HTTP response by checking for global errors.
-
- Args:
- response (HttpResponse): The HttpResponse of the API call.
-
- """
- if (response.status_code < 200) or (response.status_code > 208): # [200,208] = HTTP OK
- raise APIException('HTTP response not OK.', response)
diff --git a/bandwidth/voice/exceptions/__init__.py b/bandwidth/voice/exceptions/__init__.py
deleted file mode 100644
index 052dead3..00000000
--- a/bandwidth/voice/exceptions/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-__all__ = [
- 'api_error_exception',
-]
diff --git a/bandwidth/voice/exceptions/api_error_exception.py b/bandwidth/voice/exceptions/api_error_exception.py
deleted file mode 100644
index 995498b8..00000000
--- a/bandwidth/voice/exceptions/api_error_exception.py
+++ /dev/null
@@ -1,40 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-from bandwidth.api_helper import APIHelper
-import bandwidth.exceptions.api_exception
-
-
-class ApiErrorException(bandwidth.exceptions.api_exception.APIException):
- def __init__(self, reason, response):
- """Constructor for the ApiErrorException class
-
- Args:
- reason (string): The reason (or error message) for the Exception
- to be raised.
- response (HttpResponse): The HttpResponse of the API call.
-
- """
- super(ApiErrorException, self).__init__(reason, response)
- dictionary = APIHelper.json_deserialize(self.response.text)
- if isinstance(dictionary, dict):
- self.unbox(dictionary)
-
- def unbox(self, dictionary):
- """Populates the properties of this object by extracting them from a dictionary.
-
- Args:
- dictionary (dictionary): A dictionary representation of the object as
- obtained from the deserialization of the server's response. The keys
- MUST match property names in the API description.
-
- """
- self.mtype = dictionary.get('type')
- self.description = dictionary.get('description')
- self.id = dictionary.get('id')
diff --git a/bandwidth/voice/models/__init__.py b/bandwidth/voice/models/__init__.py
deleted file mode 100644
index 97a9d772..00000000
--- a/bandwidth/voice/models/__init__.py
+++ /dev/null
@@ -1,35 +0,0 @@
-__all__ = [
- 'create_call_request',
- 'create_call_response',
- 'call_state',
- 'modify_call_request',
- 'modify_call_recording_request',
- 'call_recording_metadata',
- 'modify_conference_request',
- 'conference_state',
- 'conference_member_state',
- 'conference_recording_metadata',
- 'machine_detection_configuration',
- 'transcribe_recording_request',
- 'transcription_response',
- 'transcription_metadata',
- 'transcript',
- 'call_callback',
- 'transcription',
- 'diversion',
- 'conference_callback',
- 'answer_fallback_method_enum',
- 'answer_method_enum',
- 'callback_method_enum',
- 'conference_event_method_enum',
- 'direction_enum',
- 'disconnect_method_enum',
- 'fallback_method_enum',
- 'file_format_enum',
- 'mode_enum',
- 'redirect_fallback_method_enum',
- 'redirect_method_enum',
- 'state_enum',
- 'state_1_enum',
- 'status_enum',
-]
diff --git a/bandwidth/voice/models/answer_fallback_method_enum.py b/bandwidth/voice/models/answer_fallback_method_enum.py
deleted file mode 100644
index 314a09c0..00000000
--- a/bandwidth/voice/models/answer_fallback_method_enum.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class AnswerFallbackMethodEnum(object):
-
- """Implementation of the 'AnswerFallbackMethod' enum.
-
- TODO: type enum description here.
-
- Attributes:
- POST: TODO: type description here.
- GET: TODO: type description here.
-
- """
-
- POST = 'POST'
-
- GET = 'GET'
diff --git a/bandwidth/voice/models/answer_method_enum.py b/bandwidth/voice/models/answer_method_enum.py
deleted file mode 100644
index bc286864..00000000
--- a/bandwidth/voice/models/answer_method_enum.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class AnswerMethodEnum(object):
-
- """Implementation of the 'AnswerMethod' enum.
-
- TODO: type enum description here.
-
- Attributes:
- POST: TODO: type description here.
- GET: TODO: type description here.
-
- """
-
- POST = 'POST'
-
- GET = 'GET'
diff --git a/bandwidth/voice/models/call_callback.py b/bandwidth/voice/models/call_callback.py
deleted file mode 100644
index 36ad4762..00000000
--- a/bandwidth/voice/models/call_callback.py
+++ /dev/null
@@ -1,233 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-from bandwidth.voice.models.diversion import Diversion
-from bandwidth.voice.models.transcription import Transcription
-
-
-class CallCallback(object):
-
- """Implementation of the 'CallCallback' model.
-
- This object represents all possible fields that may be included in
- callbacks related to call events, including events that come from BXML
- verbs
-
- Attributes:
- event_type (string): TODO: type description here.
- event_time (string): TODO: type description here.
- account_id (string): TODO: type description here.
- application_id (string): TODO: type description here.
- mfrom (string): TODO: type description here.
- to (string): TODO: type description here.
- direction (string): TODO: type description here.
- call_id (string): TODO: type description here.
- call_url (string): TODO: type description here.
- start_time (string): TODO: type description here.
- answer_time (string): TODO: type description here.
- transfer_caller_id (string): TODO: type description here.
- transfer_to (string): TODO: type description here.
- cause (string): TODO: type description here.
- error_message (string): TODO: type description here.
- error_id (string): TODO: type description here.
- end_time (string): TODO: type description here.
- digit (string): TODO: type description here.
- parent_call_id (string): TODO: type description here.
- recording_id (string): TODO: type description here.
- duration (string): TODO: type description here.
- file_format (string): TODO: type description here.
- media_url (string): TODO: type description here.
- tag (string): TODO: type description here.
- channels (int): TODO: type description here.
- status (string): TODO: type description here.
- digits (string): TODO: type description here.
- terminating_digit (string): TODO: type description here.
- transcription (Transcription): TODO: type description here.
- diversion (Diversion): TODO: type description here.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "event_type": 'eventType',
- "event_time": 'eventTime',
- "account_id": 'accountId',
- "application_id": 'applicationId',
- "mfrom": 'from',
- "to": 'to',
- "direction": 'direction',
- "call_id": 'callId',
- "call_url": 'callUrl',
- "start_time": 'startTime',
- "answer_time": 'answerTime',
- "transfer_caller_id": 'transferCallerId',
- "transfer_to": 'transferTo',
- "cause": 'cause',
- "error_message": 'errorMessage',
- "error_id": 'errorId',
- "end_time": 'endTime',
- "digit": 'digit',
- "parent_call_id": 'parentCallId',
- "recording_id": 'recordingId',
- "duration": 'duration',
- "file_format": 'fileFormat',
- "media_url": 'mediaUrl',
- "tag": 'tag',
- "channels": 'channels',
- "status": 'status',
- "digits": 'digits',
- "terminating_digit": 'terminatingDigit',
- "transcription": 'transcription',
- "diversion": 'diversion'
- }
-
- def __init__(self,
- event_type=None,
- event_time=None,
- account_id=None,
- application_id=None,
- mfrom=None,
- to=None,
- direction=None,
- call_id=None,
- call_url=None,
- start_time=None,
- answer_time=None,
- transfer_caller_id=None,
- transfer_to=None,
- cause=None,
- error_message=None,
- error_id=None,
- end_time=None,
- digit=None,
- parent_call_id=None,
- recording_id=None,
- duration=None,
- file_format=None,
- media_url=None,
- tag=None,
- channels=None,
- status=None,
- digits=None,
- terminating_digit=None,
- transcription=None,
- diversion=None):
- """Constructor for the CallCallback class"""
-
- # Initialize members of the class
- self.event_type = event_type
- self.event_time = event_time
- self.account_id = account_id
- self.application_id = application_id
- self.mfrom = mfrom
- self.to = to
- self.direction = direction
- self.call_id = call_id
- self.call_url = call_url
- self.start_time = start_time
- self.answer_time = answer_time
- self.transfer_caller_id = transfer_caller_id
- self.transfer_to = transfer_to
- self.cause = cause
- self.error_message = error_message
- self.error_id = error_id
- self.end_time = end_time
- self.digit = digit
- self.parent_call_id = parent_call_id
- self.recording_id = recording_id
- self.duration = duration
- self.file_format = file_format
- self.media_url = media_url
- self.tag = tag
- self.channels = channels
- self.status = status
- self.digits = digits
- self.terminating_digit = terminating_digit
- self.transcription = transcription
- self.diversion = diversion
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- event_type = dictionary.get('eventType')
- event_time = dictionary.get('eventTime')
- account_id = dictionary.get('accountId')
- application_id = dictionary.get('applicationId')
- mfrom = dictionary.get('from')
- to = dictionary.get('to')
- direction = dictionary.get('direction')
- call_id = dictionary.get('callId')
- call_url = dictionary.get('callUrl')
- start_time = dictionary.get('startTime')
- answer_time = dictionary.get('answerTime')
- transfer_caller_id = dictionary.get('transferCallerId')
- transfer_to = dictionary.get('transferTo')
- cause = dictionary.get('cause')
- error_message = dictionary.get('errorMessage')
- error_id = dictionary.get('errorId')
- end_time = dictionary.get('endTime')
- digit = dictionary.get('digit')
- parent_call_id = dictionary.get('parentCallId')
- recording_id = dictionary.get('recordingId')
- duration = dictionary.get('duration')
- file_format = dictionary.get('fileFormat')
- media_url = dictionary.get('mediaUrl')
- tag = dictionary.get('tag')
- channels = dictionary.get('channels')
- status = dictionary.get('status')
- digits = dictionary.get('digits')
- terminating_digit = dictionary.get('terminatingDigit')
- transcription = Transcription.from_dictionary(dictionary.get('transcription')) if dictionary.get('transcription') else None
- diversion = Diversion.from_dictionary(dictionary.get('diversion')) if dictionary.get('diversion') else None
-
- # Return an object of this model
- return cls(event_type,
- event_time,
- account_id,
- application_id,
- mfrom,
- 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)
diff --git a/bandwidth/voice/models/call_recording_metadata.py b/bandwidth/voice/models/call_recording_metadata.py
deleted file mode 100644
index 81e67d58..00000000
--- a/bandwidth/voice/models/call_recording_metadata.py
+++ /dev/null
@@ -1,162 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-from bandwidth.api_helper import APIHelper
-from bandwidth.voice.models.transcription_metadata import TranscriptionMetadata
-
-
-class CallRecordingMetadata(object):
-
- """Implementation of the 'CallRecordingMetadata' model.
-
- TODO: type model description here.
-
- Attributes:
- application_id (string): TODO: type description here.
- account_id (string): TODO: type description here.
- call_id (string): TODO: type description here.
- parent_call_id (string): TODO: type description here.
- recording_id (string): TODO: type description here.
- to (string): TODO: type description here.
- mfrom (string): TODO: type description here.
- transfer_caller_id (string): TODO: type description here.
- transfer_to (string): TODO: type description here.
- duration (string): Format is ISO-8601
- direction (DirectionEnum): TODO: type description here.
- channels (int): TODO: type description here.
- start_time (datetime): TODO: type description here.
- end_time (datetime): TODO: type description here.
- file_format (FileFormatEnum): TODO: type description here.
- status (string): 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.
- media_url (string): TODO: type description here.
- transcription (TranscriptionMetadata): TODO: type description here.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "application_id": 'applicationId',
- "account_id": 'accountId',
- "call_id": 'callId',
- "parent_call_id": 'parentCallId',
- "recording_id": 'recordingId',
- "to": 'to',
- "mfrom": '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'
- }
-
- def __init__(self,
- application_id=None,
- account_id=None,
- call_id=None,
- parent_call_id=None,
- recording_id=None,
- to=None,
- mfrom=None,
- transfer_caller_id=None,
- transfer_to=None,
- duration=None,
- direction=None,
- channels=None,
- start_time=None,
- end_time=None,
- file_format=None,
- status=None,
- media_url=None,
- transcription=None):
- """Constructor for the CallRecordingMetadata class"""
-
- # Initialize members of the class
- self.application_id = application_id
- self.account_id = account_id
- self.call_id = call_id
- self.parent_call_id = parent_call_id
- self.recording_id = recording_id
- self.to = to
- self.mfrom = mfrom
- self.transfer_caller_id = transfer_caller_id
- self.transfer_to = transfer_to
- self.duration = duration
- self.direction = direction
- self.channels = channels
- self.start_time = APIHelper.RFC3339DateTime(start_time) if start_time else None
- self.end_time = APIHelper.RFC3339DateTime(end_time) if end_time else None
- self.file_format = file_format
- self.status = status
- self.media_url = media_url
- self.transcription = transcription
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- application_id = dictionary.get('applicationId')
- account_id = dictionary.get('accountId')
- call_id = dictionary.get('callId')
- parent_call_id = dictionary.get('parentCallId')
- recording_id = dictionary.get('recordingId')
- to = dictionary.get('to')
- mfrom = dictionary.get('from')
- transfer_caller_id = dictionary.get('transferCallerId')
- transfer_to = dictionary.get('transferTo')
- duration = dictionary.get('duration')
- direction = dictionary.get('direction')
- channels = dictionary.get('channels')
- start_time = APIHelper.RFC3339DateTime.from_value(dictionary.get("startTime")).datetime if dictionary.get("startTime") else None
- end_time = APIHelper.RFC3339DateTime.from_value(dictionary.get("endTime")).datetime if dictionary.get("endTime") else None
- file_format = dictionary.get('fileFormat')
- status = dictionary.get('status')
- media_url = dictionary.get('mediaUrl')
- transcription = TranscriptionMetadata.from_dictionary(dictionary.get('transcription')) if dictionary.get('transcription') else None
-
- # Return an object of this model
- return cls(application_id,
- account_id,
- call_id,
- parent_call_id,
- recording_id,
- to,
- mfrom,
- transfer_caller_id,
- transfer_to,
- duration,
- direction,
- channels,
- start_time,
- end_time,
- file_format,
- status,
- media_url,
- transcription)
diff --git a/bandwidth/voice/models/call_state.py b/bandwidth/voice/models/call_state.py
deleted file mode 100644
index b4fafde3..00000000
--- a/bandwidth/voice/models/call_state.py
+++ /dev/null
@@ -1,166 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-from bandwidth.api_helper import APIHelper
-
-
-class CallState(object):
-
- """Implementation of the 'CallState' model.
-
- TODO: type model description here.
-
- Attributes:
- call_id (string): TODO: type description here.
- parent_call_id (string): TODO: type description here.
- application_id (string): TODO: type description here.
- account_id (string): TODO: type description here.
- to (string): TODO: type description here.
- mfrom (string): TODO: type description here.
- direction (string): TODO: type description here.
- state (string): 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.
- identity (string): TODO: type description here.
- stir_shaken (dict): TODO: type description here.
- start_time (datetime): TODO: type description here.
- answer_time (datetime): TODO: type description here.
- end_time (datetime): TODO: type description here.
- disconnect_cause (string): 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.
- error_message (string): TODO: type description here.
- error_id (string): TODO: type description here.
- last_update (datetime): TODO: type description here.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "call_id": 'callId',
- "parent_call_id": 'parentCallId',
- "application_id": 'applicationId',
- "account_id": 'accountId',
- "to": 'to',
- "mfrom": 'from',
- "direction": 'direction',
- "state": 'state',
- "identity": 'identity',
- "stir_shaken": 'stirShaken',
- "start_time": 'startTime',
- "enqueued_time": 'enqueuedTime',
- "answer_time": 'answerTime',
- "end_time": 'endTime',
- "disconnect_cause": 'disconnectCause',
- "error_message": 'errorMessage',
- "error_id": 'errorId',
- "last_update": 'lastUpdate'
- }
-
- def __init__(self,
- call_id=None,
- parent_call_id=None,
- application_id=None,
- account_id=None,
- to=None,
- mfrom=None,
- direction=None,
- state=None,
- identity=None,
- stir_shaken=None,
- start_time=None,
- enqueued_time=None,
- answer_time=None,
- end_time=None,
- disconnect_cause=None,
- error_message=None,
- error_id=None,
- last_update=None):
- """Constructor for the CallState class"""
-
- # Initialize members of the class
- self.call_id = call_id
- self.parent_call_id = parent_call_id
- self.application_id = application_id
- self.account_id = account_id
- self.to = to
- self.mfrom = mfrom
- self.direction = direction
- self.state = state
- self.identity = identity
- self.stir_shaken = stir_shaken
- self.start_time = APIHelper.RFC3339DateTime(start_time) if start_time else None
- self.enqueued_time = APIHelper.RFC3339DateTime(enqueued_time) if enqueued_time else None
- self.answer_time = APIHelper.RFC3339DateTime(answer_time) if answer_time else None
- self.end_time = APIHelper.RFC3339DateTime(end_time) if end_time else None
- self.disconnect_cause = disconnect_cause
- self.error_message = error_message
- self.error_id = error_id
- self.last_update = APIHelper.RFC3339DateTime(last_update) if last_update else None
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- call_id = dictionary.get('callId')
- parent_call_id = dictionary.get('parentCallId')
- application_id = dictionary.get('applicationId')
- account_id = dictionary.get('accountId')
- to = dictionary.get('to')
- mfrom = dictionary.get('from')
- direction = dictionary.get('direction')
- state = dictionary.get('state')
- identity = dictionary.get('identity')
- stir_shaken = dictionary.get('stirShaken')
- start_time = APIHelper.RFC3339DateTime.from_value(dictionary.get("startTime")).datetime if dictionary.get("startTime") else None
- enqueued_time = APIHelper.RFC3339DateTime.from_value(dictionary.get("enqueuedTime")).datetime if dictionary.get("enqueuedTime") else None
- answer_time = APIHelper.RFC3339DateTime.from_value(dictionary.get("answerTime")).datetime if dictionary.get("answerTime") else None
- end_time = APIHelper.RFC3339DateTime.from_value(dictionary.get("endTime")).datetime if dictionary.get("endTime") else None
- disconnect_cause = dictionary.get('disconnectCause')
- error_message = dictionary.get('errorMessage')
- error_id = dictionary.get('errorId')
- last_update = APIHelper.RFC3339DateTime.from_value(dictionary.get("lastUpdate")).datetime if dictionary.get("lastUpdate") else None
-
- # Return an object of this model
- return cls(call_id,
- parent_call_id,
- application_id,
- account_id,
- to,
- mfrom,
- direction,
- state,
- identity,
- stir_shaken,
- start_time,
- enqueued_time,
- answer_time,
- end_time,
- disconnect_cause,
- error_message,
- error_id,
- last_update)
diff --git a/bandwidth/voice/models/callback_method_enum.py b/bandwidth/voice/models/callback_method_enum.py
deleted file mode 100644
index b7b27b07..00000000
--- a/bandwidth/voice/models/callback_method_enum.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class CallbackMethodEnum(object):
-
- """Implementation of the 'CallbackMethod' enum.
-
- TODO: type enum description here.
-
- Attributes:
- POST: TODO: type description here.
- GET: TODO: type description here.
-
- """
-
- POST = 'POST'
-
- GET = 'GET'
diff --git a/bandwidth/voice/models/conference_callback.py b/bandwidth/voice/models/conference_callback.py
deleted file mode 100644
index 3ab33016..00000000
--- a/bandwidth/voice/models/conference_callback.py
+++ /dev/null
@@ -1,152 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class ConferenceCallback(object):
-
- """Implementation of the 'ConferenceCallback' model.
-
- This object represents all possible fields that may be included in
- callbacks related to conference events
-
- Attributes:
- conference_id (string): TODO: type description here.
- name (string): TODO: type description here.
- event_type (string): TODO: type description here.
- event_time (string): TODO: type description here.
- tag (string): TODO: type description here.
- call_id (string): TODO: type description here.
- to (string): TODO: type description here.
- mfrom (string): TODO: type description here.
- account_id (string): TODO: type description here.
- recording_id (string): TODO: type description here.
- channels (int): TODO: type description here.
- start_time (string): TODO: type description here.
- end_time (string): TODO: type description here.
- duration (string): TODO: type description here.
- file_format (string): TODO: type description here.
- media_url (string): TODO: type description here.
- status (string): TODO: type description here.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "conference_id": 'conferenceId',
- "name": 'name',
- "event_type": 'eventType',
- "event_time": 'eventTime',
- "tag": 'tag',
- "call_id": 'callId',
- "to": 'to',
- "mfrom": 'from',
- "account_id": 'accountId',
- "recording_id": 'recordingId',
- "channels": 'channels',
- "start_time": 'startTime',
- "end_time": 'endTime',
- "duration": 'duration',
- "file_format": 'fileFormat',
- "media_url": 'mediaUrl',
- "status": 'status'
- }
-
- def __init__(self,
- conference_id=None,
- name=None,
- event_type=None,
- event_time=None,
- tag=None,
- call_id=None,
- to=None,
- mfrom=None,
- account_id=None,
- recording_id=None,
- channels=None,
- start_time=None,
- end_time=None,
- duration=None,
- file_format=None,
- media_url=None,
- status=None):
- """Constructor for the ConferenceCallback class"""
-
- # Initialize members of the class
- self.conference_id = conference_id
- self.name = name
- self.event_type = event_type
- self.event_time = event_time
- self.tag = tag
- self.call_id = call_id
- self.to = to
- self.mfrom = mfrom
- self.account_id = account_id
- self.recording_id = recording_id
- self.channels = channels
- self.start_time = start_time
- self.end_time = end_time
- self.duration = duration
- self.file_format = file_format
- self.media_url = media_url
- self.status = status
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- conference_id = dictionary.get('conferenceId')
- name = dictionary.get('name')
- event_type = dictionary.get('eventType')
- event_time = dictionary.get('eventTime')
- tag = dictionary.get('tag')
- call_id = dictionary.get('callId')
- to = dictionary.get('to')
- mfrom = dictionary.get('from')
- account_id = dictionary.get('accountId')
- recording_id = dictionary.get('recordingId')
- channels = dictionary.get('channels')
- start_time = dictionary.get('startTime')
- end_time = dictionary.get('endTime')
- duration = dictionary.get('duration')
- file_format = dictionary.get('fileFormat')
- media_url = dictionary.get('mediaUrl')
- status = dictionary.get('status')
-
- # Return an object of this model
- return cls(conference_id,
- name,
- event_type,
- event_time,
- tag,
- call_id,
- to,
- mfrom,
- account_id,
- recording_id,
- channels,
- start_time,
- end_time,
- duration,
- file_format,
- media_url,
- status)
diff --git a/bandwidth/voice/models/conference_event_method_enum.py b/bandwidth/voice/models/conference_event_method_enum.py
deleted file mode 100644
index 5df03d66..00000000
--- a/bandwidth/voice/models/conference_event_method_enum.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class ConferenceEventMethodEnum(object):
-
- """Implementation of the 'ConferenceEventMethod' enum.
-
- TODO: type enum description here.
-
- Attributes:
- POST: TODO: type description here.
- GET: TODO: type description here.
-
- """
-
- POST = 'POST'
-
- GET = 'GET'
diff --git a/bandwidth/voice/models/conference_member_state.py b/bandwidth/voice/models/conference_member_state.py
deleted file mode 100644
index 04a42939..00000000
--- a/bandwidth/voice/models/conference_member_state.py
+++ /dev/null
@@ -1,85 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class ConferenceMemberState(object):
-
- """Implementation of the 'ConferenceMemberState' model.
-
- TODO: type model description here.
-
- Attributes:
- call_id (string): TODO: type description here.
- conference_id (string): TODO: type description here.
- member_url (string): TODO: type description here.
- mute (bool): TODO: type description here.
- hold (bool): TODO: type description here.
- call_ids_to_coach (list of string): TODO: type description here.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "call_id": 'callId',
- "conference_id": 'conferenceId',
- "member_url": 'memberUrl',
- "mute": 'mute',
- "hold": 'hold',
- "call_ids_to_coach": 'callIdsToCoach'
- }
-
- def __init__(self,
- call_id=None,
- conference_id=None,
- member_url=None,
- mute=None,
- hold=None,
- call_ids_to_coach=None):
- """Constructor for the ConferenceMemberState class"""
-
- # Initialize members of the class
- self.call_id = call_id
- self.conference_id = conference_id
- self.member_url = member_url
- self.mute = mute
- self.hold = hold
- self.call_ids_to_coach = call_ids_to_coach
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- call_id = dictionary.get('callId')
- conference_id = dictionary.get('conferenceId')
- member_url = dictionary.get('memberUrl')
- mute = dictionary.get('mute')
- hold = dictionary.get('hold')
- call_ids_to_coach = dictionary.get('callIdsToCoach')
-
- # Return an object of this model
- return cls(call_id,
- conference_id,
- member_url,
- mute,
- hold,
- call_ids_to_coach)
diff --git a/bandwidth/voice/models/conference_recording_metadata.py b/bandwidth/voice/models/conference_recording_metadata.py
deleted file mode 100644
index e29d03c4..00000000
--- a/bandwidth/voice/models/conference_recording_metadata.py
+++ /dev/null
@@ -1,119 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-from bandwidth.api_helper import APIHelper
-
-
-class ConferenceRecordingMetadata(object):
-
- """Implementation of the 'ConferenceRecordingMetadata' model.
-
- TODO: type model description here.
-
- Attributes:
- account_id (string): TODO: type description here.
- conference_id (string): TODO: type description here.
- name (string): TODO: type description here.
- recording_id (string): TODO: type description here.
- duration (string): Format is ISO-8601
- channels (int): TODO: type description here.
- start_time (datetime): TODO: type description here.
- end_time (datetime): TODO: type description here.
- file_format (FileFormatEnum): TODO: type description here.
- status (string): 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.
- media_url (string): TODO: type description here.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "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'
- }
-
- def __init__(self,
- account_id=None,
- conference_id=None,
- name=None,
- recording_id=None,
- duration=None,
- channels=None,
- start_time=None,
- end_time=None,
- file_format=None,
- status=None,
- media_url=None):
- """Constructor for the ConferenceRecordingMetadata class"""
-
- # Initialize members of the class
- self.account_id = account_id
- self.conference_id = conference_id
- self.name = name
- self.recording_id = recording_id
- self.duration = duration
- self.channels = channels
- self.start_time = APIHelper.RFC3339DateTime(start_time) if start_time else None
- self.end_time = APIHelper.RFC3339DateTime(end_time) if end_time else None
- self.file_format = file_format
- self.status = status
- self.media_url = media_url
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- account_id = dictionary.get('accountId')
- conference_id = dictionary.get('conferenceId')
- name = dictionary.get('name')
- recording_id = dictionary.get('recordingId')
- duration = dictionary.get('duration')
- channels = dictionary.get('channels')
- start_time = APIHelper.RFC3339DateTime.from_value(dictionary.get("startTime")).datetime if dictionary.get("startTime") else None
- end_time = APIHelper.RFC3339DateTime.from_value(dictionary.get("endTime")).datetime if dictionary.get("endTime") else None
- file_format = dictionary.get('fileFormat')
- status = dictionary.get('status')
- media_url = dictionary.get('mediaUrl')
-
- # Return an object of this model
- return cls(account_id,
- conference_id,
- name,
- recording_id,
- duration,
- channels,
- start_time,
- end_time,
- file_format,
- status,
- media_url)
diff --git a/bandwidth/voice/models/conference_state.py b/bandwidth/voice/models/conference_state.py
deleted file mode 100644
index 9d292bda..00000000
--- a/bandwidth/voice/models/conference_state.py
+++ /dev/null
@@ -1,103 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-from bandwidth.api_helper import APIHelper
-from bandwidth.voice.models.conference_member_state import ConferenceMemberState
-
-
-class ConferenceState(object):
-
- """Implementation of the 'ConferenceState' model.
-
- TODO: type model description here.
-
- Attributes:
- id (string): TODO: type description here.
- name (string): TODO: type description here.
- created_time (datetime): TODO: type description here.
- completed_time (datetime): TODO: type description here.
- conference_event_url (string): TODO: type description here.
- conference_event_method (ConferenceEventMethodEnum): TODO: type
- description here.
- tag (string): TODO: type description here.
- active_members (list of ConferenceMemberState): TODO: type description
- here.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "id": 'id',
- "name": 'name',
- "created_time": 'createdTime',
- "completed_time": 'completedTime',
- "conference_event_url": 'conferenceEventUrl',
- "conference_event_method": 'conferenceEventMethod',
- "tag": 'tag',
- "active_members": 'activeMembers'
- }
-
- def __init__(self,
- id=None,
- name=None,
- created_time=None,
- completed_time=None,
- conference_event_url=None,
- conference_event_method=None,
- tag=None,
- active_members=None):
- """Constructor for the ConferenceState class"""
-
- # Initialize members of the class
- self.id = id
- self.name = name
- self.created_time = APIHelper.RFC3339DateTime(created_time) if created_time else None
- self.completed_time = APIHelper.RFC3339DateTime(completed_time) if completed_time else None
- self.conference_event_url = conference_event_url
- self.conference_event_method = conference_event_method
- self.tag = tag
- self.active_members = active_members
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- id = dictionary.get('id')
- name = dictionary.get('name')
- created_time = APIHelper.RFC3339DateTime.from_value(dictionary.get("createdTime")).datetime if dictionary.get("createdTime") else None
- completed_time = APIHelper.RFC3339DateTime.from_value(dictionary.get("completedTime")).datetime if dictionary.get("completedTime") else None
- conference_event_url = dictionary.get('conferenceEventUrl')
- conference_event_method = dictionary.get('conferenceEventMethod')
- tag = dictionary.get('tag')
- active_members = None
- if dictionary.get('activeMembers') is not None:
- active_members = [ConferenceMemberState.from_dictionary(x) for x in dictionary.get('activeMembers')]
-
- # Return an object of this model
- return cls(id,
- name,
- created_time,
- completed_time,
- conference_event_url,
- conference_event_method,
- tag,
- active_members)
diff --git a/bandwidth/voice/models/create_call_request.py b/bandwidth/voice/models/create_call_request.py
deleted file mode 100644
index 683b4d87..00000000
--- a/bandwidth/voice/models/create_call_request.py
+++ /dev/null
@@ -1,173 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-from bandwidth.voice.models.machine_detection_configuration import MachineDetectionConfiguration
-
-
-class CreateCallRequest(object):
-
- """Implementation of the 'CreateCallRequest' model.
-
- TODO: type model description here.
-
- Attributes:
- mfrom (string): Format is E164
- to (string): Format is E164 or SIP URI
- 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
- https://tools.ietf.org/html/rfc7433. Only 'jwt' and 'base64'
- encodings are allowed. The entire value cannot exceed 350
- characters, including parameters and separators.
- call_timeout (float): TODO: type description here.
- callback_timeout (float): TODO: type description here.
- answer_url (string): TODO: type description here.
- answer_fallback_url (string): TODO: type description here.
- username (string): TODO: type description here.
- password (string): TODO: type description here.
- fallback_username (string): TODO: type description here.
- fallback_password (string): TODO: type description here.
- answer_method (AnswerMethodEnum): TODO: type description here.
- answer_fallback_method (AnswerFallbackMethodEnum): TODO: type
- description here.
- disconnect_url (string): TODO: type description here.
- disconnect_method (DisconnectMethodEnum): TODO: type description
- here.
- tag (string): TODO: type description here.
- application_id (string): TODO: type description here.
- machine_detection (MachineDetectionConfiguration): TODO: type description
- here.
- priority (int): 1-5. The priority of this call over other calls from
- your account when outbound call queueing is enabled.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "mfrom": 'from',
- "to": 'to',
- "answer_url": 'answerUrl',
- "application_id": 'applicationId',
- "uui": 'uui',
- "call_timeout": 'callTimeout',
- "callback_timeout": 'callbackTimeout',
- "answer_fallback_url": 'answerFallbackUrl',
- "username": 'username',
- "password": 'password',
- "fallback_username": 'fallbackUsername',
- "fallback_password": 'fallbackPassword',
- "answer_method": 'answerMethod',
- "answer_fallback_method": 'answerFallbackMethod',
- "disconnect_url": 'disconnectUrl',
- "disconnect_method": 'disconnectMethod',
- "tag": 'tag',
- "machine_detection": 'machineDetection',
- "priority": "priority"
- }
-
- def __init__(self,
- mfrom=None,
- to=None,
- answer_url=None,
- application_id=None,
- uui=None,
- call_timeout=None,
- callback_timeout=None,
- answer_fallback_url=None,
- username=None,
- password=None,
- fallback_username=None,
- fallback_password=None,
- answer_method=None,
- answer_fallback_method=None,
- disconnect_url=None,
- disconnect_method=None,
- tag=None,
- machine_detection=None,
- priority=None):
- """Constructor for the CreateCallRequest class"""
-
- # Initialize members of the class
- self.mfrom = mfrom
- self.to = to
- self.uui = uui
- self.call_timeout = call_timeout
- self.callback_timeout = callback_timeout
- self.answer_url = answer_url
- self.answer_fallback_url = answer_fallback_url
- self.username = username
- self.password = password
- self.fallback_username = fallback_username
- self.fallback_password = fallback_password
- self.answer_method = answer_method
- self.answer_fallback_method = answer_fallback_method
- self.disconnect_url = disconnect_url
- self.disconnect_method = disconnect_method
- self.tag = tag
- self.application_id = application_id
- self.machine_detection = machine_detection
- self.priority=priority
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- mfrom = dictionary.get('from')
- to = dictionary.get('to')
- answer_url = dictionary.get('answerUrl')
- application_id = dictionary.get('applicationId')
- uui = dictionary.get('uui')
- call_timeout = dictionary.get('callTimeout')
- callback_timeout = dictionary.get('callbackTimeout')
- answer_fallback_url = dictionary.get('answerFallbackUrl')
- username = dictionary.get('username')
- password = dictionary.get('password')
- fallback_username = dictionary.get('fallbackUsername')
- fallback_password = dictionary.get('fallbackPassword')
- answer_method = dictionary.get('answerMethod')
- answer_fallback_method = dictionary.get('answerFallbackMethod')
- disconnect_url = dictionary.get('disconnectUrl')
- disconnect_method = dictionary.get('disconnectMethod')
- tag = dictionary.get('tag')
- machine_detection = MachineDetectionConfiguration.from_dictionary(dictionary.get('machineDetection')) if dictionary.get('machineDetection') else None
- priority = dictionary.get('priority')
-
- # Return an object of this model
- return cls(mfrom,
- 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)
diff --git a/bandwidth/voice/models/create_call_response.py b/bandwidth/voice/models/create_call_response.py
deleted file mode 100644
index f3063a74..00000000
--- a/bandwidth/voice/models/create_call_response.py
+++ /dev/null
@@ -1,181 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-from bandwidth.api_helper import APIHelper
-from bandwidth.voice.models.machine_detection_configuration import MachineDetectionConfiguration
-
-
-class CreateCallResponse(object):
-
- """Implementation of the 'CreateCallResponse' model.
-
- TODO: type model description here.
-
- Attributes:
- account_id (string): TODO: type description here.
- call_id (string): TODO: type description here.
- application_id (string): TODO: type description here.
- to (string): TODO: type description here.
- mfrom (string): TODO: type description here.
- enqueued_time (datetime): TODO
- call_url (string): TODO: type description here.
- call_timeout (float): TODO: type description here.
- callback_timeout (float): TODO: type description here.
- answer_url (string): TODO: type description here.
- answer_method (AnswerMethodEnum): TODO: type description here.
- answer_fallback_url (string): TODO: type description here.
- answer_fallback_method (AnswerFallbackMethodEnum): TODO: type
- description here.
- disconnect_url (string): TODO: type description here.
- disconnect_method (DisconnectMethodEnum): TODO: type description
- here.
- username (string): TODO: type description here.
- password (string): TODO: type description here.
- fallback_username (string): TODO: type description here.
- fallback_password (string): TODO: type description here.
- tag (string): TODO: type description here.
- priority (int): TODO: type description here.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "account_id": 'accountId',
- "call_id": 'callId',
- "application_id": 'applicationId',
- "to": 'to',
- "mfrom": 'from',
- "call_url": 'callUrl',
- "answer_url": 'answerUrl',
- "answer_method": 'answerMethod',
- "disconnect_method": 'disconnectMethod',
- "enqueued_time": 'enqueuedTime',
- "call_timeout": 'callTimeout',
- "callback_timeout": 'callbackTimeout',
- "answer_fallback_url": 'answerFallbackUrl',
- "answer_fallback_method": 'answerFallbackMethod',
- "disconnect_url": 'disconnectUrl',
- "username": 'username',
- "password": 'password',
- "fallback_username": 'fallbackUsername',
- "fallback_password": 'fallbackPassword',
- "tag": 'tag',
- "machine_detection": 'machineDetection',
- "priority": 'priority'
- }
-
- def __init__(self,
- account_id=None,
- call_id=None,
- application_id=None,
- to=None,
- mfrom=None,
- call_url=None,
- answer_url=None,
- answer_method=None,
- disconnect_method=None,
- enqueued_time=None,
- call_timeout=None,
- callback_timeout=None,
- answer_fallback_url=None,
- answer_fallback_method=None,
- disconnect_url=None,
- username=None,
- password=None,
- fallback_username=None,
- fallback_password=None,
- tag=None,
- priority=None):
- """Constructor for the CreateCallResponse class"""
-
- # Initialize members of the class
- self.account_id = account_id
- self.call_id = call_id
- self.application_id = application_id
- self.to = to
- self.mfrom = mfrom
- self.enqueued_time = APIHelper.RFC3339DateTime(enqueued_time) if enqueued_time else None,
- self.enqueued_time = enqueued_time
- self.call_url = call_url
- self.call_timeout = call_timeout
- self.callback_timeout = callback_timeout
- self.answer_url = answer_url
- self.answer_method = answer_method
- self.answer_fallback_url = answer_fallback_url
- self.answer_fallback_method = answer_fallback_method
- self.disconnect_url = disconnect_url
- self.disconnect_method = disconnect_method
- self.username = username
- self.password = password
- self.fallback_username = fallback_username
- self.fallback_password = fallback_password
- self.tag = tag
- self.priority = priority
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- account_id = dictionary.get('accountId')
- call_id = dictionary.get('callId')
- application_id = dictionary.get('applicationId')
- to = dictionary.get('to')
- mfrom = dictionary.get('from')
- call_url = dictionary.get('callUrl')
- answer_url = dictionary.get('answerUrl')
- answer_method = dictionary.get('answerMethod')
- disconnect_method = dictionary.get('disconnectMethod')
- enqueued_time = APIHelper.RFC3339DateTime.from_value(dictionary.get("enqueuedTime")).datetime if dictionary.get("enqueuedTime") else None
- call_timeout = dictionary.get('callTimeout')
- callback_timeout = dictionary.get('callbackTimeout')
- answer_fallback_url = dictionary.get('answerFallbackUrl')
- answer_fallback_method = dictionary.get('answerFallbackMethod')
- disconnect_url = dictionary.get('disconnectUrl')
- username = dictionary.get('username')
- password = dictionary.get('password')
- fallback_username = dictionary.get('fallbackUsername')
- fallback_password = dictionary.get('fallbackPassword')
- tag = dictionary.get('tag')
- priority = dictionary.get('priority')
-
- # Return an object of this model
- return cls(account_id,
- call_id,
- application_id,
- to,
- mfrom,
- 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)
diff --git a/bandwidth/voice/models/direction_enum.py b/bandwidth/voice/models/direction_enum.py
deleted file mode 100644
index 494321e3..00000000
--- a/bandwidth/voice/models/direction_enum.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class DirectionEnum(object):
-
- """Implementation of the 'Direction' enum.
-
- TODO: type enum description here.
-
- Attributes:
- INBOUND: TODO: type description here.
- OUTBOUND: TODO: type description here.
-
- """
-
- INBOUND = 'inbound'
-
- OUTBOUND = 'outbound'
diff --git a/bandwidth/voice/models/disconnect_method_enum.py b/bandwidth/voice/models/disconnect_method_enum.py
deleted file mode 100644
index 59f5066c..00000000
--- a/bandwidth/voice/models/disconnect_method_enum.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class DisconnectMethodEnum(object):
-
- """Implementation of the 'DisconnectMethod' enum.
-
- TODO: type enum description here.
-
- Attributes:
- POST: TODO: type description here.
- GET: TODO: type description here.
-
- """
-
- POST = 'POST'
-
- GET = 'GET'
diff --git a/bandwidth/voice/models/diversion.py b/bandwidth/voice/models/diversion.py
deleted file mode 100644
index 1a99140e..00000000
--- a/bandwidth/voice/models/diversion.py
+++ /dev/null
@@ -1,73 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class Diversion(object):
-
- """Implementation of the 'Diversion' model.
-
- TODO: type model description here.
-
- Attributes:
- reason (string): TODO: type description here.
- privacy (string): TODO: type description here.
- unknown (string): TODO: type description here.
- orig_to (string): TODO: type description here.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "reason": 'reason',
- "privacy": 'privacy',
- "unknown": 'unknown',
- "orig_to": 'origTo'
- }
-
- def __init__(self,
- reason=None,
- privacy=None,
- unknown=None,
- orig_to=None):
- """Constructor for the Diversion class"""
-
- # Initialize members of the class
- self.reason = reason
- self.privacy = privacy
- self.unknown = unknown
- self.orig_to = orig_to
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- reason = dictionary.get('reason')
- privacy = dictionary.get('privacy')
- unknown = dictionary.get('unknown')
- orig_to = dictionary.get('origTo')
-
- # Return an object of this model
- return cls(reason,
- privacy,
- unknown,
- orig_to)
diff --git a/bandwidth/voice/models/fallback_method_enum.py b/bandwidth/voice/models/fallback_method_enum.py
deleted file mode 100644
index 0b5e0ed6..00000000
--- a/bandwidth/voice/models/fallback_method_enum.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class FallbackMethodEnum(object):
-
- """Implementation of the 'FallbackMethod' enum.
-
- TODO: type enum description here.
-
- Attributes:
- POST: TODO: type description here.
- GET: TODO: type description here.
-
- """
-
- POST = 'POST'
-
- GET = 'GET'
diff --git a/bandwidth/voice/models/file_format_enum.py b/bandwidth/voice/models/file_format_enum.py
deleted file mode 100644
index 14fcd48f..00000000
--- a/bandwidth/voice/models/file_format_enum.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class FileFormatEnum(object):
-
- """Implementation of the 'FileFormat' enum.
-
- TODO: type enum description here.
-
- Attributes:
- MP3: TODO: type description here.
- WAV: TODO: type description here.
-
- """
-
- MP3 = 'mp3'
-
- WAV = 'wav'
diff --git a/bandwidth/voice/models/machine_detection_configuration.py b/bandwidth/voice/models/machine_detection_configuration.py
deleted file mode 100644
index d4c1120f..00000000
--- a/bandwidth/voice/models/machine_detection_configuration.py
+++ /dev/null
@@ -1,159 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class MachineDetectionConfiguration(object):
-
- """Implementation of the 'MachineDetectionRequest' model.
-
- TODO: type model description here.
-
- Attributes:
- mode (ModeEnum): 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'.
- detection_timeout (float): Total amount of time (in seconds) before
- giving up.
- silence_timeout (float): If no speech is detected in this period, a
- callback with a 'silence' result is sent. Default is 10 seconds.
- 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'. Default is 10 seconds.
- speech_end_threshold (float): Amount of silence (in seconds) before
- assuming the callee has finished speaking.
- machine_speech_end_threshold (float): When an answering machine is
- detected, the amount of silence (in seconds) before assuming the
- message has finished playing.
- delay_result (bool): If set to 'true' and if an answering machine is
- detected, the 'answering-machine' callback will be delayed until
- the machine is done speaking or until the 'detectionTimeout' is
- exceeded. If false, the 'answering-machine' result is sent
- immediately. Default is 'false'.
- callback_url (string): The URL to send the 'machineDetectionComplete'
- callback when the detection is completed. Only for 'async' mode.
- callback_method (CallbackMethodEnum): TODO: type description here.
- fallback_url (string): TODO: type description here.
- fallback_method (FallbackMethodEnum): TODO: type description here.
- username (string): TODO: type description here.
- password (string): TODO: type description here.
- fallback_username (string): TODO: type description here.
- fallback_password (string): TODO: type description here.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "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',
- "fallback_url": 'fallbackUrl',
- "fallback_method": 'fallbackMethod',
- "username": 'username',
- "password": 'password',
- "fallback_username": 'fallbackUsername',
- "fallback_password": 'fallbackPassword'
- }
-
- def __init__(self,
- mode=None,
- detection_timeout=None,
- silence_timeout=None,
- speech_threshold=None,
- speech_end_threshold=None,
- machine_speech_end_threshold = None,
- delay_result=None,
- callback_url=None,
- callback_method=None,
- fallback_url=None,
- fallback_method=None,
- username=None,
- password=None,
- fallback_username=None,
- fallback_password=None):
- """Constructor for the MachineDetectionRequest class"""
-
- # Initialize members of the class
- self.mode = mode
- self.detection_timeout = detection_timeout
- self.silence_timeout = silence_timeout
- self.speech_threshold = speech_threshold
- self.speech_end_threshold = speech_end_threshold
- self.machine_speech_end_threshold = machine_speech_end_threshold
- self.delay_result = delay_result
- self.callback_url = callback_url
- self.callback_method = callback_method
- self.fallback_url = fallback_url
- self.fallback_method = fallback_method
- self.username = username
- self.password = password
- self.fallback_username = fallback_username
- self.fallback_password = fallback_password
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- mode = dictionary.get('mode')
- detection_timeout = dictionary.get('detectionTimeout')
- silence_timeout = dictionary.get('silenceTimeout')
- speech_threshold = dictionary.get('speechThreshold')
- speech_end_threshold = dictionary.get('speechEndThreshold')
- machine_speech_end_threshold = dictionary.get('machineSpeechEndThreshold')
- delay_result = dictionary.get('delayResult')
- callback_url = dictionary.get('callbackUrl')
- callback_method = dictionary.get('callbackMethod')
- fallback_url = dictionary.get('fallbackUrl')
- fallback_method = dictionary.get('fallbackMethod')
- username = dictionary.get('username')
- password = dictionary.get('password')
- fallback_username = dictionary.get('fallbackUsername')
- fallback_password = dictionary.get('fallbackPassword')
-
- # Return an object of this model
- return cls(mode,
- detection_timeout,
- silence_timeout,
- speech_threshold,
- speech_end_threshold,
- machine_speech_end_threshold,
- delay_result,
- callback_url,
- callback_method,
- fallback_url,
- fallback_method,
- username,
- password,
- fallback_username,
- fallback_password)
diff --git a/bandwidth/voice/models/mode_enum.py b/bandwidth/voice/models/mode_enum.py
deleted file mode 100644
index 85c80e43..00000000
--- a/bandwidth/voice/models/mode_enum.py
+++ /dev/null
@@ -1,28 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class ModeEnum(object):
-
- """Implementation of the 'Mode' enum.
-
- 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'.
-
- Attributes:
- SYNC: TODO: type description here.
- ASYNC: TODO: type description here.
-
- """
-
- SYNC = 'sync'
-
- ASYNC = 'async'
diff --git a/bandwidth/voice/models/modify_call_recording_request.py b/bandwidth/voice/models/modify_call_recording_request.py
deleted file mode 100644
index 911df7a3..00000000
--- a/bandwidth/voice/models/modify_call_recording_request.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class ModifyCallRecordingRequest(object):
-
- """Implementation of the 'ModifyCallRecordingRequest' model.
-
- TODO: type model description here.
-
- Attributes:
- state (State1Enum): TODO: type description here.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "state": 'state'
- }
-
- def __init__(self,
- state=None):
- """Constructor for the ModifyCallRecordingRequest class"""
-
- # Initialize members of the class
- self.state = state
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- state = dictionary.get('state')
-
- # Return an object of this model
- return cls(state)
diff --git a/bandwidth/voice/models/modify_call_request.py b/bandwidth/voice/models/modify_call_request.py
deleted file mode 100644
index 04e0e90f..00000000
--- a/bandwidth/voice/models/modify_call_request.py
+++ /dev/null
@@ -1,110 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class ModifyCallRequest(object):
-
- """Implementation of the 'ModifyCallRequest' model.
-
- TODO: type model description here.
-
- Attributes:
- state (StateEnum): TODO: type description here.
- redirect_url (string): Required if state is 'active'
- redirect_fallback_url (string): TODO: type description here.
- redirect_method (RedirectMethodEnum): TODO: type description here.
- redirect_fallback_method (RedirectFallbackMethodEnum): TODO: type
- description here.
- username (string): TODO: type description here.
- password (string): TODO: type description here.
- fallback_username (string): TODO: type description here.
- fallback_password (string): TODO: type description here.
- tag (string): TODO: type description here.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "state": 'state',
- "redirect_url": 'redirectUrl',
- "redirect_fallback_url": 'redirectFallbackUrl',
- "redirect_method": 'redirectMethod',
- "redirect_fallback_method": 'redirectFallbackMethod',
- "username": 'username',
- "password": 'password',
- "fallback_username": 'fallbackUsername',
- "fallback_password": 'fallbackPassword',
- "tag": 'tag'
- }
-
- def __init__(self,
- state='active',
- redirect_url=None,
- redirect_fallback_url=None,
- redirect_method=None,
- redirect_fallback_method=None,
- username=None,
- password=None,
- fallback_username=None,
- fallback_password=None,
- tag=None):
- """Constructor for the ModifyCallRequest class"""
-
- # Initialize members of the class
- self.state = state
- self.redirect_url = redirect_url
- self.redirect_fallback_url = redirect_fallback_url
- self.redirect_method = redirect_method
- self.redirect_fallback_method = redirect_fallback_method
- self.username = username
- self.password = password
- self.fallback_username = fallback_username
- self.fallback_password = fallback_password
- self.tag = tag
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- state = dictionary.get("state") if dictionary.get("state") else 'active'
- redirect_url = dictionary.get('redirectUrl')
- redirect_fallback_url = dictionary.get('redirectFallbackUrl')
- redirect_method = dictionary.get('redirectMethod')
- redirect_fallback_method = dictionary.get('redirectFallbackMethod')
- username = dictionary.get('username')
- password = dictionary.get('password')
- fallback_username = dictionary.get('fallbackUsername')
- fallback_password = dictionary.get('fallbackPassword')
- tag = dictionary.get('tag')
-
- # Return an object of this model
- return cls(state,
- redirect_url,
- redirect_fallback_url,
- redirect_method,
- redirect_fallback_method,
- username,
- password,
- fallback_username,
- fallback_password,
- tag)
diff --git a/bandwidth/voice/models/modify_conference_request.py b/bandwidth/voice/models/modify_conference_request.py
deleted file mode 100644
index 7b424a2d..00000000
--- a/bandwidth/voice/models/modify_conference_request.py
+++ /dev/null
@@ -1,104 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class ModifyConferenceRequest(object):
-
- """Implementation of the 'ModifyConferenceRequest' model.
-
- TODO: type model description here.
-
- Attributes:
- status (StatusEnum): TODO: type description here.
- redirect_url (string): TODO: type description here.
- redirect_fallback_url (string): TODO: type description here.
- redirect_method (RedirectMethodEnum): TODO: type description here.
- redirect_fallback_method (RedirectFallbackMethodEnum): TODO: type
- description here.
- username (string): TODO: type description here.
- password (string): TODO: type description here.
- fallback_username (string): TODO: type description here.
- fallback_password (string): TODO: type description here.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "status": 'status',
- "redirect_url": 'redirectUrl',
- "redirect_fallback_url": 'redirectFallbackUrl',
- "redirect_method": 'redirectMethod',
- "redirect_fallback_method": 'redirectFallbackMethod',
- "username": 'username',
- "password": 'password',
- "fallback_username": 'fallbackUsername',
- "fallback_password": 'fallbackPassword'
- }
-
- def __init__(self,
- status=None,
- redirect_url=None,
- redirect_fallback_url=None,
- redirect_method=None,
- redirect_fallback_method=None,
- username=None,
- password=None,
- fallback_username=None,
- fallback_password=None):
- """Constructor for the ModifyConferenceRequest class"""
-
- # Initialize members of the class
- self.status = status
- self.redirect_url = redirect_url
- self.redirect_fallback_url = redirect_fallback_url
- self.redirect_method = redirect_method
- self.redirect_fallback_method = redirect_fallback_method
- self.username = username
- self.password = password
- self.fallback_username = fallback_username
- self.fallback_password = fallback_password
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- status = dictionary.get('status')
- redirect_url = dictionary.get('redirectUrl')
- redirect_fallback_url = dictionary.get('redirectFallbackUrl')
- redirect_method = dictionary.get('redirectMethod')
- redirect_fallback_method = dictionary.get('redirectFallbackMethod')
- username = dictionary.get('username')
- password = dictionary.get('password')
- fallback_username = dictionary.get('fallbackUsername')
- fallback_password = dictionary.get('fallbackPassword')
-
- # Return an object of this model
- return cls(status,
- redirect_url,
- redirect_fallback_url,
- redirect_method,
- redirect_fallback_method,
- username,
- password,
- fallback_username,
- fallback_password)
diff --git a/bandwidth/voice/models/redirect_fallback_method_enum.py b/bandwidth/voice/models/redirect_fallback_method_enum.py
deleted file mode 100644
index d104aadf..00000000
--- a/bandwidth/voice/models/redirect_fallback_method_enum.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class RedirectFallbackMethodEnum(object):
-
- """Implementation of the 'RedirectFallbackMethod' enum.
-
- TODO: type enum description here.
-
- Attributes:
- POST: TODO: type description here.
- GET: TODO: type description here.
-
- """
-
- POST = 'POST'
-
- GET = 'GET'
diff --git a/bandwidth/voice/models/redirect_method_enum.py b/bandwidth/voice/models/redirect_method_enum.py
deleted file mode 100644
index bbdbc144..00000000
--- a/bandwidth/voice/models/redirect_method_enum.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class RedirectMethodEnum(object):
-
- """Implementation of the 'RedirectMethod' enum.
-
- TODO: type enum description here.
-
- Attributes:
- POST: TODO: type description here.
- GET: TODO: type description here.
-
- """
-
- POST = 'POST'
-
- GET = 'GET'
diff --git a/bandwidth/voice/models/state_1_enum.py b/bandwidth/voice/models/state_1_enum.py
deleted file mode 100644
index 8e0784fa..00000000
--- a/bandwidth/voice/models/state_1_enum.py
+++ /dev/null
@@ -1,28 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class State1Enum(object):
-
- """Implementation of the 'State1' enum.
-
- TODO: type enum description here.
-
- Attributes:
- NOT_RECORDING: TODO: type description here.
- PAUSED: TODO: type description here.
- RECORDING: TODO: type description here.
-
- """
-
- NOT_RECORDING = 'NOT_RECORDING'
-
- PAUSED = 'PAUSED'
-
- RECORDING = 'RECORDING'
diff --git a/bandwidth/voice/models/state_enum.py b/bandwidth/voice/models/state_enum.py
deleted file mode 100644
index f1d22106..00000000
--- a/bandwidth/voice/models/state_enum.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class StateEnum(object):
-
- """Implementation of the 'State' enum.
-
- TODO: type enum description here.
-
- Attributes:
- ACTIVE: TODO: type description here.
- COMPLETED: TODO: type description here.
-
- """
-
- ACTIVE = 'active'
-
- COMPLETED = 'completed'
diff --git a/bandwidth/voice/models/status_enum.py b/bandwidth/voice/models/status_enum.py
deleted file mode 100644
index 0abc0674..00000000
--- a/bandwidth/voice/models/status_enum.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class StatusEnum(object):
-
- """Implementation of the 'Status' enum.
-
- TODO: type enum description here.
-
- Attributes:
- ACTIVE: TODO: type description here.
- COMPLETED: TODO: type description here.
-
- """
-
- ACTIVE = 'active'
-
- COMPLETED = 'completed'
diff --git a/bandwidth/voice/models/transcribe_recording_request.py b/bandwidth/voice/models/transcribe_recording_request.py
deleted file mode 100644
index e2edc941..00000000
--- a/bandwidth/voice/models/transcribe_recording_request.py
+++ /dev/null
@@ -1,90 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class TranscribeRecordingRequest(object):
- """Implementation of the 'TranscribeRecordingRequest' model.
-
- TODO: type model description here.
-
- Attributes:
- detect_language (bool): Indicates 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.
- callback_url (string): TODO: type description here.
- callback_method (CallbackMethodEnum): TODO: type description here.
- username (string): TODO: type description here.
- password (string): TODO: type description here.
- tag (string): TODO: type description here.
- callback_timeout (float): TODO: type description here.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "detect_language": "detectLanguage",
- "callback_url": 'callbackUrl',
- "callback_method": 'callbackMethod',
- "username": 'username',
- "password": 'password',
- "tag": 'tag',
- "callback_timeout": 'callbackTimeout'
- }
-
- def __init__(self,
- detect_language=None,
- callback_url=None,
- callback_method=None,
- username=None,
- password=None,
- tag=None,
- callback_timeout=None):
- """Constructor for the TranscribeRecordingRequest class"""
-
- # Initialize members of the class
- self.detect_language = detect_language
- self.callback_url = callback_url
- self.callback_method = callback_method
- self.username = username
- self.password = password
- self.tag = tag
- self.callback_timeout = callback_timeout
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- detect_language = dictionary.get('detectLanguage')
- callback_url = dictionary.get('callbackUrl')
- callback_method = dictionary.get('callbackMethod')
- username = dictionary.get('username')
- password = dictionary.get('password')
- tag = dictionary.get('tag')
- callback_timeout = dictionary.get('callbackTimeout')
-
- # Return an object of this model
- return cls(detect_language,
- callback_url,
- callback_method,
- username,
- password,
- tag,
- callback_timeout)
diff --git a/bandwidth/voice/models/transcript.py b/bandwidth/voice/models/transcript.py
deleted file mode 100644
index b379dac7..00000000
--- a/bandwidth/voice/models/transcript.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class Transcript(object):
-
- """Implementation of the 'Transcript' model.
-
- TODO: type model description here.
-
- Attributes:
- text (string): TODO: type description here.
- confidence (float): TODO: type description here.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "text": 'text',
- "confidence": 'confidence'
- }
-
- def __init__(self,
- text=None,
- confidence=None):
- """Constructor for the Transcript class"""
-
- # Initialize members of the class
- self.text = text
- self.confidence = confidence
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- text = dictionary.get('text')
- confidence = dictionary.get('confidence')
-
- # Return an object of this model
- return cls(text,
- confidence)
diff --git a/bandwidth/voice/models/transcription.py b/bandwidth/voice/models/transcription.py
deleted file mode 100644
index b0d10fc9..00000000
--- a/bandwidth/voice/models/transcription.py
+++ /dev/null
@@ -1,73 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class Transcription(object):
-
- """Implementation of the 'Transcription' model.
-
- TODO: type model description here.
-
- Attributes:
- id (string): TODO: type description here.
- url (string): TODO: type description here.
- status (string): TODO: type description here.
- completed_time (string): TODO: type description here.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "id": 'id',
- "url": 'url',
- "status": 'status',
- "completed_time": 'completedTime'
- }
-
- def __init__(self,
- id=None,
- url=None,
- status=None,
- completed_time=None):
- """Constructor for the Transcription class"""
-
- # Initialize members of the class
- self.id = id
- self.url = url
- self.status = status
- self.completed_time = completed_time
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- id = dictionary.get('id')
- url = dictionary.get('url')
- status = dictionary.get('status')
- completed_time = dictionary.get('completedTime')
-
- # Return an object of this model
- return cls(id,
- url,
- status,
- completed_time)
diff --git a/bandwidth/voice/models/transcription_metadata.py b/bandwidth/voice/models/transcription_metadata.py
deleted file mode 100644
index 62c15bee..00000000
--- a/bandwidth/voice/models/transcription_metadata.py
+++ /dev/null
@@ -1,77 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class TranscriptionMetadata(object):
-
- """Implementation of the 'TranscriptionMetadata' model.
-
- TODO: type model description here.
-
- Attributes:
- id (string): TODO: type description here.
- status (string): 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.
- completed_time (string): TODO: type description here.
- url (string): TODO: type description here.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "id": 'id',
- "status": 'status',
- "completed_time": 'completedTime',
- "url": 'url'
- }
-
- def __init__(self,
- id=None,
- status=None,
- completed_time=None,
- url=None):
- """Constructor for the TranscriptionMetadata class"""
-
- # Initialize members of the class
- self.id = id
- self.status = status
- self.completed_time = completed_time
- self.url = url
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- id = dictionary.get('id')
- status = dictionary.get('status')
- completed_time = dictionary.get('completedTime')
- url = dictionary.get('url')
-
- # Return an object of this model
- return cls(id,
- status,
- completed_time,
- url)
diff --git a/bandwidth/voice/models/transcription_response.py b/bandwidth/voice/models/transcription_response.py
deleted file mode 100644
index 5bc1d867..00000000
--- a/bandwidth/voice/models/transcription_response.py
+++ /dev/null
@@ -1,58 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-from bandwidth.voice.models.transcript import Transcript
-
-
-class TranscriptionResponse(object):
-
- """Implementation of the 'TranscriptionResponse' model.
-
- TODO: type model description here.
-
- Attributes:
- transcripts (list of Transcript): TODO: type description here.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "transcripts": 'transcripts'
- }
-
- def __init__(self,
- transcripts=None):
- """Constructor for the TranscriptionResponse class"""
-
- # Initialize members of the class
- self.transcripts = transcripts
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- transcripts = None
- if dictionary.get('transcripts') is not None:
- transcripts = [Transcript.from_dictionary(x) for x in dictionary.get('transcripts')]
-
- # Return an object of this model
- return cls(transcripts)
diff --git a/bandwidth/voice/voice_client.py b/bandwidth/voice/voice_client.py
deleted file mode 100644
index 9170722c..00000000
--- a/bandwidth/voice/voice_client.py
+++ /dev/null
@@ -1,56 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-from bandwidth.decorators import lazy_property
-from bandwidth.configuration import Configuration
-from bandwidth.configuration import Environment
-from bandwidth.voice.controllers.api_controller import APIController
-
-
-class VoiceClient(object):
-
- @lazy_property
- def client(self):
- return APIController(self.config)
-
- def __init__(self, timeout=60, max_retries=0, 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=['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=None):
- if config is None:
- self.config = Configuration(timeout=timeout,
- max_retries=max_retries,
- 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:
- self.config = config
diff --git a/bandwidth/webrtc/__init__.py b/bandwidth/webrtc/__init__.py
deleted file mode 100644
index f601a659..00000000
--- a/bandwidth/webrtc/__init__.py
+++ /dev/null
@@ -1,6 +0,0 @@
-__all__ = [
- 'controllers',
- 'exceptions',
- 'models',
- 'web_rtc_client',
-]
diff --git a/bandwidth/webrtc/controllers/__init__.py b/bandwidth/webrtc/controllers/__init__.py
deleted file mode 100644
index c1660224..00000000
--- a/bandwidth/webrtc/controllers/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-__all__ = [
- 'base_controller',
- 'api_controller',
-]
diff --git a/bandwidth/webrtc/controllers/api_controller.py b/bandwidth/webrtc/controllers/api_controller.py
deleted file mode 100644
index f4bd04bb..00000000
--- a/bandwidth/webrtc/controllers/api_controller.py
+++ /dev/null
@@ -1,681 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-from bandwidth.api_helper import APIHelper
-from bandwidth.configuration import Server
-from bandwidth.http.api_response import ApiResponse
-from bandwidth.webrtc.controllers.base_controller import BaseController
-from bandwidth.http.auth.web_rtc_basic_auth import WebRtcBasicAuth
-from bandwidth.webrtc.models.accounts_participants_response import AccountsParticipantsResponse
-from bandwidth.webrtc.models.participant import Participant
-from bandwidth.webrtc.models.session import Session
-from bandwidth.webrtc.models.subscriptions import Subscriptions
-from bandwidth.exceptions.api_exception import APIException
-from bandwidth.webrtc.exceptions.error_exception import ErrorException
-
-
-class APIController(BaseController):
-
- """A Controller to access Endpoints in the bandwidth API."""
-
- def __init__(self, config, call_back=None):
- super(APIController, self).__init__(config, call_back)
-
- def create_participant(self,
- account_id,
- body=None):
- """Does a POST request to /accounts/{accountId}/participants.
-
- Create a new participant under this account.
- Participants are idempotent, so relevant parameters must be set in
- this function if desired.
-
- Args:
- account_id (string): Account ID
- body (Participant, optional): Participant parameters
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers. Success
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/accounts/{accountId}/participants'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.WEBRTCDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'accept': 'application/json',
- 'content-type': 'application/json; charset=utf-8'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.post(_query_url, headers=_headers, parameters=APIHelper.json_serialize(body))
- WebRtcBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise APIException('Bad Request', _response)
- elif _response.status_code == 401:
- raise APIException('Unauthorized', _response)
- elif _response.status_code == 403:
- raise APIException('Access Denied', _response)
- elif (_response.status_code < 200) or (_response.status_code > 208):
- raise ErrorException('Unexpected Error', _response)
- self.validate_response(_response)
-
- decoded = APIHelper.json_deserialize(_response.text, AccountsParticipantsResponse.from_dictionary)
- _result = ApiResponse(_response, body=decoded)
- return _result
-
- def get_participant(self,
- account_id,
- participant_id):
- """Does a GET request to /accounts/{accountId}/participants/{participantId}.
-
- Get participant by ID.
-
- Args:
- account_id (string): Account ID
- participant_id (string): Participant ID
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers. Success
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/accounts/{accountId}/participants/{participantId}'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'participantId': {'value': participant_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.WEBRTCDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'accept': 'application/json'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.get(_query_url, headers=_headers)
- WebRtcBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 401:
- raise APIException('Unauthorized', _response)
- elif _response.status_code == 403:
- raise APIException('Access Denied', _response)
- elif _response.status_code == 404:
- raise APIException('Not Found', _response)
- elif (_response.status_code < 200) or (_response.status_code > 208):
- raise ErrorException('Unexpected Error', _response)
- self.validate_response(_response)
-
- decoded = APIHelper.json_deserialize(_response.text, Participant.from_dictionary)
- _result = ApiResponse(_response, body=decoded)
- return _result
-
- def delete_participant(self,
- account_id,
- participant_id):
- """Does a DELETE request to /accounts/{accountId}/participants/{participantId}.
-
- Delete participant by ID.
-
- Args:
- account_id (string): Account ID
- participant_id (string): TODO: type description here.
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers. No
- Content
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/accounts/{accountId}/participants/{participantId}'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'participantId': {'value': participant_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.WEBRTCDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare and execute request
- _request = self.config.http_client.delete(_query_url)
- WebRtcBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 401:
- raise APIException('Unauthorized', _response)
- elif _response.status_code == 403:
- raise APIException('Access Denied', _response)
- elif _response.status_code == 404:
- raise APIException('Not Found', _response)
- elif (_response.status_code < 200) or (_response.status_code > 208):
- raise ErrorException('Unexpected Error', _response)
- self.validate_response(_response)
-
- # Return appropriate type
- return ApiResponse(_response)
-
- def create_session(self,
- account_id,
- body=None):
- """Does a POST request to /accounts/{accountId}/sessions.
-
- Create a new session.
- Sessions are idempotent, so relevant parameters must be set in this
- function if desired.
-
- Args:
- account_id (string): Account ID
- body (Session, optional): Session parameters
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers. Success
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/accounts/{accountId}/sessions'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.WEBRTCDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'accept': 'application/json',
- 'content-type': 'application/json; charset=utf-8'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.post(_query_url, headers=_headers, parameters=APIHelper.json_serialize(body))
- WebRtcBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise APIException('Bad Request', _response)
- elif _response.status_code == 401:
- raise APIException('Unauthorized', _response)
- elif _response.status_code == 403:
- raise APIException('Access Denied', _response)
- elif (_response.status_code < 200) or (_response.status_code > 208):
- raise ErrorException('Unexpected Error', _response)
- self.validate_response(_response)
-
- decoded = APIHelper.json_deserialize(_response.text, Session.from_dictionary)
- _result = ApiResponse(_response, body=decoded)
- return _result
-
- def get_session(self,
- account_id,
- session_id):
- """Does a GET request to /accounts/{accountId}/sessions/{sessionId}.
-
- Get session by ID.
-
- Args:
- account_id (string): Account ID
- session_id (string): Session ID
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers. Success
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/accounts/{accountId}/sessions/{sessionId}'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'sessionId': {'value': session_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.WEBRTCDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'accept': 'application/json'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.get(_query_url, headers=_headers)
- WebRtcBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 401:
- raise APIException('Unauthorized', _response)
- elif _response.status_code == 403:
- raise APIException('Access Denied', _response)
- elif _response.status_code == 404:
- raise APIException('Not Found', _response)
- elif (_response.status_code < 200) or (_response.status_code > 208):
- raise ErrorException('Unexpected Error', _response)
- self.validate_response(_response)
-
- decoded = APIHelper.json_deserialize(_response.text, Session.from_dictionary)
- _result = ApiResponse(_response, body=decoded)
- return _result
-
- def delete_session(self,
- account_id,
- session_id):
- """Does a DELETE request to /accounts/{accountId}/sessions/{sessionId}.
-
- Delete session by ID.
-
- Args:
- account_id (string): Account ID
- session_id (string): Session ID
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers. No
- Content
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/accounts/{accountId}/sessions/{sessionId}'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'sessionId': {'value': session_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.WEBRTCDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare and execute request
- _request = self.config.http_client.delete(_query_url)
- WebRtcBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 401:
- raise APIException('Unauthorized', _response)
- elif _response.status_code == 403:
- raise APIException('Access Denied', _response)
- elif _response.status_code == 404:
- raise APIException('Not Found', _response)
- elif (_response.status_code < 200) or (_response.status_code > 208):
- raise ErrorException('Unexpected Error', _response)
- self.validate_response(_response)
-
- # Return appropriate type
- return ApiResponse(_response)
-
- def list_session_participants(self,
- account_id,
- session_id):
- """Does a GET request to /accounts/{accountId}/sessions/{sessionId}/participants.
-
- List participants in a session.
-
- Args:
- account_id (string): Account ID
- session_id (string): Session ID
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers. Success
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/accounts/{accountId}/sessions/{sessionId}/participants'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'sessionId': {'value': session_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.WEBRTCDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'accept': 'application/json'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.get(_query_url, headers=_headers)
- WebRtcBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 401:
- raise APIException('Unauthorized', _response)
- elif _response.status_code == 403:
- raise APIException('Access Denied', _response)
- elif _response.status_code == 404:
- raise APIException('Not Found', _response)
- elif (_response.status_code < 200) or (_response.status_code > 208):
- raise ErrorException('Unexpected Error', _response)
- self.validate_response(_response)
-
- decoded = APIHelper.json_deserialize(_response.text, Participant.from_dictionary)
- _result = ApiResponse(_response, body=decoded)
- return _result
-
- def add_participant_to_session(self,
- account_id,
- session_id,
- participant_id,
- body=None):
- """Does a PUT request to /accounts/{accountId}/sessions/{sessionId}/participants/{participantId}.
-
- Add a participant to a session.
- Subscriptions can optionally be provided as part of this call.
-
- Args:
- account_id (string): Account ID
- session_id (string): Session ID
- participant_id (string): Participant ID
- body (Subscriptions, optional): Subscriptions the participant
- should be created with
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers. No
- Content
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/accounts/{accountId}/sessions/{sessionId}/participants/{participantId}'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'sessionId': {'value': session_id, 'encode': False},
- 'participantId': {'value': participant_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.WEBRTCDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'content-type': 'application/json; charset=utf-8'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.put(_query_url, headers=_headers, parameters=APIHelper.json_serialize(body))
- WebRtcBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 401:
- raise APIException('Unauthorized', _response)
- elif _response.status_code == 403:
- raise APIException('Access Denied', _response)
- elif _response.status_code == 404:
- raise APIException('Not Found', _response)
- elif (_response.status_code < 200) or (_response.status_code > 208):
- raise ErrorException('Unexpected Error', _response)
- self.validate_response(_response)
-
- # Return appropriate type
- return ApiResponse(_response)
-
- def remove_participant_from_session(self,
- account_id,
- session_id,
- participant_id):
- """Does a DELETE request to /accounts/{accountId}/sessions/{sessionId}/participants/{participantId}.
-
- Remove a participant from a session.
- This will automatically remove any subscriptions the participant has
- associated with this session.
-
- Args:
- account_id (string): Account ID
- session_id (string): Session ID
- participant_id (string): Participant ID
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers. No
- Content
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/accounts/{accountId}/sessions/{sessionId}/participants/{participantId}'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'sessionId': {'value': session_id, 'encode': False},
- 'participantId': {'value': participant_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.WEBRTCDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare and execute request
- _request = self.config.http_client.delete(_query_url)
- WebRtcBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 401:
- raise APIException('Unauthorized', _response)
- elif _response.status_code == 403:
- raise APIException('Access Denied', _response)
- elif _response.status_code == 404:
- raise APIException('Not Found', _response)
- elif (_response.status_code < 200) or (_response.status_code > 208):
- raise ErrorException('Unexpected Error', _response)
- self.validate_response(_response)
-
- # Return appropriate type
- return ApiResponse(_response)
-
- def get_participant_subscriptions(self,
- account_id,
- session_id,
- participant_id):
- """Does a GET request to /accounts/{accountId}/sessions/{sessionId}/participants/{participantId}/subscriptions.
-
- Get a participant's subscriptions.
-
- Args:
- account_id (string): Account ID
- session_id (string): Session ID
- participant_id (string): Participant ID
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers. Success
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/accounts/{accountId}/sessions/{sessionId}/participants/{participantId}/subscriptions'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'sessionId': {'value': session_id, 'encode': False},
- 'participantId': {'value': participant_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.WEBRTCDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'accept': 'application/json'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.get(_query_url, headers=_headers)
- WebRtcBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 401:
- raise APIException('Unauthorized', _response)
- elif _response.status_code == 403:
- raise APIException('Access Denied', _response)
- elif _response.status_code == 404:
- raise APIException('Not Found', _response)
- elif (_response.status_code < 200) or (_response.status_code > 208):
- raise ErrorException('Unexpected Error', _response)
- self.validate_response(_response)
-
- decoded = APIHelper.json_deserialize(_response.text, Subscriptions.from_dictionary)
- _result = ApiResponse(_response, body=decoded)
- return _result
-
- def update_participant_subscriptions(self,
- account_id,
- session_id,
- participant_id,
- body=None):
- """Does a PUT request to /accounts/{accountId}/sessions/{sessionId}/participants/{participantId}/subscriptions.
-
- 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.
-
- Args:
- account_id (string): Account ID
- session_id (string): Session ID
- participant_id (string): Participant ID
- body (Subscriptions, optional): Initial state
-
- Returns:
- ApiResponse: An object with the response value as well as other
- useful information such as status codes and headers. No
- Content
-
- Raises:
- APIException: When an error occurs while fetching the data from
- the remote API. This exception includes the HTTP Response
- code, an error message, and the HTTP body that was received in
- the request.
-
- """
-
- # Prepare query URL
- _url_path = '/accounts/{accountId}/sessions/{sessionId}/participants/{participantId}/subscriptions'
- _url_path = APIHelper.append_url_with_template_parameters(_url_path, {
- 'accountId': {'value': account_id, 'encode': False},
- 'sessionId': {'value': session_id, 'encode': False},
- 'participantId': {'value': participant_id, 'encode': False}
- })
- _query_builder = self.config.get_base_uri(Server.WEBRTCDEFAULT)
- _query_builder += _url_path
- _query_url = APIHelper.clean_url(_query_builder)
-
- # Prepare headers
- _headers = {
- 'content-type': 'application/json; charset=utf-8'
- }
-
- # Prepare and execute request
- _request = self.config.http_client.put(_query_url, headers=_headers, parameters=APIHelper.json_serialize(body))
- WebRtcBasicAuth.apply(self.config, _request)
- _response = self.execute_request(_request)
-
- # Endpoint and global error handling using HTTP status codes.
- if _response.status_code == 400:
- raise APIException('Bad Request', _response)
- elif _response.status_code == 401:
- raise APIException('Unauthorized', _response)
- elif _response.status_code == 403:
- raise APIException('Access Denied', _response)
- elif _response.status_code == 404:
- raise APIException('Not Found', _response)
- elif (_response.status_code < 200) or (_response.status_code > 208):
- raise ErrorException('Unexpected Error', _response)
- self.validate_response(_response)
-
- # Return appropriate type
- return ApiResponse(_response)
diff --git a/bandwidth/webrtc/controllers/base_controller.py b/bandwidth/webrtc/controllers/base_controller.py
deleted file mode 100644
index ec1c6e23..00000000
--- a/bandwidth/webrtc/controllers/base_controller.py
+++ /dev/null
@@ -1,95 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-from bandwidth.api_helper import APIHelper
-from bandwidth.exceptions.api_exception import APIException
-
-
-class BaseController(object):
-
- """All controllers inherit from this base class.
-
- Attributes:
- config (Configuration): The HttpClient which a specific controller
- instance will use. By default all the controller objects share
- the same HttpClient. A user can use his own custom HttpClient
- as well.
- http_call_back (HttpCallBack): An object which holds call back
- methods to be called before and after the execution of an HttpRequest.
- global_headers (dict): The global headers of the API which are sent with
- every request.
-
- """
-
- def global_headers(self):
- return {
- 'user-agent': 'python-sdk'
- }
-
- def __init__(self, config, call_back=None):
- self._config = config
- self._http_call_back = call_back
-
- @property
- def config(self):
- return self._config
-
- @property
- def http_call_back(self):
- return self._http_call_back
-
- def validate_parameters(self, **kwargs):
- """Validates required parameters of an endpoint.
-
- Args:
- kwargs (dict): A dictionary of the required parameters.
-
- """
- for name, value in kwargs.items():
- if value is None:
- raise ValueError("Required parameter {} cannot be None.".format(name))
-
- def execute_request(self, request, binary=False):
- """Executes an HttpRequest.
-
- Args:
- request (HttpRequest): The HttpRequest to execute.
- binary (bool): A flag which should be set to True if
- a binary response is expected.
-
- Returns:
- HttpResponse: The HttpResponse received.
-
- """
- # Invoke the on before request HttpCallBack if specified
- if self.http_call_back is not None:
- self.http_call_back.on_before_request(request)
-
- # Add global headers to request
- request.headers = APIHelper.merge_dicts(self.global_headers(), request.headers)
-
- # Invoke the API call to fetch the response.
- func = self.config.http_client.execute_as_binary if binary else self.config.http_client.execute_as_string
- response = func(request)
-
- # Invoke the on after response HttpCallBack if specified
- if self.http_call_back is not None:
- self.http_call_back.on_after_response(response)
-
- return response
-
- def validate_response(self, response):
- """Validates an HTTP response by checking for global errors.
-
- Args:
- response (HttpResponse): The HttpResponse of the API call.
-
- """
- if (response.status_code < 200) or (response.status_code > 208): # [200,208] = HTTP OK
- raise APIException('HTTP response not OK.', response)
diff --git a/bandwidth/webrtc/exceptions/__init__.py b/bandwidth/webrtc/exceptions/__init__.py
deleted file mode 100644
index 4d4907bb..00000000
--- a/bandwidth/webrtc/exceptions/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-__all__ = [
- 'error_exception',
-]
diff --git a/bandwidth/webrtc/exceptions/error_exception.py b/bandwidth/webrtc/exceptions/error_exception.py
deleted file mode 100644
index 794ce935..00000000
--- a/bandwidth/webrtc/exceptions/error_exception.py
+++ /dev/null
@@ -1,39 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-from bandwidth.api_helper import APIHelper
-import bandwidth.exceptions.api_exception
-
-
-class ErrorException(bandwidth.exceptions.api_exception.APIException):
- def __init__(self, reason, response):
- """Constructor for the ErrorException class
-
- Args:
- reason (string): The reason (or error message) for the Exception
- to be raised.
- response (HttpResponse): The HttpResponse of the API call.
-
- """
- super(ErrorException, self).__init__(reason, response)
- dictionary = APIHelper.json_deserialize(self.response.text)
- if isinstance(dictionary, dict):
- self.unbox(dictionary)
-
- def unbox(self, dictionary):
- """Populates the properties of this object by extracting them from a dictionary.
-
- Args:
- dictionary (dictionary): A dictionary representation of the object as
- obtained from the deserialization of the server's response. The keys
- MUST match property names in the API description.
-
- """
- self.code = dictionary.get('code')
- self.message = dictionary.get('message')
diff --git a/bandwidth/webrtc/models/__init__.py b/bandwidth/webrtc/models/__init__.py
deleted file mode 100644
index 947920dc..00000000
--- a/bandwidth/webrtc/models/__init__.py
+++ /dev/null
@@ -1,9 +0,0 @@
-__all__ = [
- 'session',
- 'participant',
- 'subscriptions',
- 'participant_subscription',
- 'accounts_participants_response',
- 'device_api_version_enum',
- 'publish_permission_enum',
-]
diff --git a/bandwidth/webrtc/models/accounts_participants_response.py b/bandwidth/webrtc/models/accounts_participants_response.py
deleted file mode 100644
index 8ab0cbe9..00000000
--- a/bandwidth/webrtc/models/accounts_participants_response.py
+++ /dev/null
@@ -1,64 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-from bandwidth.webrtc.models.participant import Participant
-
-
-class AccountsParticipantsResponse(object):
-
- """Implementation of the 'Accounts Participants Response' model.
-
- TODO: type model description here.
-
- Attributes:
- participant (Participant): A participant object
- token (string): Auth token for the returned participant This should
- be passed to the participant so that they can connect to the
- platform
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "participant": 'participant',
- "token": 'token'
- }
-
- def __init__(self,
- participant=None,
- token=None):
- """Constructor for the AccountsParticipantsResponse class"""
-
- # Initialize members of the class
- self.participant = participant
- self.token = token
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- participant = Participant.from_dictionary(dictionary.get('participant')) if dictionary.get('participant') else None
- token = dictionary.get('token')
-
- # Return an object of this model
- return cls(participant,
- token)
diff --git a/bandwidth/webrtc/models/device_api_version_enum.py b/bandwidth/webrtc/models/device_api_version_enum.py
deleted file mode 100644
index ca6ed925..00000000
--- a/bandwidth/webrtc/models/device_api_version_enum.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class DeviceApiVersionEnum(object):
-
- """Implementation of the 'DeviceApiVersion' enum.
-
- Optional field to define the device api version of this participant
-
- Attributes:
- V3: TODO: type description here.
- V2: TODO: type description here.
-
- """
-
- V3 = 'V3'
-
- V2 = 'V2'
diff --git a/bandwidth/webrtc/models/participant.py b/bandwidth/webrtc/models/participant.py
deleted file mode 100644
index 9f01fb2d..00000000
--- a/bandwidth/webrtc/models/participant.py
+++ /dev/null
@@ -1,96 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-from bandwidth.webrtc.models.subscriptions import Subscriptions
-
-
-class Participant(object):
-
- """Implementation of the 'Participant' model.
-
- A participant object
-
- Attributes:
- id (string): Unique id of the participant
- callback_url (string): Full callback url to use for notifications
- about this participant
- publish_permissions (list of PublishPermissionEnum): Defines if this
- participant can publish audio or video
- sessions (list of string): List of session ids this participant is
- associated with Capped to one
- subscriptions (Subscriptions): TODO: type description here.
- tag (string): User defined tag to associate with the participant
- device_api_version (DeviceApiVersionEnum): Optional field to define
- the device api version of this participant
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "id": 'id',
- "callback_url": 'callbackUrl',
- "publish_permissions": 'publishPermissions',
- "sessions": 'sessions',
- "subscriptions": 'subscriptions',
- "tag": 'tag',
- "device_api_version": 'deviceApiVersion'
- }
-
- def __init__(self,
- id=None,
- callback_url=None,
- publish_permissions=None,
- sessions=None,
- subscriptions=None,
- tag=None,
- device_api_version='V2'):
- """Constructor for the Participant class"""
-
- # Initialize members of the class
- self.id = id
- self.callback_url = callback_url
- self.publish_permissions = publish_permissions
- self.sessions = sessions
- self.subscriptions = subscriptions
- self.tag = tag
- self.device_api_version = device_api_version
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- id = dictionary.get('id')
- callback_url = dictionary.get('callbackUrl')
- publish_permissions = dictionary.get('publishPermissions')
- sessions = dictionary.get('sessions')
- subscriptions = Subscriptions.from_dictionary(dictionary.get('subscriptions')) if dictionary.get('subscriptions') else None
- tag = dictionary.get('tag')
- device_api_version = dictionary.get("deviceApiVersion") if dictionary.get("deviceApiVersion") else 'V2'
-
- # Return an object of this model
- return cls(id,
- callback_url,
- publish_permissions,
- sessions,
- subscriptions,
- tag,
- device_api_version)
diff --git a/bandwidth/webrtc/models/participant_subscription.py b/bandwidth/webrtc/models/participant_subscription.py
deleted file mode 100644
index 58d272a0..00000000
--- a/bandwidth/webrtc/models/participant_subscription.py
+++ /dev/null
@@ -1,56 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class ParticipantSubscription(object):
-
- """Implementation of the 'ParticipantSubscription' model.
-
- TODO: type model description here.
-
- Attributes:
- participant_id (string): Participant the subscriber should be
- subscribed to
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "participant_id": 'participantId'
- }
-
- def __init__(self,
- participant_id=None):
- """Constructor for the ParticipantSubscription class"""
-
- # Initialize members of the class
- self.participant_id = participant_id
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- participant_id = dictionary.get('participantId')
-
- # Return an object of this model
- return cls(participant_id)
diff --git a/bandwidth/webrtc/models/publish_permission_enum.py b/bandwidth/webrtc/models/publish_permission_enum.py
deleted file mode 100644
index a4e3289b..00000000
--- a/bandwidth/webrtc/models/publish_permission_enum.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class PublishPermissionEnum(object):
-
- """Implementation of the 'PublishPermission' enum.
-
- TODO: type enum description here.
-
- Attributes:
- AUDIO: TODO: type description here.
- VIDEO: TODO: type description here.
-
- """
-
- AUDIO = 'AUDIO'
-
- VIDEO = 'VIDEO'
diff --git a/bandwidth/webrtc/models/session.py b/bandwidth/webrtc/models/session.py
deleted file mode 100644
index bbdec8c6..00000000
--- a/bandwidth/webrtc/models/session.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-
-class Session(object):
-
- """Implementation of the 'Session' model.
-
- A session object
-
- Attributes:
- id (string): Unique id of the session
- tag (string): User defined tag to associate with the session
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "id": 'id',
- "tag": 'tag'
- }
-
- def __init__(self,
- id=None,
- tag=None):
- """Constructor for the Session class"""
-
- # Initialize members of the class
- self.id = id
- self.tag = tag
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- id = dictionary.get('id')
- tag = dictionary.get('tag')
-
- # Return an object of this model
- return cls(id,
- tag)
diff --git a/bandwidth/webrtc/models/subscriptions.py b/bandwidth/webrtc/models/subscriptions.py
deleted file mode 100644
index 908fce22..00000000
--- a/bandwidth/webrtc/models/subscriptions.py
+++ /dev/null
@@ -1,68 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-from bandwidth.webrtc.models.participant_subscription import ParticipantSubscription
-
-
-class Subscriptions(object):
-
- """Implementation of the 'Subscriptions' model.
-
- TODO: type model description here.
-
- Attributes:
- session_id (string): 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)
- participants (list of ParticipantSubscription): Subset of participants
- to subscribe to in the session. Optional.
-
- """
-
- # Create a mapping from Model property names to API property names
- _names = {
- "session_id": 'sessionId',
- "participants": 'participants'
- }
-
- def __init__(self,
- session_id=None,
- participants=None):
- """Constructor for the Subscriptions class"""
-
- # Initialize members of the class
- self.session_id = session_id
- self.participants = participants
-
- @classmethod
- def from_dictionary(cls,
- dictionary):
- """Creates an instance of this model from a dictionary
-
- Args:
- dictionary (dictionary): A dictionary representation of the object
- as obtained from the deserialization of the server's response. The
- keys MUST match property names in the API description.
-
- Returns:
- object: An instance of this structure class.
-
- """
- if dictionary is None:
- return None
-
- # Extract variables from the dictionary
- session_id = dictionary.get('sessionId')
- participants = None
- if dictionary.get('participants') is not None:
- participants = [ParticipantSubscription.from_dictionary(x) for x in dictionary.get('participants')]
-
- # Return an object of this model
- return cls(session_id,
- participants)
diff --git a/bandwidth/webrtc/utils/__init__.py b/bandwidth/webrtc/utils/__init__.py
deleted file mode 100644
index 22b9880a..00000000
--- a/bandwidth/webrtc/utils/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from .transfer_util import generate_transfer_bxml, generate_transfer_bxml_verb
diff --git a/bandwidth/webrtc/utils/transfer_util.py b/bandwidth/webrtc/utils/transfer_util.py
deleted file mode 100644
index 7bddc10d..00000000
--- a/bandwidth/webrtc/utils/transfer_util.py
+++ /dev/null
@@ -1,25 +0,0 @@
-"""
-transfer_util.py
-
-Method to generate the transfer BXML to connect WebRTC <-> phones
-
-@copyright Bandwidth INC
-"""
-
-def generate_transfer_bxml(device_token, voice_call_id, sip_uri='sip:sipx.webrtc.bandwidth.com:5060'):
- """
- Returns BXML string with WebRTC a device token to perform a SIP transfer
- :param device_token: The device token
- :param voice_call_id: The Bandwidth Voice Call Id
- :param sip_uri: The SIP URI to transfer the call to
- """
- return '' + generate_transfer_bxml_verb(device_token, voice_call_id, sip_uri) + ''
-
-def generate_transfer_bxml_verb(device_token, voice_call_id, sip_uri='sip:sipx.webrtc.bandwidth.com:5060'):
- """
- Returns the Transfer verb to perform the SIP transfer
- :param device_token: The device token
- :param voice_call_id: The Bandwidth Voice Call Id
- :param sip_uri: The SIP URI to transfer the call to
- """
- return f'''{sip_uri}'''
diff --git a/bandwidth/webrtc/web_rtc_client.py b/bandwidth/webrtc/web_rtc_client.py
deleted file mode 100644
index 63bf50b7..00000000
--- a/bandwidth/webrtc/web_rtc_client.py
+++ /dev/null
@@ -1,56 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-bandwidth
-
-This file was automatically generated by APIMATIC v3.0 (
- https://www.apimatic.io ).
-"""
-
-from bandwidth.decorators import lazy_property
-from bandwidth.configuration import Configuration
-from bandwidth.configuration import Environment
-from bandwidth.webrtc.controllers.api_controller import APIController
-
-
-class WebRtcClient(object):
-
- @lazy_property
- def client(self):
- return APIController(self.config)
-
- def __init__(self, timeout=60, max_retries=0, 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=['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=None):
- if config is None:
- self.config = Configuration(timeout=timeout,
- max_retries=max_retries,
- 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:
- self.config = config
diff --git a/docs/AccountStatistics.md b/docs/AccountStatistics.md
new file mode 100644
index 00000000..58efebeb
--- /dev/null
+++ b/docs/AccountStatistics.md
@@ -0,0 +1,29 @@
+# AccountStatistics
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**current_call_queue_size** | **int** | The number of calls currently enqueued. | [optional]
+**max_call_queue_size** | **int** | The maximum size of the queue before outgoing calls start being rejected. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.account_statistics import AccountStatistics
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of AccountStatistics from a JSON string
+account_statistics_instance = AccountStatistics.from_json(json)
+# print the JSON string representation of the object
+print AccountStatistics.to_json()
+
+# convert the object into a dict
+account_statistics_dict = account_statistics_instance.to_dict()
+# create an instance of AccountStatistics from a dict
+account_statistics_form_dict = account_statistics.from_dict(account_statistics_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/AnswerCallback.md b/docs/AnswerCallback.md
new file mode 100644
index 00000000..bf6127d2
--- /dev/null
+++ b/docs/AnswerCallback.md
@@ -0,0 +1,42 @@
+# AnswerCallback
+
+The Answer event is sent to the answerUrl specified in the createCall request when an outbound call is answered.
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**event_type** | **str** | 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** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional]
+**account_id** | **str** | The user account associated with the call. | [optional]
+**application_id** | **str** | The id of the application associated with the call. | [optional]
+**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional]
+**to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional]
+**direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional]
+**call_id** | **str** | The call id associated with the event. | [optional]
+**call_url** | **str** | The URL of the call associated with the event. | [optional]
+**enqueued_time** | **datetime** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional]
+**start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional]
+**answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional]
+**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional]
+**machine_detection_result** | [**MachineDetectionResult**](MachineDetectionResult.md) | | [optional]
+
+## Example
+
+```python
+from bandwidth.models.answer_callback import AnswerCallback
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of AnswerCallback from a JSON string
+answer_callback_instance = AnswerCallback.from_json(json)
+# print the JSON string representation of the object
+print AnswerCallback.to_json()
+
+# convert the object into a dict
+answer_callback_dict = answer_callback_instance.to_dict()
+# create an instance of AnswerCallback from a dict
+answer_callback_form_dict = answer_callback.from_dict(answer_callback_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/BridgeCompleteCallback.md b/docs/BridgeCompleteCallback.md
new file mode 100644
index 00000000..d1f03961
--- /dev/null
+++ b/docs/BridgeCompleteCallback.md
@@ -0,0 +1,44 @@
+# BridgeCompleteCallback
+
+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
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**event_type** | **str** | 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** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional]
+**account_id** | **str** | The user account associated with the call. | [optional]
+**application_id** | **str** | The id of the application associated with the call. | [optional]
+**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional]
+**to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional]
+**direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional]
+**call_id** | **str** | The call id associated with the event. | [optional]
+**call_url** | **str** | The URL of the call associated with the event. | [optional]
+**enqueued_time** | **datetime** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional]
+**start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional]
+**answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional]
+**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional]
+**cause** | **str** | Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown. | [optional]
+**error_message** | **str** | Text explaining the reason that caused the call to fail in case of errors. | [optional]
+**error_id** | **str** | Bandwidth's internal id that references the error event. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.bridge_complete_callback import BridgeCompleteCallback
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of BridgeCompleteCallback from a JSON string
+bridge_complete_callback_instance = BridgeCompleteCallback.from_json(json)
+# print the JSON string representation of the object
+print BridgeCompleteCallback.to_json()
+
+# convert the object into a dict
+bridge_complete_callback_dict = bridge_complete_callback_instance.to_dict()
+# create an instance of BridgeCompleteCallback from a dict
+bridge_complete_callback_form_dict = bridge_complete_callback.from_dict(bridge_complete_callback_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/BridgeTargetCompleteCallback.md b/docs/BridgeTargetCompleteCallback.md
new file mode 100644
index 00000000..d9d885e2
--- /dev/null
+++ b/docs/BridgeTargetCompleteCallback.md
@@ -0,0 +1,41 @@
+# BridgeTargetCompleteCallback
+
+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
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**event_type** | **str** | 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** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional]
+**account_id** | **str** | The user account associated with the call. | [optional]
+**application_id** | **str** | The id of the application associated with the call. | [optional]
+**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional]
+**to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional]
+**direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional]
+**call_id** | **str** | The call id associated with the event. | [optional]
+**call_url** | **str** | The URL of the call associated with the event. | [optional]
+**enqueued_time** | **datetime** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional]
+**start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional]
+**answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional]
+**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.bridge_target_complete_callback import BridgeTargetCompleteCallback
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of BridgeTargetCompleteCallback from a JSON string
+bridge_target_complete_callback_instance = BridgeTargetCompleteCallback.from_json(json)
+# print the JSON string representation of the object
+print BridgeTargetCompleteCallback.to_json()
+
+# convert the object into a dict
+bridge_target_complete_callback_dict = bridge_target_complete_callback_instance.to_dict()
+# create an instance of BridgeTargetCompleteCallback from a dict
+bridge_target_complete_callback_form_dict = bridge_target_complete_callback.from_dict(bridge_target_complete_callback_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/CallDirectionEnum.md b/docs/CallDirectionEnum.md
new file mode 100644
index 00000000..7bc0ad21
--- /dev/null
+++ b/docs/CallDirectionEnum.md
@@ -0,0 +1,11 @@
+# CallDirectionEnum
+
+The direction of the call.
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/CallRecordingMetadata.md b/docs/CallRecordingMetadata.md
new file mode 100644
index 00000000..56ea2a38
--- /dev/null
+++ b/docs/CallRecordingMetadata.md
@@ -0,0 +1,45 @@
+# CallRecordingMetadata
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**application_id** | **str** | The id of the application associated with the call. | [optional]
+**account_id** | **str** | The user account associated with the call. | [optional]
+**call_id** | **str** | The call id associated with the event. | [optional]
+**parent_call_id** | **str** | (optional) If the event is related to the B leg of a <Transfer>, the call id of the original call leg that executed the <Transfer>. Otherwise, this field will not be present. | [optional]
+**recording_id** | **str** | The unique ID of this recording | [optional]
+**to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional]
+**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional]
+**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional]
+**transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional]
+**duration** | **str** | The duration of the recording in ISO-8601 format | [optional]
+**direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional]
+**channels** | **int** | Always `1` for conference recordings; multi-channel recordings are not supported on conferences. | [optional]
+**start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional]
+**end_time** | **datetime** | The time that the recording ended in ISO-8601 format | [optional]
+**file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional]
+**status** | **str** | The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional]
+**media_url** | **str** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional]
+**transcription** | [**TranscriptionMetadata**](TranscriptionMetadata.md) | | [optional]
+
+## Example
+
+```python
+from bandwidth.models.call_recording_metadata import CallRecordingMetadata
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of CallRecordingMetadata from a JSON string
+call_recording_metadata_instance = CallRecordingMetadata.from_json(json)
+# print the JSON string representation of the object
+print CallRecordingMetadata.to_json()
+
+# convert the object into a dict
+call_recording_metadata_dict = call_recording_metadata_instance.to_dict()
+# create an instance of CallRecordingMetadata from a dict
+call_recording_metadata_form_dict = call_recording_metadata.from_dict(call_recording_metadata_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/CallState.md b/docs/CallState.md
new file mode 100644
index 00000000..2ddefa30
--- /dev/null
+++ b/docs/CallState.md
@@ -0,0 +1,45 @@
+# CallState
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**application_id** | **str** | The application id associated with the call. | [optional]
+**account_id** | **str** | The account id associated with the call. | [optional]
+**call_id** | **str** | The programmable voice API call ID. | [optional]
+**parent_call_id** | **str** | The A-leg call id, set only if this call is the B-leg of a [`<Transfer>`](/docs/voice/bxml/transfer). | [optional]
+**to** | **str** | 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]
+**var_from** | **str** | The phone number that made the call, in E.164 format (e.g. +15555555555). | [optional]
+**direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional]
+**state** | **str** | 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** | **Dict[str, str]** | 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** | **str** | 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** | **datetime** | The time this call was placed in queue. | [optional]
+**start_time** | **datetime** | The time the call was initiated, in ISO 8601 format. `null` if the call is still in your queue. | [optional]
+**answer_time** | **datetime** | Populated once the call has been answered, with the time in ISO 8601 format. | [optional]
+**end_time** | **datetime** | Populated once the call has ended, with the time in ISO 8601 format. | [optional]
+**disconnect_cause** | **str** | | 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** | **str** | Populated only if the call ended with an error, with text explaining the reason. | [optional]
+**error_id** | **str** | Populated only if the call ended with an error, with a Bandwidth internal id that references the error event. | [optional]
+**last_update** | **datetime** | The last time the call had a state update, in ISO 8601 format. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.call_state import CallState
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of CallState from a JSON string
+call_state_instance = CallState.from_json(json)
+# print the JSON string representation of the object
+print CallState.to_json()
+
+# convert the object into a dict
+call_state_dict = call_state_instance.to_dict()
+# create an instance of CallState from a dict
+call_state_form_dict = call_state.from_dict(call_state_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/CallStateEnum.md b/docs/CallStateEnum.md
new file mode 100644
index 00000000..051e3b88
--- /dev/null
+++ b/docs/CallStateEnum.md
@@ -0,0 +1,11 @@
+# CallStateEnum
+
+The call state. Possible values:
`active` to redirect the call (default)
`completed` to hang up the call if it is answered, cancel it if it is an unanswered outbound call, or reject it if it an unanswered inbound call
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/CallbackMethodEnum.md b/docs/CallbackMethodEnum.md
new file mode 100644
index 00000000..aa0ef6ae
--- /dev/null
+++ b/docs/CallbackMethodEnum.md
@@ -0,0 +1,11 @@
+# CallbackMethodEnum
+
+The HTTP method to use to deliver the callback. GET or POST. Default value is POST.
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/CallsApi.md b/docs/CallsApi.md
new file mode 100644
index 00000000..7b4d4fc7
--- /dev/null
+++ b/docs/CallsApi.md
@@ -0,0 +1,369 @@
+# 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**
+> CreateCallResponse 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.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.models.create_call import CreateCall
+from bandwidth.models.create_call_response import CreateCallResponse
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.CallsApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ create_call = bandwidth.CreateCall() # CreateCall | JSON object containing information to create an outbound call
+
+ try:
+ # Create Call
+ api_response = api_instance.create_call(account_id, create_call)
+ print("The response of CallsApi->create_call:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling CallsApi->create_call: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| 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
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**201** | Call Successfully Created | * Location - The URL for further interactions with this call
|
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**405** | Method Not Allowed | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | * Retry-After - When you should try your request again.
|
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **get_call_state**
+> CallState 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.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.models.call_state import CallState
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.CallsApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Call ID.
+
+ try:
+ # Get Call State Information
+ api_response = api_instance.get_call_state(account_id, call_id)
+ print("The response of CallsApi->get_call_state:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling CallsApi->get_call_state: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **call_id** | **str**| Programmable Voice API Call ID. |
+
+### Return type
+
+[**CallState**](CallState.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Call found | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**405** | Method Not Allowed | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | * Retry-After - When you should try your request again.
|
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **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.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.models.update_call import UpdateCall
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.CallsApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Call ID.
+ update_call = bandwidth.UpdateCall() # UpdateCall | JSON object containing information to redirect an existing call to a new BXML document
+
+ try:
+ # Update Call
+ api_instance.update_call(account_id, call_id, update_call)
+ except Exception as e:
+ print("Exception when calling CallsApi->update_call: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **call_id** | **str**| 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
+
+void (empty response body)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Call was successfully modified. | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**405** | Method Not Allowed | - |
+**409** | Conflict | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | * Retry-After - When you should try your request again.
|
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **update_call_bxml**
+> update_call_bxml(account_id, call_id, body)
+
+Update Call BXML
+
+Interrupts and replaces an active call's BXML document.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.CallsApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Call ID.
+ body =
+
+ This is a test sentence.
+ # str |
+
+ try:
+ # Update Call BXML
+ api_instance.update_call_bxml(account_id, call_id, body)
+ except Exception as e:
+ print("Exception when calling CallsApi->update_call_bxml: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **call_id** | **str**| Programmable Voice API Call ID. |
+ **body** | **str**| |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+ - **Content-Type**: application/xml
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**204** | Call BXML was successfully replaced. | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**405** | Method Not Allowed | - |
+**409** | Conflict | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | * Retry-After - When you should try your request again.
|
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/docs/CodeRequest.md b/docs/CodeRequest.md
new file mode 100644
index 00000000..e0c3b255
--- /dev/null
+++ b/docs/CodeRequest.md
@@ -0,0 +1,33 @@
+# CodeRequest
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**to** | **str** | The phone number to send the mfa code to. |
+**var_from** | **str** | The application phone number, the sender of the mfa code. |
+**application_id** | **str** | The application unique ID, obtained from Bandwidth. |
+**scope** | **str** | An optional field to denote what scope or action the mfa code is addressing. If not supplied, defaults to \"2FA\". | [optional]
+**message** | **str** | 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** | **int** | The number of digits for your mfa code. The valid number ranges from 2 to 8, inclusively. |
+
+## Example
+
+```python
+from bandwidth.models.code_request import CodeRequest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of CodeRequest from a JSON string
+code_request_instance = CodeRequest.from_json(json)
+# print the JSON string representation of the object
+print CodeRequest.to_json()
+
+# convert the object into a dict
+code_request_dict = code_request_instance.to_dict()
+# create an instance of CodeRequest from a dict
+code_request_form_dict = code_request.from_dict(code_request_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/Conference.md b/docs/Conference.md
new file mode 100644
index 00000000..a66b6593
--- /dev/null
+++ b/docs/Conference.md
@@ -0,0 +1,35 @@
+# Conference
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **str** | The Bandwidth-generated conference ID. | [optional]
+**name** | **str** | The name of the conference, as specified by your application. | [optional]
+**created_time** | **datetime** | The time the conference was initiated, in ISO 8601 format. | [optional]
+**completed_time** | **datetime** | The time the conference was terminated, in ISO 8601 format. | [optional]
+**conference_event_url** | **str** | The URL to send the conference-related events. | [optional]
+**conference_event_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional]
+**tag** | **str** | The custom string attached to the conference that will be sent with callbacks. | [optional]
+**active_members** | [**List[ConferenceMember]**](ConferenceMember.md) | A list of active members of the conference. Omitted if this is a response to the [Get Conferences endpoint](/apis/voice#tag/Conferences/operation/listConferences). | [optional]
+
+## Example
+
+```python
+from bandwidth.models.conference import Conference
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Conference from a JSON string
+conference_instance = Conference.from_json(json)
+# print the JSON string representation of the object
+print Conference.to_json()
+
+# convert the object into a dict
+conference_dict = conference_instance.to_dict()
+# create an instance of Conference from a dict
+conference_form_dict = conference.from_dict(conference_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/ConferenceCompletedCallback.md b/docs/ConferenceCompletedCallback.md
new file mode 100644
index 00000000..bf449190
--- /dev/null
+++ b/docs/ConferenceCompletedCallback.md
@@ -0,0 +1,33 @@
+# ConferenceCompletedCallback
+
+The Conference Completed event is fired when the last member leaves the conference. The response to this event may not contain BXML.
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**event_type** | **str** | 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** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional]
+**conference_id** | **str** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional]
+**name** | **str** | The user-specified name of the conference that was recorded | [optional]
+**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.conference_completed_callback import ConferenceCompletedCallback
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ConferenceCompletedCallback from a JSON string
+conference_completed_callback_instance = ConferenceCompletedCallback.from_json(json)
+# print the JSON string representation of the object
+print ConferenceCompletedCallback.to_json()
+
+# convert the object into a dict
+conference_completed_callback_dict = conference_completed_callback_instance.to_dict()
+# create an instance of ConferenceCompletedCallback from a dict
+conference_completed_callback_form_dict = conference_completed_callback.from_dict(conference_completed_callback_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/ConferenceCreatedCallback.md b/docs/ConferenceCreatedCallback.md
new file mode 100644
index 00000000..4a976b29
--- /dev/null
+++ b/docs/ConferenceCreatedCallback.md
@@ -0,0 +1,33 @@
+# ConferenceCreatedCallback
+
+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
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**event_type** | **str** | 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** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional]
+**conference_id** | **str** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional]
+**name** | **str** | The user-specified name of the conference that was recorded | [optional]
+**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.conference_created_callback import ConferenceCreatedCallback
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ConferenceCreatedCallback from a JSON string
+conference_created_callback_instance = ConferenceCreatedCallback.from_json(json)
+# print the JSON string representation of the object
+print ConferenceCreatedCallback.to_json()
+
+# convert the object into a dict
+conference_created_callback_dict = conference_created_callback_instance.to_dict()
+# create an instance of ConferenceCreatedCallback from a dict
+conference_created_callback_form_dict = conference_created_callback.from_dict(conference_created_callback_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/ConferenceMember.md b/docs/ConferenceMember.md
new file mode 100644
index 00000000..0a3395e2
--- /dev/null
+++ b/docs/ConferenceMember.md
@@ -0,0 +1,33 @@
+# ConferenceMember
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**call_id** | **str** | The call id associated with the event. | [optional]
+**conference_id** | **str** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional]
+**member_url** | **str** | 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** | **bool** | 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** | **bool** | 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** | **List[str]** | 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
+
+```python
+from bandwidth.models.conference_member import ConferenceMember
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ConferenceMember from a JSON string
+conference_member_instance = ConferenceMember.from_json(json)
+# print the JSON string representation of the object
+print ConferenceMember.to_json()
+
+# convert the object into a dict
+conference_member_dict = conference_member_instance.to_dict()
+# create an instance of ConferenceMember from a dict
+conference_member_form_dict = conference_member.from_dict(conference_member_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/ConferenceMemberExitCallback.md b/docs/ConferenceMemberExitCallback.md
new file mode 100644
index 00000000..db062db0
--- /dev/null
+++ b/docs/ConferenceMemberExitCallback.md
@@ -0,0 +1,36 @@
+# ConferenceMemberExitCallback
+
+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
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**event_type** | **str** | 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** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional]
+**conference_id** | **str** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional]
+**name** | **str** | The user-specified name of the conference that was recorded | [optional]
+**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional]
+**to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional]
+**call_id** | **str** | The call id associated with the event. | [optional]
+**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.conference_member_exit_callback import ConferenceMemberExitCallback
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ConferenceMemberExitCallback from a JSON string
+conference_member_exit_callback_instance = ConferenceMemberExitCallback.from_json(json)
+# print the JSON string representation of the object
+print ConferenceMemberExitCallback.to_json()
+
+# convert the object into a dict
+conference_member_exit_callback_dict = conference_member_exit_callback_instance.to_dict()
+# create an instance of ConferenceMemberExitCallback from a dict
+conference_member_exit_callback_form_dict = conference_member_exit_callback.from_dict(conference_member_exit_callback_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/ConferenceMemberJoinCallback.md b/docs/ConferenceMemberJoinCallback.md
new file mode 100644
index 00000000..af6ca5d8
--- /dev/null
+++ b/docs/ConferenceMemberJoinCallback.md
@@ -0,0 +1,36 @@
+# ConferenceMemberJoinCallback
+
+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
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**event_type** | **str** | 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** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional]
+**conference_id** | **str** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional]
+**name** | **str** | The user-specified name of the conference that was recorded | [optional]
+**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional]
+**to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional]
+**call_id** | **str** | The call id associated with the event. | [optional]
+**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.conference_member_join_callback import ConferenceMemberJoinCallback
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ConferenceMemberJoinCallback from a JSON string
+conference_member_join_callback_instance = ConferenceMemberJoinCallback.from_json(json)
+# print the JSON string representation of the object
+print ConferenceMemberJoinCallback.to_json()
+
+# convert the object into a dict
+conference_member_join_callback_dict = conference_member_join_callback_instance.to_dict()
+# create an instance of ConferenceMemberJoinCallback from a dict
+conference_member_join_callback_form_dict = conference_member_join_callback.from_dict(conference_member_join_callback_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/ConferenceRecordingAvailableCallback.md b/docs/ConferenceRecordingAvailableCallback.md
new file mode 100644
index 00000000..7a7ca2b9
--- /dev/null
+++ b/docs/ConferenceRecordingAvailableCallback.md
@@ -0,0 +1,42 @@
+# ConferenceRecordingAvailableCallback
+
+The Conference Recording Available event is sent after a conference recording has been processed. It indicates that the recording is available for download.
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**event_type** | **str** | 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** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional]
+**conference_id** | **str** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional]
+**name** | **str** | The user-specified name of the conference that was recorded | [optional]
+**account_id** | **str** | The user account associated with the call. | [optional]
+**recording_id** | **str** | The unique ID of this recording | [optional]
+**channels** | **int** | Always `1` for conference recordings; multi-channel recordings are not supported on conferences. | [optional]
+**start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional]
+**end_time** | **datetime** | The time that the recording ended in ISO-8601 format | [optional]
+**duration** | **str** | The duration of the recording in ISO-8601 format | [optional]
+**file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional]
+**media_url** | **str** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional]
+**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional]
+**status** | **str** | The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.conference_recording_available_callback import ConferenceRecordingAvailableCallback
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ConferenceRecordingAvailableCallback from a JSON string
+conference_recording_available_callback_instance = ConferenceRecordingAvailableCallback.from_json(json)
+# print the JSON string representation of the object
+print ConferenceRecordingAvailableCallback.to_json()
+
+# convert the object into a dict
+conference_recording_available_callback_dict = conference_recording_available_callback_instance.to_dict()
+# create an instance of ConferenceRecordingAvailableCallback from a dict
+conference_recording_available_callback_form_dict = conference_recording_available_callback.from_dict(conference_recording_available_callback_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/ConferenceRecordingMetadata.md b/docs/ConferenceRecordingMetadata.md
new file mode 100644
index 00000000..8f068ecd
--- /dev/null
+++ b/docs/ConferenceRecordingMetadata.md
@@ -0,0 +1,38 @@
+# ConferenceRecordingMetadata
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**account_id** | **str** | The user account associated with the call. | [optional]
+**conference_id** | **str** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional]
+**name** | **str** | The user-specified name of the conference that was recorded | [optional]
+**recording_id** | **str** | The unique ID of this recording | [optional]
+**duration** | **str** | The duration of the recording in ISO-8601 format | [optional]
+**channels** | **int** | Always `1` for conference recordings; multi-channel recordings are not supported on conferences. | [optional]
+**start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional]
+**end_time** | **datetime** | The time that the recording ended in ISO-8601 format | [optional]
+**file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional]
+**status** | **str** | The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional]
+**media_url** | **str** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.conference_recording_metadata import ConferenceRecordingMetadata
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ConferenceRecordingMetadata from a JSON string
+conference_recording_metadata_instance = ConferenceRecordingMetadata.from_json(json)
+# print the JSON string representation of the object
+print ConferenceRecordingMetadata.to_json()
+
+# convert the object into a dict
+conference_recording_metadata_dict = conference_recording_metadata_instance.to_dict()
+# create an instance of ConferenceRecordingMetadata from a dict
+conference_recording_metadata_form_dict = conference_recording_metadata.from_dict(conference_recording_metadata_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/ConferenceRedirectCallback.md b/docs/ConferenceRedirectCallback.md
new file mode 100644
index 00000000..e1c34958
--- /dev/null
+++ b/docs/ConferenceRedirectCallback.md
@@ -0,0 +1,33 @@
+# ConferenceRedirectCallback
+
+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
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**event_type** | **str** | 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** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional]
+**conference_id** | **str** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional]
+**name** | **str** | The user-specified name of the conference that was recorded | [optional]
+**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.conference_redirect_callback import ConferenceRedirectCallback
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ConferenceRedirectCallback from a JSON string
+conference_redirect_callback_instance = ConferenceRedirectCallback.from_json(json)
+# print the JSON string representation of the object
+print ConferenceRedirectCallback.to_json()
+
+# convert the object into a dict
+conference_redirect_callback_dict = conference_redirect_callback_instance.to_dict()
+# create an instance of ConferenceRedirectCallback from a dict
+conference_redirect_callback_form_dict = conference_redirect_callback.from_dict(conference_redirect_callback_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/ConferenceStateEnum.md b/docs/ConferenceStateEnum.md
new file mode 100644
index 00000000..91a8ca0a
--- /dev/null
+++ b/docs/ConferenceStateEnum.md
@@ -0,0 +1,11 @@
+# ConferenceStateEnum
+
+Setting the conference state to `completed` ends the conference and ejects all members.
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/ConferencesApi.md b/docs/ConferencesApi.md
new file mode 100644
index 00000000..86879936
--- /dev/null
+++ b/docs/ConferencesApi.md
@@ -0,0 +1,826 @@
+# 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**
+> bytearray download_conference_recording(account_id, conference_id, recording_id)
+
+Download Conference Recording
+
+Downloads the specified recording file.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.ConferencesApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # str | Programmable Voice API Conference ID.
+ recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Recording ID.
+
+ try:
+ # Download Conference Recording
+ api_response = api_instance.download_conference_recording(account_id, conference_id, recording_id)
+ print("The response of ConferencesApi->download_conference_recording:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling ConferencesApi->download_conference_recording: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **conference_id** | **str**| Programmable Voice API Conference ID. |
+ **recording_id** | **str**| Programmable Voice API Recording ID. |
+
+### Return type
+
+**bytearray**
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: audio/vnd.wave, audio/mpeg, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Media found | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**405** | Method Not Allowed | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | * Retry-After - When you should try your request again.
|
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **get_conference**
+> Conference get_conference(account_id, conference_id)
+
+Get Conference Information
+
+Returns information about the specified conference.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.models.conference import Conference
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.ConferencesApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # str | Programmable Voice API Conference ID.
+
+ try:
+ # Get Conference Information
+ api_response = api_instance.get_conference(account_id, conference_id)
+ print("The response of ConferencesApi->get_conference:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling ConferencesApi->get_conference: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **conference_id** | **str**| 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
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Conferences retrieved successfully | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**405** | Method Not Allowed | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | * Retry-After - When you should try your request again.
|
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **get_conference_member**
+> ConferenceMember get_conference_member(account_id, conference_id, member_id)
+
+Get Conference Member
+
+Returns information about the specified conference member.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.models.conference_member import ConferenceMember
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.ConferencesApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # str | Programmable Voice API Conference ID.
+ member_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Conference Member ID.
+
+ try:
+ # Get Conference Member
+ api_response = api_instance.get_conference_member(account_id, conference_id, member_id)
+ print("The response of ConferencesApi->get_conference_member:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling ConferencesApi->get_conference_member: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **conference_id** | **str**| Programmable Voice API Conference ID. |
+ **member_id** | **str**| 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
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Conference member found | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**405** | Method Not Allowed | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | * Retry-After - When you should try your request again.
|
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **get_conference_recording**
+> ConferenceRecordingMetadata get_conference_recording(account_id, conference_id, recording_id)
+
+Get Conference Recording Information
+
+Returns metadata for the specified recording.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.models.conference_recording_metadata import ConferenceRecordingMetadata
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.ConferencesApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # str | Programmable Voice API Conference ID.
+ recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Recording ID.
+
+ try:
+ # Get Conference Recording Information
+ api_response = api_instance.get_conference_recording(account_id, conference_id, recording_id)
+ print("The response of ConferencesApi->get_conference_recording:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling ConferencesApi->get_conference_recording: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **conference_id** | **str**| Programmable Voice API Conference ID. |
+ **recording_id** | **str**| 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
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Conference recording found | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**405** | Method Not Allowed | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | * Retry-After - When you should try your request again.
|
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **list_conference_recordings**
+> List[ConferenceRecordingMetadata] 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.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.models.conference_recording_metadata import ConferenceRecordingMetadata
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.ConferencesApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # str | Programmable Voice API Conference ID.
+
+ try:
+ # Get Conference Recordings
+ api_response = api_instance.list_conference_recordings(account_id, conference_id)
+ print("The response of ConferencesApi->list_conference_recordings:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling ConferencesApi->list_conference_recordings: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **conference_id** | **str**| Programmable Voice API Conference ID. |
+
+### Return type
+
+[**List[ConferenceRecordingMetadata]**](ConferenceRecordingMetadata.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Conference recordings retrieved successfully | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**405** | Method Not Allowed | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | * Retry-After - When you should try your request again.
|
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **list_conferences**
+> List[Conference] list_conferences(account_id, name=name, min_created_time=min_created_time, max_created_time=max_created_time, page_size=page_size, page_token=page_token)
+
+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.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.models.conference import Conference
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.ConferencesApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ name = 'my-custom-name' # str | Filter results by the `name` field. (optional)
+ min_created_time = '2022-06-21T19:13:21Z' # str | Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format). (optional)
+ max_created_time = '2022-06-21T19:13:21Z' # str | Filter results to conferences which have a `createdTime` before or at `maxCreatedTime` (in ISO8601 format). (optional)
+ page_size = 1000 # int | Specifies the max number of conferences that will be returned. (optional) (default to 1000)
+ page_token = 'page_token_example' # str | Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description. (optional)
+
+ try:
+ # Get Conferences
+ api_response = api_instance.list_conferences(account_id, name=name, min_created_time=min_created_time, max_created_time=max_created_time, page_size=page_size, page_token=page_token)
+ print("The response of ConferencesApi->list_conferences:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling ConferencesApi->list_conferences: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **name** | **str**| Filter results by the `name` field. | [optional]
+ **min_created_time** | **str**| Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format). | [optional]
+ **max_created_time** | **str**| Filter results to conferences which have a `createdTime` before or at `maxCreatedTime` (in ISO8601 format). | [optional]
+ **page_size** | **int**| Specifies the max number of conferences that will be returned. | [optional] [default to 1000]
+ **page_token** | **str**| Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description. | [optional]
+
+### Return type
+
+[**List[Conference]**](Conference.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Conferences retrieved successfully | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**405** | Method Not Allowed | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | * Retry-After - When you should try your request again.
|
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **update_conference**
+> update_conference(account_id, conference_id, update_conference)
+
+Update Conference
+
+Update the conference state.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.models.update_conference import UpdateConference
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.ConferencesApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # str | Programmable Voice API Conference ID.
+ update_conference = bandwidth.UpdateConference() # UpdateConference |
+
+ try:
+ # Update Conference
+ api_instance.update_conference(account_id, conference_id, update_conference)
+ except Exception as e:
+ print("Exception when calling ConferencesApi->update_conference: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **conference_id** | **str**| Programmable Voice API Conference ID. |
+ **update_conference** | [**UpdateConference**](UpdateConference.md)| |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**204** | Conference was successfully modified. | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**405** | Method Not Allowed | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | * Retry-After - When you should try your request again.
|
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **update_conference_bxml**
+> update_conference_bxml(account_id, conference_id, body)
+
+Update Conference BXML
+
+Update the conference BXML document.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.ConferencesApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # str | Programmable Voice API Conference ID.
+ body =
+
+
+ # str |
+
+ try:
+ # Update Conference BXML
+ api_instance.update_conference_bxml(account_id, conference_id, body)
+ except Exception as e:
+ print("Exception when calling ConferencesApi->update_conference_bxml: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **conference_id** | **str**| Programmable Voice API Conference ID. |
+ **body** | **str**| |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+ - **Content-Type**: application/xml
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**204** | Conference successfully modified. | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**405** | Method Not Allowed | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | * Retry-After - When you should try your request again.
|
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **update_conference_member**
+> update_conference_member(account_id, conference_id, member_id, update_conference_member)
+
+Update Conference Member
+
+Updates settings for a particular conference member.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.models.update_conference_member import UpdateConferenceMember
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.ConferencesApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # str | Programmable Voice API Conference ID.
+ member_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Conference Member ID.
+ update_conference_member = bandwidth.UpdateConferenceMember() # UpdateConferenceMember |
+
+ try:
+ # Update Conference Member
+ api_instance.update_conference_member(account_id, conference_id, member_id, update_conference_member)
+ except Exception as e:
+ print("Exception when calling ConferencesApi->update_conference_member: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **conference_id** | **str**| Programmable Voice API Conference ID. |
+ **member_id** | **str**| Programmable Voice API Conference Member ID. |
+ **update_conference_member** | [**UpdateConferenceMember**](UpdateConferenceMember.md)| |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**204** | Conference member was successfully modified. | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**405** | Method Not Allowed | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | * Retry-After - When you should try your request again.
|
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/docs/CreateCall.md b/docs/CreateCall.md
new file mode 100644
index 00000000..e5ba0658
--- /dev/null
+++ b/docs/CreateCall.md
@@ -0,0 +1,47 @@
+# CreateCall
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**to** | **str** | The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.example`)). |
+**var_from** | **str** | A Bandwidth phone number on your account the call should come from (must be in E.164 format, like `+15555551212`, or be one of the following strings: `Restricted`, `Anonymous`, `Private`, or `Unavailable`). |
+**display_name** | **str** | The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. | [optional]
+**uui** | **str** | A comma-separated list of 'User-To-User' headers to be sent in the INVITE when calling a SIP URI. Each value must end with an 'encoding' parameter as described in <a href='https://tools.ietf.org/html/rfc7433'>RFC 7433</a>. Only 'jwt' and 'base64' encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators. | [optional]
+**application_id** | **str** | The id of the application associated with the `from` number. |
+**answer_url** | **str** | The full URL to send the <a href='/docs/voice/webhooks/answer'>Answer</a> event to when the called party answers. This endpoint should return the first <a href='/docs/voice/bxml'>BXML document</a> to be executed in the call. Must use `https` if specifying `username` and `password`. |
+**answer_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional]
+**username** | **str** | Basic auth username. | [optional]
+**password** | **str** | Basic auth password. | [optional]
+**answer_fallback_url** | **str** | A fallback url which, if provided, will be used to retry the `answer` webhook delivery in case `answerUrl` fails to respond Must use `https` if specifying `fallbackUsername` and `fallbackPassword`. | [optional]
+**answer_fallback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional]
+**fallback_username** | **str** | Basic auth username. | [optional]
+**fallback_password** | **str** | Basic auth password. | [optional]
+**disconnect_url** | **str** | The URL to send the <a href='/docs/voice/webhooks/disconnect'>Disconnect</a> event to when the call ends. This event does not expect a BXML response. | [optional]
+**disconnect_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional]
+**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** | **int** | 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** | **str** | 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
+
+```python
+from bandwidth.models.create_call import CreateCall
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of CreateCall from a JSON string
+create_call_instance = CreateCall.from_json(json)
+# print the JSON string representation of the object
+print CreateCall.to_json()
+
+# convert the object into a dict
+create_call_dict = create_call_instance.to_dict()
+# create an instance of CreateCall from a dict
+create_call_form_dict = create_call.from_dict(create_call_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/CreateCallResponse.md b/docs/CreateCallResponse.md
new file mode 100644
index 00000000..f40cad98
--- /dev/null
+++ b/docs/CreateCallResponse.md
@@ -0,0 +1,48 @@
+# CreateCallResponse
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**application_id** | **str** | The id of the application associated with the `from` number. |
+**account_id** | **str** | The bandwidth account ID associated with the call. |
+**call_id** | **str** | Programmable Voice API Call ID. |
+**to** | **str** | Recipient of the outgoing call. |
+**var_from** | **str** | Phone number that created the outbound call. |
+**enqueued_time** | **datetime** | The time at which the call was accepted into the queue. | [optional]
+**call_url** | **str** | 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** | **str** | Custom tag value. | [optional]
+**answer_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | |
+**answer_url** | **str** | URL to deliver the `answer` event webhook. |
+**answer_fallback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional]
+**answer_fallback_url** | **str** | Fallback URL to deliver the `answer` event webhook. | [optional]
+**disconnect_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | |
+**disconnect_url** | **str** | URL to deliver the `disconnect` event webhook. | [optional]
+**username** | **str** | Basic auth username. | [optional]
+**password** | **str** | Basic auth password. | [optional]
+**fallback_username** | **str** | Basic auth username. | [optional]
+**fallback_password** | **str** | Basic auth password. | [optional]
+**priority** | **int** | The priority of this call over other calls from your account. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.create_call_response import CreateCallResponse
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of CreateCallResponse from a JSON string
+create_call_response_instance = CreateCallResponse.from_json(json)
+# print the JSON string representation of the object
+print CreateCallResponse.to_json()
+
+# convert the object into a dict
+create_call_response_dict = create_call_response_instance.to_dict()
+# create an instance of CreateCallResponse from a dict
+create_call_response_form_dict = create_call_response.from_dict(create_call_response_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/CreateLookupResponse.md b/docs/CreateLookupResponse.md
new file mode 100644
index 00000000..98b97e9b
--- /dev/null
+++ b/docs/CreateLookupResponse.md
@@ -0,0 +1,30 @@
+# CreateLookupResponse
+
+The request has been accepted for processing but not yet finished and in a terminal state (COMPLETE, PARTIAL_COMPLETE, or FAILED).
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**request_id** | **str** | The phone number lookup request ID from Bandwidth. | [optional]
+**status** | [**LookupStatusEnum**](LookupStatusEnum.md) | | [optional]
+
+## Example
+
+```python
+from bandwidth.models.create_lookup_response import CreateLookupResponse
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of CreateLookupResponse from a JSON string
+create_lookup_response_instance = CreateLookupResponse.from_json(json)
+# print the JSON string representation of the object
+print CreateLookupResponse.to_json()
+
+# convert the object into a dict
+create_lookup_response_dict = create_lookup_response_instance.to_dict()
+# create an instance of CreateLookupResponse from a dict
+create_lookup_response_form_dict = create_lookup_response.from_dict(create_lookup_response_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/CreateMessageRequestError.md b/docs/CreateMessageRequestError.md
new file mode 100644
index 00000000..d079b313
--- /dev/null
+++ b/docs/CreateMessageRequestError.md
@@ -0,0 +1,30 @@
+# CreateMessageRequestError
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**type** | **str** | |
+**description** | **str** | |
+**field_errors** | [**List[FieldError]**](FieldError.md) | | [optional]
+
+## Example
+
+```python
+from bandwidth.models.create_message_request_error import CreateMessageRequestError
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of CreateMessageRequestError from a JSON string
+create_message_request_error_instance = CreateMessageRequestError.from_json(json)
+# print the JSON string representation of the object
+print CreateMessageRequestError.to_json()
+
+# convert the object into a dict
+create_message_request_error_dict = create_message_request_error_instance.to_dict()
+# create an instance of CreateMessageRequestError from a dict
+create_message_request_error_form_dict = create_message_request_error.from_dict(create_message_request_error_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/DeferredResult.md b/docs/DeferredResult.md
new file mode 100644
index 00000000..228ed4a2
--- /dev/null
+++ b/docs/DeferredResult.md
@@ -0,0 +1,29 @@
+# DeferredResult
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**result** | **object** | | [optional]
+**set_or_expired** | **bool** | | [optional]
+
+## Example
+
+```python
+from bandwidth.models.deferred_result import DeferredResult
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DeferredResult from a JSON string
+deferred_result_instance = DeferredResult.from_json(json)
+# print the JSON string representation of the object
+print DeferredResult.to_json()
+
+# convert the object into a dict
+deferred_result_dict = deferred_result_instance.to_dict()
+# create an instance of DeferredResult from a dict
+deferred_result_form_dict = deferred_result.from_dict(deferred_result_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/DisconnectCallback.md b/docs/DisconnectCallback.md
new file mode 100644
index 00000000..d7fb29b5
--- /dev/null
+++ b/docs/DisconnectCallback.md
@@ -0,0 +1,45 @@
+# DisconnectCallback
+
+The Disconnect event is fired when a call ends, for any reason.
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**event_type** | **str** | 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** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional]
+**account_id** | **str** | The user account associated with the call. | [optional]
+**application_id** | **str** | The id of the application associated with the call. | [optional]
+**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional]
+**to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional]
+**call_id** | **str** | The call id associated with the event. | [optional]
+**direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional]
+**call_url** | **str** | The URL of the call associated with the event. | [optional]
+**enqueued_time** | **datetime** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional]
+**start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional]
+**answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional]
+**end_time** | **datetime** | The time that the recording ended in ISO-8601 format | [optional]
+**cause** | **str** | Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown. | [optional]
+**error_message** | **str** | Text explaining the reason that caused the call to fail in case of errors. | [optional]
+**error_id** | **str** | Bandwidth's internal id that references the error event. | [optional]
+**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.disconnect_callback import DisconnectCallback
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DisconnectCallback from a JSON string
+disconnect_callback_instance = DisconnectCallback.from_json(json)
+# print the JSON string representation of the object
+print DisconnectCallback.to_json()
+
+# convert the object into a dict
+disconnect_callback_dict = disconnect_callback_instance.to_dict()
+# create an instance of DisconnectCallback from a dict
+disconnect_callback_form_dict = disconnect_callback.from_dict(disconnect_callback_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/Diversion.md b/docs/Diversion.md
new file mode 100644
index 00000000..210f52b0
--- /dev/null
+++ b/docs/Diversion.md
@@ -0,0 +1,34 @@
+# Diversion
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**reason** | **str** | 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** | **str** | off or full | [optional]
+**screen** | **str** | No if the number was provided by the user, yes if the number was provided by the network | [optional]
+**counter** | **str** | The number of diversions that have occurred | [optional]
+**limit** | **str** | The maximum number of diversions allowed for this session | [optional]
+**unknown** | **str** | 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** | **str** | Always present. Indicates the last telephone number that the call was diverted from. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.diversion import Diversion
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Diversion from a JSON string
+diversion_instance = Diversion.from_json(json)
+# print the JSON string representation of the object
+print Diversion.to_json()
+
+# convert the object into a dict
+diversion_dict = diversion_instance.to_dict()
+# create an instance of Diversion from a dict
+diversion_form_dict = diversion.from_dict(diversion_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/DtmfCallback.md b/docs/DtmfCallback.md
new file mode 100644
index 00000000..f07d87aa
--- /dev/null
+++ b/docs/DtmfCallback.md
@@ -0,0 +1,45 @@
+# DtmfCallback
+
+The DTMF event is sent for every digit detected after a verb is executed. You may not respond to this event with BXML.
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**event_type** | **str** | 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** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional]
+**account_id** | **str** | The user account associated with the call. | [optional]
+**application_id** | **str** | The id of the application associated with the call. | [optional]
+**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional]
+**to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional]
+**call_id** | **str** | The call id associated with the event. | [optional]
+**direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional]
+**digit** | **str** | The digit collected in the call. | [optional]
+**call_url** | **str** | The URL of the call associated with the event. | [optional]
+**enqueued_time** | **datetime** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional]
+**start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional]
+**answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional]
+**parent_call_id** | **str** | (optional) If the event is related to the B leg of a <Transfer>, the call id of the original call leg that executed the <Transfer>. Otherwise, this field will not be present. | [optional]
+**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional]
+**transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional]
+**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.dtmf_callback import DtmfCallback
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DtmfCallback from a JSON string
+dtmf_callback_instance = DtmfCallback.from_json(json)
+# print the JSON string representation of the object
+print DtmfCallback.to_json()
+
+# convert the object into a dict
+dtmf_callback_dict = dtmf_callback_instance.to_dict()
+# create an instance of DtmfCallback from a dict
+dtmf_callback_form_dict = dtmf_callback.from_dict(dtmf_callback_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/FieldError.md b/docs/FieldError.md
new file mode 100644
index 00000000..95d6ad78
--- /dev/null
+++ b/docs/FieldError.md
@@ -0,0 +1,29 @@
+# FieldError
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**field_name** | **str** | The name of the field that contains the error | [optional]
+**description** | **str** | The error associated with the field | [optional]
+
+## Example
+
+```python
+from bandwidth.models.field_error import FieldError
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of FieldError from a JSON string
+field_error_instance = FieldError.from_json(json)
+# print the JSON string representation of the object
+print FieldError.to_json()
+
+# convert the object into a dict
+field_error_dict = field_error_instance.to_dict()
+# create an instance of FieldError from a dict
+field_error_form_dict = field_error.from_dict(field_error_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/FileFormatEnum.md b/docs/FileFormatEnum.md
new file mode 100644
index 00000000..149b4ac0
--- /dev/null
+++ b/docs/FileFormatEnum.md
@@ -0,0 +1,11 @@
+# FileFormatEnum
+
+The format that the recording is stored in.
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/GatherCallback.md b/docs/GatherCallback.md
new file mode 100644
index 00000000..72bb5747
--- /dev/null
+++ b/docs/GatherCallback.md
@@ -0,0 +1,46 @@
+# GatherCallback
+
+The gather event is sent after a verb is executed. Its purpose is to report the gathered digits to the calling application.
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**event_type** | **str** | 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** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional]
+**account_id** | **str** | The user account associated with the call. | [optional]
+**application_id** | **str** | The id of the application associated with the call. | [optional]
+**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional]
+**to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional]
+**direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional]
+**call_id** | **str** | The call id associated with the event. | [optional]
+**digits** | **str** | (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** | **str** | The URL of the call associated with the event. | [optional]
+**enqueued_time** | **datetime** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional]
+**start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional]
+**answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional]
+**parent_call_id** | **str** | (optional) If the event is related to the B leg of a <Transfer>, the call id of the original call leg that executed the <Transfer>. Otherwise, this field will not be present. | [optional]
+**terminating_digit** | **str** | (optional) The digit the user pressed to end the gather. Empty string value if no terminating digit was pressed. | [optional]
+**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional]
+**transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional]
+**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.gather_callback import GatherCallback
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of GatherCallback from a JSON string
+gather_callback_instance = GatherCallback.from_json(json)
+# print the JSON string representation of the object
+print GatherCallback.to_json()
+
+# convert the object into a dict
+gather_callback_dict = gather_callback_instance.to_dict()
+# create an instance of GatherCallback from a dict
+gather_callback_form_dict = gather_callback.from_dict(gather_callback_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/InboundMessageCallback.md b/docs/InboundMessageCallback.md
new file mode 100644
index 00000000..68d66d67
--- /dev/null
+++ b/docs/InboundMessageCallback.md
@@ -0,0 +1,33 @@
+# InboundMessageCallback
+
+Inbound Message Callback
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**time** | **datetime** | |
+**type** | **str** | |
+**to** | **str** | |
+**description** | **str** | |
+**message** | [**InboundMessageCallbackMessage**](InboundMessageCallbackMessage.md) | |
+
+## Example
+
+```python
+from bandwidth.models.inbound_message_callback import InboundMessageCallback
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of InboundMessageCallback from a JSON string
+inbound_message_callback_instance = InboundMessageCallback.from_json(json)
+# print the JSON string representation of the object
+print InboundMessageCallback.to_json()
+
+# convert the object into a dict
+inbound_message_callback_dict = inbound_message_callback_instance.to_dict()
+# create an instance of InboundMessageCallback from a dict
+inbound_message_callback_form_dict = inbound_message_callback.from_dict(inbound_message_callback_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/InboundMessageCallbackMessage.md b/docs/InboundMessageCallbackMessage.md
new file mode 100644
index 00000000..33230fe3
--- /dev/null
+++ b/docs/InboundMessageCallbackMessage.md
@@ -0,0 +1,40 @@
+# InboundMessageCallbackMessage
+
+Inbound Message Callback Message Schema
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **str** | |
+**owner** | **str** | |
+**application_id** | **str** | |
+**time** | **datetime** | |
+**segment_count** | **int** | |
+**direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | |
+**to** | **List[str]** | |
+**var_from** | **str** | |
+**text** | **str** | |
+**tag** | **str** | | [optional]
+**media** | **List[str]** | | [optional]
+**priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional]
+
+## Example
+
+```python
+from bandwidth.models.inbound_message_callback_message import InboundMessageCallbackMessage
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of InboundMessageCallbackMessage from a JSON string
+inbound_message_callback_message_instance = InboundMessageCallbackMessage.from_json(json)
+# print the JSON string representation of the object
+print InboundMessageCallbackMessage.to_json()
+
+# convert the object into a dict
+inbound_message_callback_message_dict = inbound_message_callback_message_instance.to_dict()
+# create an instance of InboundMessageCallbackMessage from a dict
+inbound_message_callback_message_form_dict = inbound_message_callback_message.from_dict(inbound_message_callback_message_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/InitiateCallback.md b/docs/InitiateCallback.md
new file mode 100644
index 00000000..2f7b5860
--- /dev/null
+++ b/docs/InitiateCallback.md
@@ -0,0 +1,40 @@
+# InitiateCallback
+
+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
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**event_type** | **str** | 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** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional]
+**account_id** | **str** | The user account associated with the call. | [optional]
+**application_id** | **str** | The id of the application associated with the call. | [optional]
+**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional]
+**to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional]
+**direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional]
+**call_id** | **str** | The call id associated with the event. | [optional]
+**call_url** | **str** | The URL of the call associated with the event. | [optional]
+**start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional]
+**diversion** | [**Diversion**](Diversion.md) | | [optional]
+**stir_shaken** | [**StirShaken**](StirShaken.md) | | [optional]
+
+## Example
+
+```python
+from bandwidth.models.initiate_callback import InitiateCallback
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of InitiateCallback from a JSON string
+initiate_callback_instance = InitiateCallback.from_json(json)
+# print the JSON string representation of the object
+print InitiateCallback.to_json()
+
+# convert the object into a dict
+initiate_callback_dict = initiate_callback_instance.to_dict()
+# create an instance of InitiateCallback from a dict
+initiate_callback_form_dict = initiate_callback.from_dict(initiate_callback_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/ListMessageDirectionEnum.md b/docs/ListMessageDirectionEnum.md
new file mode 100644
index 00000000..c39a3328
--- /dev/null
+++ b/docs/ListMessageDirectionEnum.md
@@ -0,0 +1,11 @@
+# ListMessageDirectionEnum
+
+The direction of the message. One of INBOUND OUTBOUND.
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/ListMessageItem.md b/docs/ListMessageItem.md
new file mode 100644
index 00000000..ffd5a30c
--- /dev/null
+++ b/docs/ListMessageItem.md
@@ -0,0 +1,44 @@
+# ListMessageItem
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**message_id** | **str** | The message id | [optional]
+**account_id** | **str** | The account id associated with this message. | [optional]
+**source_tn** | **str** | The source phone number of the message. | [optional]
+**destination_tn** | **str** | 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** | **int** | The number of segments the message was sent as. | [optional]
+**error_code** | **int** | The numeric error code of the message. | [optional]
+**receive_time** | **datetime** | The ISO 8601 datetime of the message. | [optional]
+**carrier_name** | **str** | The name of the carrier. Not currently supported for MMS coming soon. | [optional]
+**message_size** | **int** | The size of the message including message content and headers. | [optional]
+**message_length** | **int** | The length of the message content. | [optional]
+**attachment_count** | **int** | The number of attachments the message has. | [optional]
+**recipient_count** | **int** | The number of recipients the message has. | [optional]
+**campaign_class** | **str** | The campaign class of the message if it has one. | [optional]
+**campaign_id** | **str** | The campaign ID of the message if it has one. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.list_message_item import ListMessageItem
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ListMessageItem from a JSON string
+list_message_item_instance = ListMessageItem.from_json(json)
+# print the JSON string representation of the object
+print ListMessageItem.to_json()
+
+# convert the object into a dict
+list_message_item_dict = list_message_item_instance.to_dict()
+# create an instance of ListMessageItem from a dict
+list_message_item_form_dict = list_message_item.from_dict(list_message_item_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/LookupRequest.md b/docs/LookupRequest.md
new file mode 100644
index 00000000..78c3debf
--- /dev/null
+++ b/docs/LookupRequest.md
@@ -0,0 +1,29 @@
+# LookupRequest
+
+Create phone number lookup request.
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**tns** | **List[str]** | |
+
+## Example
+
+```python
+from bandwidth.models.lookup_request import LookupRequest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of LookupRequest from a JSON string
+lookup_request_instance = LookupRequest.from_json(json)
+# print the JSON string representation of the object
+print LookupRequest.to_json()
+
+# convert the object into a dict
+lookup_request_dict = lookup_request_instance.to_dict()
+# create an instance of LookupRequest from a dict
+lookup_request_form_dict = lookup_request.from_dict(lookup_request_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/LookupResult.md b/docs/LookupResult.md
new file mode 100644
index 00000000..6b0900d6
--- /dev/null
+++ b/docs/LookupResult.md
@@ -0,0 +1,37 @@
+# LookupResult
+
+Carrier information results for the specified telephone number.
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**response_code** | **int** | Our vendor's response code. | [optional]
+**message** | **str** | Message associated with the response code. | [optional]
+**e_164_format** | **str** | The telephone number in E.164 format. | [optional]
+**formatted** | **str** | The formatted version of the telephone number. | [optional]
+**country** | **str** | The country of the telephone number. | [optional]
+**line_type** | **str** | The line type of the telephone number. | [optional]
+**line_provider** | **str** | The messaging service provider of the telephone number. | [optional]
+**mobile_country_code** | **str** | The first half of the Home Network Identity (HNI). | [optional]
+**mobile_network_code** | **str** | The second half of the HNI. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.lookup_result import LookupResult
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of LookupResult from a JSON string
+lookup_result_instance = LookupResult.from_json(json)
+# print the JSON string representation of the object
+print LookupResult.to_json()
+
+# convert the object into a dict
+lookup_result_dict = lookup_result_instance.to_dict()
+# create an instance of LookupResult from a dict
+lookup_result_form_dict = lookup_result.from_dict(lookup_result_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/LookupStatus.md b/docs/LookupStatus.md
new file mode 100644
index 00000000..fd445292
--- /dev/null
+++ b/docs/LookupStatus.md
@@ -0,0 +1,32 @@
+# LookupStatus
+
+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
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**request_id** | **str** | The requestId. | [optional]
+**status** | [**LookupStatusEnum**](LookupStatusEnum.md) | | [optional]
+**result** | [**List[LookupResult]**](LookupResult.md) | The carrier information results for the specified telephone number. | [optional]
+**failed_telephone_numbers** | **List[str]** | The telephone numbers whose lookup failed. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.lookup_status import LookupStatus
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of LookupStatus from a JSON string
+lookup_status_instance = LookupStatus.from_json(json)
+# print the JSON string representation of the object
+print LookupStatus.to_json()
+
+# convert the object into a dict
+lookup_status_dict = lookup_status_instance.to_dict()
+# create an instance of LookupStatus from a dict
+lookup_status_form_dict = lookup_status.from_dict(lookup_status_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/LookupStatusEnum.md b/docs/LookupStatusEnum.md
new file mode 100644
index 00000000..d5486493
--- /dev/null
+++ b/docs/LookupStatusEnum.md
@@ -0,0 +1,11 @@
+# LookupStatusEnum
+
+The status of the request (IN_PROGRESS, COMPLETE, PARTIAL_COMPLETE, or FAILED).
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/MFAApi.md b/docs/MFAApi.md
new file mode 100644
index 00000000..ef3e2b7f
--- /dev/null
+++ b/docs/MFAApi.md
@@ -0,0 +1,267 @@
+# 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**
+> MessagingCodeResponse generate_messaging_code(account_id, code_request)
+
+Messaging Authentication Code
+
+Send an MFA code via text message (SMS).
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.models.code_request import CodeRequest
+from bandwidth.models.messaging_code_response import MessagingCodeResponse
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.MFAApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ code_request = bandwidth.CodeRequest() # CodeRequest | MFA code request body.
+
+ try:
+ # Messaging Authentication Code
+ api_response = api_instance.generate_messaging_code(account_id, code_request)
+ print("The response of MFAApi->generate_messaging_code:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling MFAApi->generate_messaging_code: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **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
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | OK | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **generate_voice_code**
+> VoiceCodeResponse generate_voice_code(account_id, code_request)
+
+Voice Authentication Code
+
+Send an MFA Code via a phone call.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.models.code_request import CodeRequest
+from bandwidth.models.voice_code_response import VoiceCodeResponse
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.MFAApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ code_request = bandwidth.CodeRequest() # CodeRequest | MFA code request body.
+
+ try:
+ # Voice Authentication Code
+ api_response = api_instance.generate_voice_code(account_id, code_request)
+ print("The response of MFAApi->generate_voice_code:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling MFAApi->generate_voice_code: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **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
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | OK | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **verify_code**
+> VerifyCodeResponse verify_code(account_id, verify_code_request)
+
+Verify Authentication Code
+
+Verify a previously sent MFA code.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.models.verify_code_request import VerifyCodeRequest
+from bandwidth.models.verify_code_response import VerifyCodeResponse
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.MFAApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ verify_code_request = bandwidth.VerifyCodeRequest() # VerifyCodeRequest | MFA code verify request body.
+
+ try:
+ # Verify Authentication Code
+ api_response = api_instance.verify_code(account_id, verify_code_request)
+ print("The response of MFAApi->verify_code:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling MFAApi->verify_code: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **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
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | OK | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**429** | Too Many Requests | - |
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/docs/MachineDetectionCompleteCallback.md b/docs/MachineDetectionCompleteCallback.md
new file mode 100644
index 00000000..21838990
--- /dev/null
+++ b/docs/MachineDetectionCompleteCallback.md
@@ -0,0 +1,42 @@
+# MachineDetectionCompleteCallback
+
+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
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**event_type** | **str** | 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** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional]
+**account_id** | **str** | The user account associated with the call. | [optional]
+**application_id** | **str** | The id of the application associated with the call. | [optional]
+**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional]
+**to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional]
+**direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional]
+**call_id** | **str** | The call id associated with the event. | [optional]
+**call_url** | **str** | The URL of the call associated with the event. | [optional]
+**enqueued_time** | **datetime** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional]
+**start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional]
+**answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional]
+**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional]
+**machine_detection_result** | [**MachineDetectionResult**](MachineDetectionResult.md) | | [optional]
+
+## Example
+
+```python
+from bandwidth.models.machine_detection_complete_callback import MachineDetectionCompleteCallback
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MachineDetectionCompleteCallback from a JSON string
+machine_detection_complete_callback_instance = MachineDetectionCompleteCallback.from_json(json)
+# print the JSON string representation of the object
+print MachineDetectionCompleteCallback.to_json()
+
+# convert the object into a dict
+machine_detection_complete_callback_dict = machine_detection_complete_callback_instance.to_dict()
+# create an instance of MachineDetectionCompleteCallback from a dict
+machine_detection_complete_callback_form_dict = machine_detection_complete_callback.from_dict(machine_detection_complete_callback_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/MachineDetectionConfiguration.md b/docs/MachineDetectionConfiguration.md
new file mode 100644
index 00000000..ba9e4bd4
--- /dev/null
+++ b/docs/MachineDetectionConfiguration.md
@@ -0,0 +1,43 @@
+# MachineDetectionConfiguration
+
+The machine detection request used to perform machine detection on the call.
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**mode** | [**MachineDetectionModeEnum**](MachineDetectionModeEnum.md) | | [optional]
+**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** | **bool** | If set to 'true' and if an answering machine is detected, the 'answering-machine' callback will be delayed until the machine is done speaking, or an end of message tone is detected, or until the 'detectionTimeout' is exceeded. If false, the 'answering-machine' result is sent immediately. | [optional] [default to False]
+**callback_url** | **str** | The URL to send the 'machineDetectionComplete' webhook when the detection is completed. Only for 'async' mode. | [optional]
+**callback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional]
+**username** | **str** | Basic auth username. | [optional]
+**password** | **str** | Basic auth password. | [optional]
+**fallback_url** | **str** | A fallback URL which, if provided, will be used to retry the machine detection complete webhook delivery in case `callbackUrl` fails to respond | [optional]
+**fallback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional]
+**fallback_username** | **str** | Basic auth username. | [optional]
+**fallback_password** | **str** | Basic auth password. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.machine_detection_configuration import MachineDetectionConfiguration
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MachineDetectionConfiguration from a JSON string
+machine_detection_configuration_instance = MachineDetectionConfiguration.from_json(json)
+# print the JSON string representation of the object
+print MachineDetectionConfiguration.to_json()
+
+# convert the object into a dict
+machine_detection_configuration_dict = machine_detection_configuration_instance.to_dict()
+# create an instance of MachineDetectionConfiguration from a dict
+machine_detection_configuration_form_dict = machine_detection_configuration.from_dict(machine_detection_configuration_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/MachineDetectionModeEnum.md b/docs/MachineDetectionModeEnum.md
new file mode 100644
index 00000000..66804762
--- /dev/null
+++ b/docs/MachineDetectionModeEnum.md
@@ -0,0 +1,11 @@
+# MachineDetectionModeEnum
+
+The machine detection mode. If set to 'async', the detection result will be sent in a 'machineDetectionComplete' callback. If set to 'sync', the 'answer' callback will wait for the machine detection to complete and will include its result.
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/MachineDetectionResult.md b/docs/MachineDetectionResult.md
new file mode 100644
index 00000000..f7447ae6
--- /dev/null
+++ b/docs/MachineDetectionResult.md
@@ -0,0 +1,30 @@
+# MachineDetectionResult
+
+(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
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**value** | **str** | Possible values are answering-machine, human, silence, timeout, or error. | [optional]
+**duration** | **str** | The amount of time it took to determine the result. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.machine_detection_result import MachineDetectionResult
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MachineDetectionResult from a JSON string
+machine_detection_result_instance = MachineDetectionResult.from_json(json)
+# print the JSON string representation of the object
+print MachineDetectionResult.to_json()
+
+# convert the object into a dict
+machine_detection_result_dict = machine_detection_result_instance.to_dict()
+# create an instance of MachineDetectionResult from a dict
+machine_detection_result_form_dict = machine_detection_result.from_dict(machine_detection_result_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/Media.md b/docs/Media.md
new file mode 100644
index 00000000..3c2c5a1e
--- /dev/null
+++ b/docs/Media.md
@@ -0,0 +1,30 @@
+# Media
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**content** | **str** | | [optional]
+**content_length** | **int** | | [optional]
+**media_name** | **str** | | [optional]
+
+## Example
+
+```python
+from bandwidth.models.media import Media
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Media from a JSON string
+media_instance = Media.from_json(json)
+# print the JSON string representation of the object
+print Media.to_json()
+
+# convert the object into a dict
+media_dict = media_instance.to_dict()
+# create an instance of Media from a dict
+media_form_dict = media.from_dict(media_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/MediaApi.md b/docs/MediaApi.md
new file mode 100644
index 00000000..52c14370
--- /dev/null
+++ b/docs/MediaApi.md
@@ -0,0 +1,363 @@
+# 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.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.MediaApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ media_id = '14762070468292kw2fuqty55yp2b2/0/bw.png' # str | Media ID to retrieve.
+
+ try:
+ # Delete Media
+ api_instance.delete_media(account_id, media_id)
+ except Exception as e:
+ print("Exception when calling MediaApi->delete_media: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **media_id** | **str**| Media ID to retrieve. |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**204** | No Content | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**406** | Not Acceptable | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | - |
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **get_media**
+> bytearray get_media(account_id, media_id)
+
+Get Media
+
+Downloads a media file you previously uploaded.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.MediaApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ media_id = '14762070468292kw2fuqty55yp2b2/0/bw.png' # str | Media ID to retrieve.
+
+ try:
+ # Get Media
+ api_response = api_instance.get_media(account_id, media_id)
+ print("The response of MediaApi->get_media:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling MediaApi->get_media: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **media_id** | **str**| Media ID to retrieve. |
+
+### Return type
+
+**bytearray**
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/octet-stream, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | OK | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**406** | Not Acceptable | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | - |
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **list_media**
+> List[Media] list_media(account_id, continuation_token=continuation_token)
+
+List Media
+
+Gets a list of your media files. No query parameters are supported.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.models.media import Media
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.MediaApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ continuation_token = '1XEi2tsFtLo1JbtLwETnM1ZJ+PqAa8w6ENvC5QKvwyrCDYII663Gy5M4s40owR1tjkuWUif6qbWvFtQJR5/ipqbUnfAqL254LKNlPy6tATCzioKSuHuOqgzloDkSwRtX0LtcL2otHS69hK343m+SjdL+vlj71tT39' # str | Continuation token used to retrieve subsequent media. (optional)
+
+ try:
+ # List Media
+ api_response = api_instance.list_media(account_id, continuation_token=continuation_token)
+ print("The response of MediaApi->list_media:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling MediaApi->list_media: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **continuation_token** | **str**| Continuation token used to retrieve subsequent media. | [optional]
+
+### Return type
+
+[**List[Media]**](Media.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | OK | * Continuation-Token - Continuation token used to retrieve subsequent media.
|
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**406** | Not Acceptable | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | - |
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **upload_media**
+> upload_media(account_id, media_id, body, content_type=content_type, cache_control=cache_control)
+
+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-).
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.MediaApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ media_id = '14762070468292kw2fuqty55yp2b2/0/bw.png' # str | Media ID to retrieve.
+ body = None # bytearray |
+ content_type = 'audio/wav' # str | The media type of the entity-body. (optional)
+ cache_control = 'no-cache' # str | General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. (optional)
+
+ try:
+ # Upload Media
+ api_instance.upload_media(account_id, media_id, body, content_type=content_type, cache_control=cache_control)
+ except Exception as e:
+ print("Exception when calling MediaApi->upload_media: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **media_id** | **str**| Media ID to retrieve. |
+ **body** | **bytearray**| |
+ **content_type** | **str**| The media type of the entity-body. | [optional]
+ **cache_control** | **str**| General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. | [optional]
+
+### Return type
+
+void (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
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**204** | No Content | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**406** | Not Acceptable | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | - |
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/docs/Message.md b/docs/Message.md
new file mode 100644
index 00000000..87ad84b1
--- /dev/null
+++ b/docs/Message.md
@@ -0,0 +1,40 @@
+# Message
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **str** | The id of the message. | [optional]
+**owner** | **str** | The Bandwidth phone number associated with the message. | [optional]
+**application_id** | **str** | The application ID associated with the message. | [optional]
+**time** | **datetime** | The datetime stamp of the message in ISO 8601 | [optional]
+**segment_count** | **int** | 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** | **List[str]** | The phone number recipients of the message. | [optional]
+**var_from** | **str** | The phone number the message was sent from. | [optional]
+**media** | **List[str]** | 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** | **str** | The contents of the message. | [optional]
+**tag** | **str** | The custom string set by the user. | [optional]
+**priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional]
+**expiration** | **datetime** | The expiration date-time set by the user. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.message import Message
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Message from a JSON string
+message_instance = Message.from_json(json)
+# print the JSON string representation of the object
+print Message.to_json()
+
+# convert the object into a dict
+message_dict = message_instance.to_dict()
+# create an instance of Message from a dict
+message_form_dict = message.from_dict(message_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/MessageDeliveredCallback.md b/docs/MessageDeliveredCallback.md
new file mode 100644
index 00000000..61622f89
--- /dev/null
+++ b/docs/MessageDeliveredCallback.md
@@ -0,0 +1,33 @@
+# MessageDeliveredCallback
+
+Message Delivered Callback
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**time** | **datetime** | |
+**type** | **str** | |
+**to** | **str** | |
+**description** | **str** | |
+**message** | [**MessageDeliveredCallbackMessage**](MessageDeliveredCallbackMessage.md) | |
+
+## Example
+
+```python
+from bandwidth.models.message_delivered_callback import MessageDeliveredCallback
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MessageDeliveredCallback from a JSON string
+message_delivered_callback_instance = MessageDeliveredCallback.from_json(json)
+# print the JSON string representation of the object
+print MessageDeliveredCallback.to_json()
+
+# convert the object into a dict
+message_delivered_callback_dict = message_delivered_callback_instance.to_dict()
+# create an instance of MessageDeliveredCallback from a dict
+message_delivered_callback_form_dict = message_delivered_callback.from_dict(message_delivered_callback_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/MessageDeliveredCallbackMessage.md b/docs/MessageDeliveredCallbackMessage.md
new file mode 100644
index 00000000..c2211a2a
--- /dev/null
+++ b/docs/MessageDeliveredCallbackMessage.md
@@ -0,0 +1,40 @@
+# MessageDeliveredCallbackMessage
+
+Message Delivered Callback Message Schema
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **str** | |
+**owner** | **str** | |
+**application_id** | **str** | |
+**time** | **datetime** | |
+**segment_count** | **int** | |
+**direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | |
+**to** | **List[str]** | |
+**var_from** | **str** | |
+**text** | **str** | |
+**tag** | **str** | |
+**media** | **List[str]** | | [optional]
+**priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional]
+
+## Example
+
+```python
+from bandwidth.models.message_delivered_callback_message import MessageDeliveredCallbackMessage
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MessageDeliveredCallbackMessage from a JSON string
+message_delivered_callback_message_instance = MessageDeliveredCallbackMessage.from_json(json)
+# print the JSON string representation of the object
+print MessageDeliveredCallbackMessage.to_json()
+
+# convert the object into a dict
+message_delivered_callback_message_dict = message_delivered_callback_message_instance.to_dict()
+# create an instance of MessageDeliveredCallbackMessage from a dict
+message_delivered_callback_message_form_dict = message_delivered_callback_message.from_dict(message_delivered_callback_message_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/MessageDirectionEnum.md b/docs/MessageDirectionEnum.md
new file mode 100644
index 00000000..22d0d608
--- /dev/null
+++ b/docs/MessageDirectionEnum.md
@@ -0,0 +1,11 @@
+# MessageDirectionEnum
+
+The direction of the message. One of in out.
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/MessageFailedCallback.md b/docs/MessageFailedCallback.md
new file mode 100644
index 00000000..984acebe
--- /dev/null
+++ b/docs/MessageFailedCallback.md
@@ -0,0 +1,34 @@
+# MessageFailedCallback
+
+Message Failed Callback
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**time** | **datetime** | |
+**type** | **str** | |
+**to** | **str** | |
+**description** | **str** | |
+**message** | [**MessageFailedCallbackMessage**](MessageFailedCallbackMessage.md) | |
+**error_code** | **int** | |
+
+## Example
+
+```python
+from bandwidth.models.message_failed_callback import MessageFailedCallback
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MessageFailedCallback from a JSON string
+message_failed_callback_instance = MessageFailedCallback.from_json(json)
+# print the JSON string representation of the object
+print MessageFailedCallback.to_json()
+
+# convert the object into a dict
+message_failed_callback_dict = message_failed_callback_instance.to_dict()
+# create an instance of MessageFailedCallback from a dict
+message_failed_callback_form_dict = message_failed_callback.from_dict(message_failed_callback_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/MessageFailedCallbackMessage.md b/docs/MessageFailedCallbackMessage.md
new file mode 100644
index 00000000..7257e9c0
--- /dev/null
+++ b/docs/MessageFailedCallbackMessage.md
@@ -0,0 +1,40 @@
+# MessageFailedCallbackMessage
+
+Message Failed Callback Message Schema
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **str** | |
+**owner** | **str** | |
+**application_id** | **str** | |
+**time** | **datetime** | |
+**segment_count** | **int** | |
+**direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | |
+**to** | **List[str]** | |
+**var_from** | **str** | |
+**text** | **str** | |
+**tag** | **str** | |
+**media** | **List[str]** | | [optional]
+**priority** | [**PriorityEnum**](PriorityEnum.md) | |
+
+## Example
+
+```python
+from bandwidth.models.message_failed_callback_message import MessageFailedCallbackMessage
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MessageFailedCallbackMessage from a JSON string
+message_failed_callback_message_instance = MessageFailedCallbackMessage.from_json(json)
+# print the JSON string representation of the object
+print MessageFailedCallbackMessage.to_json()
+
+# convert the object into a dict
+message_failed_callback_message_dict = message_failed_callback_message_instance.to_dict()
+# create an instance of MessageFailedCallbackMessage from a dict
+message_failed_callback_message_form_dict = message_failed_callback_message.from_dict(message_failed_callback_message_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/MessageRequest.md b/docs/MessageRequest.md
new file mode 100644
index 00000000..f26039ff
--- /dev/null
+++ b/docs/MessageRequest.md
@@ -0,0 +1,35 @@
+# MessageRequest
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**application_id** | **str** | The ID of the Application your from number is associated with in the Bandwidth Phone Number Dashboard. |
+**to** | **List[str]** | The phone number(s) the message should be sent to in E164 format. |
+**var_from** | **str** | One of your telephone numbers the message should come from in E164 format. |
+**text** | **str** | The contents of the text message. Must be 2048 characters or less. | [optional]
+**media** | **List[str]** | A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters. | [optional]
+**tag** | **str** | A custom string that will be included in callback events of the message. Max 1024 characters. | [optional]
+**priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional]
+**expiration** | **datetime** | 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
+
+```python
+from bandwidth.models.message_request import MessageRequest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MessageRequest from a JSON string
+message_request_instance = MessageRequest.from_json(json)
+# print the JSON string representation of the object
+print MessageRequest.to_json()
+
+# convert the object into a dict
+message_request_dict = message_request_instance.to_dict()
+# create an instance of MessageRequest from a dict
+message_request_form_dict = message_request.from_dict(message_request_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/MessageSendingCallback.md b/docs/MessageSendingCallback.md
new file mode 100644
index 00000000..8d0f2ae8
--- /dev/null
+++ b/docs/MessageSendingCallback.md
@@ -0,0 +1,33 @@
+# MessageSendingCallback
+
+Message Sending Callback
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**time** | **datetime** | |
+**type** | **str** | |
+**to** | **str** | |
+**description** | **str** | |
+**message** | [**MessageSendingCallbackMessage**](MessageSendingCallbackMessage.md) | |
+
+## Example
+
+```python
+from bandwidth.models.message_sending_callback import MessageSendingCallback
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MessageSendingCallback from a JSON string
+message_sending_callback_instance = MessageSendingCallback.from_json(json)
+# print the JSON string representation of the object
+print MessageSendingCallback.to_json()
+
+# convert the object into a dict
+message_sending_callback_dict = message_sending_callback_instance.to_dict()
+# create an instance of MessageSendingCallback from a dict
+message_sending_callback_form_dict = message_sending_callback.from_dict(message_sending_callback_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/MessageSendingCallbackMessage.md b/docs/MessageSendingCallbackMessage.md
new file mode 100644
index 00000000..238bbefe
--- /dev/null
+++ b/docs/MessageSendingCallbackMessage.md
@@ -0,0 +1,40 @@
+# MessageSendingCallbackMessage
+
+Message Sending Callback Message Schema
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **str** | |
+**owner** | **str** | |
+**application_id** | **str** | |
+**time** | **datetime** | |
+**segment_count** | **int** | |
+**direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | |
+**to** | **List[str]** | |
+**var_from** | **str** | |
+**text** | **str** | |
+**tag** | **str** | | [optional]
+**media** | **List[str]** | |
+**priority** | [**PriorityEnum**](PriorityEnum.md) | |
+
+## Example
+
+```python
+from bandwidth.models.message_sending_callback_message import MessageSendingCallbackMessage
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MessageSendingCallbackMessage from a JSON string
+message_sending_callback_message_instance = MessageSendingCallbackMessage.from_json(json)
+# print the JSON string representation of the object
+print MessageSendingCallbackMessage.to_json()
+
+# convert the object into a dict
+message_sending_callback_message_dict = message_sending_callback_message_instance.to_dict()
+# create an instance of MessageSendingCallbackMessage from a dict
+message_sending_callback_message_form_dict = message_sending_callback_message.from_dict(message_sending_callback_message_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/MessageStatusEnum.md b/docs/MessageStatusEnum.md
new file mode 100644
index 00000000..9715623d
--- /dev/null
+++ b/docs/MessageStatusEnum.md
@@ -0,0 +1,11 @@
+# MessageStatusEnum
+
+The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED.
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/MessageTypeEnum.md b/docs/MessageTypeEnum.md
new file mode 100644
index 00000000..908c564a
--- /dev/null
+++ b/docs/MessageTypeEnum.md
@@ -0,0 +1,11 @@
+# MessageTypeEnum
+
+The type of message. Either SMS or MMS.
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/MessagesApi.md b/docs/MessagesApi.md
new file mode 100644
index 00000000..4a32bc57
--- /dev/null
+++ b/docs/MessagesApi.md
@@ -0,0 +1,217 @@
+# 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**
+> Message create_message(account_id, message_request)
+
+Create Message
+
+Endpoint for sending text messages and picture messages using V2 messaging.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.models.message import Message
+from bandwidth.models.message_request import MessageRequest
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.MessagesApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ message_request = bandwidth.MessageRequest() # MessageRequest |
+
+ try:
+ # Create Message
+ api_response = api_instance.create_message(account_id, message_request)
+ print("The response of MessagesApi->create_message:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling MessagesApi->create_message: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| 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
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**202** | Accepted | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**406** | Not Acceptable | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | - |
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **list_messages**
+> MessagesList list_messages(account_id, message_id=message_id, source_tn=source_tn, destination_tn=destination_tn, message_status=message_status, message_direction=message_direction, carrier_name=carrier_name, message_type=message_type, error_code=error_code, from_date_time=from_date_time, to_date_time=to_date_time, campaign_id=campaign_id, sort=sort, page_token=page_token, limit=limit, limit_total_count=limit_total_count)
+
+List Messages
+
+Returns a list of messages based on query parameters.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.models.list_message_direction_enum import ListMessageDirectionEnum
+from bandwidth.models.message_status_enum import MessageStatusEnum
+from bandwidth.models.message_type_enum import MessageTypeEnum
+from bandwidth.models.messages_list import MessagesList
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.MessagesApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ message_id = '9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6' # str | 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 = '%2B15554443333' # str | 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 = '%2B15554443333' # str | 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 = bandwidth.MessageStatusEnum() # MessageStatusEnum | The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. (optional)
+ message_direction = bandwidth.ListMessageDirectionEnum() # ListMessageDirectionEnum | The direction of the message. One of INBOUND OUTBOUND. (optional)
+ carrier_name = 'Verizon' # str | 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 = bandwidth.MessageTypeEnum() # MessageTypeEnum | The type of message. Either sms or mms. (optional)
+ error_code = 9902 # int | The error code of the message. (optional)
+ from_date_time = '2022-09-14T18:20:16.000Z' # str | 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 = '2022-09-14T18:20:16.000Z' # str | 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 = 'CJEUMDK' # str | The campaign ID of the message. (optional)
+ sort = 'sourceTn:desc' # str | The field and direction to sort by combined with a colon. Direction is either asc or desc. (optional)
+ page_token = 'gdEewhcJLQRB5' # str | A base64 encoded value used for pagination of results. (optional)
+ limit = 50 # int | The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. (optional)
+ limit_total_count = true # bool | 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)
+
+ try:
+ # List Messages
+ api_response = api_instance.list_messages(account_id, message_id=message_id, source_tn=source_tn, destination_tn=destination_tn, message_status=message_status, message_direction=message_direction, carrier_name=carrier_name, message_type=message_type, error_code=error_code, from_date_time=from_date_time, to_date_time=to_date_time, campaign_id=campaign_id, sort=sort, page_token=page_token, limit=limit, limit_total_count=limit_total_count)
+ print("The response of MessagesApi->list_messages:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling MessagesApi->list_messages: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **message_id** | **str**| 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** | **str**| 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** | **str**| 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** | **str**| 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** | **int**| The error code of the message. | [optional]
+ **from_date_time** | **str**| 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** | **str**| 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** | **str**| The campaign ID of the message. | [optional]
+ **sort** | **str**| The field and direction to sort by combined with a colon. Direction is either asc or desc. | [optional]
+ **page_token** | **str**| A base64 encoded value used for pagination of results. | [optional]
+ **limit** | **int**| The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. | [optional]
+ **limit_total_count** | **bool**| 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
+
+[**MessagesList**](MessagesList.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | OK | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | - |
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/docs/MessagesList.md b/docs/MessagesList.md
new file mode 100644
index 00000000..25fdcc3f
--- /dev/null
+++ b/docs/MessagesList.md
@@ -0,0 +1,30 @@
+# MessagesList
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**total_count** | **int** | 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** | [**List[ListMessageItem]**](ListMessageItem.md) | | [optional]
+
+## Example
+
+```python
+from bandwidth.models.messages_list import MessagesList
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MessagesList from a JSON string
+messages_list_instance = MessagesList.from_json(json)
+# print the JSON string representation of the object
+print MessagesList.to_json()
+
+# convert the object into a dict
+messages_list_dict = messages_list_instance.to_dict()
+# create an instance of MessagesList from a dict
+messages_list_form_dict = messages_list.from_dict(messages_list_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/MessagingCodeResponse.md b/docs/MessagingCodeResponse.md
new file mode 100644
index 00000000..52832cb4
--- /dev/null
+++ b/docs/MessagingCodeResponse.md
@@ -0,0 +1,28 @@
+# MessagingCodeResponse
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**message_id** | **str** | Messaging API Message ID. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.messaging_code_response import MessagingCodeResponse
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MessagingCodeResponse from a JSON string
+messaging_code_response_instance = MessagingCodeResponse.from_json(json)
+# print the JSON string representation of the object
+print MessagingCodeResponse.to_json()
+
+# convert the object into a dict
+messaging_code_response_dict = messaging_code_response_instance.to_dict()
+# create an instance of MessagingCodeResponse from a dict
+messaging_code_response_form_dict = messaging_code_response.from_dict(messaging_code_response_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/MessagingRequestError.md b/docs/MessagingRequestError.md
new file mode 100644
index 00000000..419cca76
--- /dev/null
+++ b/docs/MessagingRequestError.md
@@ -0,0 +1,29 @@
+# MessagingRequestError
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**type** | **str** | |
+**description** | **str** | |
+
+## Example
+
+```python
+from bandwidth.models.messaging_request_error import MessagingRequestError
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MessagingRequestError from a JSON string
+messaging_request_error_instance = MessagingRequestError.from_json(json)
+# print the JSON string representation of the object
+print MessagingRequestError.to_json()
+
+# convert the object into a dict
+messaging_request_error_dict = messaging_request_error_instance.to_dict()
+# create an instance of MessagingRequestError from a dict
+messaging_request_error_form_dict = messaging_request_error.from_dict(messaging_request_error_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/MfaForbiddenRequestError.md b/docs/MfaForbiddenRequestError.md
new file mode 100644
index 00000000..8730b69f
--- /dev/null
+++ b/docs/MfaForbiddenRequestError.md
@@ -0,0 +1,28 @@
+# MfaForbiddenRequestError
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**message** | **str** | The message containing the reason behind the request being forbidden. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.mfa_forbidden_request_error import MfaForbiddenRequestError
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MfaForbiddenRequestError from a JSON string
+mfa_forbidden_request_error_instance = MfaForbiddenRequestError.from_json(json)
+# print the JSON string representation of the object
+print MfaForbiddenRequestError.to_json()
+
+# convert the object into a dict
+mfa_forbidden_request_error_dict = mfa_forbidden_request_error_instance.to_dict()
+# create an instance of MfaForbiddenRequestError from a dict
+mfa_forbidden_request_error_form_dict = mfa_forbidden_request_error.from_dict(mfa_forbidden_request_error_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/MfaRequestError.md b/docs/MfaRequestError.md
new file mode 100644
index 00000000..da6060a3
--- /dev/null
+++ b/docs/MfaRequestError.md
@@ -0,0 +1,29 @@
+# MfaRequestError
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**error** | **str** | A message describing the error with your request. | [optional]
+**request_id** | **str** | The associated requestId from AWS. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.mfa_request_error import MfaRequestError
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MfaRequestError from a JSON string
+mfa_request_error_instance = MfaRequestError.from_json(json)
+# print the JSON string representation of the object
+print MfaRequestError.to_json()
+
+# convert the object into a dict
+mfa_request_error_dict = mfa_request_error_instance.to_dict()
+# create an instance of MfaRequestError from a dict
+mfa_request_error_form_dict = mfa_request_error.from_dict(mfa_request_error_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/MfaUnauthorizedRequestError.md b/docs/MfaUnauthorizedRequestError.md
new file mode 100644
index 00000000..b4ca631b
--- /dev/null
+++ b/docs/MfaUnauthorizedRequestError.md
@@ -0,0 +1,28 @@
+# MfaUnauthorizedRequestError
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**message** | **str** | Unauthorized | [optional]
+
+## Example
+
+```python
+from bandwidth.models.mfa_unauthorized_request_error import MfaUnauthorizedRequestError
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MfaUnauthorizedRequestError from a JSON string
+mfa_unauthorized_request_error_instance = MfaUnauthorizedRequestError.from_json(json)
+# print the JSON string representation of the object
+print MfaUnauthorizedRequestError.to_json()
+
+# convert the object into a dict
+mfa_unauthorized_request_error_dict = mfa_unauthorized_request_error_instance.to_dict()
+# create an instance of MfaUnauthorizedRequestError from a dict
+mfa_unauthorized_request_error_form_dict = mfa_unauthorized_request_error.from_dict(mfa_unauthorized_request_error_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/PageInfo.md b/docs/PageInfo.md
new file mode 100644
index 00000000..f7027dc3
--- /dev/null
+++ b/docs/PageInfo.md
@@ -0,0 +1,31 @@
+# PageInfo
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**prev_page** | **str** | The link to the previous page for pagination. | [optional]
+**next_page** | **str** | The link to the next page for pagination. | [optional]
+**prev_page_token** | **str** | The isolated pagination token for the previous page. | [optional]
+**next_page_token** | **str** | The isolated pagination token for the next page. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.page_info import PageInfo
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of PageInfo from a JSON string
+page_info_instance = PageInfo.from_json(json)
+# print the JSON string representation of the object
+print PageInfo.to_json()
+
+# convert the object into a dict
+page_info_dict = page_info_instance.to_dict()
+# create an instance of PageInfo from a dict
+page_info_form_dict = page_info.from_dict(page_info_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/PhoneNumberLookupApi.md b/docs/PhoneNumberLookupApi.md
new file mode 100644
index 00000000..6bacc173
--- /dev/null
+++ b/docs/PhoneNumberLookupApi.md
@@ -0,0 +1,183 @@
+# 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**
+> CreateLookupResponse create_lookup(account_id, lookup_request)
+
+Create Lookup
+
+Create a Phone Number Lookup Request.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.models.create_lookup_response import CreateLookupResponse
+from bandwidth.models.lookup_request import LookupRequest
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.PhoneNumberLookupApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ lookup_request = bandwidth.LookupRequest() # LookupRequest | Phone number lookup request.
+
+ try:
+ # Create Lookup
+ api_response = api_instance.create_lookup(account_id, lookup_request)
+ print("The response of PhoneNumberLookupApi->create_lookup:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling PhoneNumberLookupApi->create_lookup: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **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
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**202** | Accepted | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | - |
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **get_lookup_status**
+> LookupStatus get_lookup_status(account_id, request_id)
+
+Get Lookup Request Status
+
+Get an existing Phone Number Lookup Request.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.models.lookup_status import LookupStatus
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.PhoneNumberLookupApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ request_id = '004223a0-8b17-41b1-bf81-20732adf5590' # str | The phone number lookup request ID from Bandwidth.
+
+ try:
+ # Get Lookup Request Status
+ api_response = api_instance.get_lookup_status(account_id, request_id)
+ print("The response of PhoneNumberLookupApi->get_lookup_status:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling PhoneNumberLookupApi->get_lookup_status: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **request_id** | **str**| 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
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | OK | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**429** | Too Many Requests | - |
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/docs/PriorityEnum.md b/docs/PriorityEnum.md
new file mode 100644
index 00000000..2a560ccc
--- /dev/null
+++ b/docs/PriorityEnum.md
@@ -0,0 +1,11 @@
+# PriorityEnum
+
+The priority specified by the user. Not supported on MMS.
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/RecordingAvailableCallback.md b/docs/RecordingAvailableCallback.md
new file mode 100644
index 00000000..eeb59c57
--- /dev/null
+++ b/docs/RecordingAvailableCallback.md
@@ -0,0 +1,50 @@
+# RecordingAvailableCallback
+
+The Recording Available event is sent after a recording has been processed. It indicates that the recording is available for download.
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**event_type** | **str** | 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** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional]
+**account_id** | **str** | The user account associated with the call. | [optional]
+**application_id** | **str** | The id of the application associated with the call. | [optional]
+**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional]
+**to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional]
+**direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional]
+**call_id** | **str** | The call id associated with the event. | [optional]
+**call_url** | **str** | The URL of the call associated with the event. | [optional]
+**parent_call_id** | **str** | (optional) If the event is related to the B leg of a <Transfer>, the call id of the original call leg that executed the <Transfer>. Otherwise, this field will not be present. | [optional]
+**recording_id** | **str** | The unique ID of this recording | [optional]
+**media_url** | **str** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional]
+**enqueued_time** | **datetime** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional]
+**start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional]
+**end_time** | **datetime** | The time that the recording ended in ISO-8601 format | [optional]
+**duration** | **str** | The duration of the recording in ISO-8601 format | [optional]
+**file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional]
+**channels** | **str** | The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional]
+**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional]
+**status** | **str** | The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional]
+**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional]
+**transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional]
+
+## Example
+
+```python
+from bandwidth.models.recording_available_callback import RecordingAvailableCallback
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of RecordingAvailableCallback from a JSON string
+recording_available_callback_instance = RecordingAvailableCallback.from_json(json)
+# print the JSON string representation of the object
+print RecordingAvailableCallback.to_json()
+
+# convert the object into a dict
+recording_available_callback_dict = recording_available_callback_instance.to_dict()
+# create an instance of RecordingAvailableCallback from a dict
+recording_available_callback_form_dict = recording_available_callback.from_dict(recording_available_callback_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/RecordingCompleteCallback.md b/docs/RecordingCompleteCallback.md
new file mode 100644
index 00000000..686fcef6
--- /dev/null
+++ b/docs/RecordingCompleteCallback.md
@@ -0,0 +1,50 @@
+# RecordingCompleteCallback
+
+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
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**event_type** | **str** | 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** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional]
+**account_id** | **str** | The user account associated with the call. | [optional]
+**application_id** | **str** | The id of the application associated with the call. | [optional]
+**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional]
+**to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional]
+**direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional]
+**call_id** | **str** | The call id associated with the event. | [optional]
+**call_url** | **str** | The URL of the call associated with the event. | [optional]
+**parent_call_id** | **str** | (optional) If the event is related to the B leg of a <Transfer>, the call id of the original call leg that executed the <Transfer>. Otherwise, this field will not be present. | [optional]
+**recording_id** | **str** | The unique ID of this recording | [optional]
+**media_url** | **str** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional]
+**enqueued_time** | **datetime** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional]
+**start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional]
+**answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional]
+**end_time** | **datetime** | The time that the recording ended in ISO-8601 format | [optional]
+**duration** | **str** | The duration of the recording in ISO-8601 format | [optional]
+**file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional]
+**channels** | **int** | Always `1` for conference recordings; multi-channel recordings are not supported on conferences. | [optional]
+**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional]
+**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional]
+**transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional]
+
+## Example
+
+```python
+from bandwidth.models.recording_complete_callback import RecordingCompleteCallback
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of RecordingCompleteCallback from a JSON string
+recording_complete_callback_instance = RecordingCompleteCallback.from_json(json)
+# print the JSON string representation of the object
+print RecordingCompleteCallback.to_json()
+
+# convert the object into a dict
+recording_complete_callback_dict = recording_complete_callback_instance.to_dict()
+# create an instance of RecordingCompleteCallback from a dict
+recording_complete_callback_form_dict = recording_complete_callback.from_dict(recording_complete_callback_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/RecordingStateEnum.md b/docs/RecordingStateEnum.md
new file mode 100644
index 00000000..2e1b4e58
--- /dev/null
+++ b/docs/RecordingStateEnum.md
@@ -0,0 +1,11 @@
+# RecordingStateEnum
+
+The recording state. Possible values: `paused` to pause an active recording `recording` to resume a paused recording
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/RecordingsApi.md b/docs/RecordingsApi.md
new file mode 100644
index 00000000..35d9eb3f
--- /dev/null
+++ b/docs/RecordingsApi.md
@@ -0,0 +1,908 @@
+# 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.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.RecordingsApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Call ID.
+ recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Recording ID.
+
+ try:
+ # Delete Transcription
+ api_instance.delete_call_transcription(account_id, call_id, recording_id)
+ except Exception as e:
+ print("Exception when calling RecordingsApi->delete_call_transcription: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **call_id** | **str**| Programmable Voice API Call ID. |
+ **recording_id** | **str**| Programmable Voice API Recording ID. |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**204** | The transcription was successfully deleted. | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**405** | Method Not Allowed | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | * Retry-After - When you should try your request again.
|
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **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.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.RecordingsApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Call ID.
+ recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Recording ID.
+
+ try:
+ # Delete Recording
+ api_instance.delete_recording(account_id, call_id, recording_id)
+ except Exception as e:
+ print("Exception when calling RecordingsApi->delete_recording: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **call_id** | **str**| Programmable Voice API Call ID. |
+ **recording_id** | **str**| Programmable Voice API Recording ID. |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**204** | Recording was deleted. | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**405** | Method Not Allowed | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | * Retry-After - When you should try your request again.
|
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **delete_recording_media**
+> delete_recording_media(account_id, call_id, recording_id)
+
+Delete Recording Media
+
+Deletes the specified recording's media.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.RecordingsApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Call ID.
+ recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Recording ID.
+
+ try:
+ # Delete Recording Media
+ api_instance.delete_recording_media(account_id, call_id, recording_id)
+ except Exception as e:
+ print("Exception when calling RecordingsApi->delete_recording_media: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **call_id** | **str**| Programmable Voice API Call ID. |
+ **recording_id** | **str**| Programmable Voice API Recording ID. |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**204** | The recording media was successfully deleted. | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**405** | Method Not Allowed | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | * Retry-After - When you should try your request again.
|
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **download_call_recording**
+> bytearray download_call_recording(account_id, call_id, recording_id)
+
+Download Recording
+
+Downloads the specified recording.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.RecordingsApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Call ID.
+ recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Recording ID.
+
+ try:
+ # Download Recording
+ api_response = api_instance.download_call_recording(account_id, call_id, recording_id)
+ print("The response of RecordingsApi->download_call_recording:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling RecordingsApi->download_call_recording: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **call_id** | **str**| Programmable Voice API Call ID. |
+ **recording_id** | **str**| Programmable Voice API Recording ID. |
+
+### Return type
+
+**bytearray**
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: audio/vnd.wave, audio/mpeg, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Media found | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**405** | Method Not Allowed | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | * Retry-After - When you should try your request again.
|
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **get_call_recording**
+> CallRecordingMetadata get_call_recording(account_id, call_id, recording_id)
+
+Get Call Recording
+
+Returns metadata for the specified recording.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.models.call_recording_metadata import CallRecordingMetadata
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.RecordingsApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Call ID.
+ recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Recording ID.
+
+ try:
+ # Get Call Recording
+ api_response = api_instance.get_call_recording(account_id, call_id, recording_id)
+ print("The response of RecordingsApi->get_call_recording:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling RecordingsApi->get_call_recording: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **call_id** | **str**| Programmable Voice API Call ID. |
+ **recording_id** | **str**| 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
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Recording found | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**405** | Method Not Allowed | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | * Retry-After - When you should try your request again.
|
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **get_call_transcription**
+> TranscriptionList 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.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.models.transcription_list import TranscriptionList
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.RecordingsApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Call ID.
+ recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Recording ID.
+
+ try:
+ # Get Transcription
+ api_response = api_instance.get_call_transcription(account_id, call_id, recording_id)
+ print("The response of RecordingsApi->get_call_transcription:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling RecordingsApi->get_call_transcription: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **call_id** | **str**| Programmable Voice API Call ID. |
+ **recording_id** | **str**| 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
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Transcription found | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**405** | Method Not Allowed | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | * Retry-After - When you should try your request again.
|
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **list_account_call_recordings**
+> List[CallRecordingMetadata] list_account_call_recordings(account_id, to=to, var_from=var_from, min_start_time=min_start_time, max_start_time=max_start_time)
+
+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.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.models.call_recording_metadata import CallRecordingMetadata
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.RecordingsApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ to = '%2b19195551234' # str | Filter results by the `to` field. (optional)
+ var_from = '%2b19195554321' # str | Filter results by the `from` field. (optional)
+ min_start_time = '2022-06-21T19:13:21Z' # str | Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format). (optional)
+ max_start_time = '2022-06-21T19:13:21Z' # str | Filter results to recordings which have a `startTime` before `maxStartTime` (in ISO8601 format). (optional)
+
+ try:
+ # Get Call Recordings
+ api_response = api_instance.list_account_call_recordings(account_id, to=to, var_from=var_from, min_start_time=min_start_time, max_start_time=max_start_time)
+ print("The response of RecordingsApi->list_account_call_recordings:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling RecordingsApi->list_account_call_recordings: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **to** | **str**| Filter results by the `to` field. | [optional]
+ **var_from** | **str**| Filter results by the `from` field. | [optional]
+ **min_start_time** | **str**| Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format). | [optional]
+ **max_start_time** | **str**| Filter results to recordings which have a `startTime` before `maxStartTime` (in ISO8601 format). | [optional]
+
+### Return type
+
+[**List[CallRecordingMetadata]**](CallRecordingMetadata.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Recordings retrieved successfully | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**405** | Method Not Allowed | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | * Retry-After - When you should try your request again.
|
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **list_call_recordings**
+> List[CallRecordingMetadata] 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.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.models.call_recording_metadata import CallRecordingMetadata
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.RecordingsApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Call ID.
+
+ try:
+ # List Call Recordings
+ api_response = api_instance.list_call_recordings(account_id, call_id)
+ print("The response of RecordingsApi->list_call_recordings:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling RecordingsApi->list_call_recordings: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **call_id** | **str**| Programmable Voice API Call ID. |
+
+### Return type
+
+[**List[CallRecordingMetadata]**](CallRecordingMetadata.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Recordings retrieved successfully | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**405** | Method Not Allowed | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | * Retry-After - When you should try your request again.
|
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **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.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.models.transcribe_recording import TranscribeRecording
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.RecordingsApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Call ID.
+ recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Recording ID.
+ transcribe_recording = bandwidth.TranscribeRecording() # TranscribeRecording |
+
+ try:
+ # Create Transcription Request
+ api_instance.transcribe_call_recording(account_id, call_id, recording_id, transcribe_recording)
+ except Exception as e:
+ print("Exception when calling RecordingsApi->transcribe_call_recording: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **call_id** | **str**| Programmable Voice API Call ID. |
+ **recording_id** | **str**| Programmable Voice API Recording ID. |
+ **transcribe_recording** | [**TranscribeRecording**](TranscribeRecording.md)| |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**204** | Transcription was successfully requested. | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**405** | Method Not Allowed | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | * Retry-After - When you should try your request again.
|
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **update_call_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.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.models.update_call_recording import UpdateCallRecording
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.RecordingsApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # str | Programmable Voice API Call ID.
+ update_call_recording = bandwidth.UpdateCallRecording() # UpdateCallRecording |
+
+ try:
+ # Update Recording
+ api_instance.update_call_recording_state(account_id, call_id, update_call_recording)
+ except Exception as e:
+ print("Exception when calling RecordingsApi->update_call_recording_state: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+ **call_id** | **str**| Programmable Voice API Call ID. |
+ **update_call_recording** | [**UpdateCallRecording**](UpdateCallRecording.md)| |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Recording state was successfully modified. | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**405** | Method Not Allowed | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | * Retry-After - When you should try your request again.
|
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/docs/RedirectCallback.md b/docs/RedirectCallback.md
new file mode 100644
index 00000000..46489833
--- /dev/null
+++ b/docs/RedirectCallback.md
@@ -0,0 +1,44 @@
+# RedirectCallback
+
+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
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**event_type** | **str** | 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** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional]
+**account_id** | **str** | The user account associated with the call. | [optional]
+**application_id** | **str** | The id of the application associated with the call. | [optional]
+**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional]
+**to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional]
+**direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional]
+**call_id** | **str** | The call id associated with the event. | [optional]
+**call_url** | **str** | The URL of the call associated with the event. | [optional]
+**parent_call_id** | **str** | (optional) If the event is related to the B leg of a <Transfer>, the call id of the original call leg that executed the <Transfer>. Otherwise, this field will not be present. | [optional]
+**enqueued_time** | **datetime** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional]
+**start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional]
+**answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional]
+**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional]
+**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional]
+**transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional]
+
+## Example
+
+```python
+from bandwidth.models.redirect_callback import RedirectCallback
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of RedirectCallback from a JSON string
+redirect_callback_instance = RedirectCallback.from_json(json)
+# print the JSON string representation of the object
+print RedirectCallback.to_json()
+
+# convert the object into a dict
+redirect_callback_dict = redirect_callback_instance.to_dict()
+# create an instance of RedirectCallback from a dict
+redirect_callback_form_dict = redirect_callback.from_dict(redirect_callback_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/RedirectMethodEnum.md b/docs/RedirectMethodEnum.md
new file mode 100644
index 00000000..a792f1a1
--- /dev/null
+++ b/docs/RedirectMethodEnum.md
@@ -0,0 +1,11 @@
+# RedirectMethodEnum
+
+The HTTP method to use for the request to `redirectUrl`. GET or POST. Default value is POST.
Not allowed if `state` is `completed`.
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/StatisticsApi.md b/docs/StatisticsApi.md
new file mode 100644
index 00000000..4ab15247
--- /dev/null
+++ b/docs/StatisticsApi.md
@@ -0,0 +1,95 @@
+# 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**
+> AccountStatistics get_statistics(account_id)
+
+Get Account Statistics
+
+Returns details about the current state of the account.
+
+### Example
+
+* Basic Authentication (Basic):
+```python
+import time
+import os
+import bandwidth
+from bandwidth.models.account_statistics import AccountStatistics
+from bandwidth.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://localhost
+# See configuration.py for a list of all supported configuration parameters.
+configuration = bandwidth.Configuration(
+ host = "http://localhost"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: Basic
+configuration = bandwidth.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with bandwidth.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = bandwidth.StatisticsApi(api_client)
+ account_id = '9900000' # str | Your Bandwidth Account ID.
+
+ try:
+ # Get Account Statistics
+ api_response = api_instance.get_statistics(account_id)
+ print("The response of StatisticsApi->get_statistics:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling StatisticsApi->get_statistics: %s\n" % e)
+```
+
+
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **account_id** | **str**| Your Bandwidth Account ID. |
+
+### Return type
+
+[**AccountStatistics**](AccountStatistics.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Statistics Found | - |
+**400** | Bad Request | - |
+**401** | Unauthorized | - |
+**403** | Forbidden | - |
+**404** | Not Found | - |
+**405** | Method Not Allowed | - |
+**415** | Unsupported Media Type | - |
+**429** | Too Many Requests | * Retry-After - When you should try your request again.
|
+**500** | Internal Server Error | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/docs/StirShaken.md b/docs/StirShaken.md
new file mode 100644
index 00000000..f41a820c
--- /dev/null
+++ b/docs/StirShaken.md
@@ -0,0 +1,30 @@
+# StirShaken
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**verstat** | **str** | (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** | **str** | (optional) The attestation level verified by Bandwidth. Possible values are A (full), B (partial) or C (gateway). | [optional]
+**originating_id** | **str** | (optional) A unique origination identifier. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.stir_shaken import StirShaken
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of StirShaken from a JSON string
+stir_shaken_instance = StirShaken.from_json(json)
+# print the JSON string representation of the object
+print StirShaken.to_json()
+
+# convert the object into a dict
+stir_shaken_dict = stir_shaken_instance.to_dict()
+# create an instance of StirShaken from a dict
+stir_shaken_form_dict = stir_shaken.from_dict(stir_shaken_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/Tag.md b/docs/Tag.md
new file mode 100644
index 00000000..79565e36
--- /dev/null
+++ b/docs/Tag.md
@@ -0,0 +1,29 @@
+# Tag
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**key** | **str** | | [optional]
+**value** | **str** | | [optional]
+
+## Example
+
+```python
+from bandwidth.models.tag import Tag
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Tag from a JSON string
+tag_instance = Tag.from_json(json)
+# print the JSON string representation of the object
+print Tag.to_json()
+
+# convert the object into a dict
+tag_dict = tag_instance.to_dict()
+# create an instance of Tag from a dict
+tag_form_dict = tag.from_dict(tag_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/TnLookupRequestError.md b/docs/TnLookupRequestError.md
new file mode 100644
index 00000000..a5180963
--- /dev/null
+++ b/docs/TnLookupRequestError.md
@@ -0,0 +1,28 @@
+# TnLookupRequestError
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**message** | **str** | A description of what validation error occurred. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.tn_lookup_request_error import TnLookupRequestError
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of TnLookupRequestError from a JSON string
+tn_lookup_request_error_instance = TnLookupRequestError.from_json(json)
+# print the JSON string representation of the object
+print TnLookupRequestError.to_json()
+
+# convert the object into a dict
+tn_lookup_request_error_dict = tn_lookup_request_error_instance.to_dict()
+# create an instance of TnLookupRequestError from a dict
+tn_lookup_request_error_form_dict = tn_lookup_request_error.from_dict(tn_lookup_request_error_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/TranscribeRecording.md b/docs/TranscribeRecording.md
new file mode 100644
index 00000000..e960b3fa
--- /dev/null
+++ b/docs/TranscribeRecording.md
@@ -0,0 +1,34 @@
+# TranscribeRecording
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**callback_url** | **str** | The URL to send the [TranscriptionAvailable](/docs/voice/webhooks/transcriptionAvailable) event to. You should not include sensitive or personally-identifiable information in the callbackUrl field! Always use the proper username and password fields for authorization. | [optional]
+**callback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional]
+**username** | **str** | Basic auth username. | [optional]
+**password** | **str** | Basic auth password. | [optional]
+**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional]
+**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** | **bool** | 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
+
+```python
+from bandwidth.models.transcribe_recording import TranscribeRecording
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of TranscribeRecording from a JSON string
+transcribe_recording_instance = TranscribeRecording.from_json(json)
+# print the JSON string representation of the object
+print TranscribeRecording.to_json()
+
+# convert the object into a dict
+transcribe_recording_dict = transcribe_recording_instance.to_dict()
+# create an instance of TranscribeRecording from a dict
+transcribe_recording_form_dict = transcribe_recording.from_dict(transcribe_recording_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/Transcription.md b/docs/Transcription.md
new file mode 100644
index 00000000..69614ba6
--- /dev/null
+++ b/docs/Transcription.md
@@ -0,0 +1,29 @@
+# Transcription
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**text** | **str** | 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
+
+```python
+from bandwidth.models.transcription import Transcription
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Transcription from a JSON string
+transcription_instance = Transcription.from_json(json)
+# print the JSON string representation of the object
+print Transcription.to_json()
+
+# convert the object into a dict
+transcription_dict = transcription_instance.to_dict()
+# create an instance of Transcription from a dict
+transcription_form_dict = transcription.from_dict(transcription_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/TranscriptionAvailableCallback.md b/docs/TranscriptionAvailableCallback.md
new file mode 100644
index 00000000..f295b071
--- /dev/null
+++ b/docs/TranscriptionAvailableCallback.md
@@ -0,0 +1,49 @@
+# TranscriptionAvailableCallback
+
+The Transcription Available event is sent when the recording transcription is available to be downloaded.
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**event_type** | **str** | 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** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional]
+**account_id** | **str** | The user account associated with the call. | [optional]
+**application_id** | **str** | The id of the application associated with the call. | [optional]
+**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional]
+**to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional]
+**direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional]
+**call_id** | **str** | The call id associated with the event. | [optional]
+**call_url** | **str** | The URL of the call associated with the event. | [optional]
+**media_url** | **str** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional]
+**parent_call_id** | **str** | (optional) If the event is related to the B leg of a <Transfer>, the call id of the original call leg that executed the <Transfer>. Otherwise, this field will not be present. | [optional]
+**recording_id** | **str** | The unique ID of this recording | [optional]
+**enqueued_time** | **datetime** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional]
+**start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional]
+**end_time** | **datetime** | The time that the recording ended in ISO-8601 format | [optional]
+**duration** | **str** | The duration of the recording in ISO-8601 format | [optional]
+**file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional]
+**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional]
+**transcription** | [**Transcription**](Transcription.md) | | [optional]
+**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional]
+**transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional]
+
+## Example
+
+```python
+from bandwidth.models.transcription_available_callback import TranscriptionAvailableCallback
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of TranscriptionAvailableCallback from a JSON string
+transcription_available_callback_instance = TranscriptionAvailableCallback.from_json(json)
+# print the JSON string representation of the object
+print TranscriptionAvailableCallback.to_json()
+
+# convert the object into a dict
+transcription_available_callback_dict = transcription_available_callback_instance.to_dict()
+# create an instance of TranscriptionAvailableCallback from a dict
+transcription_available_callback_form_dict = transcription_available_callback.from_dict(transcription_available_callback_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/TranscriptionList.md b/docs/TranscriptionList.md
new file mode 100644
index 00000000..d8ef5f3c
--- /dev/null
+++ b/docs/TranscriptionList.md
@@ -0,0 +1,28 @@
+# TranscriptionList
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**transcripts** | [**List[Transcription]**](Transcription.md) | | [optional]
+
+## Example
+
+```python
+from bandwidth.models.transcription_list import TranscriptionList
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of TranscriptionList from a JSON string
+transcription_list_instance = TranscriptionList.from_json(json)
+# print the JSON string representation of the object
+print TranscriptionList.to_json()
+
+# convert the object into a dict
+transcription_list_dict = transcription_list_instance.to_dict()
+# create an instance of TranscriptionList from a dict
+transcription_list_form_dict = transcription_list.from_dict(transcription_list_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/TranscriptionMetadata.md b/docs/TranscriptionMetadata.md
new file mode 100644
index 00000000..8d8a4236
--- /dev/null
+++ b/docs/TranscriptionMetadata.md
@@ -0,0 +1,32 @@
+# TranscriptionMetadata
+
+If the recording was transcribed, metadata about the transcription
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **str** | The unique transcription ID | [optional]
+**status** | **str** | The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional]
+**completed_time** | **str** | The time that the transcription was completed | [optional]
+**url** | **str** | The URL of the [transcription](#operation/getCallTranscription) | [optional]
+
+## Example
+
+```python
+from bandwidth.models.transcription_metadata import TranscriptionMetadata
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of TranscriptionMetadata from a JSON string
+transcription_metadata_instance = TranscriptionMetadata.from_json(json)
+# print the JSON string representation of the object
+print TranscriptionMetadata.to_json()
+
+# convert the object into a dict
+transcription_metadata_dict = transcription_metadata_instance.to_dict()
+# create an instance of TranscriptionMetadata from a dict
+transcription_metadata_form_dict = transcription_metadata.from_dict(transcription_metadata_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/TransferAnswerCallback.md b/docs/TransferAnswerCallback.md
new file mode 100644
index 00000000..3cb88fb4
--- /dev/null
+++ b/docs/TransferAnswerCallback.md
@@ -0,0 +1,43 @@
+# TransferAnswerCallback
+
+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
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**event_type** | **str** | 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** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional]
+**account_id** | **str** | The user account associated with the call. | [optional]
+**application_id** | **str** | The id of the application associated with the call. | [optional]
+**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional]
+**to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional]
+**direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional]
+**call_id** | **str** | The call id associated with the event. | [optional]
+**call_url** | **str** | The URL of the call associated with the event. | [optional]
+**enqueued_time** | **datetime** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional]
+**start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional]
+**answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional]
+**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional]
+**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional]
+**transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional]
+
+## Example
+
+```python
+from bandwidth.models.transfer_answer_callback import TransferAnswerCallback
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of TransferAnswerCallback from a JSON string
+transfer_answer_callback_instance = TransferAnswerCallback.from_json(json)
+# print the JSON string representation of the object
+print TransferAnswerCallback.to_json()
+
+# convert the object into a dict
+transfer_answer_callback_dict = transfer_answer_callback_instance.to_dict()
+# create an instance of TransferAnswerCallback from a dict
+transfer_answer_callback_form_dict = transfer_answer_callback.from_dict(transfer_answer_callback_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/TransferCompleteCallback.md b/docs/TransferCompleteCallback.md
new file mode 100644
index 00000000..c0cdc051
--- /dev/null
+++ b/docs/TransferCompleteCallback.md
@@ -0,0 +1,46 @@
+# TransferCompleteCallback
+
+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
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**event_type** | **str** | 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** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional]
+**account_id** | **str** | The user account associated with the call. | [optional]
+**application_id** | **str** | The id of the application associated with the call. | [optional]
+**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional]
+**to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional]
+**direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional]
+**call_id** | **str** | The call id associated with the event. | [optional]
+**call_url** | **str** | The URL of the call associated with the event. | [optional]
+**enqueued_time** | **datetime** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional]
+**start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional]
+**answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional]
+**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional]
+**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional]
+**transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional]
+**cause** | **str** | Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown. | [optional]
+**error_message** | **str** | Text explaining the reason that caused the call to fail in case of errors. | [optional]
+**error_id** | **str** | Bandwidth's internal id that references the error event. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.transfer_complete_callback import TransferCompleteCallback
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of TransferCompleteCallback from a JSON string
+transfer_complete_callback_instance = TransferCompleteCallback.from_json(json)
+# print the JSON string representation of the object
+print TransferCompleteCallback.to_json()
+
+# convert the object into a dict
+transfer_complete_callback_dict = transfer_complete_callback_instance.to_dict()
+# create an instance of TransferCompleteCallback from a dict
+transfer_complete_callback_form_dict = transfer_complete_callback.from_dict(transfer_complete_callback_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/TransferDisconnectCallback.md b/docs/TransferDisconnectCallback.md
new file mode 100644
index 00000000..ea743865
--- /dev/null
+++ b/docs/TransferDisconnectCallback.md
@@ -0,0 +1,48 @@
+# TransferDisconnectCallback
+
+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
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**event_type** | **str** | 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** | **datetime** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional]
+**account_id** | **str** | The user account associated with the call. | [optional]
+**application_id** | **str** | The id of the application associated with the call. | [optional]
+**var_from** | **str** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional]
+**to** | **str** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional]
+**direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional]
+**call_id** | **str** | The call id associated with the event. | [optional]
+**call_url** | **str** | The URL of the call associated with the event. | [optional]
+**parent_call_id** | **str** | (optional) If the event is related to the B leg of a <Transfer>, the call id of the original call leg that executed the <Transfer>. Otherwise, this field will not be present. | [optional]
+**enqueued_time** | **datetime** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional]
+**start_time** | **datetime** | Time the call was started, in ISO 8601 format. | [optional]
+**answer_time** | **datetime** | Time the call was answered, in ISO 8601 format. | [optional]
+**end_time** | **datetime** | The time that the recording ended in ISO-8601 format | [optional]
+**tag** | **str** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional]
+**transfer_caller_id** | **str** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional]
+**transfer_to** | **str** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional]
+**cause** | **str** | Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown. | [optional]
+**error_message** | **str** | Text explaining the reason that caused the call to fail in case of errors. | [optional]
+**error_id** | **str** | Bandwidth's internal id that references the error event. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.transfer_disconnect_callback import TransferDisconnectCallback
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of TransferDisconnectCallback from a JSON string
+transfer_disconnect_callback_instance = TransferDisconnectCallback.from_json(json)
+# print the JSON string representation of the object
+print TransferDisconnectCallback.to_json()
+
+# convert the object into a dict
+transfer_disconnect_callback_dict = transfer_disconnect_callback_instance.to_dict()
+# create an instance of TransferDisconnectCallback from a dict
+transfer_disconnect_callback_form_dict = transfer_disconnect_callback.from_dict(transfer_disconnect_callback_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/UpdateCall.md b/docs/UpdateCall.md
new file mode 100644
index 00000000..e62c224d
--- /dev/null
+++ b/docs/UpdateCall.md
@@ -0,0 +1,37 @@
+# UpdateCall
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**state** | [**CallStateEnum**](CallStateEnum.md) | | [optional]
+**redirect_url** | **str** | The URL to send the [Redirect](/docs/voice/bxml/redirect) event to which will provide new BXML. Required if `state` is `active`. Not allowed if `state` is `completed`. | [optional]
+**redirect_method** | [**RedirectMethodEnum**](RedirectMethodEnum.md) | | [optional]
+**username** | **str** | Basic auth username. | [optional]
+**password** | **str** | Basic auth password. | [optional]
+**redirect_fallback_url** | **str** | A fallback url which, if provided, will be used to retry the redirect callback delivery in case `redirectUrl` fails to respond. | [optional]
+**redirect_fallback_method** | [**RedirectMethodEnum**](RedirectMethodEnum.md) | | [optional]
+**fallback_username** | **str** | Basic auth username. | [optional]
+**fallback_password** | **str** | Basic auth password. | [optional]
+**tag** | **str** | A custom string that will be sent with this and all future callbacks unless overwritten by a future `tag` attribute or [`<Tag>`](/docs/voice/bxml/tag) verb, or cleared. May be cleared by setting `tag=\"\"`. Max length 256 characters. Not allowed if `state` is `completed`. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.update_call import UpdateCall
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of UpdateCall from a JSON string
+update_call_instance = UpdateCall.from_json(json)
+# print the JSON string representation of the object
+print UpdateCall.to_json()
+
+# convert the object into a dict
+update_call_dict = update_call_instance.to_dict()
+# create an instance of UpdateCall from a dict
+update_call_form_dict = update_call.from_dict(update_call_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/UpdateCallRecording.md b/docs/UpdateCallRecording.md
new file mode 100644
index 00000000..7ae49a70
--- /dev/null
+++ b/docs/UpdateCallRecording.md
@@ -0,0 +1,28 @@
+# UpdateCallRecording
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**state** | [**RecordingStateEnum**](RecordingStateEnum.md) | |
+
+## Example
+
+```python
+from bandwidth.models.update_call_recording import UpdateCallRecording
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of UpdateCallRecording from a JSON string
+update_call_recording_instance = UpdateCallRecording.from_json(json)
+# print the JSON string representation of the object
+print UpdateCallRecording.to_json()
+
+# convert the object into a dict
+update_call_recording_dict = update_call_recording_instance.to_dict()
+# create an instance of UpdateCallRecording from a dict
+update_call_recording_form_dict = update_call_recording.from_dict(update_call_recording_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/UpdateConference.md b/docs/UpdateConference.md
new file mode 100644
index 00000000..4dff95c3
--- /dev/null
+++ b/docs/UpdateConference.md
@@ -0,0 +1,36 @@
+# UpdateConference
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**status** | [**ConferenceStateEnum**](ConferenceStateEnum.md) | | [optional]
+**redirect_url** | **str** | The URL to send the [conferenceRedirect](/docs/voice/webhooks/conferenceRedirect) event which will provide new BXML. Not allowed if `state` is `completed`, but required if `state` is `active`. | [optional]
+**redirect_method** | [**RedirectMethodEnum**](RedirectMethodEnum.md) | | [optional]
+**username** | **str** | Basic auth username. | [optional]
+**password** | **str** | Basic auth password. | [optional]
+**redirect_fallback_url** | **str** | A fallback url which, if provided, will be used to retry the `conferenceRedirect` webhook delivery in case `redirectUrl` fails to respond. Not allowed if `state` is `completed`. | [optional]
+**redirect_fallback_method** | [**RedirectMethodEnum**](RedirectMethodEnum.md) | | [optional]
+**fallback_username** | **str** | Basic auth username. | [optional]
+**fallback_password** | **str** | Basic auth password. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.update_conference import UpdateConference
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of UpdateConference from a JSON string
+update_conference_instance = UpdateConference.from_json(json)
+# print the JSON string representation of the object
+print UpdateConference.to_json()
+
+# convert the object into a dict
+update_conference_dict = update_conference_instance.to_dict()
+# create an instance of UpdateConference from a dict
+update_conference_form_dict = update_conference.from_dict(update_conference_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/UpdateConferenceMember.md b/docs/UpdateConferenceMember.md
new file mode 100644
index 00000000..3306417e
--- /dev/null
+++ b/docs/UpdateConferenceMember.md
@@ -0,0 +1,30 @@
+# UpdateConferenceMember
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**mute** | **bool** | 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** | **bool** | 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** | **List[str]** | 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
+
+```python
+from bandwidth.models.update_conference_member import UpdateConferenceMember
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of UpdateConferenceMember from a JSON string
+update_conference_member_instance = UpdateConferenceMember.from_json(json)
+# print the JSON string representation of the object
+print UpdateConferenceMember.to_json()
+
+# convert the object into a dict
+update_conference_member_dict = update_conference_member_instance.to_dict()
+# create an instance of UpdateConferenceMember from a dict
+update_conference_member_form_dict = update_conference_member.from_dict(update_conference_member_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/VerifyCodeRequest.md b/docs/VerifyCodeRequest.md
new file mode 100644
index 00000000..cf533a0b
--- /dev/null
+++ b/docs/VerifyCodeRequest.md
@@ -0,0 +1,31 @@
+# VerifyCodeRequest
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**to** | **str** | The phone number to send the mfa code to. |
+**scope** | **str** | 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** | **str** | The generated mfa code to check if valid. |
+
+## Example
+
+```python
+from bandwidth.models.verify_code_request import VerifyCodeRequest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of VerifyCodeRequest from a JSON string
+verify_code_request_instance = VerifyCodeRequest.from_json(json)
+# print the JSON string representation of the object
+print VerifyCodeRequest.to_json()
+
+# convert the object into a dict
+verify_code_request_dict = verify_code_request_instance.to_dict()
+# create an instance of VerifyCodeRequest from a dict
+verify_code_request_form_dict = verify_code_request.from_dict(verify_code_request_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/VerifyCodeResponse.md b/docs/VerifyCodeResponse.md
new file mode 100644
index 00000000..4c1a3ee5
--- /dev/null
+++ b/docs/VerifyCodeResponse.md
@@ -0,0 +1,28 @@
+# VerifyCodeResponse
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**valid** | **bool** | Whether or not the supplied code is valid. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.verify_code_response import VerifyCodeResponse
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of VerifyCodeResponse from a JSON string
+verify_code_response_instance = VerifyCodeResponse.from_json(json)
+# print the JSON string representation of the object
+print VerifyCodeResponse.to_json()
+
+# convert the object into a dict
+verify_code_response_dict = verify_code_response_instance.to_dict()
+# create an instance of VerifyCodeResponse from a dict
+verify_code_response_form_dict = verify_code_response.from_dict(verify_code_response_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/VoiceApiError.md b/docs/VoiceApiError.md
new file mode 100644
index 00000000..8788cd2c
--- /dev/null
+++ b/docs/VoiceApiError.md
@@ -0,0 +1,30 @@
+# VoiceApiError
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**type** | **str** | | [optional]
+**description** | **str** | | [optional]
+**id** | **str** | | [optional]
+
+## Example
+
+```python
+from bandwidth.models.voice_api_error import VoiceApiError
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of VoiceApiError from a JSON string
+voice_api_error_instance = VoiceApiError.from_json(json)
+# print the JSON string representation of the object
+print VoiceApiError.to_json()
+
+# convert the object into a dict
+voice_api_error_dict = voice_api_error_instance.to_dict()
+# create an instance of VoiceApiError from a dict
+voice_api_error_form_dict = voice_api_error.from_dict(voice_api_error_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/docs/VoiceCodeResponse.md b/docs/VoiceCodeResponse.md
new file mode 100644
index 00000000..01a83c7c
--- /dev/null
+++ b/docs/VoiceCodeResponse.md
@@ -0,0 +1,28 @@
+# VoiceCodeResponse
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**call_id** | **str** | Programmable Voice API Call ID. | [optional]
+
+## Example
+
+```python
+from bandwidth.models.voice_code_response import VoiceCodeResponse
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of VoiceCodeResponse from a JSON string
+voice_code_response_instance = VoiceCodeResponse.from_json(json)
+# print the JSON string representation of the object
+print VoiceCodeResponse.to_json()
+
+# convert the object into a dict
+voice_code_response_dict = voice_code_response_instance.to_dict()
+# create an instance of VoiceCodeResponse from a dict
+voice_code_response_form_dict = voice_code_response.from_dict(voice_code_response_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/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/openapi-config.yml b/openapi-config.yml
index 28180263..6e31f7c6 100644
--- a/openapi-config.yml
+++ b/openapi-config.yml
@@ -1,4 +1,5 @@
projectName: bandwidth-sdk
packageName: bandwidth
-packageVersion: 1.0.0
+packageVersion: 15.0.0
packageUrl: 'https://dev.bandwidth.com/sdks/python'
+disallowAdditionalPropertiesIfNotPresent: false
diff --git a/openapitools.json b/openapitools.json
new file mode 100644
index 00000000..061a7721
--- /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.0.1"
+ }
+}
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 00000000..10cf5b7d
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,30 @@
+[tool.poetry]
+name = "bandwidth"
+version = "15.0.0"
+description = "Bandwidth"
+authors = ["Bandwidth "]
+license = "NoLicense"
+readme = "README.md"
+repository = "https://github.com/GIT_USER_ID/GIT_REPO_ID"
+keywords = ["OpenAPI", "OpenAPI-Generator", "Bandwidth"]
+include = ["bandwidth/py.typed"]
+
+[tool.poetry.dependencies]
+python = "^3.7"
+
+urllib3 = ">= 1.25.3"
+python-dateutil = ">=2.8.2"
+pydantic = "^1.10.5, <2"
+aenum = ">=3.1.11"
+
+[tool.poetry.dev-dependencies]
+pytest = ">=7.2.1"
+tox = ">=3.9.0"
+flake8 = ">=4.0.0"
+
+[build-system]
+requires = ["setuptools"]
+build-backend = "setuptools.build_meta"
+
+[tool.pylint.'MESSAGES CONTROL']
+extension-pkg-whitelist = "pydantic"
diff --git a/requirements.txt b/requirements.txt
index d0012186..258c179c 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,7 +1,5 @@
-requests>=2.27.1
-jsonpickle>=1.4.1
-cachecontrol>=0.12.6
-python-dateutil~=2.8.1
-enum34~=1.1, >=1.1.10
-lxml>=4.6.5
-urllib3>=1.26.8
+python_dateutil >= 2.5.3
+setuptools >= 21.0.0
+urllib3 >= 1.25.3, < 2.1.0
+pydantic >= 1.10.5, < 2
+aenum >= 3.1.11
diff --git a/requirements_dev.txt b/requirements_dev.txt
deleted file mode 100644
index 5ceda91c..00000000
--- a/requirements_dev.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-attrs==21.2.0
-cachecontrol>=0.13.1
-certifi==2023.7.22
-charset-normalizer==2.0.6
-enum34==1.1.10
-idna==3.2
-iniconfig==1.1.1
-jsonpickle>=3.0
-lxml==4.9.1
-msgpack==1.0.2
-packaging==21.0
-pluggy==1.0.0
-py==1.11.0
-pyparsing==2.4.7
-pytest~=7.1.3
-python-dateutil==2.8.1
-requests==2.31.0
-six==1.16.0
-toml==0.10.2
-urllib3==1.26.8
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 00000000..147380f7
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,5 @@
+[flake8]
+max-line-length=99
+[tool:pytest]
+log_cli = True
+junit_logging = system-out
diff --git a/setup.py b/setup.py
index 51ae8e51..6c4430ce 100644
--- a/setup.py
+++ b/setup.py
@@ -1,30 +1,51 @@
-# -*- coding: utf-8 -*-
-
-import os
-import sys
-from setuptools import setup, find_packages
-
-VERSION = os.environ['RELEASE_VERSION']
-
-if sys.version_info[0] < 3:
- with open('README.md', 'r') as fh:
- long_description = fh.read()
-else:
- with open('README.md', 'r', encoding='utf-8') as fh:
- long_description = fh.read()
-
-with open("requirements.txt", "r") as fp:
- requirements = fp.readlines()
-
-setup(
- name='bandwidth-sdk',
- version=VERSION,
- description='Bandwidth\'s set of APIs',
- long_description=long_description,
- long_description_content_type="text/markdown",
- author='APIMatic SDK Generator',
- author_email='support@apimatic.io',
- url='https://apimatic.io',
- packages=find_packages(),
- install_requires=requirements
-)
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by: https://openapi-generator.tech
+"""
+
+import os
+import sys
+from setuptools import setup, find_packages # noqa: H301
+
+NAME = "bandwidth-sdk"
+VERSION = os.environ['RELEASE_VERSION']
+# To install the library, run the following
+#
+# python setup.py install
+#
+# prerequisite: setuptools
+# http://pypi.python.org/pypi/setuptools
+
+if sys.version_info[0] < 3:
+ with open('README.md', 'r') as fh:
+ long_description = fh.read()
+else:
+ with open('README.md', 'r', encoding='utf-8') as fh:
+ long_description = fh.read()
+
+REQUIRES = [
+ "urllib3 >= 1.25.3",
+ "python-dateutil",
+]
+
+setup(
+ name=NAME,
+ version=VERSION,
+ description="Bandwidth",
+ author="Bandwidth",
+ author_email="letstalk@bandwidth.com",
+ url="https://dev.bandwidth.com/sdks/python",
+ keywords=["OpenAPI", "OpenAPI-Generator", "Bandwidth"],
+ python_requires=">=3.6",
+ install_requires=REQUIRES,
+ packages=find_packages(exclude=["test", "tests"]),
+ include_package_data=True,
+ long_description="""\
+ Bandwidth's Communication APIs # noqa: E501
+ """
+)
diff --git a/test-requirements.txt b/test-requirements.txt
new file mode 100644
index 00000000..666cad0c
--- /dev/null
+++ b/test-requirements.txt
@@ -0,0 +1,4 @@
+pytest~=7.1.3
+pytest-cov>=2.8.1
+pytest-randomly>=3.12.0
+pyhamcrest>=2.0.4
diff --git a/test/__init__.py b/test/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/test/fixtures/python_cat.jpeg b/test/fixtures/python_cat.jpeg
new file mode 100644
index 00000000..d08a926e
Binary files /dev/null and b/test/fixtures/python_cat.jpeg differ
diff --git a/test/integration/__init__.py b/test/integration/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/test/integration/bwmatchers/one_of_string.py b/test/integration/bwmatchers/one_of_string.py
new file mode 100644
index 00000000..740c6c7d
--- /dev/null
+++ b/test/integration/bwmatchers/one_of_string.py
@@ -0,0 +1,33 @@
+from typing import Any
+
+from hamcrest.core.base_matcher import BaseMatcher
+from hamcrest.core.description import Description
+from hamcrest.core.matcher import Matcher
+
+
+class IsOneOfString(BaseMatcher[Any]):
+ def __init__(self, equalsAnyString: Any) -> None:
+ self.object = equalsAnyString
+
+ def _matches(self, item: Any) -> bool:
+ if isinstance(self.object, list):
+ return item in self.object
+ return False
+
+ def describe_to(self, description: Description) -> None:
+ nested_matcher = isinstance(self.object, Matcher)
+ description.append_description_of("one of ")
+ if nested_matcher:
+ description.append_text("<")
+ description.append_description_of(self.object)
+ if nested_matcher:
+ description.append_text(">")
+
+
+def is_one_of_string(obj: Any) -> Matcher[Any]:
+ """Matches expected string is in a given list.
+
+ :param obj: The object to compare against as the expected value.
+
+ This matcher compares the evaluated object to ``obj`` for a match."""
+ return IsOneOfString(obj)
diff --git a/test/integration/test_calls_api.py b/test/integration/test_calls_api.py
new file mode 100644
index 00000000..7744a340
--- /dev/null
+++ b/test/integration/test_calls_api.py
@@ -0,0 +1,380 @@
+"""
+Integration test for Bandwidth's Voice Voice Calls API
+"""
+from bandwidth import ApiResponse
+from test.utils.env_variables import *
+from test.utils.call_cleanup import callCleanup
+import time
+import unittest
+import datetime
+
+from hamcrest import assert_that, has_properties, not_none, instance_of
+
+import bandwidth
+from bandwidth.api import calls_api
+from bandwidth.models.create_call import CreateCall
+from bandwidth.models.create_call_response import CreateCallResponse
+from bandwidth.models.call_direction_enum import CallDirectionEnum
+from bandwidth.models.callback_method_enum import CallbackMethodEnum
+from bandwidth.models.machine_detection_configuration import MachineDetectionConfiguration
+from bandwidth.models.machine_detection_mode_enum import MachineDetectionModeEnum
+from bandwidth.models.call_state_enum import CallStateEnum
+from bandwidth.models.redirect_method_enum import RedirectMethodEnum
+from bandwidth.models.call_state import CallState
+from bandwidth.models.update_call import UpdateCall
+from bandwidth.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException
+
+
+class CallsIntegration(unittest.TestCase):
+ """Voice Calls API integration test"""
+
+ def setUp(self):
+ configuration = bandwidth.Configuration(
+ username=BW_USERNAME,
+ password=BW_PASSWORD,
+ )
+ api_client = bandwidth.ApiClient(configuration)
+ self.calls_api_instance = calls_api.CallsApi(api_client)
+
+ # Unauthorized API Client
+
+ unauthorizedConfiguration = bandwidth.Configuration(
+ username='bad_username',
+ password='bad_password'
+ )
+ unauthorized_api_client = bandwidth.ApiClient(unauthorizedConfiguration)
+ self.unauthorized_api_instance = calls_api.CallsApi(unauthorized_api_client)
+
+ # Forbidden API Client
+
+ forbiddenConfiguration = bandwidth.Configuration(
+ username=FORBIDDEN_USERNAME,
+ password=FORBIDDEN_PASSWORD
+ )
+ forbidden_api_client = bandwidth.ApiClient(forbiddenConfiguration)
+ self.forbidden_api_instance = calls_api.CallsApi(forbidden_api_client)
+ self.account_id = BW_ACCOUNT_ID
+ self.createCallBody = CreateCall(
+ to=USER_NUMBER,
+ var_from=BW_NUMBER,
+ application_id=BW_VOICE_APPLICATION_ID,
+ answer_url=BASE_CALLBACK_URL,
+ answer_method=CallbackMethodEnum("POST"),
+ username="mySecretUsername",
+ password="mySecretPassword1!",
+ answer_fallback_url="https://www.myFallbackServer.com/webhooks/answer",
+ answer_fallback_method=CallbackMethodEnum("POST"),
+ fallback_username="mySecretUsername",
+ fallback_password="mySecretPassword1!",
+ disconnect_url="https://myServer.com/bandwidth/webhooks/disconnectUrl",
+ disconnect_method=CallbackMethodEnum("POST"),
+ call_timeout=30.0,
+ callback_timeout=15.0,
+ machine_detection=MachineDetectionConfiguration(
+ mode=MachineDetectionModeEnum("async"),
+ detection_timeout=15.0,
+ silence_timeout=10.0,
+ speech_threshold=10.0,
+ speech_end_threshold=5.0,
+ machine_speech_end_threshold=5.0,
+ delay_result=False,
+ callback_url="https://myServer.com/bandwidth/webhooks/machineDetectionComplete",
+ callback_method=CallbackMethodEnum("POST"),
+ username="mySecretUsername",
+ password="mySecretPassword1!",
+ fallback_url="https://myFallbackServer.com/bandwidth/webhooks/machineDetectionComplete",
+ fallback_method=CallbackMethodEnum("POST"),
+ fallback_username="mySecretUsername",
+ fallback_password="mySecretPassword1!",
+ ),
+ priority=5,
+ tag="tag_example",
+ )
+ self.testCallBody = CreateCall(to=USER_NUMBER, var_from=BW_NUMBER, application_id=BW_VOICE_APPLICATION_ID, answer_url=BASE_CALLBACK_URL)
+ self.testMantecaCallBody = CreateCall(to=MANTECA_IDLE_NUMBER, var_from=MANTECA_ACTIVE_NUMBER, application_id=MANTECA_APPLICATION_ID, answer_url=MANTECA_BASE_URL + "/bxml/pause")
+ self.updateStateCompleted = UpdateCall(state=CallStateEnum("completed"))
+ self.testCallId = "Call-Id"
+ self.testBxmlBody = 'This is a test bxml response'
+ self.callIdArray = []
+ self.TEST_SLEEP = 5
+ self.TEST_SLEEP_LONG = 15
+
+ def tearDown(self):
+ callCleanup(self)
+
+ def assertApiException(self, context: ApiException, expectedException: ApiException, expected_status_code: int):
+ """Validates that common API exceptions, (401, 403, and 404) are properly formatted
+ Args:
+ context (ApiException): Exception to validate
+ expectedException (ApiException): Expected exception type
+ expected_status_code (int): Expected status code
+ """
+ assert_that(context.exception, has_properties(
+ 'status', expected_status_code,
+ 'body', not_none()
+ ))
+
+ def test_create_call(self):
+ """
+ Validate a Create Call request with all optional parameters
+ """
+ time.sleep(self.TEST_SLEEP)
+ create_call_response: ApiResponse = self.calls_api_instance.create_call_with_http_info(
+ BW_ACCOUNT_ID,
+ self.createCallBody
+ )
+
+ #Adding the call to the self.callIdArray
+ self.callIdArray.append(create_call_response.data.call_id)
+
+ assert_that(create_call_response.status_code, 201)
+ assert_that(create_call_response.data, has_properties(
+ 'call_id', instance_of(str),
+ 'account_id', BW_ACCOUNT_ID,
+ 'application_id', BW_VOICE_APPLICATION_ID,
+ 'to', USER_NUMBER,
+ 'var_from', BW_NUMBER
+ ))
+
+ def test_create_call_bad_request(self):
+ """Validate a bad (400) request
+ """
+ call_body = CreateCall(to="invalidNumberFormat", var_from=BW_NUMBER, application_id=BW_VOICE_APPLICATION_ID, answer_url=BASE_CALLBACK_URL)
+
+ with self.assertRaises(ApiException) as context:
+ self.calls_api_instance.create_call_with_http_info(BW_ACCOUNT_ID, call_body)
+
+ assert_that(context.exception.status, 400)
+
+ def test_create_call_unauthorized(self) -> None:
+ """Validate an unauthorized (401) request
+ """
+ with self.assertRaises(UnauthorizedException) as context:
+ self.unauthorized_api_instance.create_call(BW_ACCOUNT_ID, self.testCallBody)
+
+ self.assertApiException(context, UnauthorizedException, 401)
+
+ def test_create_call_forbidden(self) -> None:
+ """Validate a forbidden (403) request
+ """
+ with self.assertRaises(ForbiddenException) as context:
+ self.forbidden_api_instance.create_call(BW_ACCOUNT_ID, self.testCallBody)
+
+ self.assertApiException(context, ForbiddenException, 403)
+
+
+ def test_get_call_state(self):
+ """Validate an Get Call State Request
+ """
+ create_call_response: CreateCallResponse = self.calls_api_instance.create_call(BW_ACCOUNT_ID, self.testCallBody)
+ call_id = create_call_response.call_id
+
+ #Adding the call to the self.callIdArray
+ self.callIdArray.append(call_id)
+
+ time.sleep(self.TEST_SLEEP)
+
+ get_call_response: ApiResponse = self.calls_api_instance.get_call_state_with_http_info(BW_ACCOUNT_ID, call_id)
+
+ assert_that(get_call_response.status_code, 200)
+ assert_that(get_call_response.data, has_properties(
+ "call_id", call_id,
+ "state", instance_of(str),
+ "direction", CallDirectionEnum("outbound"),
+ "enqueued_time", instance_of(datetime.datetime),
+ "last_update", instance_of(datetime.datetime),
+ "start_time", instance_of(datetime.datetime)
+ ))
+
+ def test_get_call_state_unauthorized(self) -> None:
+ """Validate an unauthorized (401) request
+ """
+ with self.assertRaises(UnauthorizedException) as context:
+ self.unauthorized_api_instance.get_call_state(BW_ACCOUNT_ID, self.testCallId)
+
+ self.assertApiException(context, UnauthorizedException, 401)
+
+ def test_get_call_state_forbidden(self) -> None:
+ """Validate a forbidden (403) request
+ """
+ with self.assertRaises(ForbiddenException) as context:
+ self.forbidden_api_instance.get_call_state(BW_ACCOUNT_ID, self.testCallId, _return_http_data_only=False)
+
+ self.assertApiException(context, ForbiddenException, 403)
+
+ def test_get_call_state_not_found(self):
+ """Validate an invalid Get Call State Request due to a bad callID
+ """
+ with self.assertRaises(NotFoundException) as context:
+ self.calls_api_instance.get_call_state(BW_ACCOUNT_ID, self.testCallId, _return_http_data_only=False)
+
+ self.assertApiException(context, NotFoundException, 404)
+
+ def test_update_call(self):
+ """Validate an UpdateCall Request
+ """
+ time.sleep(self.TEST_SLEEP)
+ create_call_response: CreateCallResponse = self.calls_api_instance.create_call(BW_ACCOUNT_ID, self.testMantecaCallBody, _return_http_data_only=False)
+ call_id = create_call_response.call_id
+
+ #Adding the call to the self.callIdArray
+ self.callIdArray.append(call_id)
+
+ updateCallBody = UpdateCall(
+ state=CallStateEnum("active"),
+ redirect_url=MANTECA_BASE_URL + "/bxml/pause",
+ redirect_method=RedirectMethodEnum("POST"),
+ username="mySecretUsername",
+ password="mySecretPassword1!",
+ redirect_fallback_url=MANTECA_BASE_URL + "/bxml/pause",
+ redirect_fallback_method=RedirectMethodEnum("POST"),
+ fallback_username="mySecretUsername",
+ fallback_password="mySecretPassword1!",
+ tag="My Custom Tag",
+ )
+
+ time.sleep(self.TEST_SLEEP)
+ update_call_response: ApiResponse = self.calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, updateCallBody)
+ assert_that(update_call_response.status_code, 200)
+
+ time.sleep(self.TEST_SLEEP)
+ # hanging-up the call
+ update_call_response: ApiResponse = self.calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, self.updateStateCompleted)
+ assert_that(update_call_response.status_code, 200)
+
+ def test_update_call_bad_request(self):
+ """Validate a bad (400) update call request
+ """
+ create_call_response: CreateCallResponse = self.calls_api_instance.create_call(BW_ACCOUNT_ID, self.testMantecaCallBody)
+ call_id = create_call_response.call_id
+
+ #Adding the call to the self.callIdArray
+ self.callIdArray.append(call_id)
+
+ time.sleep(self.TEST_SLEEP)
+
+ with self.assertRaises(ApiException) as context:
+ badRequestBody = UpdateCall(states="badRequest")
+ self.calls_api_instance.update_call(BW_ACCOUNT_ID, call_id, badRequestBody, _return_http_data_only=False)
+
+ assert_that(context.exception.status, 400)
+
+ # hanging-up the call
+ time.sleep(self.TEST_SLEEP)
+ update_call_response: ApiResponse = self.calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, self.updateStateCompleted)
+ assert_that(update_call_response.status_code, 200)
+
+ def test_update_call_unauthorized(self):
+ """Validate an unauthorized (401) update call request
+ """
+ with self.assertRaises(UnauthorizedException) as context:
+ self.unauthorized_api_instance.update_call(BW_ACCOUNT_ID, self.testCallId, self.updateStateCompleted, _return_http_data_only=False)
+
+ self.assertApiException(context, UnauthorizedException, 401)
+
+ def test_update_call_forbidden(self):
+ """Validate a forbidden (403) update call request
+ """
+ create_call_response: CreateCallResponse = self.calls_api_instance.create_call(BW_ACCOUNT_ID, self.testMantecaCallBody, _return_http_data_only=False)
+ call_id = create_call_response.call_id
+
+ #Adding the call to the self.callIdArray
+ self.callIdArray.append(call_id)
+
+ time.sleep(self.TEST_SLEEP)
+
+ with self.assertRaises(ForbiddenException) as context:
+ self.forbidden_api_instance.update_call(BW_ACCOUNT_ID, call_id, self.updateStateCompleted, _return_http_data_only=False)
+
+ self.assertApiException(context, ForbiddenException, 403)
+
+ time.sleep(self.TEST_SLEEP_LONG)
+ # hanging-up the call
+ update_call_response: ApiResponse = self.calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, self.updateStateCompleted)
+ assert_that(update_call_response.status_code, 200)
+
+ def test_update_call_not_found(self):
+ """Validate a not found update call request
+ """
+ with self.assertRaises(NotFoundException) as context:
+ self.calls_api_instance.update_call(BW_ACCOUNT_ID, self.testCallId, self.updateStateCompleted, _return_http_data_only=False)
+
+ self.assertApiException(context, NotFoundException, 404)
+
+ def test_update_call_bxml(self):
+ """Validate an UpdateCallBxml Request
+ """
+ create_call_response: CreateCallResponse = self.calls_api_instance.create_call(BW_ACCOUNT_ID, self.testMantecaCallBody)
+ call_id = create_call_response.call_id
+
+ #Adding the call to the self.callIdArray
+ self.callIdArray.append(create_call_response.call_id)
+
+ time.sleep(self.TEST_SLEEP)
+ update_call_bxml_response: ApiResponse = self.calls_api_instance.update_call_bxml_with_http_info(BW_ACCOUNT_ID, call_id, self.testBxmlBody)
+ assert_that(update_call_bxml_response.status_code, 204)
+
+ time.sleep(self.TEST_SLEEP)
+ # hanging-up the call
+ update_call_response: ApiResponse = self.calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, self.updateStateCompleted)
+ assert_that(update_call_response.status_code, 200)
+
+ def test_update_call_bxml_bad_request(self):
+ """Validate a bad (400) update call bxml request
+ """
+ create_call_response: CreateCallResponse = self.calls_api_instance.create_call(BW_ACCOUNT_ID, self.testMantecaCallBody)
+ call_id = create_call_response.call_id
+
+ #Adding the call to the self.callIdArray
+ self.callIdArray.append(call_id)
+
+ time.sleep(self.TEST_SLEEP)
+
+ invalidBxmlBody = "invalidBXML"
+
+ with self.assertRaises(ApiException) as context:
+ self.calls_api_instance.update_call_bxml_with_http_info(BW_ACCOUNT_ID, call_id, invalidBxmlBody)
+
+ assert_that(context.exception.status, 400)
+
+ time.sleep(self.TEST_SLEEP)
+ # hanging-up the call
+ update_call_response: ApiResponse = self.calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, self.updateStateCompleted)
+ assert_that(update_call_response.status_code, 200)
+
+
+ def test_update_call_bxml_unauthorized(self):
+ """Validate an unauthorized (401) update call bxml request
+ """
+
+ with self.assertRaises(UnauthorizedException) as context:
+ self.unauthorized_api_instance.update_call_bxml(BW_ACCOUNT_ID, self.testCallId, self.testBxmlBody, _return_http_data_only=False)
+
+ self.assertApiException(context, UnauthorizedException, 401)
+
+ def test_update_call_bxml_forbidden(self):
+ """Validate a forbidden (403) update call bxml request
+ """
+ create_call_response: CreateCallResponse = self.calls_api_instance.create_call(BW_ACCOUNT_ID, self.testMantecaCallBody, _return_http_data_only=False)
+ call_id = create_call_response.call_id
+
+ #Adding the call to the self.callIdArray
+ self.callIdArray.append(call_id)
+
+ time.sleep(self.TEST_SLEEP)
+ with self.assertRaises(ForbiddenException) as context:
+ self.forbidden_api_instance.update_call_bxml(BW_ACCOUNT_ID, call_id, self.testBxmlBody, _return_http_data_only=False)
+
+ self.assertApiException(context, ForbiddenException, 403)
+
+ def test_update_call_bxml_not_found(self):
+ """
+ Validate a not found update call bxml request
+ """
+ with self.assertRaises(NotFoundException) as context:
+ self.calls_api_instance.update_call_bxml(BW_ACCOUNT_ID, self.testCallId, self.testBxmlBody, _return_http_data_only=False)
+
+ self.assertApiException(context, NotFoundException, 404)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/integration/test_conferences_api.py b/test/integration/test_conferences_api.py
new file mode 100644
index 00000000..63a09772
--- /dev/null
+++ b/test/integration/test_conferences_api.py
@@ -0,0 +1,463 @@
+"""
+Integration tests for Bandwidth's Voice Voice Conferences API
+"""
+
+from cgi import test
+import json
+import time
+from typing import Dict, List, Tuple
+import unittest
+
+from hamcrest import assert_that, has_properties, not_none, instance_of, greater_than
+
+import bandwidth
+from bandwidth import ApiResponse
+from bandwidth.api import calls_api
+from bandwidth.models.create_call import CreateCall
+from bandwidth.models.create_call_response import CreateCallResponse
+from bandwidth.models.call_state import CallState
+from bandwidth.models.call_state_enum import CallStateEnum
+from bandwidth.models.update_call import UpdateCall
+from bandwidth.models.redirect_method_enum import RedirectMethodEnum
+from bandwidth.api import conferences_api
+from bandwidth.models.conference_state_enum import ConferenceStateEnum
+from bandwidth.models.conference_recording_metadata import ConferenceRecordingMetadata
+from bandwidth.models.update_conference import UpdateConference
+from bandwidth.models.update_conference_member import UpdateConferenceMember
+from bandwidth.models.file_format_enum import FileFormatEnum
+from bandwidth.rest import RESTClientObject, RESTResponse
+from bandwidth.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException
+from test.utils.env_variables import *
+from test.utils.call_cleanup import callCleanup
+
+
+class ConferencesIntegration(unittest.TestCase):
+ """
+ Voice Conferences API integration test
+ """
+
+ def setUp(self):
+ """
+ Set up for our tests by creating the CallsApi and ConferencesApi instances
+ for testing as well as the unauthorized and forbidden credentials for the 4xx tests.
+ """
+ configuration = bandwidth.Configuration(
+ username=BW_USERNAME,
+ password=BW_PASSWORD
+ )
+ api_client = bandwidth.ApiClient(configuration)
+
+ self.calls_api_instance = calls_api.CallsApi(api_client)
+ self.conference_api_instance = conferences_api.ConferencesApi(api_client)
+
+ unauthorizedConfiguration = bandwidth.Configuration(
+ username='bad_username',
+ password='bad_password'
+ )
+ unauthorized_api_client = bandwidth.ApiClient(unauthorizedConfiguration)
+ self.unauthorized_api_instance = conferences_api.ConferencesApi(unauthorized_api_client)
+
+ forbiddenConfiguration = bandwidth.Configuration(
+ username=FORBIDDEN_USERNAME,
+ password=FORBIDDEN_PASSWORD
+ )
+ forbidden_api_client = bandwidth.ApiClient(forbiddenConfiguration)
+ self.forbidden_api_instance = conferences_api.ConferencesApi(forbidden_api_client)
+
+ # Rest client for interacting with Manteca
+ self.rest_client = RESTClientObject(bandwidth.Configuration.get_default_copy())
+ configuration = bandwidth.Configuration(
+ username=BW_USERNAME,
+ password=BW_PASSWORD,
+ )
+
+ self.account_id = BW_ACCOUNT_ID
+ self.callIdArray = []
+ self.testUpdateConf = UpdateConference(
+ state=ConferenceStateEnum("active"),
+ redirect_url=MANTECA_BASE_URL + "/bxml/pause",
+ redirect_method=RedirectMethodEnum("POST"),
+ username="mySecretUsername",
+ password="mySecretPassword1!",
+ redirect_fallback_url=MANTECA_BASE_URL + "/bxml/pause",
+ redirect_fallback_method=RedirectMethodEnum("POST"),
+ fallback_username="mySecretUsername",
+ fallback_password="mySecretPassword1!",
+ tag="My Custom Tag",
+ )
+ self.testUpdateBxml = 'This is test BXML.'
+ self.testUpdateMember = UpdateConferenceMember(mute=False)
+ self.testConfId = "Conf-id"
+ self.testMemberId = "Member-Id"
+ self.testRecordId = "Recording-Id"
+ self.TEST_SLEEP = 3
+ self.TEST_SLEEP_LONG = 10
+ self.MAX_RETRIES = 40
+
+ def tearDown(self):
+ callCleanup(self)
+
+ def assertApiException(self, context: ApiException, expectedException: ApiException, expected_status_code: int):
+ """Validates that common API exceptions, (401, 403, and 404) are properly formatted
+ Args:
+ context (ApiException): Exception to validate
+ expected_status_code (int): Expected status code
+ """
+ assert_that(context.exception, has_properties(
+ 'status', expected_status_code,
+ 'body', not_none()
+ ))
+
+ def create_conference(self, answer_url: str) -> Tuple[str, str]:
+ """
+ Create and validate a call between two bandwidth numbers. Initializes the call with the Manteca
+ system.
+
+ Args:
+ answer_url (str): The answer url for the call to create.
+ Return:
+ Tuple[str, str]: A tuple containing the test id created in Manteca to track this call, as well as
+ the call id for the created call.
+ """
+
+ # Initialize the call with Manteca
+ response = self.rest_client.request(
+ method='POST',
+ url=MANTECA_BASE_URL + 'tests',
+ body={
+ 'os': OPERATING_SYSTEM,
+ 'language': 'python' + PYTHON_VERSION,
+ 'type': 'CONFERENCE'
+ }
+ )
+
+ # Get the test id from the response
+ test_id = response.data.decode("utf-8")
+
+ call_body = CreateCall(to=MANTECA_IDLE_NUMBER, var_from=MANTECA_ACTIVE_NUMBER,
+ application_id=MANTECA_APPLICATION_ID, answer_url=answer_url, tag=test_id)
+
+ create_call_response: CreateCallResponse = self.calls_api_instance.create_call(
+ BW_ACCOUNT_ID, call_body)
+
+ assert_that(create_call_response, has_properties(
+ "call_id", instance_of(str),
+ 'account_id', BW_ACCOUNT_ID,
+ 'application_id', MANTECA_APPLICATION_ID,
+ 'to', MANTECA_IDLE_NUMBER,
+ 'var_from', MANTECA_ACTIVE_NUMBER
+ ))
+
+ time.sleep(self.TEST_SLEEP)
+ list_conferences_response = self.conference_api_instance.list_conferences_with_http_info(
+ BW_ACCOUNT_ID, name=test_id)
+
+ assert_that(list_conferences_response.status_code, 200)
+
+ # TODO: This is not deterministic; our latest conference may not always be the one we just created due to parallelism.
+ # This new solution should guarantee the right conference id is grabbed.
+ conference_id = list_conferences_response.data[0].id
+
+ get_conference_response = self.conference_api_instance.get_conference_with_http_info(
+ BW_ACCOUNT_ID, conference_id)
+ assert_that(get_conference_response.status_code, 200)
+
+ self.callIdArray.append(create_call_response.call_id)
+
+ return (test_id, create_call_response.call_id, conference_id)
+
+ def validate_recording(self, recording: ConferenceRecordingMetadata) -> None:
+ assert_that(recording.status, 'complete')
+ assert_that(recording.file_format, FileFormatEnum('wav'))
+
+ def get_test_status(self, test_id: str) -> Dict:
+ """
+ Get the status of the specified test by its id value from Manteca services.
+
+ Args:
+ test_id (str): The test id associated with the test to get the status of.
+
+ Returns:
+ Dict: The status of the test requested.
+ """
+ status_url = MANTECA_STATUS_URL + test_id
+ response: RESTResponse = self.rest_client.request(
+ method='GET',
+ url=status_url
+ )
+ return json.loads(response.data)
+
+ def test_conference_and_members(self):
+ """
+ Tests a successful flow of creating and ending a conference.
+ The following endpoints are tested in this flow:
+ - list_conferences
+ - get_conference_information
+ - get_conference_member
+ - update_conference_member
+ - update_conference_
+ - update_conference_bxml
+ """
+
+ answer_url = MANTECA_BASE_URL + "bxml/joinConferencePause"
+ (test_id, call_id, conference_id) = self.create_conference(answer_url)
+
+ list_conferences_response = self.conference_api_instance.list_conferences_with_http_info(
+ BW_ACCOUNT_ID)
+
+ assert_that(list_conferences_response.status_code, 200)
+ assert_that(list_conferences_response.data[0].name, instance_of(str))
+ assert_that(list_conferences_response.data[0].id, instance_of(str))
+
+ # TODO: Also non-deterministic; we could differentiate by conference name instead? The conference name is set to be the test id by Manteca
+ # conferenceId = (list_conferences_response[0][len(list_conferences_response[0])-1].id)
+
+ get_conference_response = self.conference_api_instance.get_conference_with_http_info(
+ BW_ACCOUNT_ID, conference_id)
+ assert_that(get_conference_response.status_code, 200)
+ assert_that(get_conference_response.data.id, conference_id)
+ assert_that(get_conference_response.data.name, instance_of(str))
+ callId = (get_conference_response.data.active_members[0].call_id)
+ self.callIdArray.append(callId)
+
+ get_conference_member_response = self.conference_api_instance.get_conference_member_with_http_info(
+ BW_ACCOUNT_ID, conference_id, callId)
+ assert_that(get_conference_member_response.status_code, 200)
+ assert_that(get_conference_member_response.data.conference_id, conference_id)
+ assert_that(get_conference_member_response.data.call_id, callId)
+
+ # time.sleep(self.TEST_SLEEP)
+ update_conference_member_response = self.conference_api_instance.update_conference_member_with_http_info(
+ BW_ACCOUNT_ID, conference_id, callId, self.testUpdateMember)
+ assert_that(update_conference_member_response.status_code, 204)
+
+ # time.sleep(self.TEST_SLEEP)
+ update_conference_response = self.conference_api_instance.update_conference_with_http_info(
+ BW_ACCOUNT_ID, conference_id, self.testUpdateConf)
+ assert_that(update_conference_response.status_code, 204)
+
+ updateBxmlBody = 'This is a test bxml response'
+
+ # time.sleep(self.TEST_SLEEP)
+ update_conference_bxml_response = self.conference_api_instance.update_conference_bxml_with_http_info(
+ BW_ACCOUNT_ID, conference_id, updateBxmlBody)
+ assert_that(update_conference_bxml_response.status_code, 204)
+
+ update_call = UpdateCall(state=CallStateEnum('completed'))
+ self.calls_api_instance.update_call(
+ BW_ACCOUNT_ID, call_id, update_call, _return_http_data_only=False)
+
+ def test_conference_recordings(self) -> None:
+ """
+ Tests a successful flow of creating a call with a recording.
+ The following endpoints are tested in this flow:
+ - list_conference_recordings
+ - get_conference_recording
+ - download_conference_recording
+ """
+
+ answer_url = MANTECA_BASE_URL + "bxml/joinConferencePause"
+ (test_id, call_id, conference_id) = self.create_conference(answer_url)
+
+ list_conferences_response = self.conference_api_instance.list_conferences(
+ BW_ACCOUNT_ID, _return_http_data_only=False)
+
+ assert_that(list_conferences_response[1], 200)
+
+ updateBxmlBody = 'This should be a conference recording.'
+ update_conference_bxml_response = self.conference_api_instance.update_conference_bxml_with_http_info(
+ BW_ACCOUNT_ID, conference_id, updateBxmlBody)
+ assert_that(update_conference_bxml_response.status_code, 204)
+
+ # Poll Manteca to ensure our conference is recorded
+ call_status = self.get_test_status(test_id)
+ retries = 0
+ while call_status['callRecorded'] == False and retries < self.MAX_RETRIES:
+ time.sleep(self.TEST_SLEEP)
+ call_status = self.get_test_status(test_id)
+ retries += 1
+
+ # If we failed to get a recorded conference, fail due to polling timeout
+ assert call_status['callRecorded'] == True
+
+ list_conference_recordings_response: ApiResponse = self.conference_api_instance.list_conference_recordings_with_http_info(
+ BW_ACCOUNT_ID, conference_id)
+ assert_that(list_conference_recordings_response.status_code, 200)
+
+ conference_recordings = list_conference_recordings_response.data
+ assert_that(len(conference_recordings), greater_than(0))
+
+ first_recording: ConferenceRecordingMetadata = conference_recordings[0]
+ self.validate_recording(first_recording)
+ recording_id = first_recording.recording_id
+
+ recording_response: ConferenceRecordingMetadata = self.conference_api_instance.get_conference_recording_with_http_info(
+ BW_ACCOUNT_ID, conference_id, recording_id)
+ assert_that(recording_response.status_code, 200)
+ assert_that(recording_response.data.conference_id, conference_id)
+ assert_that(recording_response.data.recording_id, recording_id)
+ assert_that(recording_response.data.name, instance_of(str))
+
+ self.validate_recording(recording_response.data)
+
+ recording_media_response = self.conference_api_instance.download_conference_recording(
+ BW_ACCOUNT_ID, conference_id, recording_id)
+ conference_recording_media = recording_media_response
+
+ def test_list_conferences_unauthorized(self) -> None:
+ with self.assertRaises(UnauthorizedException) as context:
+ self.unauthorized_api_instance.list_conferences(
+ BW_ACCOUNT_ID, _return_http_data_only=False)
+
+ self.assertApiException(context, UnauthorizedException, 401)
+
+ def test_list_conferences_forbidden(self) -> None:
+ with self.assertRaises(ForbiddenException) as context:
+ self.forbidden_api_instance.list_conferences(
+ BW_ACCOUNT_ID, _return_http_data_only=False)
+
+ self.assertApiException(context, ForbiddenException, 403)
+
+ def test_get_conferences_unauthorized(self) -> None:
+ with self.assertRaises(UnauthorizedException) as context:
+ self.unauthorized_api_instance.get_conference(
+ BW_ACCOUNT_ID, self.testConfId, _return_http_data_only=False)
+
+ self.assertApiException(context, UnauthorizedException, 401)
+
+ def test_get_conferences_forbidden(self) -> None:
+ with self.assertRaises(ForbiddenException) as context:
+ self.forbidden_api_instance.get_conference(
+ BW_ACCOUNT_ID, self.testConfId, _return_http_data_only=False)
+
+ self.assertApiException(context, ForbiddenException, 403)
+
+ def test_get_conferences_not_found(self) -> None:
+ with self.assertRaises(NotFoundException) as context:
+ self.conference_api_instance.get_conference(
+ BW_ACCOUNT_ID, self.testConfId, _return_http_data_only=False)
+
+ self.assertApiException(context, NotFoundException, 404)
+
+ def test_get_conference_member_unauthorized(self) -> None:
+ with self.assertRaises(UnauthorizedException) as context:
+ self.unauthorized_api_instance.get_conference_member(
+ BW_ACCOUNT_ID, self.testConfId, self.testMemberId, _return_http_data_only=False)
+
+ self.assertApiException(context, UnauthorizedException, 401)
+
+ def test_get_conference_member_forbidden(self) -> None:
+ with self.assertRaises(ForbiddenException) as context:
+ self.forbidden_api_instance.get_conference_member(
+ BW_ACCOUNT_ID, self.testConfId, self.testMemberId, _return_http_data_only=False)
+
+ self.assertApiException(context, ForbiddenException, 403)
+
+ def test_get_conference_member_not_found(self) -> None:
+ with self.assertRaises(NotFoundException) as context:
+ self.conference_api_instance.get_conference_member(
+ BW_ACCOUNT_ID, self.testConfId, self.testMemberId, _return_http_data_only=False)
+
+ self.assertApiException(context, NotFoundException, 404)
+
+ def test_list_conference_recordings_unauthorized(self) -> None:
+ with self.assertRaises(UnauthorizedException) as context:
+ self.unauthorized_api_instance.list_conference_recordings(
+ BW_ACCOUNT_ID, self.testConfId, _return_http_data_only=False)
+
+ self.assertApiException(context, UnauthorizedException, 401)
+
+ def test_list_conference_recordings_forbidden(self) -> None:
+ with self.assertRaises(ForbiddenException) as context:
+ self.forbidden_api_instance.list_conference_recordings(
+ BW_ACCOUNT_ID, self.testConfId, _return_http_data_only=False)
+
+ self.assertApiException(context, ForbiddenException, 403)
+
+ def test_get_recording_unauthorized(self) -> None:
+ with self.assertRaises(UnauthorizedException) as context:
+ self.unauthorized_api_instance.get_conference_recording(
+ BW_ACCOUNT_ID, self.testConfId, self.testRecordId, _return_http_data_only=False)
+
+ self.assertApiException(context, UnauthorizedException, 401)
+
+ def test_get_recording_forbidden(self) -> None:
+ with self.assertRaises(ForbiddenException) as context:
+ self.forbidden_api_instance.get_conference_recording(
+ BW_ACCOUNT_ID, self.testConfId, self.testRecordId, _return_http_data_only=False)
+
+ self.assertApiException(context, ForbiddenException, 403)
+
+ def test_get_conference_recording_not_found(self) -> None:
+ with self.assertRaises(NotFoundException) as context:
+ self.conference_api_instance.get_conference_member(
+ BW_ACCOUNT_ID, self.testConfId, self.testRecordId, _return_http_data_only=False)
+
+ self.assertApiException(context, NotFoundException, 404)
+
+ def test_update_conference_unauthorized(self) -> None:
+ with self.assertRaises(UnauthorizedException) as context:
+ self.unauthorized_api_instance.update_conference(
+ BW_ACCOUNT_ID, self.testConfId, self.testUpdateConf, _return_http_data_only=False)
+
+ self.assertApiException(context, UnauthorizedException, 401)
+
+ def test_update_conference_forbidden(self) -> None:
+ with self.assertRaises(ForbiddenException) as context:
+ self.forbidden_api_instance.update_conference(
+ BW_ACCOUNT_ID, self.testConfId, self.testUpdateConf, _return_http_data_only=False)
+
+ self.assertApiException(context, ForbiddenException, 403)
+
+ def test_update_conference_not_found(self) -> None:
+ with self.assertRaises(NotFoundException) as context:
+ self.conference_api_instance.update_conference(
+ BW_ACCOUNT_ID, self.testConfId, self.testUpdateConf, _return_http_data_only=False)
+
+ self.assertApiException(context, NotFoundException, 404)
+
+ def test_update_conference_bxml_unauthorized(self) -> None:
+ with self.assertRaises(UnauthorizedException) as context:
+ self.unauthorized_api_instance.update_conference_bxml(
+ BW_ACCOUNT_ID, self.testConfId, self.testUpdateBxml, _return_http_data_only=False)
+
+ self.assertApiException(context, UnauthorizedException, 401)
+
+ def test_update_conference_bxml_forbidden(self) -> None:
+ with self.assertRaises(ForbiddenException) as context:
+ self.forbidden_api_instance.update_conference_bxml(
+ BW_ACCOUNT_ID, self.testConfId, self.testUpdateBxml, _return_http_data_only=False)
+
+ self.assertApiException(context, ForbiddenException, 403)
+
+ def test_update_conference_bxml_not_found(self) -> None:
+ with self.assertRaises(NotFoundException) as context:
+ self.conference_api_instance.update_conference_bxml(
+ BW_ACCOUNT_ID, self.testConfId, self.testUpdateBxml, _return_http_data_only=False)
+
+ self.assertApiException(context, NotFoundException, 404)
+
+ def test_update_conference_member_unauthorized(self) -> None:
+ with self.assertRaises(UnauthorizedException) as context:
+ self.unauthorized_api_instance.update_conference_member(
+ BW_ACCOUNT_ID, self.testConfId, self.testMemberId, self.testUpdateMember, _return_http_data_only=False)
+
+ self.assertApiException(context, UnauthorizedException, 401)
+
+ def test_update_conference_member_forbidden(self) -> None:
+ with self.assertRaises(ForbiddenException) as context:
+ self.forbidden_api_instance.update_conference_member(
+ BW_ACCOUNT_ID, self.testConfId, self.testMemberId, self.testUpdateMember, _return_http_data_only=False)
+
+ self.assertApiException(context, ForbiddenException, 403)
+
+ def test_update_conference_member_not_found(self) -> None:
+ with self.assertRaises(NotFoundException) as context:
+ self.conference_api_instance.update_conference_member(
+ BW_ACCOUNT_ID, self.testConfId, self.testMemberId, self.testUpdateMember, _return_http_data_only=False)
+
+ self.assertApiException(context, NotFoundException, 404)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/integration/test_media_api.py b/test/integration/test_media_api.py
new file mode 100644
index 00000000..ea50a45c
--- /dev/null
+++ b/test/integration/test_media_api.py
@@ -0,0 +1,134 @@
+"""
+Integration test for Bandwidth's Media API
+"""
+
+import uuid
+import filecmp
+import unittest
+import logging
+
+from bandwidth import ApiResponse
+
+import bandwidth
+from hamcrest import *
+from bandwidth.api import media_api
+from bandwidth.models.media import Media
+from bandwidth.exceptions import ApiException, NotFoundException
+from test.utils.env_variables import *
+
+
+class TestMedia(unittest.TestCase):
+ """Media API integration Test
+ """
+
+ def setUp(self) -> None:
+ configuration = bandwidth.Configuration(
+ username=BW_USERNAME,
+ password=BW_PASSWORD
+ )
+ self.api_client = bandwidth.ApiClient(configuration)
+ self.api_instance = media_api.MediaApi(self.api_client)
+ self.account_id = BW_ACCOUNT_ID
+ self.media_path = "./test/fixtures/"
+ self.media_file = "python_cat.jpeg"
+ self.media_id = PYTHON_VERSION + "_" + RUNNER_OS + "_" + str(uuid.uuid4()) + "_" + self.media_file
+ self.download_file_path = "cat_download.jpeg"
+ self.original_file = open(self.media_path + self.media_file, "rb")
+
+ def uploadMedia(self) -> None:
+ """Test uploading media
+ """
+ media_id = self.media_id
+ content_type = "image/jpeg"
+ cache_control = "no-cache"
+
+ api_response_with_http_info: ApiResponse = self.api_instance.upload_media_with_http_info(
+ account_id=self.account_id,
+ media_id=media_id,
+ body=bytearray(self.original_file.read()),
+ _content_type=content_type,
+ cache_control=cache_control,
+ _return_http_data_only=False
+ )
+
+ logging.debug(api_response_with_http_info)
+ assert_that(api_response_with_http_info.status_code, equal_to(204))
+
+ # reopen the media file
+ # the client automatically closes any files passed into request bodies
+ reopened_file = open(self.media_path + self.media_file, "rb")
+
+ # returns void
+ self.api_instance.upload_media(
+ account_id=self.account_id,
+ media_id=media_id,
+ body=bytearray(reopened_file.read()),
+ _content_type=content_type,
+ cache_control=cache_control,
+ _return_http_data_only=False
+ )
+
+ def listMedia(self) -> None:
+ """Test listing all media on the account
+ """
+ api_response_with_http_info = self.api_instance.list_media_with_http_info(
+ self.account_id, _return_http_data_only=False)
+
+ assert_that(api_response_with_http_info.status_code, equal_to(200))
+
+ api_response = self.api_instance.list_media(self.account_id)
+ logging.debug("List Media" + str(api_response))
+
+ assert_that(api_response[0], instance_of(Media))
+ pass
+
+ def getMedia(self) -> None:
+ """Test downloading the media we previously uploaded
+ """
+ api_response_with_http_info = self.api_instance.get_media_with_http_info(
+ self.account_id, self.media_id)
+
+ logging.debug(api_response_with_http_info)
+ assert_that(api_response_with_http_info.status_code, equal_to(200))
+
+ api_response = self.api_instance.get_media(
+ self.account_id, self.media_id)
+
+ with open(self.media_path + self.download_file_path, "wb") as download_file:
+ download_file.write(api_response)
+
+ assert_that(filecmp.cmp(self.media_path + self.media_file,
+ self.media_path + self.download_file_path), equal_to(True))
+ download_file.close()
+
+ def deleteMedia(self) -> None:
+ """Test deleting the media that we previously uploaded
+ """
+ api_response_with_http_info = self.api_instance.delete_media_with_http_info(
+ self.account_id, self.media_id)
+
+ logging.debug(api_response_with_http_info)
+ assert_that(api_response_with_http_info.status_code, equal_to(204))
+
+ # returns void
+ self.api_instance.delete_media(self.account_id, self.media_id)
+
+ def _steps(self):
+ call_order = ['uploadMedia', 'listMedia', 'getMedia', 'deleteMedia']
+ for name in call_order:
+ yield name, getattr(self, name)
+
+ def test_steps(self) -> None:
+ """Test each function from _steps.call_order in specified order
+ """
+
+ for name, step in self._steps():
+ step()
+
+ @unittest.skip("API does not support url encoded characters in path")
+ def testGetMediaWithBandwidthId(self) -> None:
+ # use a nonexistent mediaId - results in a 404
+ media_id = "abcd1234-e5f6-1111-2222-3456ghi7890/image123456.jpg"
+
+ assert_that(calling(self.api_instance.get_media).with_args(
+ self.account_id, media_id, _preload_content=False)), raises(NotFoundException)
diff --git a/test/integration/test_messages_api.py b/test/integration/test_messages_api.py
new file mode 100644
index 00000000..bd9eba02
--- /dev/null
+++ b/test/integration/test_messages_api.py
@@ -0,0 +1,163 @@
+"""
+ Bandwidth
+
+
+ Bandwidth's Communication APIs # noqa: E501
+
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by: https://openapi-generator.tech
+"""
+
+import os
+import json
+import unittest
+from datetime import datetime
+
+import bandwidth
+from hamcrest import *
+
+from bandwidth import ApiResponse
+from bandwidth.api import messages_api
+from bandwidth.models.list_message_direction_enum import ListMessageDirectionEnum
+from bandwidth.models.list_message_item import ListMessageItem
+from bandwidth.models.message_request import MessageRequest
+from bandwidth.models.message_status_enum import MessageStatusEnum
+from bandwidth.models.message_type_enum import MessageTypeEnum
+from bandwidth.models.messages_list import MessagesList
+from bandwidth.models.priority_enum import PriorityEnum
+from bandwidth.models.message import Message
+from bandwidth.exceptions import ApiException, UnauthorizedException
+from test.utils.env_variables import *
+
+
+class TestMessagesApi(unittest.TestCase):
+ """MessagesApi unit test stubs"""
+
+ def setUp(self):
+ # API Client
+ configuration = bandwidth.Configuration(
+ username = BW_USERNAME,
+ password = BW_PASSWORD
+ )
+ api_client = bandwidth.ApiClient(configuration)
+ self.api_instance = messages_api.MessagesApi(api_client)
+ self.account_id = BW_ACCOUNT_ID
+
+ # Unauthorized API Client
+ self.unauthorized_api_client = bandwidth.ApiClient()
+ self.unauthorized_api_instance = messages_api.MessagesApi(self.unauthorized_api_client)
+
+ # Message Properties
+ self.application_id = BW_MESSAGING_APPLICATION_ID
+ self.to_number = [USER_NUMBER]
+ self.from_number = BW_NUMBER
+ self.text = 'python integration'
+ self.media = ['https://cdn2.thecatapi.com/images/MTY3ODIyMQ.jpg']
+ self.tag = 'python integration tag'
+ self.priority = PriorityEnum("default")
+
+ # Message Request
+ self.message_request = MessageRequest(
+ application_id=self.application_id,
+ to=self.to_number,
+ var_from=self.from_number,
+ text=self.text,
+ media=self.media,
+ tag=self.tag,
+ priority=self.priority,
+ )
+
+ # Invalid Message Request
+ self.invalid_message_request = MessageRequest(
+ application_id=self.application_id,
+ to=['+invalid'],
+ var_from='+invalid',
+ text='',
+ )
+
+
+ def test_create_message(self):
+ response: ApiResponse = self.api_instance.create_message_with_http_info(self.account_id, self.message_request, _return_http_data_only=False)
+
+ assert_that(response.status_code, equal_to(202))
+
+ api_response = response.data
+ assert_that(api_response, instance_of(Message))
+ assert_that(api_response, has_properties(
+ 'application_id', self.application_id,
+ 'to', self.to_number,
+ 'var_from', self.from_number,
+ 'owner', self.from_number,
+ 'text', self.text,
+ 'media', self.media,
+ 'tag', self.tag,
+ 'priority', instance_of(PriorityEnum),
+ 'priority', self.priority,
+ 'segment_count', 1,
+ )
+ )
+ assert_that(api_response.time, instance_of(datetime))
+
+
+ def test_create_message_bad_request(self):
+ assert_that(calling(self.api_instance.create_message).with_args(
+ self.account_id, self.invalid_message_request)), raises(ApiException)
+
+
+ def test_create_message_unauthorized(self):
+ assert_that(calling(self.unauthorized_api_instance.create_message).with_args(
+ self.account_id, self.invalid_message_request)), raises(UnauthorizedException)
+
+
+ @unittest.skip('The SDK catches incorrect content-type before making the request and attempts to create an ApiException,\
+ but the creation of the exception fails since there is no response body. This should probably create some\
+ kind of Client Exception instead, since this is not an actual API Exception.')
+ def test_create_message_invalid_media(self):
+ assert_that(calling(self.api_instance.create_message).with_args(
+ self.account_id, self.message_request, _content_type='application/xml')), raises(ApiException)
+
+
+ def test_list_messages(self):
+ message_direction = ListMessageDirectionEnum("OUTBOUND")
+
+ response = self.api_instance.list_messages_with_http_info(self.account_id, message_direction=message_direction, _return_http_data_only=False)
+
+ assert_that(response.status_code, equal_to(200))
+
+ api_response = response.data
+ assert_that(api_response, instance_of(MessagesList))
+ assert_that(api_response, has_properties(
+ 'total_count', greater_than(0),
+ 'messages', instance_of(list)
+ ))
+
+ assert_that(api_response.messages[0], instance_of(ListMessageItem))
+
+ message = api_response.messages[0]
+ assert_that(message, has_properties(
+ 'account_id', self.account_id,
+ 'destination_tn', matches_regexp('^\\+[1-9]\\d{1,14}$'),
+ 'message_direction', ListMessageDirectionEnum("OUTBOUND"),
+ 'message_id', matches_regexp('^.+$'),
+ 'message_status', instance_of(MessageStatusEnum),
+ 'message_type', instance_of(MessageTypeEnum),
+ 'segment_count', greater_than(0),
+ 'source_tn', matches_regexp('^\\+[1-9]\\d{1,14}$')
+ ))
+ assert_that(message.receive_time, instance_of(datetime))
+
+
+ def test_list_messages_bad_request(self):
+ assert_that(calling(self.api_instance.list_messages).with_args(
+ self.account_id), raises(ApiException))
+
+
+ def test_list_messages_unauthorized(self):
+ assert_that(calling(self.unauthorized_api_instance.list_messages).with_args(
+ self.account_id), raises(UnauthorizedException))
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/integration/test_mfa_api.py b/test/integration/test_mfa_api.py
new file mode 100644
index 00000000..d1482d06
--- /dev/null
+++ b/test/integration/test_mfa_api.py
@@ -0,0 +1,202 @@
+"""
+Integration test for Bandwidth's Multi-Factor Authentication API
+"""
+
+import os
+import time
+import unittest
+import logging
+from random import randint
+
+import bandwidth
+from bandwidth.api import mfa_api
+from bandwidth.models.code_request import CodeRequest
+from bandwidth.models.messaging_code_response import MessagingCodeResponse
+from bandwidth.models.verify_code_request import VerifyCodeRequest
+from bandwidth.models.verify_code_response import VerifyCodeResponse
+from bandwidth.models.voice_code_response import VoiceCodeResponse
+from bandwidth.exceptions import ApiException, BadRequestException, UnauthorizedException, ForbiddenException
+from test.utils.env_variables import *
+
+from hamcrest.core import *
+from hamcrest.library import *
+
+class TestMultiFactorAuthentication(unittest.TestCase):
+ """Multi-Factor Authentication API integration Test
+ """
+
+ def setUp(self) -> None:
+ configuration = bandwidth.Configuration(
+ username=BW_USERNAME,
+ password=BW_PASSWORD
+ )
+ api_client = bandwidth.ApiClient(configuration)
+ self.api_instance = mfa_api.MFAApi(api_client)
+ self.account_id = BW_ACCOUNT_ID
+ self.messaging_code_request = CodeRequest(
+ to=USER_NUMBER,
+ var_from=BW_NUMBER,
+ application_id=BW_MESSAGING_APPLICATION_ID,
+ scope="scope",
+ message="Your temporary {NAME} {SCOPE} code is {CODE}",
+ digits=6,
+ )
+ self.voice_code_request = CodeRequest(
+ to=USER_NUMBER,
+ var_from=BW_NUMBER,
+ application_id=BW_VOICE_APPLICATION_ID,
+ scope="scope",
+ message="Your temporary {NAME} {SCOPE} code is {CODE}",
+ digits=6,
+ )
+ self.bad_code_request = CodeRequest(
+ to=USER_NUMBER,
+ var_from=BW_NUMBER,
+ application_id='not_an_application_id',
+ scope="scope",
+ message="Your temporary {NAME} {SCOPE} code is {CODE}",
+ digits=6,
+ )
+
+ def assertAuthException(self, context: Exception, expected_exception: Exception, expected_status_code: int) -> None:
+ """Validates that an auth exception (401 or 403) is properly formatted
+ Args:
+ context (ApiException): Exception to validate
+ expected_exception (ApiException): Expected exception type
+ expected_status_code (int): Expected status code
+ """
+ self.assertIs(type(context.exception), expected_exception)
+ self.assertIs(type(context.exception.status), int)
+ self.assertEqual(context.exception.status, expected_status_code)
+ self.assertIs(type(context.exception.body), str)
+
+ # alternate option using hamcrest mathcers - reads like normal sentence, easy to read/speak & less brain overload
+ assert_that(context.exception, is_(expected_exception))
+
+ assert_that(context.exception, has_properties(
+ 'status', equal_to(expected_status_code),
+ 'body', not_none())
+ )
+
+ def testSuccessfulMfaGenerateMessagingCodeRequest(self) -> None:
+ """Test a successful MFA messaging code request
+ """
+ api_response_with_http_info = self.api_instance.generate_messaging_code_with_http_info(
+ self.account_id, self.messaging_code_request,
+ _return_http_data_only=False
+ )
+ self.assertEqual(api_response_with_http_info.status_code, 200)
+
+ api_response: MessagingCodeResponse = self.api_instance.generate_messaging_code(
+ self.account_id, self.messaging_code_request)
+ self.assertIs(type(api_response.message_id), str)
+
+ def testSuccessfulMfaGenerateVoiceCodeRequest(self) -> None:
+ """Test a successful MFA voice code request
+ """
+ api_response_with_http_info = self.api_instance.generate_voice_code_with_http_info(
+ self.account_id, self.voice_code_request,
+ _return_http_data_only=False
+ )
+ self.assertEqual(api_response_with_http_info.status_code, 200)
+
+ api_response: VoiceCodeResponse = self.api_instance.generate_voice_code(
+ self.account_id, self.voice_code_request)
+ self.assertIs(type(api_response.call_id), str)
+
+ # Will always have to test against False codes unless we incorporate the Manteca project into MFA
+ def testSuccessfulMfaGVerifyCodeRequest(self) -> None:
+ """Test a successful MFA verify code request
+ """
+ verify_code_request = VerifyCodeRequest(
+ to="+1" + str(randint(1111111111, 9999999999)),
+ scope="2FA",
+ expiration_time_in_minutes=3.0,
+ code="123456",
+ )
+ api_response_with_http_info = self.api_instance.verify_code_with_http_info(
+ self.account_id, verify_code_request,
+ _return_http_data_only=False
+ )
+ self.assertEqual(api_response_with_http_info.status_code, 200)
+
+ api_response: VerifyCodeResponse = self.api_instance.verify_code(
+ self.account_id, verify_code_request)
+ self.assertEqual(type(api_response), VerifyCodeResponse)
+ self.assertEqual(type(api_response.valid), bool)
+ self.assertIs(api_response.valid, False)
+
+ # can be simplified
+ assert_that(api_response, has_property('valid', False))
+
+ def testBadRequest(self) -> None:
+ """Validates a bad (400) request
+ """
+ with self.assertRaises(BadRequestException) as context:
+ self.api_instance.generate_messaging_code(self.account_id, self.bad_code_request)
+
+ self.assertAuthException(context, BadRequestException, 400)
+
+ def testUnauthorizedRequest(self) -> None:
+ """Validate an unauthorized (401) request
+ """
+ unauthorized_api_client = bandwidth.ApiClient()
+ unauthorized_api_instance = mfa_api.MFAApi(unauthorized_api_client)
+
+ with self.assertRaises(UnauthorizedException) as context:
+ unauthorized_api_instance.generate_messaging_code(
+ self.account_id, self.messaging_code_request
+ )
+
+ self.assertAuthException(context, UnauthorizedException, 401)
+
+ def testForbiddenRequest(self) -> None:
+ """Validate a forbidden (403) request
+ """
+ configuration = bandwidth.Configuration(
+ username=FORBIDDEN_USERNAME,
+ # password=FORBIDDEN_PASSWORD,
+ password='bad_password'
+ )
+ forbidden_api_client = bandwidth.ApiClient(configuration)
+ forbidden_api_instance = mfa_api.MFAApi(forbidden_api_client)
+
+ with self.assertRaises(ForbiddenException) as context:
+ forbidden_api_instance.generate_messaging_code(
+ self.account_id, self.messaging_code_request
+ )
+
+ self.assertAuthException(context, ForbiddenException, 403)
+
+ def testRateLimit(self) -> None:
+ """Validate that the API reutrns a 429 error, and that the 429 clears after 30 seconds
+ """
+ verify_code_request = VerifyCodeRequest(
+ to="+1" + str(randint(1111111111, 9999999999)),
+ scope="2FA",
+ expiration_time_in_minutes=3.0,
+ code="123456",
+ )
+ call_count = 1
+ while True:
+ try:
+ logging.debug('Testing rate limit, attempt #'+ str(call_count))
+ self.api_instance.verify_code(
+ self.account_id, verify_code_request
+ )
+ call_count += 1
+ except ApiException as e:
+ if e.status == 429:
+ logging.debug('Got rate limit error')
+ time.sleep(35)
+ api_response_with_http_info = self.api_instance.verify_code_with_http_info(
+ self.account_id, verify_code_request,
+ _return_http_data_only=False
+ )
+ self.assertEqual(api_response_with_http_info.status_code, 200)
+ break
+ else:
+ raise e
+ except:
+ logging.error("Unexpected error while testing rate limit!")
+ raise e
diff --git a/test/integration/test_phone_number_lookup_api.py b/test/integration/test_phone_number_lookup_api.py
new file mode 100644
index 00000000..17a76d79
--- /dev/null
+++ b/test/integration/test_phone_number_lookup_api.py
@@ -0,0 +1,243 @@
+"""
+Integration test for Bandwidth's Phone Number Lookup API
+"""
+
+import json
+import time
+import unittest
+
+import bandwidth
+from bandwidth.api import phone_number_lookup_api
+from bandwidth.models.lookup_request import LookupRequest
+from bandwidth.models.create_lookup_response import CreateLookupResponse
+from bandwidth.models.lookup_status import LookupStatus
+from bandwidth.models.lookup_result import LookupResult
+from bandwidth.models.lookup_status_enum import LookupStatusEnum
+from bandwidth.models.tn_lookup_request_error import TnLookupRequestError
+from bandwidth.exceptions import ApiException, UnauthorizedException, ForbiddenException
+from test.utils.env_variables import *
+
+from hamcrest.core import *
+from hamcrest.library import *
+
+from .bwmatchers.one_of_string import is_one_of_string
+
+
+class TestPhoneNumberLookupIntegration(unittest.TestCase):
+ """Phone Number Lookup API integration test
+ """
+
+ def setUp(self) -> None:
+ configuration = bandwidth.Configuration(
+ username=BW_USERNAME,
+ password=BW_PASSWORD
+ )
+ api_client = bandwidth.ApiClient(configuration)
+ self.api_instance = phone_number_lookup_api.PhoneNumberLookupApi(api_client)
+ self.account_id = BW_ACCOUNT_ID
+
+ def validateResult(self, result: LookupResult, e_164_format: str) -> None:
+ """Verify a successful phone number lookup LookupResult object
+
+ Args:
+ result (LookupResult): Result derived from LookupStatus result list
+ e_164_format (str): Phone number in e164 format ex: +19195551234
+ line_provider (str): Line service provider ex: Verizon
+ """
+
+ # if result has 1 of these attributes it should have the other
+ if result.mobile_country_code or result.mobile_network_code:
+ self.assertIs(type(result.mobile_country_code), str)
+ self.assertIs(type(result.mobile_network_code), str)
+
+ assert_that(result, has_properties(
+ 'response_code', 0,
+ 'e_164_format', e_164_format,
+ 'country', is_one_of_string(["US", "Canada"]),
+ 'line_type', is_one_of_string(["Mobile", "Fixed"])
+ )
+ )
+ self.assertIs(type(result.line_provider), str)
+
+ def pollLookupStatus(self, request_id: str) -> LookupStatus:
+ """Poll LookupRequest for 'COMPLETE' status
+
+ Args:
+ request_id (str): LookupResult.request_id value to query
+
+ Raises:
+ Exception: Tries 5 times and raises a general exception if the query takes more than 5 attempts to minimize run time.
+
+ Returns:
+ LookupStatus: LookupStatus in 'COMPLETE' state
+ """
+ get_lookup_status_response: LookupStatus = self.api_instance.get_lookup_status(
+ self.account_id, request_id)
+ get_lookup_status_response_attempts = 1
+ while get_lookup_status_response.status != LookupStatusEnum('COMPLETE'):
+ # Raise an error if it takes more than 5 requests to get COMPLETE status
+ if get_lookup_status_response_attempts == 5:
+ raise Exception(
+ f'Took too long to get phone number lookup \'COMPLETE\' status. Aborting test after {get_lookup_status_response_attempts} attempts.')
+ time.sleep(2)
+
+ get_lookup_status_response: LookupStatus = self.api_instance.get_lookup_status(
+ self.account_id, request_id)
+ get_lookup_status_response_attempts += 1
+
+ return get_lookup_status_response
+
+ def assertAuthException(self, context: ApiException, expectedException: ApiException, expected_status_code: int) -> None:
+ """Validates that an auth exception (401 or 403) is properly formatted
+
+ Args:
+ context (ApiException): Exception to validate
+ expectedException (ApiException): Expected exception type
+ expected_status_code (int): Expected status code
+ """
+ self.assertIs(type(context.exception), expectedException)
+ self.assertIs(type(context.exception.status), int)
+ self.assertEqual(context.exception.status, expected_status_code)
+ self.assertIs(type(context.exception.body), str)
+
+ def testSuccessfulPhoneNumberLookup(self) -> None:
+ """Test Phone Number Lookup API
+ """
+ lookup_request = LookupRequest(
+ tns=[
+ BW_NUMBER,
+ VZW_NUMBER,
+ ATT_NUMBER,
+ T_MOBILE_NUMBER,
+ # BW_INVALID_TN_LOOKUP_NUMBER
+ ],
+ )
+
+ # Create the lookup request and validate the response
+ create_lookup_response: CreateLookupResponse = self.api_instance.create_lookup(
+ self.account_id, lookup_request, _return_http_data_only=False)
+
+ self.assertIs(type(create_lookup_response.status), LookupStatusEnum)
+ self.assertEqual(create_lookup_response.status, LookupStatusEnum("IN_PROGRESS"))
+ self.assertIs(type(create_lookup_response.request_id), str)
+ self.assertRegex(create_lookup_response.request_id,
+ r'^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$')
+
+ # Check the status code for the GET LookupStatus response
+ get_lookup_status_response: LookupStatus = self.api_instance.get_lookup_status(
+ self.account_id, create_lookup_response.request_id, _return_http_data_only=False)
+
+ # make the request again without _return_http_data_only=False to just get the LookupStatus model
+ get_lookup_status_response: LookupStatus = self.pollLookupStatus(
+ create_lookup_response.request_id)
+
+ self.assertEqual(get_lookup_status_response.request_id,
+ create_lookup_response.request_id)
+ self.assertIs(type(get_lookup_status_response), LookupStatus)
+
+ # Assert that each result is of type LookupResult
+ for i in range(len(get_lookup_status_response.result)):
+ self.assertIs(type(get_lookup_status_response.result[i]), LookupResult)
+
+ # Check the information for a Bandwidth TN
+ bw_lookup_result = get_lookup_status_response.result[0]
+ self.validateResult(bw_lookup_result, BW_NUMBER)
+
+ # Check the information for a Verizon TN
+ vzw_lookup_result = get_lookup_status_response.result[1]
+ self.validateResult(vzw_lookup_result, VZW_NUMBER)
+
+ # Check the information for an AT&T TN
+ att_lookup_result = get_lookup_status_response.result[2]
+ self.validateResult(att_lookup_result, ATT_NUMBER)
+
+ # Check the information for a T-Mobile TN
+ t_mobile_lookup_result = get_lookup_status_response.result[3]
+ self.validateResult(t_mobile_lookup_result, T_MOBILE_NUMBER)
+
+ # The only way to get a failed number is if the api call to the downstream service fails - so there is no way to force this in our testing currently
+ # check the failed_telephone_number list
+ # self.assertIs(type(get_lookup_status_response.failed_telephone_numbers), list)
+ # self.assertIn(BW_INVALID_TN_LOOKUP_NUMBER, get_lookup_status_response.failed_telephone_numbers)
+
+ def testFailedPhoneNumberLookup(self) -> None:
+ """Test Phone Number Lookup API with bad data to force an error
+ """
+ with self.assertRaises(ApiException) as context:
+ lookup_request = LookupRequest(
+ tns=[
+ 'not a number',
+ ],
+ )
+ self.api_instance.create_lookup(self.account_id, lookup_request)
+
+ self.assertIs(type(context.exception.status), int)
+ self.assertIs(type(context.exception.body), str)
+
+ # initialize TnLookupRequestError model
+ error = TnLookupRequestError(message=(json.loads(context.exception.body))['message'])
+ self.assertIs(type(error), TnLookupRequestError)
+
+ def testDuplicatePhoneNumberLookup(self) -> None:
+ """Test a request with a duplicate number. Should throw a 400 Bad Request error.
+ """
+ with self.assertRaises(ApiException) as context:
+ lookup_request = LookupRequest(
+ tns=[
+ BW_NUMBER,
+ BW_NUMBER
+ ],
+ )
+ self.api_instance.create_lookup(self.account_id, lookup_request)
+
+ self.assertIs(type(context.exception.status), int)
+ self.assertEqual(context.exception.status, 400)
+ self.assertIs(type(context.exception.body), str)
+
+ def testUnauthorizedRequest(self) -> None:
+ """Validate an unauthorized (401) request
+ """
+ configuration = bandwidth.Configuration(
+ username='bad_username',
+ password='bad_password'
+ )
+ unauthorized_api_client = bandwidth.ApiClient(configuration)
+ unauthorized_api_instance = phone_number_lookup_api.PhoneNumberLookupApi(
+ unauthorized_api_client)
+ lookup_request = LookupRequest(
+ tns=[
+ BW_NUMBER
+ ],
+ )
+
+ with self.assertRaises(UnauthorizedException) as context:
+ unauthorized_api_instance.create_lookup(self.account_id, lookup_request)
+
+ self.assertAuthException(context, UnauthorizedException, 401)
+
+ def testForbiddenRequest(self) -> None:
+ """Validate a forbidden (403) request
+ """
+ configuration = bandwidth.Configuration(
+ username=FORBIDDEN_USERNAME,
+ password=FORBIDDEN_PASSWORD
+ )
+ forbidden_api_client = bandwidth.ApiClient(configuration)
+ forbidden_api_instance = phone_number_lookup_api.PhoneNumberLookupApi(forbidden_api_client)
+ lookup_request = LookupRequest(
+ tns=[
+ BW_NUMBER
+ ],
+ )
+
+ # This API throws a 401 when a user provides valid credentials with the `TN Lookup` role disabled
+ # with self.assertRaises(ForbiddenException) as context:
+ with self.assertRaises(UnauthorizedException) as context:
+ forbidden_api_instance.create_lookup(self.account_id, lookup_request)
+
+ # self.validateAuthException(context, ForbiddenException, 403)
+ self.assertAuthException(context, UnauthorizedException, 401)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/integration/test_recordings_api.py b/test/integration/test_recordings_api.py
new file mode 100644
index 00000000..e7c3bfcb
--- /dev/null
+++ b/test/integration/test_recordings_api.py
@@ -0,0 +1,545 @@
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs # noqa: E501
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by: https://openapi-generator.tech
+"""
+
+
+import os
+from typing import Dict, List, Tuple
+import unittest
+import time
+import json
+
+import bandwidth
+from hamcrest import *
+
+from bandwidth import ApiResponse
+from bandwidth.api.recordings_api import RecordingsApi
+from bandwidth.configuration import Configuration
+from bandwidth.exceptions import ForbiddenException, NotFoundException, UnauthorizedException
+from bandwidth.models.call_recording_metadata import CallRecordingMetadata
+from bandwidth.models.call_state import CallState
+from bandwidth.models.call_state_enum import CallStateEnum
+from bandwidth.api.calls_api import CallsApi
+from bandwidth.models.create_call_response import CreateCallResponse
+from bandwidth.models.create_call import CreateCall
+from bandwidth.models.file_format_enum import FileFormatEnum
+from bandwidth.models.recording_state_enum import RecordingStateEnum
+from bandwidth.models.transcribe_recording import TranscribeRecording
+from bandwidth.models.transcription import Transcription
+from bandwidth.models.update_call import UpdateCall
+from bandwidth.models.update_call_recording import UpdateCallRecording
+from bandwidth.rest import RESTClientObject, RESTResponse
+from test.utils.call_cleanup import callCleanup
+from test.utils.env_variables import *
+
+
+try:
+ # BW Credentials
+ BW_USERNAME = BW_USERNAME
+ BW_PASSWORD = BW_PASSWORD
+ BW_ACCOUNT_ID = BW_ACCOUNT_ID
+
+ # Manteca Numbers
+ MANTECA_ACTIVE_NUMBER = MANTECA_ACTIVE_NUMBER
+ MANTECA_IDLE_NUMBER = MANTECA_IDLE_NUMBER
+
+ # Manteca
+ MANTECA_BASE_URL = MANTECA_BASE_URL
+ MANTECA_STATUS_URL = MANTECA_BASE_URL + "tests/"
+ MANTECA_APPLICATION_ID = MANTECA_APPLICATION_ID
+
+ # Test Environment
+ PYTHON_VERSION = PYTHON_VERSION
+ OPERATING_SYSTEM = OPERATING_SYSTEM
+except KeyError as e:
+ raise Exception("Environmental variables not found")
+
+MAX_RETRIES = 40
+TEST_SLEEP = 5
+
+
+class TestRecordings(unittest.TestCase):
+ """
+ Integration tests for the Recordings API.
+ """
+
+ def setUp(self) -> None:
+ """
+ Set up for our tests by creating the CallsApi and RecordingsApi instances
+ for testing.
+ """
+ configuration = bandwidth.Configuration(
+ username=BW_USERNAME,
+ password=BW_PASSWORD
+ )
+ api_client = bandwidth.ApiClient(configuration)
+
+ # Two Valid API Clients
+ self.calls_api_instance = CallsApi(api_client)
+ self.recordings_api_instance = RecordingsApi(api_client)
+
+ # Unauthorized Recordings API Client
+ self.unauthorized_recordings_api_instance = RecordingsApi(
+ api_client=bandwidth.ApiClient(Configuration.get_default_copy())
+ )
+
+ # Rest client for interacting with Manteca
+ self.rest_client = RESTClientObject(Configuration.get_default_copy())
+
+ # Call ID Array
+ self.callIdArray = []
+
+ def tearDown(self):
+ callCleanup(self)
+
+ def create_and_validate_call(self, answer_url: str) -> Tuple[str, str]:
+ """
+ Create and validate a call between two bandwidth numbers. Initializes the call with the Manteca
+ system.
+
+ Args:
+ answer_url (str): The answer url for the call to create.
+
+ Return:
+ Tuple[str, str]: A tuple containing the test id created in Manteca to track this call, as well as
+ the call id for the created call.
+ """
+
+ # Initialize the call with Manteca
+ response = self.rest_client.request(
+ method='POST',
+ url=MANTECA_BASE_URL + 'tests',
+ body={
+ 'os': OPERATING_SYSTEM,
+ 'language': 'python' + PYTHON_VERSION,
+ 'type': 'CALL'
+ }
+ )
+
+ # Get the test id from the response
+ test_id = response.data.decode("utf-8")
+
+ # Make a CreateCall body and assign the appropriate params
+ call_body = CreateCall(to=MANTECA_IDLE_NUMBER, var_from=MANTECA_ACTIVE_NUMBER,
+ application_id=MANTECA_APPLICATION_ID, answer_url=answer_url, tag=test_id)
+
+ # Make the call
+ create_call_response: CreateCallResponse = self.calls_api_instance.create_call(
+ BW_ACCOUNT_ID, call_body)
+
+ # Verify info about the call
+ assert_that(create_call_response, has_properties(
+ # assert request created and id matches expected length (47)
+ 'call_id', has_length(47),
+ 'account_id', BW_ACCOUNT_ID,
+ 'application_id', MANTECA_APPLICATION_ID,
+ 'to', MANTECA_IDLE_NUMBER,
+ 'var_from', MANTECA_ACTIVE_NUMBER,
+ 'call_url', "https://voice.bandwidth.com/api/v2/accounts/" + \
+ BW_ACCOUNT_ID + "/calls/" + create_call_response.call_id
+ ))
+
+ # Adding the call to the callIdArray
+ self.callIdArray.append(create_call_response.call_id)
+
+ # Return our test id and call id
+ return (test_id, create_call_response.call_id)
+
+ def complete_recorded_call(self) -> Tuple[str, str]:
+ """
+ Creates and completes an entire recorded call lifecycle. A call should be completed and fully recorded.
+
+ Return:
+ (str, str): A tuple containing the test id to track this call in the Manteca system and the call id
+ associated with the call in Bandwidth services.
+ """
+ # Create a call
+ answer_url = MANTECA_BASE_URL + '/bxml/startRecording'
+ (test_id, call_id) = self.create_and_validate_call(answer_url)
+
+ time.sleep(12)
+ # Poll Manteca to make sure our call is recorded
+ call_status = self.get_test_status(test_id)
+ retries = 0
+ while call_status['callRecorded'] == False and retries < MAX_RETRIES:
+ time.sleep(TEST_SLEEP)
+ call_status = self.get_test_status(test_id)
+ retries += 1
+
+ # If we failed to get a recorded call, fail due to polling timeout
+ assert_that(call_status['callRecorded'], equal_to(True))
+
+ # Return our test_id and call_id
+ return (test_id, call_id)
+
+ def validate_recording(self, recording: CallRecordingMetadata, call_id: str) -> None:
+ """
+ Validate the given recording metadata.
+
+ Args:
+ recording (CallRecordingMetadata): The recording metadata to validate.
+ call_id (str): The call id associated with the given recording.
+ """
+ assert_that(recording, has_properties(
+ 'account_id', BW_ACCOUNT_ID,
+ 'call_id', call_id,
+ 'application_id', MANTECA_APPLICATION_ID,
+ 'status', 'complete',
+ 'file_format', FileFormatEnum('wav')
+ ))
+
+ def get_test_status(self, test_id: str) -> Dict:
+ """
+ Get the status of the specified test by its id value from Manteca services.
+
+ Args:
+ test_id (str): The test id associated with the test to get the status of.
+
+ Returns:
+ Dict: The status of the test requested.
+ """
+ status_url = MANTECA_STATUS_URL + test_id
+ response: RESTResponse = self.rest_client.request(
+ method='GET',
+ url=status_url
+ )
+ return json.loads(response.data)
+
+ def test_successful_call_recording(self) -> None:
+ """
+ Tests a successful flow of creating a call with a recording.
+ The following endpoints are tested in this flow:
+ - list_call_recordings
+ - get_call_recording
+ - download_call_recording
+ - transcribe_call_recording
+ - get_call_transcription
+ - delete_call_transcription
+ - delete_recording_media
+ - delete_recording
+ """
+
+ # Have a recorded call
+ (test_id, call_id) = self.complete_recorded_call()
+
+ # List Call Recordings Endpoint
+ response: ApiResponse = self.recordings_api_instance.list_call_recordings_with_http_info(
+ BW_ACCOUNT_ID, call_id, _return_http_data_only=False)
+ assert_that(response.status_code, equal_to(200)) # Check response code
+
+ # We should get back 1 recording
+ call_recordings: List[CallRecordingMetadata] = response.data
+ assert_that(call_recordings, has_length(1))
+
+ # Checks on the first recording
+ first_recording: CallRecordingMetadata = call_recordings[0]
+ self.validate_recording(first_recording, call_id)
+ recording_id = first_recording.recording_id
+
+ # Get Single Recording Endpoint
+ recording_response: ApiResponse = self.recordings_api_instance.get_call_recording_with_http_info(
+ BW_ACCOUNT_ID, call_id, recording_id, _return_http_data_only=False)
+ assert_that(recording_response.status_code, equal_to(200)) # Check response code
+
+ recording = recording_response.data
+ assert_that(recording.recording_id, equal_to(recording_id))
+ self.validate_recording(recording, call_id)
+
+ # Download recording media
+ recording_media_response = self.recordings_api_instance.download_call_recording(
+ BW_ACCOUNT_ID, call_id, recording_id)
+ call_recording_media = recording_media_response
+
+ '''
+ Do a verification test on the actual recording data?
+ '''
+ # # print(call_recording_media)
+ # with open("zzzz.wav", "wb") as fp:
+ # fp.write(call_recording_media)
+
+ # Create Transcription Request
+ transcription_url = MANTECA_BASE_URL + "/transcriptions"
+ transcribe_recording_request = TranscribeRecording(
+ callback_url=transcription_url, tag=test_id)
+ transcription_response = self.recordings_api_instance.transcribe_call_recording_with_http_info(
+ BW_ACCOUNT_ID, call_id, recording_id, transcribe_recording_request)
+ assert_that(transcription_response.status_code, equal_to(204)) # Check response code
+
+ # Poll Manteca to make sure our call is transcribed
+ call_status = self.get_test_status(test_id)
+ retries = 0
+ while call_status['callTranscribed'] == False and retries < MAX_RETRIES:
+ time.sleep(TEST_SLEEP)
+ call_status = self.get_test_status(test_id)
+ retries += 1
+
+ # If we failed to get a transcribed call, fail due to polling timeout
+ assert_that(call_status['callTranscribed'], equal_to(True))
+
+ # Get the transcription
+ transcription_response = self.recordings_api_instance.get_call_transcription_with_http_info(
+ BW_ACCOUNT_ID, call_id, recording_id)
+ assert_that(transcription_response.status_code, equal_to(200)) # Check response code
+
+ transcription_list = transcription_response.data
+ assert_that(transcription_list.transcripts, has_length(1))
+ transcription = transcription_list.transcripts[0]
+ assert_that(transcription, instance_of(Transcription))
+ assert_that(transcription, has_properties(
+ 'text', instance_of(str),
+ 'confidence', instance_of(float)
+ ))
+
+ # Delete the transcription
+ delete_transcription_response = self.recordings_api_instance.delete_call_transcription_with_http_info(
+ BW_ACCOUNT_ID, call_id, recording_id)
+ assert_that(delete_transcription_response.status_code, equal_to(204)) # Check response code
+
+ assert_that(calling(self.recordings_api_instance.get_call_transcription).with_args(
+ BW_ACCOUNT_ID, call_id, recording_id), raises(NotFoundException))
+
+ # Delete Recording media
+ delete_recording_media_response = self.recordings_api_instance.delete_recording_media_with_http_info(
+ BW_ACCOUNT_ID, call_id, recording_id)
+ # Validate the 204 response
+ assert_that(delete_recording_media_response.status_code, equal_to(204))
+
+ # Delete Recording
+ delete_recording_response = self.recordings_api_instance.delete_recording_with_http_info(
+ BW_ACCOUNT_ID, call_id, recording_id)
+ assert_that(delete_recording_response.status_code, equal_to(204))
+ call_recordings = self.recordings_api_instance.list_call_recordings(BW_ACCOUNT_ID, call_id)
+ assert_that(call_recordings, has_length(0))
+
+ def test_successful_update_active_recording(self) -> None:
+ """
+ Tests updating the recording for a call that is currently active.
+ Tests the following endpoints:
+ - update_call_recording_state
+ """
+
+ # Create the call
+ answer_url = MANTECA_BASE_URL + "/bxml/startLongRecording"
+ (test_id, call_id) = self.create_and_validate_call(answer_url)
+
+ # Poll Manteca to make sure our call is alive
+ call_status = self.get_test_status(test_id)
+ retries = 0
+ while call_status['status'] == 'DEAD' and retries < MAX_RETRIES:
+ time.sleep(TEST_SLEEP)
+ call_status = self.get_test_status(test_id)
+ retries += 1
+
+ # Make sure the call is alive
+ assert_that(call_status['status'], equal_to('ALIVE'))
+
+ # Add a sleep to prevent timing issues
+ time.sleep(TEST_SLEEP)
+
+ # Update the call to pause the recording
+ update_call_recording = UpdateCallRecording(state=RecordingStateEnum('paused'))
+ update_response = self.recordings_api_instance.update_call_recording_state_with_http_info(
+ BW_ACCOUNT_ID, call_id, update_call_recording)
+ assert_that(update_response.status_code, equal_to(200))
+
+ # Update the call to resume the recording
+ update_call_recording = UpdateCallRecording(state=RecordingStateEnum('recording'))
+ self.recordings_api_instance.update_call_recording_state_with_http_info(
+ BW_ACCOUNT_ID, call_id, update_call_recording)
+ assert_that(update_response.status_code, equal_to(200))
+
+ # Kill the call
+ update_call = UpdateCall()
+ update_call.state = CallStateEnum.COMPLETED
+ self.calls_api_instance.update_call(BW_ACCOUNT_ID, call_id, update_call)
+
+ def test_4xx_errors(self) -> None:
+ """
+ Tests invalid flows for several methods
+ """
+
+ # Have a recorded call
+ (test_id, call_id) = self.complete_recorded_call()
+
+ # List Recordings
+ # Use the unauthorized client to try to list recordings (401)
+ assert_that(calling(self.unauthorized_recordings_api_instance.list_call_recordings).with_args(
+ BW_ACCOUNT_ID, call_id), raises(UnauthorizedException))
+
+ # Invalid account id (403)
+ assert_that(calling(self.recordings_api_instance.list_call_recordings).with_args(
+ "not an account id", call_id), raises(ForbiddenException))
+
+ # Non-existent call id
+ # This should probably be a 404, but actually returns an empty list
+ not_found_call_recordings = self.recordings_api_instance.list_call_recordings(
+ BW_ACCOUNT_ID, "not a call id")
+ assert_that(not_found_call_recordings, equal_to([]))
+
+ # Get Call Recording
+ # Get our recording id
+ recordings = self.recordings_api_instance.list_call_recordings(BW_ACCOUNT_ID, call_id)
+ recording_id = recordings[0].recording_id
+
+ # Use the unauthorized client to try to get a recording (401)
+ assert_that(calling(self.unauthorized_recordings_api_instance.get_call_recording).with_args(
+ BW_ACCOUNT_ID, call_id, recording_id), raises(UnauthorizedException))
+
+ # Non-existent account id (403)
+ assert_that(calling(self.recordings_api_instance.get_call_recording).with_args(
+ "not an account id", call_id, recording_id), raises(ForbiddenException))
+
+ # Non-existent recording id (404)
+ assert_that(calling(self.recordings_api_instance.get_call_recording).with_args(
+ BW_ACCOUNT_ID, call_id, "not a recording id"), raises(NotFoundException))
+
+ # Download Recording
+ # Use the unauthorized client to try to download a recording (401)
+ assert_that(calling(self.unauthorized_recordings_api_instance.download_call_recording).with_args(
+ BW_ACCOUNT_ID, call_id, recording_id), raises(UnauthorizedException))
+
+ # Non-existent account id (403)
+ assert_that(calling(self.recordings_api_instance.download_call_recording).with_args(
+ "not an account id", call_id, recording_id), raises(ForbiddenException))
+
+ # Non-existent recording id (404)
+ assert_that(calling(self.recordings_api_instance.download_call_recording).with_args(
+ BW_ACCOUNT_ID, call_id, "not a recording id"), raises(NotFoundException))
+
+ # Transcribe Recording
+ # Create a standard TranscribeRecording instance to use
+ transcription_url = MANTECA_BASE_URL + "transcriptions"
+ transcribe_recording = TranscribeRecording(callback_url=transcription_url, tag=test_id)
+
+ # Use the unauthorized client to request a transcription (401)
+ assert_that(calling(self.unauthorized_recordings_api_instance.transcribe_call_recording).with_args(
+ BW_ACCOUNT_ID, call_id, recording_id, transcribe_recording), raises(UnauthorizedException))
+
+ # Non existent account id (403)
+ assert_that(calling(self.recordings_api_instance.transcribe_call_recording).with_args(
+ "not an account id", call_id, recording_id, transcribe_recording), raises(ForbiddenException))
+
+ # Non-existent recording id (404)
+ # TODO: This does not work right now as the API is unexpectedly returning a 502 Bad Gateway for this request.
+ # with self.assertRaises(NotFoundException):
+ # self.recordings_api_instance.transcribe_call_recording(BW_ACCOUNT_ID, call_id, "not a recording id", transcribe_recording)
+
+ # Get Transcription
+ # Actually Create a transcription
+ transcription_url = MANTECA_BASE_URL + "transcriptions"
+ transcribe_recording = TranscribeRecording(callback_url=transcription_url, tag=test_id)
+ self.recordings_api_instance.transcribe_call_recording(
+ BW_ACCOUNT_ID, call_id, recording_id, transcribe_recording)
+
+ # Poll Manteca to make sure our call is transcribed
+ call_status = self.get_test_status(test_id)
+ retries = 0
+ while call_status['callTranscribed'] == False and retries < MAX_RETRIES:
+ time.sleep(TEST_SLEEP)
+ call_status = self.get_test_status(test_id)
+ retries += 1
+
+ # If we failed to get a transcribed call, fail due to polling timeout (TEMP COMMENTED)
+ assert_that(call_status['callTranscribed'], equal_to(True))
+
+ # Use the unauthorized client to get transcripion (401)
+ assert_that(calling(self.unauthorized_recordings_api_instance.get_call_transcription).with_args(
+ BW_ACCOUNT_ID, call_id, recording_id), raises(UnauthorizedException))
+
+ # Non-existent account id (403)
+ assert_that(calling(self.recordings_api_instance.get_call_transcription).with_args(
+ "not an account id", call_id, recording_id), raises(ForbiddenException))
+
+ # Non-existent recording id (404)
+ assert_that(calling(self.recordings_api_instance.get_call_transcription).with_args(
+ BW_ACCOUNT_ID, call_id, "not a recording id"), raises(NotFoundException))
+
+ # Delete Transcription
+ # Use the unauthorized client to delete transcripion (401)
+ assert_that(calling(self.unauthorized_recordings_api_instance.delete_call_transcription).with_args(
+ BW_ACCOUNT_ID, call_id, recording_id), raises(UnauthorizedException))
+
+ # Non-existent account id (403)
+ assert_that(calling(self.recordings_api_instance.delete_call_transcription).with_args(
+ "not an account id", call_id, recording_id), raises(ForbiddenException))
+
+ # Non-existent recording id (404)
+ assert_that(calling(self.recordings_api_instance.delete_call_transcription).with_args(
+ BW_ACCOUNT_ID, call_id, "not a recording id"), raises(NotFoundException))
+
+ # Delete Recording Media
+ # Use the unauthorized client to try to delete a recording (401)
+ assert_that(calling(self.unauthorized_recordings_api_instance.delete_recording_media).with_args(
+ BW_ACCOUNT_ID, call_id, recording_id), raises(UnauthorizedException))
+
+ # Non-existent account id (403)
+ assert_that(calling(self.recordings_api_instance.delete_recording_media).with_args(
+ "not an account id", call_id, recording_id), raises(ForbiddenException))
+
+ # Non-existent recording id (404)
+ assert_that(calling(self.recordings_api_instance.delete_recording_media).with_args(
+ BW_ACCOUNT_ID, call_id, "not a recording id"), raises(NotFoundException))
+
+ # Delete Recording
+ # Use the unauthorized client to try to delete a recording (401)
+ assert_that(calling(self.unauthorized_recordings_api_instance.delete_recording).with_args(
+ BW_ACCOUNT_ID, call_id, recording_id), raises(UnauthorizedException))
+
+ # Non-existent account id (403)
+ assert_that(calling(self.recordings_api_instance.delete_recording).with_args(
+ "not an account id", call_id, recording_id), raises(ForbiddenException))
+
+ # Non-existent recording id (404)
+ assert_that(calling(self.recordings_api_instance.delete_recording).with_args(
+ BW_ACCOUNT_ID, call_id, "not a recording id"), raises(NotFoundException))
+
+ def test_invalid_update_call_recording_state(self) -> None:
+ """
+ Tests invalid flows for update_call_recording_state
+ """
+
+ # Create the call
+ answer_url = MANTECA_BASE_URL + "/bxml/startLongRecording"
+ (test_id, call_id) = self.create_and_validate_call(answer_url)
+
+ # Poll Manteca to make sure our call is alive
+ call_status = self.get_test_status(test_id)
+ retries = 0
+ while call_status['status'] == 'DEAD' and retries < MAX_RETRIES:
+ time.sleep(TEST_SLEEP)
+ call_status = self.get_test_status(test_id)
+ retries += 1
+
+ # Make sure the call is alive
+ assert_that(call_status['status'], equal_to('ALIVE'))
+
+ # Common models
+ pause_recording = UpdateCallRecording(state=RecordingStateEnum('paused'))
+ resume_recording = UpdateCallRecording(state=RecordingStateEnum('recording'))
+
+
+ # Use the unauthorized client to try to update (401)
+ assert_that(calling(self.unauthorized_recordings_api_instance.update_call_recording_state).with_args(
+ BW_ACCOUNT_ID, call_id, pause_recording), raises(UnauthorizedException))
+
+ # Non-existent account id (403)
+ assert_that(calling(self.recordings_api_instance.update_call_recording_state).with_args(
+ "not an account id", call_id, pause_recording), raises(ForbiddenException))
+
+ # Non-existent call id (404)
+ assert_that(calling(self.recordings_api_instance.update_call_recording_state).with_args(
+ BW_ACCOUNT_ID, "not a call id", pause_recording), raises(NotFoundException))
+
+ # Kill the call
+ update_call = UpdateCall(state=CallStateEnum('completed'))
+ self.calls_api_instance.update_call(BW_ACCOUNT_ID, call_id, update_call)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/__init__.py b/test/unit/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/test/unit/bxml/__init__.py b/test/unit/bxml/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/test/unit/bxml/test_base_classes.py b/test/unit/bxml/test_base_classes.py
new file mode 100644
index 00000000..6528c2ec
--- /dev/null
+++ b/test/unit/bxml/test_base_classes.py
@@ -0,0 +1,50 @@
+
+"""
+test_base_classes.py
+
+Unit tests for Root and Verb base classes
+
+@copyright Bandwidth Inc.
+"""
+import pytest
+import unittest
+
+from bandwidth.models.bxml import Root
+from bandwidth.models.bxml import Verb
+from bandwidth.models.bxml import TerminalVerb
+
+
+class TestBaseClasses(unittest.TestCase):
+
+ def setUp(self):
+ self.root = Root(tag="TestRoot")
+ self.verb1 = Verb(tag="TestVerb1", content="test")
+ self.verb2 = Verb(tag="TestVerb2")
+ self.verb3 = Verb(tag="TestVerb3")
+ self.terminal_verb = TerminalVerb(tag="TestTerminalVerb")
+
+ def test_root(self):
+ self.root.add_verb(self.verb1)
+ self.root.add_verb(self.verb2)
+
+ expected_bxml = "\ntest"
+ assert(type(self.root[0]) == Verb)
+ assert(len(self.root) == 2)
+ assert(expected_bxml == self.root.to_bxml())
+
+ def test_verb(self):
+ self.verb3.add_verb(self.verb1)
+
+ expected_bxml = "test"
+ assert(type(self.verb3[0]) == Verb)
+ assert(len(self.verb3) == 1)
+ assert(expected_bxml == self.verb3.to_bxml())
+
+ def test_adding_verbs_to_root_during_creation(self):
+ self.root2 = Root(tag="TestRoot2", nested_verbs=[self.verb1, self.verb2])
+
+ assert(len(self.root2) == 2)
+
+ def test_adding_verbs_to_terminal_verb(self):
+ with pytest.raises(AttributeError):
+ self.terminal_verb.add_verb(self.verb1)
diff --git a/test/unit/bxml/test_bridge.py b/test/unit/bxml/test_bridge.py
new file mode 100644
index 00000000..c41e9be7
--- /dev/null
+++ b/test/unit/bxml/test_bridge.py
@@ -0,0 +1,26 @@
+"""
+test_bridge.py
+
+Unit tests for the BXML verb
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+from bandwidth.models.bxml import Verb
+from bandwidth.models.bxml import Bridge
+
+
+class TestBridge(unittest.TestCase):
+
+ def setUp(self):
+ self.bridge = Bridge(
+ target_call="+19198675309",
+ bridge_complete_url="https://example.com",
+ tag="test"
+ )
+ self.test_verb = Verb(tag="test")
+
+ def test_to_bxml(self):
+ expected = '+19198675309'
+ assert(expected == self.bridge.to_bxml())
diff --git a/test/unit/bxml/test_bxml.py b/test/unit/bxml/test_bxml.py
new file mode 100644
index 00000000..77d1a577
--- /dev/null
+++ b/test/unit/bxml/test_bxml.py
@@ -0,0 +1,22 @@
+"""
+test_bxml.py
+
+Unit tests for Bxml Model
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+from bandwidth.models.bxml import Bxml
+
+
+class TestBxml(unittest.TestCase):
+
+ def setUp(self):
+ self.response = Bxml()
+
+ def test_bxml_init(self):
+ """Test initializing the root
+ """
+ expected_bxml = "\n"
+ assert self.response.to_bxml() == expected_bxml
diff --git a/test/unit/bxml/test_conference.py b/test/unit/bxml/test_conference.py
new file mode 100644
index 00000000..35d9733b
--- /dev/null
+++ b/test/unit/bxml/test_conference.py
@@ -0,0 +1,37 @@
+"""
+test_conference.py
+
+Unit tests for the BXML verb
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+from bandwidth.models.bxml import Verb
+from bandwidth.models.bxml import Conference
+
+
+class TestConference(unittest.TestCase):
+
+ def setUp(self):
+ self.conference = Conference(
+ name="conf1",
+ mute = "true",
+ hold = "false",
+ call_ids_to_coach = "example-call-id",
+ conference_event_url = "example.com/eventurl",
+ conference_event_method = "POST",
+ conference_event_fallback_url = "backupexample.com/eventurl",
+ conference_event_fallback_method = "POST",
+ username = "user",
+ password = "pass",
+ fallback_username = "user",
+ fallback_password = "pass",
+ tag = "tag",
+ callback_timeout = "5",
+ )
+ self.test_verb = Verb(tag="test")
+
+ def test_to_bxml(self):
+ expected = ''
+ assert(expected == self.conference.to_bxml())
diff --git a/test/unit/bxml/test_forward.py b/test/unit/bxml/test_forward.py
new file mode 100644
index 00000000..17a0d2b1
--- /dev/null
+++ b/test/unit/bxml/test_forward.py
@@ -0,0 +1,28 @@
+"""
+test_forward.py
+
+Unit tests for the BXML verb
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+from bandwidth.models.bxml import Verb
+from bandwidth.models.bxml.verbs.forward import Forward
+
+class TestForward(unittest.TestCase):
+
+ def setUp(self):
+ self.forward = Forward(
+ to="19195554321",
+ _from="19195554322",
+ call_timeout = "15",
+ diversion_treatment="propagate",
+ diversion_reason="away",
+ uui="93d6f3c0be5845960b744fa28015d8ede84bd1a4;encoding=base64,asdf;encoding=jwt"
+ )
+ self.test_verb = Verb(tag="test")
+
+ def test_to_bxml(self):
+ expected = ''
+ assert(expected == self.forward.to_bxml())
diff --git a/test/unit/bxml/test_gather.py b/test/unit/bxml/test_gather.py
new file mode 100644
index 00000000..a4b624c2
--- /dev/null
+++ b/test/unit/bxml/test_gather.py
@@ -0,0 +1,51 @@
+"""
+test_gather.py
+
+Unit tests for the BXML verb
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+from bandwidth.models.bxml import PlayAudio,SpeakSentence,Gather
+
+
+class TestGather(unittest.TestCase):
+
+ def setUp(self):
+ self.play_audio = PlayAudio(
+ audio_uri="https://audio.url/audio1.wav",
+ username="user",
+ password="pass"
+ )
+
+ self.speak_sentence = SpeakSentence(
+ text='Hello. Your number is asdf, lets play a game. What is 10 + 3. Press the pound key when finished.'
+ )
+
+ self.gather = Gather(
+ gather_url="test.com",
+ gather_method="POST",
+ gather_fallback_url= "fallback-test.com",
+ gather_fallback_method="GET",
+ username="user",
+ password="pass",
+ fallback_username="user",
+ fallback_password="pass",
+ tag = "tag",
+ terminating_digits = "2",
+ max_digits = 5,
+ inter_digit_timeout = 1,
+ first_digit_timeout = 3,
+ repeat_count = 2,
+ audio_verbs=[self.play_audio]
+ )
+
+ def test_to_bxml(self):
+ expected = 'https://audio.url/audio1.wav'
+ assert(expected == self.gather.to_bxml())
+
+ def test_add_verb(self):
+ expected = 'https://audio.url/audio1.wavHello. Your number is <say-as interpret-as="telephone">asdf</say-as>, lets play a game. What is 10 + 3. Press the pound key when finished.'
+ self.gather.add_verb(self.speak_sentence)
+ assert(expected == self.gather.to_bxml())
diff --git a/test/unit/bxml/test_hangup.py b/test/unit/bxml/test_hangup.py
new file mode 100644
index 00000000..9e2edb0f
--- /dev/null
+++ b/test/unit/bxml/test_hangup.py
@@ -0,0 +1,22 @@
+"""
+test_hangup.py
+
+Unit tests for the BXML verb
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+from bandwidth.models.bxml import Verb
+from bandwidth.models.bxml.verbs.hangup import Hangup
+
+
+class TestHangup(unittest.TestCase):
+
+ def setUp(self):
+ self.hangup = Hangup()
+ self.test_verb = Verb(tag="test")
+
+ def test_to_bxml(self):
+ expected = ''
+ assert(expected == self.hangup.to_bxml())
diff --git a/test/unit/bxml/test_pause.py b/test/unit/bxml/test_pause.py
new file mode 100644
index 00000000..ae9d8471
--- /dev/null
+++ b/test/unit/bxml/test_pause.py
@@ -0,0 +1,22 @@
+"""
+test_Pause.py
+
+Unit tests for the BXML verb
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+from bandwidth.models.bxml import Verb
+from bandwidth.models.bxml import Pause
+
+
+class TestPause(unittest.TestCase):
+
+ def setUp(self):
+ self.pause = Pause(duration=30)
+ self.test_verb = Verb(tag="test")
+
+ def test_to_bxml(self):
+ expected = ''
+ assert(expected == self.pause.to_bxml())
diff --git a/test/unit/bxml/test_pause_recording.py b/test/unit/bxml/test_pause_recording.py
new file mode 100644
index 00000000..ce20eca6
--- /dev/null
+++ b/test/unit/bxml/test_pause_recording.py
@@ -0,0 +1,22 @@
+"""
+test_pause_recording.py
+
+Unit tests for the BXML verb
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+from bandwidth.models.bxml import Verb
+from bandwidth.models.bxml import PauseRecording
+
+
+class TestPauseRecording(unittest.TestCase):
+
+ def setUp(self):
+ self.pause_recording = PauseRecording()
+ self.test_verb = Verb(tag="test")
+
+ def test_to_bxml(self):
+ expected = ''
+ assert(expected == self.pause_recording.to_bxml())
diff --git a/test/unit/bxml/test_phone_number.py b/test/unit/bxml/test_phone_number.py
new file mode 100644
index 00000000..3c4cff5e
--- /dev/null
+++ b/test/unit/bxml/test_phone_number.py
@@ -0,0 +1,27 @@
+"""
+test_phone_number.py
+
+Unit tests for the BXML verb
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+from bandwidth.models.bxml import Verb
+from bandwidth.models.bxml import PhoneNumber
+
+
+class TestPhoneNumber(unittest.TestCase):
+
+ def setUp(self):
+ self.phone_number = PhoneNumber(
+ number="+19195551234",
+ transfer_answer_url="https://example.com/webhooks/transfer_answer",
+ transfer_answer_method="POST",
+ tag=""
+ )
+ self.test_verb = Verb(tag="test")
+
+ def test_to_bxml(self):
+ expected = '+19195551234'
+ assert(expected == self.phone_number.to_bxml())
diff --git a/test/unit/bxml/test_play_audio.py b/test/unit/bxml/test_play_audio.py
new file mode 100644
index 00000000..e430719b
--- /dev/null
+++ b/test/unit/bxml/test_play_audio.py
@@ -0,0 +1,26 @@
+"""
+test_play_audio.py
+
+Unit tests for the BXML verb
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+from bandwidth.models.bxml import Verb
+from bandwidth.models.bxml import PlayAudio
+
+class TestPlayAudio(unittest.TestCase):
+
+ def setUp(self):
+ self.play_audio = PlayAudio(
+ audio_uri="https://audio.url/audio1.wav",
+ username="user",
+ password="pass"
+ )
+ self.test_verb = Verb(tag="test")
+
+
+ def test_to_bxml(self):
+ expected = 'https://audio.url/audio1.wav'
+ assert(expected == self.play_audio.to_bxml())
diff --git a/test/unit/bxml/test_record.py b/test/unit/bxml/test_record.py
new file mode 100644
index 00000000..3b08a7a5
--- /dev/null
+++ b/test/unit/bxml/test_record.py
@@ -0,0 +1,23 @@
+"""
+test_record.py
+
+Unit tests for the BXML verb
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+from bandwidth.models.bxml import Verb
+from bandwidth.models.bxml import Record
+
+
+class TestRecord(unittest.TestCase):
+
+ def setUp(self):
+ self.record = Record()
+ self.record.max_duration = 10
+ self.test_verb = Verb(tag="test")
+
+ def test_to_bxml(self):
+ expected = ''
+ assert(expected == self.record.to_bxml())
diff --git a/test/unit/bxml/test_redirect.py b/test/unit/bxml/test_redirect.py
new file mode 100644
index 00000000..2e955004
--- /dev/null
+++ b/test/unit/bxml/test_redirect.py
@@ -0,0 +1,22 @@
+"""
+test_redirect.py
+
+Unit tests for the BXML verb
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+from bandwidth.models.bxml import Verb
+from bandwidth.models.bxml import Redirect
+
+
+class TestRedirect(unittest.TestCase):
+
+ def setUp(self):
+ self.redirect = Redirect("https://example.com/redirect")
+ self.test_verb = Verb(tag="test")
+
+ def test_to_bxml(self):
+ expected = ''
+ assert(expected == self.redirect.to_bxml())
diff --git a/test/unit/bxml/test_response.py b/test/unit/bxml/test_response.py
new file mode 100644
index 00000000..b90b9b41
--- /dev/null
+++ b/test/unit/bxml/test_response.py
@@ -0,0 +1,22 @@
+"""
+test_response.py
+
+Unit tests for Response Model
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+from bandwidth.models.bxml import Response
+
+
+class TestResponse(unittest.TestCase):
+
+ def setUp(self):
+ self.response = Response()
+
+ def test_response_init(self):
+ """Test initializing the root
+ """
+ expected_bxml = "\n"
+ assert self.response.to_bxml() == expected_bxml
diff --git a/test/unit/bxml/test_resume_recording.py b/test/unit/bxml/test_resume_recording.py
new file mode 100644
index 00000000..bc7a3bf2
--- /dev/null
+++ b/test/unit/bxml/test_resume_recording.py
@@ -0,0 +1,22 @@
+"""
+test_resume_recording.py
+
+Unit tests for the BXML verb
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+from bandwidth.models.bxml import Verb
+from bandwidth.models.bxml import ResumeRecording
+
+
+class TestResumeRecording(unittest.TestCase):
+
+ def setUp(self):
+ self.resume_recording = ResumeRecording()
+ self.test_verb = Verb(tag="test")
+
+ def test_to_bxml(self):
+ expected = ''
+ assert(expected == self.resume_recording.to_bxml())
diff --git a/test/unit/bxml/test_ring.py b/test/unit/bxml/test_ring.py
new file mode 100644
index 00000000..613fc71c
--- /dev/null
+++ b/test/unit/bxml/test_ring.py
@@ -0,0 +1,25 @@
+"""
+test_ring.py
+
+Unit tests for the BXML verb
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+from bandwidth.models.bxml import Verb
+from bandwidth.models.bxml.verbs.ring import Ring
+
+
+class TestRing(unittest.TestCase):
+
+ def setUp(self):
+ self.ring = Ring(
+ duration=30,
+ answer_call=True,
+ )
+ self.test_verb = Verb(tag="test")
+
+ def test_to_bxml(self):
+ expected = ''
+ assert(expected == self.ring.to_bxml())
diff --git a/test/unit/bxml/test_send_dtmf.py b/test/unit/bxml/test_send_dtmf.py
new file mode 100644
index 00000000..ebe51035
--- /dev/null
+++ b/test/unit/bxml/test_send_dtmf.py
@@ -0,0 +1,26 @@
+"""
+test_send_dtmf.py
+
+Unit tests for the BXML verb
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+from bandwidth.models.bxml import Verb
+from bandwidth.models.bxml.verbs.send_dtmf import SendDtmf
+
+
+class TestSendDtmf(unittest.TestCase):
+
+ def setUp(self):
+ self.send_dtmf = SendDtmf(
+ digits="1234",
+ tone_duration=3,
+ tone_interval=5
+ )
+ self.test_verb = Verb(tag="test")
+
+ def test_to_bxml(self):
+ expected = '1234'
+ assert(expected == self.send_dtmf.to_bxml())
diff --git a/test/unit/bxml/test_sip_uri.py b/test/unit/bxml/test_sip_uri.py
new file mode 100644
index 00000000..f4f78c21
--- /dev/null
+++ b/test/unit/bxml/test_sip_uri.py
@@ -0,0 +1,28 @@
+"""
+test_sip_uri.py
+
+Unit tests for the BXML verb
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+from bandwidth.models.bxml import Verb
+from bandwidth.models.bxml import SipUri
+
+
+class TestSipUri(unittest.TestCase):
+
+ def setUp(self):
+ self.sip_uri = SipUri(
+ uri="sip:1-999-123-4567@voip-provider.example.net",
+ uui="abc123",
+ transfer_answer_url="https://example.com/webhooks/transfer_answer",
+ transfer_answer_method="POST",
+ tag="test"
+ )
+ self.test_verb = Verb(tag="test")
+
+ def test_to_bxml(self):
+ expected = 'sip:1-999-123-4567@voip-provider.example.net'
+ assert(expected == self.sip_uri.to_bxml())
diff --git a/test/unit/bxml/test_speak_sentence.py b/test/unit/bxml/test_speak_sentence.py
new file mode 100644
index 00000000..eb0a15d5
--- /dev/null
+++ b/test/unit/bxml/test_speak_sentence.py
@@ -0,0 +1,26 @@
+"""
+test_speak_sentence.py
+
+Unit tests for the BXML verb
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+from bandwidth.models.bxml import Verb
+from bandwidth.models.bxml import SpeakSentence
+
+
+class TestSpeakSentence(unittest.TestCase):
+
+ def setUp(self):
+ self.speak_sentence = SpeakSentence(
+ text='Hello. Your number is asdf, lets play a game. What is 10 + 3. Press the pound key when finished.',
+ voice="julie"
+ )
+
+ self.test_verb = Verb(tag="test")
+
+ def test_to_bxml(self):
+ expected = 'Hello. Your number is <say-as interpret-as="telephone">asdf</say-as>, lets play a game. What is 10 + 3. Press the pound key when finished.'
+ assert(expected == self.speak_sentence.to_bxml())
diff --git a/test/unit/bxml/test_start_gather.py b/test/unit/bxml/test_start_gather.py
new file mode 100644
index 00000000..a4766c1b
--- /dev/null
+++ b/test/unit/bxml/test_start_gather.py
@@ -0,0 +1,28 @@
+"""
+test_start_gather.py
+
+Unit tests for the BXML verb
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+from bandwidth.models.bxml import Verb
+from bandwidth.models.bxml import StartGather
+
+
+class TestStartGather(unittest.TestCase):
+
+ def setUp(self):
+ self.start_gather = StartGather(
+ dtmf_url="https://example.com/startgather",
+ dtmf_method="POST",
+ username="user",
+ password="pass",
+ tag="tag"
+ )
+ self.test_verb = Verb(tag="test")
+
+ def test_to_bxml(self):
+ expected = ''
+ assert(expected == self.start_gather.to_bxml())
diff --git a/test/unit/bxml/test_start_recording.py b/test/unit/bxml/test_start_recording.py
new file mode 100644
index 00000000..d298fc07
--- /dev/null
+++ b/test/unit/bxml/test_start_recording.py
@@ -0,0 +1,34 @@
+"""
+test_start_recording.py
+
+Unit tests for the BXML verb
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+from bandwidth.models.bxml import Verb
+from bandwidth.models.bxml import StartRecording
+
+
+class TestStartRecording(unittest.TestCase):
+
+ def setUp(self):
+ self.start_recording = StartRecording(
+ recording_available_url = "example.com",
+ recording_available_method = "POST",
+ transcribe = True,
+ transcription_available_url = "transcription-example.com",
+ transcription_available_method = "POST",
+ username = "user",
+ password = "pass",
+ tag = "tag",
+ file_format = "wav",
+ multi_channel = True
+ )
+ self.test_verb = Verb(tag="test")
+
+
+ def test_to_bxml(self):
+ expected = ''
+ assert(expected == self.start_recording.to_bxml())
diff --git a/test/unit/bxml/test_start_stream.py b/test/unit/bxml/test_start_stream.py
new file mode 100644
index 00000000..8f1f3825
--- /dev/null
+++ b/test/unit/bxml/test_start_stream.py
@@ -0,0 +1,44 @@
+"""
+test_start_stream.py
+
+Unit tests for the BXML verb
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+from bandwidth.models.bxml import StartStream, StreamParam
+
+
+class TestStartStream(unittest.TestCase):
+
+ def setUp(self):
+ self.stream_param1 = StreamParam(
+ name="name1",
+ value="value1"
+ )
+
+ self.stream_param2 = StreamParam(
+ name="name2",
+ value="value2"
+ )
+
+ self.start_stream = StartStream(
+ stream_params=[self.stream_param1],
+ name = "stream1",
+ tracks = "inbound",
+ destination = "testurl.com",
+ stream_event_url="eventurl.com",
+ stream_event_method= "POST",
+ username = "user",
+ password = "pass"
+ )
+
+ def test_to_bxml(self):
+ expected = ''
+ assert(expected == self.start_stream.to_bxml())
+
+ def test_add_verb(self):
+ expected = ''
+ self.start_stream.add_verb(self.stream_param2)
+ assert(expected == self.start_stream.to_bxml())
diff --git a/test/unit/bxml/test_start_transcription.py b/test/unit/bxml/test_start_transcription.py
new file mode 100644
index 00000000..90f25a39
--- /dev/null
+++ b/test/unit/bxml/test_start_transcription.py
@@ -0,0 +1,44 @@
+"""
+test_start_transcription.py
+
+Unit tests for the BXML verb
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+from bandwidth.models.bxml import StartTranscription, CustomParam
+
+
+class TestStartTranscription(unittest.TestCase):
+ def setUp(self) -> None:
+ self.custom_param1 = CustomParam(
+ name="name1",
+ value="value1"
+ )
+
+ self.custom_param2 = CustomParam(
+ name="name2",
+ value="value2"
+ )
+
+ self.start_transcription = StartTranscription(
+ name="transcription1",
+ tracks="both",
+ transcription_event_url="eventurl.com",
+ transcription_event_method="POST",
+ username="user",
+ password="pass",
+ destination="testurl.com",
+ stabilized=True,
+ custom_params=[self.custom_param1]
+ )
+
+ def test_to_bxml(self):
+ expected = ''
+ assert(expected == self.start_transcription.to_bxml())
+
+ def test_add_verb(self):
+ expected = ''
+ self.start_transcription.add_verb(self.custom_param2)
+ assert(expected == self.start_transcription.to_bxml())
diff --git a/test/unit/bxml/test_stop_gather.py b/test/unit/bxml/test_stop_gather.py
new file mode 100644
index 00000000..dca837eb
--- /dev/null
+++ b/test/unit/bxml/test_stop_gather.py
@@ -0,0 +1,22 @@
+"""
+test_stop_gather.py
+
+Unit tests for the BXML verb
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+from bandwidth.models.bxml import Verb
+from bandwidth.models.bxml import StopGather
+
+
+class TestStopGather(unittest.TestCase):
+
+ def setUp(self):
+ self.stop_gather = StopGather()
+ self.test_verb = Verb(tag="test")
+
+ def test_to_bxml(self):
+ expected = ''
+ assert(expected == self.stop_gather.to_bxml())
diff --git a/test/unit/bxml/test_stop_recording.py b/test/unit/bxml/test_stop_recording.py
new file mode 100644
index 00000000..57ede215
--- /dev/null
+++ b/test/unit/bxml/test_stop_recording.py
@@ -0,0 +1,22 @@
+"""
+test_stop_recording.py
+
+Unit tests for the BXML verb
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+from bandwidth.models.bxml import Verb
+from bandwidth.models.bxml.verbs.stop_recording import StopRecording
+
+
+class TestStopRecording(unittest.TestCase):
+
+ def setUp(self):
+ self.stop_recording = StopRecording()
+ self.test_verb = Verb(tag="test")
+
+ def test_to_bxml(self):
+ expected = ''
+ assert(expected == self.stop_recording.to_bxml())
diff --git a/test/unit/bxml/test_stop_stream.py b/test/unit/bxml/test_stop_stream.py
new file mode 100644
index 00000000..93772d08
--- /dev/null
+++ b/test/unit/bxml/test_stop_stream.py
@@ -0,0 +1,22 @@
+"""
+test_stop_stream.py
+
+Unit tests for the BXML verb
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+from bandwidth.models.bxml import Verb
+from bandwidth.models.bxml import StopStream
+
+
+class TestStopStream(unittest.TestCase):
+
+ def setUp(self):
+ self.stop_stream = StopStream(name="conf")
+ self.test_verb = Verb(tag="test")
+
+ def test_to_bxml(self):
+ expected = ''
+ assert(expected == self.stop_stream.to_bxml())
diff --git a/test/unit/bxml/test_stop_transcription.py b/test/unit/bxml/test_stop_transcription.py
new file mode 100644
index 00000000..0015fdab
--- /dev/null
+++ b/test/unit/bxml/test_stop_transcription.py
@@ -0,0 +1,21 @@
+"""
+test_stop_transcription.py
+
+Unit tests for the BXML verb
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+from bandwidth.models.bxml import StopTranscription
+
+
+class TestStopTranscription(unittest.TestCase):
+ def setUp(self) -> None:
+ self.stop_transcription = StopTranscription(
+ name="transcription1"
+ )
+
+ def test_to_bxml(self):
+ expected = ''
+ assert(expected == self.stop_transcription.to_bxml())
diff --git a/test/unit/bxml/test_stream_param.py b/test/unit/bxml/test_stream_param.py
new file mode 100644
index 00000000..1fed11dc
--- /dev/null
+++ b/test/unit/bxml/test_stream_param.py
@@ -0,0 +1,27 @@
+"""
+test_stream_param.py
+
+Unit tests for the BXML verb
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+
+from bandwidth.models.bxml import Verb
+from bandwidth.models.bxml import StreamParam
+
+
+class TestStreamParam(unittest.TestCase):
+
+ def setUp(self):
+ self.stream_param = StreamParam(
+ name="name1",
+ value="value1"
+ )
+ self.test_verb = Verb(tag="test")
+
+
+ def test_to_bxml(self):
+ expected = ''
+ assert(expected == self.stream_param.to_bxml())
diff --git a/test/unit/bxml/test_tag.py b/test/unit/bxml/test_tag.py
new file mode 100644
index 00000000..32679eee
--- /dev/null
+++ b/test/unit/bxml/test_tag.py
@@ -0,0 +1,22 @@
+"""
+test_tag.py
+
+Unit tests for the BXML verb
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+from bandwidth.models.bxml import Verb
+from bandwidth.models.bxml import Tag
+
+
+class TestTag(unittest.TestCase):
+
+ def setUp(self):
+ self.tag = Tag(content="Test")
+ self.test_verb = Verb(tag="test")
+
+ def test_to_bxml(self):
+ expected = 'Test'
+ assert(expected == self.tag.to_bxml())
diff --git a/test/unit/bxml/test_transfer.py b/test/unit/bxml/test_transfer.py
new file mode 100644
index 00000000..3f5124ef
--- /dev/null
+++ b/test/unit/bxml/test_transfer.py
@@ -0,0 +1,40 @@
+"""
+test_transfer.py
+
+Unit tests for the BXML verb
+
+@copyright Bandwidth Inc.
+"""
+import unittest
+
+from bandwidth.models.bxml.verbs.transfer import Transfer
+from bandwidth.models.bxml import PhoneNumber
+from bandwidth.models.bxml import SipUri
+
+
+class TestTransfer(unittest.TestCase):
+
+ def setUp(self):
+ self.sip_uri = SipUri(
+ uri="sip@bw.com",
+ uui="test"
+ )
+ self.phone_number = PhoneNumber(
+ number="+19195551234",
+ tag="test"
+ )
+ self.transfer = Transfer(
+ transfer_to=[self.sip_uri],
+ call_timeout = "15",
+ transfer_caller_id = "+19195554321",
+ tag = "test"
+ )
+
+ def test_to_bxml(self):
+ expected = 'sip@bw.com'
+ assert(expected == self.transfer.to_bxml())
+
+ def test_add_verb(self):
+ expected = 'sip@bw.com+19195551234'
+ self.transfer.add_transfer_recipient(self.phone_number)
+ assert(expected == self.transfer.to_bxml())
diff --git a/test/unit/test_account_statistics.py b/test/unit/test_account_statistics.py
new file mode 100644
index 00000000..e7038499
--- /dev/null
+++ b/test/unit/test_account_statistics.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.account_statistics import AccountStatistics # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestAccountStatistics(unittest.TestCase):
+ """AccountStatistics unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test AccountStatistics
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `AccountStatistics`
+ """
+ model = bandwidth.models.account_statistics.AccountStatistics() # noqa: E501
+ if include_optional :
+ return AccountStatistics(
+ current_call_queue_size = 0,
+ max_call_queue_size = 900
+ )
+ else :
+ return AccountStatistics(
+ )
+ """
+
+ def testAccountStatistics(self):
+ """Test AccountStatistics"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_answer_callback.py b/test/unit/test_answer_callback.py
new file mode 100644
index 00000000..94cb3d04
--- /dev/null
+++ b/test/unit/test_answer_callback.py
@@ -0,0 +1,70 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.answer_callback import AnswerCallback # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestAnswerCallback(unittest.TestCase):
+ """AnswerCallback unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test AnswerCallback
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `AnswerCallback`
+ """
+ model = bandwidth.models.answer_callback.AnswerCallback() # noqa: E501
+ if include_optional :
+ return AnswerCallback(
+ event_type = 'bridgeComplete',
+ event_time = '2022-06-17T22:19:40.375Z',
+ account_id = '920012',
+ application_id = '04e88489-df02-4e34-a0ee-27a91849555f',
+ var_from = '+15555555555',
+ to = '+15555555555',
+ direction = 'inbound',
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ enqueued_time = '2022-06-17T22:20Z',
+ start_time = '2022-06-17T22:19:40.375Z',
+ answer_time = '2022-06-17T22:20Z',
+ tag = 'exampleTag',
+ machine_detection_result = bandwidth.models.machine_detection_result.machineDetectionResult(
+ value = 'answering-machine',
+ duration = 'PT4.9891287S', )
+ )
+ else :
+ return AnswerCallback(
+ )
+ """
+
+ def testAnswerCallback(self):
+ """Test AnswerCallback"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_bridge_complete_callback.py b/test/unit/test_bridge_complete_callback.py
new file mode 100644
index 00000000..38ca08a1
--- /dev/null
+++ b/test/unit/test_bridge_complete_callback.py
@@ -0,0 +1,70 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.bridge_complete_callback import BridgeCompleteCallback # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestBridgeCompleteCallback(unittest.TestCase):
+ """BridgeCompleteCallback unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test BridgeCompleteCallback
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `BridgeCompleteCallback`
+ """
+ model = bandwidth.models.bridge_complete_callback.BridgeCompleteCallback() # noqa: E501
+ if include_optional :
+ return BridgeCompleteCallback(
+ event_type = 'bridgeComplete',
+ event_time = '2022-06-17T22:19:40.375Z',
+ account_id = '920012',
+ application_id = '04e88489-df02-4e34-a0ee-27a91849555f',
+ var_from = '+15555555555',
+ to = '+15555555555',
+ direction = 'inbound',
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ enqueued_time = '2022-06-17T22:20Z',
+ start_time = '2022-06-17T22:19:40.375Z',
+ answer_time = '2022-06-17T22:20Z',
+ tag = 'exampleTag',
+ cause = 'busy',
+ error_message = 'Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call',
+ error_id = '4642074b-7b58-478b-96e4-3a60955c6765'
+ )
+ else :
+ return BridgeCompleteCallback(
+ )
+ """
+
+ def testBridgeCompleteCallback(self):
+ """Test BridgeCompleteCallback"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_bridge_target_complete_callback.py b/test/unit/test_bridge_target_complete_callback.py
new file mode 100644
index 00000000..7de38d19
--- /dev/null
+++ b/test/unit/test_bridge_target_complete_callback.py
@@ -0,0 +1,67 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.bridge_target_complete_callback import BridgeTargetCompleteCallback # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestBridgeTargetCompleteCallback(unittest.TestCase):
+ """BridgeTargetCompleteCallback unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test BridgeTargetCompleteCallback
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `BridgeTargetCompleteCallback`
+ """
+ model = bandwidth.models.bridge_target_complete_callback.BridgeTargetCompleteCallback() # noqa: E501
+ if include_optional :
+ return BridgeTargetCompleteCallback(
+ event_type = 'bridgeComplete',
+ event_time = '2022-06-17T22:19:40.375Z',
+ account_id = '920012',
+ application_id = '04e88489-df02-4e34-a0ee-27a91849555f',
+ var_from = '+15555555555',
+ to = '+15555555555',
+ direction = 'inbound',
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ enqueued_time = '2022-06-17T22:20Z',
+ start_time = '2022-06-17T22:19:40.375Z',
+ answer_time = '2022-06-17T22:20Z',
+ tag = 'exampleTag'
+ )
+ else :
+ return BridgeTargetCompleteCallback(
+ )
+ """
+
+ def testBridgeTargetCompleteCallback(self):
+ """Test BridgeTargetCompleteCallback"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_call_direction_enum.py b/test/unit/test_call_direction_enum.py
new file mode 100644
index 00000000..7e7c152f
--- /dev/null
+++ b/test/unit/test_call_direction_enum.py
@@ -0,0 +1,37 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.call_direction_enum import CallDirectionEnum # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestCallDirectionEnum(unittest.TestCase):
+ """CallDirectionEnum unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testCallDirectionEnum(self):
+ """Test CallDirectionEnum"""
+ # inst = CallDirectionEnum()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_call_recording_metadata.py b/test/unit/test_call_recording_metadata.py
new file mode 100644
index 00000000..6b3e8d9a
--- /dev/null
+++ b/test/unit/test_call_recording_metadata.py
@@ -0,0 +1,76 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.call_recording_metadata import CallRecordingMetadata # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestCallRecordingMetadata(unittest.TestCase):
+ """CallRecordingMetadata unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test CallRecordingMetadata
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `CallRecordingMetadata`
+ """
+ model = bandwidth.models.call_recording_metadata.CallRecordingMetadata() # noqa: E501
+ if include_optional :
+ return CallRecordingMetadata(
+ application_id = '04e88489-df02-4e34-a0ee-27a91849555f',
+ account_id = '920012',
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d',
+ recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833',
+ to = '+15555555555',
+ var_from = '+15555555555',
+ transfer_caller_id = '+15555555555',
+ transfer_to = '+15555555555)',
+ duration = 'PT13.67S',
+ direction = 'inbound',
+ channels = 1,
+ start_time = '2022-06-17T22:19:40.375Z',
+ end_time = '2022-06-17T22:20Z',
+ file_format = 'wav',
+ status = 'completed',
+ media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media',
+ transcription = bandwidth.models.transcription_metadata.transcriptionMetadata(
+ id = 't-387bd648-18f3-4823-9d16-746bca0003c9',
+ status = 'completed',
+ completed_time = '2022-06-13T18:46:29.715Z',
+ url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/recordings/r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/transcription', )
+ )
+ else :
+ return CallRecordingMetadata(
+ )
+ """
+
+ def testCallRecordingMetadata(self):
+ """Test CallRecordingMetadata"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_call_state.py b/test/unit/test_call_state.py
new file mode 100644
index 00000000..a0bb02d5
--- /dev/null
+++ b/test/unit/test_call_state.py
@@ -0,0 +1,72 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.call_state import CallState # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestCallState(unittest.TestCase):
+ """CallState unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test CallState
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `CallState`
+ """
+ model = bandwidth.models.call_state.CallState() # noqa: E501
+ if include_optional :
+ return CallState(
+ application_id = '04e88489-df02-4e34-a0ee-27a91849555f',
+ account_id = '9900000',
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ parent_call_id = 'c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ to = '+19195551234',
+ var_from = '19195554321',
+ direction = 'inbound',
+ state = 'disconnected',
+ stir_shaken = {"verstat":"TN-Verification-Passed","attestationIndicator":"A","originatingId":"abc123"},
+ identity = 'eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9idy1zaGFrZW4tY2VydC1wdWIuczMuYW1hem9uYXdzLmNvbS9iYW5kd2lkdGgtc2hha2VuLWNlcnRfMjAyMzA3MTYucGVtIn0.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTg0MjgyMDI4MCJdfSwiaWF0IjoxNjU2NTM0MzM2LCJvcmlnIjp7InRuIjoiMTkxOTQ0NDI2ODMifSwib3JpZ2lkIjoiNDk0NTlhOGEtNDJmNi0zNTFjLTkzNjEtYWRmNTdhOWUwOGNhIn0.56un9sRw_uH-sbJvnUsqdevlVxbOVjn8MVlGTlBMicjaZuRRwxfiNp-C9zYCMKTTCbc-QdYPN05F61XNVN4D3w;info=;alg=ES256;ppt=shaken',
+ enqueued_time = '2022-06-16T13:15:07.160Z',
+ start_time = '2022-06-16T13:15:07.160Z',
+ answer_time = '2022-06-16T13:15:18.126Z',
+ end_time = '2022-06-16T13:15:18.314Z',
+ disconnect_cause = '',
+ error_message = '',
+ error_id = '',
+ last_update = '2022-06-16T13:15:18.314Z'
+ )
+ else :
+ return CallState(
+ )
+ """
+
+ def testCallState(self):
+ """Test CallState"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_call_state_enum.py b/test/unit/test_call_state_enum.py
new file mode 100644
index 00000000..e4eb0653
--- /dev/null
+++ b/test/unit/test_call_state_enum.py
@@ -0,0 +1,37 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.call_state_enum import CallStateEnum # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestCallStateEnum(unittest.TestCase):
+ """CallStateEnum unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testCallStateEnum(self):
+ """Test CallStateEnum"""
+ # inst = CallStateEnum()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_callback_method_enum.py b/test/unit/test_callback_method_enum.py
new file mode 100644
index 00000000..a91471a3
--- /dev/null
+++ b/test/unit/test_callback_method_enum.py
@@ -0,0 +1,37 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.callback_method_enum import CallbackMethodEnum # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestCallbackMethodEnum(unittest.TestCase):
+ """CallbackMethodEnum unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testCallbackMethodEnum(self):
+ """Test CallbackMethodEnum"""
+ # inst = CallbackMethodEnum()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_code_request.py b/test/unit/test_code_request.py
new file mode 100644
index 00000000..9df98c86
--- /dev/null
+++ b/test/unit/test_code_request.py
@@ -0,0 +1,65 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.code_request import CodeRequest # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestCodeRequest(unittest.TestCase):
+ """CodeRequest unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test CodeRequest
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `CodeRequest`
+ """
+ model = bandwidth.models.code_request.CodeRequest() # noqa: E501
+ if include_optional :
+ return CodeRequest(
+ to = '+19195551234',
+ var_from = '+19195554321',
+ application_id = '66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1',
+ scope = '2FA',
+ message = 'Your temporary {NAME} {SCOPE} code is {CODE}',
+ digits = 6
+ )
+ else :
+ return CodeRequest(
+ to = '+19195551234',
+ var_from = '+19195554321',
+ application_id = '66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1',
+ message = 'Your temporary {NAME} {SCOPE} code is {CODE}',
+ digits = 6,
+ )
+ """
+
+ def testCodeRequest(self):
+ """Test CodeRequest"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_conference.py b/test/unit/test_conference.py
new file mode 100644
index 00000000..2e83f298
--- /dev/null
+++ b/test/unit/test_conference.py
@@ -0,0 +1,70 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.conference import Conference # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestConference(unittest.TestCase):
+ """Conference unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Conference
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Conference`
+ """
+ model = bandwidth.models.conference.Conference() # noqa: E501
+ if include_optional :
+ return Conference(
+ id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9',
+ name = 'my-conference-name',
+ created_time = '2022-06-17T22:19:40.375Z',
+ completed_time = '2022-06-17T22:20Z',
+ conference_event_url = 'https://myServer.example/bandwidth/webhooks/conferenceEvent',
+ conference_event_method = 'POST',
+ tag = 'my custom tag',
+ active_members = [
+ bandwidth.models.conference_member.conferenceMember(
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9',
+ member_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/members/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ mute = False,
+ hold = False,
+ call_ids_to_coach = ["c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"], )
+ ]
+ )
+ else :
+ return Conference(
+ )
+ """
+
+ def testConference(self):
+ """Test Conference"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_conference_completed_callback.py b/test/unit/test_conference_completed_callback.py
new file mode 100644
index 00000000..7b4be3bc
--- /dev/null
+++ b/test/unit/test_conference_completed_callback.py
@@ -0,0 +1,59 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.conference_completed_callback import ConferenceCompletedCallback # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestConferenceCompletedCallback(unittest.TestCase):
+ """ConferenceCompletedCallback unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ConferenceCompletedCallback
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `ConferenceCompletedCallback`
+ """
+ model = bandwidth.models.conference_completed_callback.ConferenceCompletedCallback() # noqa: E501
+ if include_optional :
+ return ConferenceCompletedCallback(
+ event_type = 'bridgeComplete',
+ event_time = '2022-06-17T22:19:40.375Z',
+ conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9',
+ name = 'my-conference-name',
+ tag = 'exampleTag'
+ )
+ else :
+ return ConferenceCompletedCallback(
+ )
+ """
+
+ def testConferenceCompletedCallback(self):
+ """Test ConferenceCompletedCallback"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_conference_created_callback.py b/test/unit/test_conference_created_callback.py
new file mode 100644
index 00000000..af7eff5b
--- /dev/null
+++ b/test/unit/test_conference_created_callback.py
@@ -0,0 +1,59 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.conference_created_callback import ConferenceCreatedCallback # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestConferenceCreatedCallback(unittest.TestCase):
+ """ConferenceCreatedCallback unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ConferenceCreatedCallback
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `ConferenceCreatedCallback`
+ """
+ model = bandwidth.models.conference_created_callback.ConferenceCreatedCallback() # noqa: E501
+ if include_optional :
+ return ConferenceCreatedCallback(
+ event_type = 'bridgeComplete',
+ event_time = '2022-06-17T22:19:40.375Z',
+ conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9',
+ name = 'my-conference-name',
+ tag = 'exampleTag'
+ )
+ else :
+ return ConferenceCreatedCallback(
+ )
+ """
+
+ def testConferenceCreatedCallback(self):
+ """Test ConferenceCreatedCallback"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_conference_member.py b/test/unit/test_conference_member.py
new file mode 100644
index 00000000..51222320
--- /dev/null
+++ b/test/unit/test_conference_member.py
@@ -0,0 +1,60 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.conference_member import ConferenceMember # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestConferenceMember(unittest.TestCase):
+ """ConferenceMember unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ConferenceMember
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `ConferenceMember`
+ """
+ model = bandwidth.models.conference_member.ConferenceMember() # noqa: E501
+ if include_optional :
+ return ConferenceMember(
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9',
+ member_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/members/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ mute = False,
+ hold = False,
+ call_ids_to_coach = ["c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"]
+ )
+ else :
+ return ConferenceMember(
+ )
+ """
+
+ def testConferenceMember(self):
+ """Test ConferenceMember"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_conference_member_exit_callback.py b/test/unit/test_conference_member_exit_callback.py
new file mode 100644
index 00000000..879b1f4e
--- /dev/null
+++ b/test/unit/test_conference_member_exit_callback.py
@@ -0,0 +1,62 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.conference_member_exit_callback import ConferenceMemberExitCallback # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestConferenceMemberExitCallback(unittest.TestCase):
+ """ConferenceMemberExitCallback unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ConferenceMemberExitCallback
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `ConferenceMemberExitCallback`
+ """
+ model = bandwidth.models.conference_member_exit_callback.ConferenceMemberExitCallback() # noqa: E501
+ if include_optional :
+ return ConferenceMemberExitCallback(
+ event_type = 'bridgeComplete',
+ event_time = '2022-06-17T22:19:40.375Z',
+ conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9',
+ name = 'my-conference-name',
+ var_from = '+15555555555',
+ to = '+15555555555',
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ tag = 'exampleTag'
+ )
+ else :
+ return ConferenceMemberExitCallback(
+ )
+ """
+
+ def testConferenceMemberExitCallback(self):
+ """Test ConferenceMemberExitCallback"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_conference_member_join_callback.py b/test/unit/test_conference_member_join_callback.py
new file mode 100644
index 00000000..be466717
--- /dev/null
+++ b/test/unit/test_conference_member_join_callback.py
@@ -0,0 +1,62 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.conference_member_join_callback import ConferenceMemberJoinCallback # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestConferenceMemberJoinCallback(unittest.TestCase):
+ """ConferenceMemberJoinCallback unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ConferenceMemberJoinCallback
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `ConferenceMemberJoinCallback`
+ """
+ model = bandwidth.models.conference_member_join_callback.ConferenceMemberJoinCallback() # noqa: E501
+ if include_optional :
+ return ConferenceMemberJoinCallback(
+ event_type = 'bridgeComplete',
+ event_time = '2022-06-17T22:19:40.375Z',
+ conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9',
+ name = 'my-conference-name',
+ var_from = '+15555555555',
+ to = '+15555555555',
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ tag = 'exampleTag'
+ )
+ else :
+ return ConferenceMemberJoinCallback(
+ )
+ """
+
+ def testConferenceMemberJoinCallback(self):
+ """Test ConferenceMemberJoinCallback"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_conference_recording_available_callback.py b/test/unit/test_conference_recording_available_callback.py
new file mode 100644
index 00000000..91de9b94
--- /dev/null
+++ b/test/unit/test_conference_recording_available_callback.py
@@ -0,0 +1,68 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.conference_recording_available_callback import ConferenceRecordingAvailableCallback # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestConferenceRecordingAvailableCallback(unittest.TestCase):
+ """ConferenceRecordingAvailableCallback unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ConferenceRecordingAvailableCallback
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `ConferenceRecordingAvailableCallback`
+ """
+ model = bandwidth.models.conference_recording_available_callback.ConferenceRecordingAvailableCallback() # noqa: E501
+ if include_optional :
+ return ConferenceRecordingAvailableCallback(
+ event_type = 'bridgeComplete',
+ event_time = '2022-06-17T22:19:40.375Z',
+ conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9',
+ name = 'my-conference-name',
+ account_id = '920012',
+ recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833',
+ channels = 1,
+ start_time = '2022-06-17T22:19:40.375Z',
+ end_time = '2022-06-17T22:20Z',
+ duration = 'PT13.67S',
+ file_format = 'wav',
+ media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media',
+ tag = 'exampleTag',
+ status = 'completed'
+ )
+ else :
+ return ConferenceRecordingAvailableCallback(
+ )
+ """
+
+ def testConferenceRecordingAvailableCallback(self):
+ """Test ConferenceRecordingAvailableCallback"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_conference_recording_metadata.py b/test/unit/test_conference_recording_metadata.py
new file mode 100644
index 00000000..0538c7d2
--- /dev/null
+++ b/test/unit/test_conference_recording_metadata.py
@@ -0,0 +1,65 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.conference_recording_metadata import ConferenceRecordingMetadata # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestConferenceRecordingMetadata(unittest.TestCase):
+ """ConferenceRecordingMetadata unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ConferenceRecordingMetadata
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `ConferenceRecordingMetadata`
+ """
+ model = bandwidth.models.conference_recording_metadata.ConferenceRecordingMetadata() # noqa: E501
+ if include_optional :
+ return ConferenceRecordingMetadata(
+ account_id = '920012',
+ conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9',
+ name = 'my-conference-name',
+ recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833',
+ duration = 'PT13.67S',
+ channels = 1,
+ start_time = '2022-06-17T22:19:40.375Z',
+ end_time = '2022-06-17T22:20Z',
+ file_format = 'wav',
+ status = 'completed',
+ media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media'
+ )
+ else :
+ return ConferenceRecordingMetadata(
+ )
+ """
+
+ def testConferenceRecordingMetadata(self):
+ """Test ConferenceRecordingMetadata"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_conference_redirect_callback.py b/test/unit/test_conference_redirect_callback.py
new file mode 100644
index 00000000..4edd30dd
--- /dev/null
+++ b/test/unit/test_conference_redirect_callback.py
@@ -0,0 +1,59 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.conference_redirect_callback import ConferenceRedirectCallback # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestConferenceRedirectCallback(unittest.TestCase):
+ """ConferenceRedirectCallback unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ConferenceRedirectCallback
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `ConferenceRedirectCallback`
+ """
+ model = bandwidth.models.conference_redirect_callback.ConferenceRedirectCallback() # noqa: E501
+ if include_optional :
+ return ConferenceRedirectCallback(
+ event_type = 'bridgeComplete',
+ event_time = '2022-06-17T22:19:40.375Z',
+ conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9',
+ name = 'my-conference-name',
+ tag = 'exampleTag'
+ )
+ else :
+ return ConferenceRedirectCallback(
+ )
+ """
+
+ def testConferenceRedirectCallback(self):
+ """Test ConferenceRedirectCallback"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_conference_state_enum.py b/test/unit/test_conference_state_enum.py
new file mode 100644
index 00000000..87caff31
--- /dev/null
+++ b/test/unit/test_conference_state_enum.py
@@ -0,0 +1,37 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.conference_state_enum import ConferenceStateEnum # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestConferenceStateEnum(unittest.TestCase):
+ """ConferenceStateEnum unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testConferenceStateEnum(self):
+ """Test ConferenceStateEnum"""
+ # inst = ConferenceStateEnum()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_create_call.py b/test/unit/test_create_call.py
new file mode 100644
index 00000000..2aa1ef1b
--- /dev/null
+++ b/test/unit/test_create_call.py
@@ -0,0 +1,93 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.create_call import CreateCall # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestCreateCall(unittest.TestCase):
+ """CreateCall unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test CreateCall
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `CreateCall`
+ """
+ model = bandwidth.models.create_call.CreateCall() # noqa: E501
+ if include_optional :
+ return CreateCall(
+ to = '+19195551234',
+ var_from = '+19195554321',
+ display_name = 'John Doe',
+ uui = 'eyJhbGciOiJIUzI1NiJ9.WyJoaSJd.-znkjYyCkgz4djmHUPSXl9YrJ6Nix_XvmlwKGFh5ERM;encoding=jwt,aGVsbG8gd29ybGQ;encoding=base64',
+ application_id = '1234-qwer-5679-tyui',
+ answer_url = 'https://www.myCallbackServer.example/webhooks/answer',
+ answer_method = 'POST',
+ username = 'mySecretUsername',
+ password = 'mySecretPassword1!',
+ answer_fallback_url = 'https://www.myFallbackServer.example/webhooks/answer',
+ answer_fallback_method = 'POST',
+ fallback_username = 'mySecretUsername',
+ fallback_password = 'mySecretPassword1!',
+ disconnect_url = 'https://www.myCallbackServer.example/webhooks/disconnect',
+ disconnect_method = 'POST',
+ call_timeout = 30,
+ callback_timeout = 15,
+ machine_detection = bandwidth.models.machine_detection_configuration.machineDetectionConfiguration(
+ mode = 'async',
+ detection_timeout = 15,
+ silence_timeout = 10,
+ speech_threshold = 10,
+ speech_end_threshold = 5,
+ machine_speech_end_threshold = 5,
+ delay_result = False,
+ callback_url = 'https://myServer.example/bandwidth/webhooks/machineDetectionComplete',
+ callback_method = 'POST',
+ username = 'mySecretUsername',
+ password = 'mySecretPassword1!',
+ fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/machineDetectionComplete',
+ fallback_method = 'POST',
+ fallback_username = 'mySecretUsername',
+ fallback_password = 'mySecretPassword1!', ),
+ priority = 5,
+ tag = 'arbitrary text here'
+ )
+ else :
+ return CreateCall(
+ to = '+19195551234',
+ var_from = '+19195554321',
+ application_id = '1234-qwer-5679-tyui',
+ answer_url = 'https://www.myCallbackServer.example/webhooks/answer',
+ )
+ """
+
+ def testCreateCall(self):
+ """Test CreateCall"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_create_call_response.py b/test/unit/test_create_call_response.py
new file mode 100644
index 00000000..deeb0bd2
--- /dev/null
+++ b/test/unit/test_create_call_response.py
@@ -0,0 +1,84 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.create_call_response import CreateCallResponse # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestCreateCallResponse(unittest.TestCase):
+ """CreateCallResponse unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test CreateCallResponse
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `CreateCallResponse`
+ """
+ model = bandwidth.models.create_call_response.CreateCallResponse() # noqa: E501
+ if include_optional :
+ return CreateCallResponse(
+ application_id = '04e88489-df02-4e34-a0ee-27a91849555f',
+ account_id = '9900000',
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ to = '+19195551234',
+ var_from = '+19195554321',
+ enqueued_time = '2022-06-16T13:15:07.160Z',
+ call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ call_timeout = 30,
+ callback_timeout = 15,
+ tag = 'My custom tag value',
+ answer_method = 'POST',
+ answer_url = 'https://myServer.example/bandwidth/webhooks/answer',
+ answer_fallback_method = 'POST',
+ answer_fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/answer',
+ disconnect_method = 'POST',
+ disconnect_url = 'https://myServer.example/bandwidth/webhooks/disconnect',
+ username = 'mySecretUsername',
+ password = 'mySecretPassword1!',
+ fallback_username = 'mySecretUsername',
+ fallback_password = 'mySecretPassword1!',
+ priority = 5
+ )
+ else :
+ return CreateCallResponse(
+ application_id = '04e88489-df02-4e34-a0ee-27a91849555f',
+ account_id = '9900000',
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ to = '+19195551234',
+ var_from = '+19195554321',
+ call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ answer_method = 'POST',
+ answer_url = 'https://myServer.example/bandwidth/webhooks/answer',
+ disconnect_method = 'POST',
+ )
+ """
+
+ def testCreateCallResponse(self):
+ """Test CreateCallResponse"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_create_lookup_response.py b/test/unit/test_create_lookup_response.py
new file mode 100644
index 00000000..73081e2a
--- /dev/null
+++ b/test/unit/test_create_lookup_response.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.create_lookup_response import CreateLookupResponse # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestCreateLookupResponse(unittest.TestCase):
+ """CreateLookupResponse unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test CreateLookupResponse
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `CreateLookupResponse`
+ """
+ model = bandwidth.models.create_lookup_response.CreateLookupResponse() # noqa: E501
+ if include_optional :
+ return CreateLookupResponse(
+ request_id = '',
+ status = 'COMPLETE'
+ )
+ else :
+ return CreateLookupResponse(
+ )
+ """
+
+ def testCreateLookupResponse(self):
+ """Test CreateLookupResponse"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_create_message_request_error.py b/test/unit/test_create_message_request_error.py
new file mode 100644
index 00000000..031fe199
--- /dev/null
+++ b/test/unit/test_create_message_request_error.py
@@ -0,0 +1,63 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.create_message_request_error import CreateMessageRequestError # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestCreateMessageRequestError(unittest.TestCase):
+ """CreateMessageRequestError unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test CreateMessageRequestError
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `CreateMessageRequestError`
+ """
+ model = bandwidth.models.create_message_request_error.CreateMessageRequestError() # noqa: E501
+ if include_optional :
+ return CreateMessageRequestError(
+ type = '',
+ description = '',
+ field_errors = [
+ bandwidth.models.field_error.fieldError(
+ field_name = 'from',
+ description = ''+invalid' must be replaced with a valid E164 formatted telephone number', )
+ ]
+ )
+ else :
+ return CreateMessageRequestError(
+ type = '',
+ description = '',
+ )
+ """
+
+ def testCreateMessageRequestError(self):
+ """Test CreateMessageRequestError"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_deferred_result.py b/test/unit/test_deferred_result.py
new file mode 100644
index 00000000..e9a0fee8
--- /dev/null
+++ b/test/unit/test_deferred_result.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.deferred_result import DeferredResult # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestDeferredResult(unittest.TestCase):
+ """DeferredResult unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test DeferredResult
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `DeferredResult`
+ """
+ model = bandwidth.models.deferred_result.DeferredResult() # noqa: E501
+ if include_optional :
+ return DeferredResult(
+ result = None,
+ set_or_expired = True
+ )
+ else :
+ return DeferredResult(
+ )
+ """
+
+ def testDeferredResult(self):
+ """Test DeferredResult"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_disconnect_callback.py b/test/unit/test_disconnect_callback.py
new file mode 100644
index 00000000..7efc4c10
--- /dev/null
+++ b/test/unit/test_disconnect_callback.py
@@ -0,0 +1,71 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.disconnect_callback import DisconnectCallback # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestDisconnectCallback(unittest.TestCase):
+ """DisconnectCallback unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test DisconnectCallback
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `DisconnectCallback`
+ """
+ model = bandwidth.models.disconnect_callback.DisconnectCallback() # noqa: E501
+ if include_optional :
+ return DisconnectCallback(
+ event_type = 'bridgeComplete',
+ event_time = '2022-06-17T22:19:40.375Z',
+ account_id = '920012',
+ application_id = '04e88489-df02-4e34-a0ee-27a91849555f',
+ var_from = '+15555555555',
+ to = '+15555555555',
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ direction = 'inbound',
+ call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ enqueued_time = '2022-06-17T22:20Z',
+ start_time = '2022-06-17T22:19:40.375Z',
+ answer_time = '2022-06-17T22:20Z',
+ end_time = '2022-06-17T22:20Z',
+ cause = 'busy',
+ error_message = 'Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call',
+ error_id = '4642074b-7b58-478b-96e4-3a60955c6765',
+ tag = 'exampleTag'
+ )
+ else :
+ return DisconnectCallback(
+ )
+ """
+
+ def testDisconnectCallback(self):
+ """Test DisconnectCallback"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_diversion.py b/test/unit/test_diversion.py
new file mode 100644
index 00000000..6109e693
--- /dev/null
+++ b/test/unit/test_diversion.py
@@ -0,0 +1,61 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.diversion import Diversion # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestDiversion(unittest.TestCase):
+ """Diversion unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Diversion
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Diversion`
+ """
+ model = bandwidth.models.diversion.Diversion() # noqa: E501
+ if include_optional :
+ return Diversion(
+ reason = 'unavailable',
+ privacy = 'off',
+ screen = 'no',
+ counter = '2',
+ limit = '3',
+ unknown = 'unknownValue',
+ orig_to = '+15558884444'
+ )
+ else :
+ return Diversion(
+ )
+ """
+
+ def testDiversion(self):
+ """Test Diversion"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_dtmf_callback.py b/test/unit/test_dtmf_callback.py
new file mode 100644
index 00000000..10091a99
--- /dev/null
+++ b/test/unit/test_dtmf_callback.py
@@ -0,0 +1,71 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.dtmf_callback import DtmfCallback # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestDtmfCallback(unittest.TestCase):
+ """DtmfCallback unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test DtmfCallback
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `DtmfCallback`
+ """
+ model = bandwidth.models.dtmf_callback.DtmfCallback() # noqa: E501
+ if include_optional :
+ return DtmfCallback(
+ event_type = 'bridgeComplete',
+ event_time = '2022-06-17T22:19:40.375Z',
+ account_id = '920012',
+ application_id = '04e88489-df02-4e34-a0ee-27a91849555f',
+ var_from = '+15555555555',
+ to = '+15555555555',
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ direction = 'inbound',
+ digit = '2',
+ call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ enqueued_time = '2022-06-17T22:20Z',
+ start_time = '2022-06-17T22:19:40.375Z',
+ answer_time = '2022-06-17T22:20Z',
+ parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d',
+ transfer_caller_id = '+15555555555',
+ transfer_to = '+15555555555)',
+ tag = 'exampleTag'
+ )
+ else :
+ return DtmfCallback(
+ )
+ """
+
+ def testDtmfCallback(self):
+ """Test DtmfCallback"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_field_error.py b/test/unit/test_field_error.py
new file mode 100644
index 00000000..77e049c6
--- /dev/null
+++ b/test/unit/test_field_error.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.field_error import FieldError # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestFieldError(unittest.TestCase):
+ """FieldError unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test FieldError
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `FieldError`
+ """
+ model = bandwidth.models.field_error.FieldError() # noqa: E501
+ if include_optional :
+ return FieldError(
+ field_name = 'from',
+ description = ''+invalid' must be replaced with a valid E164 formatted telephone number'
+ )
+ else :
+ return FieldError(
+ )
+ """
+
+ def testFieldError(self):
+ """Test FieldError"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_file_format_enum.py b/test/unit/test_file_format_enum.py
new file mode 100644
index 00000000..40cf27e0
--- /dev/null
+++ b/test/unit/test_file_format_enum.py
@@ -0,0 +1,37 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.file_format_enum import FileFormatEnum # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestFileFormatEnum(unittest.TestCase):
+ """FileFormatEnum unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testFileFormatEnum(self):
+ """Test FileFormatEnum"""
+ # inst = FileFormatEnum()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_gather_callback.py b/test/unit/test_gather_callback.py
new file mode 100644
index 00000000..dae61d55
--- /dev/null
+++ b/test/unit/test_gather_callback.py
@@ -0,0 +1,72 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.gather_callback import GatherCallback # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestGatherCallback(unittest.TestCase):
+ """GatherCallback unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test GatherCallback
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `GatherCallback`
+ """
+ model = bandwidth.models.gather_callback.GatherCallback() # noqa: E501
+ if include_optional :
+ return GatherCallback(
+ event_type = 'bridgeComplete',
+ event_time = '2022-06-17T22:19:40.375Z',
+ account_id = '920012',
+ application_id = '04e88489-df02-4e34-a0ee-27a91849555f',
+ var_from = '+15555555555',
+ to = '+15555555555',
+ direction = 'inbound',
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ digits = '123',
+ call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ enqueued_time = '2022-06-17T22:20Z',
+ start_time = '2022-06-17T22:19:40.375Z',
+ answer_time = '2022-06-17T22:20Z',
+ parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d',
+ terminating_digit = '#',
+ transfer_caller_id = '+15555555555',
+ transfer_to = '+15555555555)',
+ tag = 'exampleTag'
+ )
+ else :
+ return GatherCallback(
+ )
+ """
+
+ def testGatherCallback(self):
+ """Test GatherCallback"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_inbound_message_callback.py b/test/unit/test_inbound_message_callback.py
new file mode 100644
index 00000000..d0264bc2
--- /dev/null
+++ b/test/unit/test_inbound_message_callback.py
@@ -0,0 +1,88 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.inbound_message_callback import InboundMessageCallback # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestInboundMessageCallback(unittest.TestCase):
+ """InboundMessageCallback unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test InboundMessageCallback
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `InboundMessageCallback`
+ """
+ model = bandwidth.models.inbound_message_callback.InboundMessageCallback() # noqa: E501
+ if include_optional :
+ return InboundMessageCallback(
+ time = '2016-09-14T18:20:16Z',
+ type = 'message-received',
+ to = '+15552223333',
+ description = 'Incoming message received',
+ message = bandwidth.models.inbound_message_callback_message.inboundMessageCallbackMessage(
+ id = '1661365814859loidf7mcwd4qacn7',
+ owner = '+15553332222',
+ application_id = '93de2206-9669-4e07-948d-329f4b722ee2',
+ time = '2016-09-14T18:20:16Z',
+ segment_count = 1,
+ direction = 'in',
+ 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 = 'default', )
+ )
+ else :
+ return InboundMessageCallback(
+ time = '2016-09-14T18:20:16Z',
+ type = 'message-received',
+ to = '+15552223333',
+ description = 'Incoming message received',
+ message = bandwidth.models.inbound_message_callback_message.inboundMessageCallbackMessage(
+ id = '1661365814859loidf7mcwd4qacn7',
+ owner = '+15553332222',
+ application_id = '93de2206-9669-4e07-948d-329f4b722ee2',
+ time = '2016-09-14T18:20:16Z',
+ segment_count = 1,
+ direction = 'in',
+ 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 = 'default', ),
+ )
+ """
+
+ def testInboundMessageCallback(self):
+ """Test InboundMessageCallback"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_inbound_message_callback_message.py b/test/unit/test_inbound_message_callback_message.py
new file mode 100644
index 00000000..35126e7d
--- /dev/null
+++ b/test/unit/test_inbound_message_callback_message.py
@@ -0,0 +1,75 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.inbound_message_callback_message import InboundMessageCallbackMessage # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestInboundMessageCallbackMessage(unittest.TestCase):
+ """InboundMessageCallbackMessage unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test InboundMessageCallbackMessage
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `InboundMessageCallbackMessage`
+ """
+ model = bandwidth.models.inbound_message_callback_message.InboundMessageCallbackMessage() # noqa: E501
+ if include_optional :
+ return InboundMessageCallbackMessage(
+ id = '1661365814859loidf7mcwd4qacn7',
+ owner = '+15553332222',
+ application_id = '93de2206-9669-4e07-948d-329f4b722ee2',
+ time = '2016-09-14T18:20:16Z',
+ segment_count = 1,
+ direction = 'in',
+ to = ["+15552223333"],
+ var_from = '+15553332222',
+ text = 'Hello world',
+ tag = 'custom string',
+ media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"],
+ priority = 'default'
+ )
+ else :
+ return InboundMessageCallbackMessage(
+ id = '1661365814859loidf7mcwd4qacn7',
+ owner = '+15553332222',
+ application_id = '93de2206-9669-4e07-948d-329f4b722ee2',
+ time = '2016-09-14T18:20:16Z',
+ segment_count = 1,
+ direction = 'in',
+ to = ["+15552223333"],
+ var_from = '+15553332222',
+ text = 'Hello world',
+ )
+ """
+
+ def testInboundMessageCallbackMessage(self):
+ """Test InboundMessageCallbackMessage"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_initiate_callback.py b/test/unit/test_initiate_callback.py
new file mode 100644
index 00000000..49014cae
--- /dev/null
+++ b/test/unit/test_initiate_callback.py
@@ -0,0 +1,76 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.initiate_callback import InitiateCallback # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestInitiateCallback(unittest.TestCase):
+ """InitiateCallback unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test InitiateCallback
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `InitiateCallback`
+ """
+ model = bandwidth.models.initiate_callback.InitiateCallback() # noqa: E501
+ if include_optional :
+ return InitiateCallback(
+ event_type = 'bridgeComplete',
+ event_time = '2022-06-17T22:19:40.375Z',
+ account_id = '920012',
+ application_id = '04e88489-df02-4e34-a0ee-27a91849555f',
+ var_from = '+15555555555',
+ to = '+15555555555',
+ direction = 'inbound',
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ start_time = '2022-06-17T22:19:40.375Z',
+ diversion = bandwidth.models.diversion.diversion(
+ reason = 'unavailable',
+ privacy = 'off',
+ screen = 'no',
+ counter = '2',
+ limit = '3',
+ unknown = 'unknownValue',
+ orig_to = '+15558884444', ),
+ stir_shaken = bandwidth.models.stir_shaken.stirShaken(
+ verstat = 'Tn-Verification-Passed',
+ attestation_indicator = 'A',
+ originating_id = '99759086-1335-11ed-9bcf-5f7d464e91af', )
+ )
+ else :
+ return InitiateCallback(
+ )
+ """
+
+ def testInitiateCallback(self):
+ """Test InitiateCallback"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_list_message_direction_enum.py b/test/unit/test_list_message_direction_enum.py
new file mode 100644
index 00000000..72ac6efe
--- /dev/null
+++ b/test/unit/test_list_message_direction_enum.py
@@ -0,0 +1,37 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.list_message_direction_enum import ListMessageDirectionEnum # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestListMessageDirectionEnum(unittest.TestCase):
+ """ListMessageDirectionEnum unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testListMessageDirectionEnum(self):
+ """Test ListMessageDirectionEnum"""
+ # inst = ListMessageDirectionEnum()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_list_message_item.py b/test/unit/test_list_message_item.py
new file mode 100644
index 00000000..9b549595
--- /dev/null
+++ b/test/unit/test_list_message_item.py
@@ -0,0 +1,71 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.list_message_item import ListMessageItem # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestListMessageItem(unittest.TestCase):
+ """ListMessageItem unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test ListMessageItem
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `ListMessageItem`
+ """
+ model = bandwidth.models.list_message_item.ListMessageItem() # noqa: E501
+ if include_optional :
+ return ListMessageItem(
+ message_id = '1589228074636lm4k2je7j7jklbn2',
+ account_id = '9900000',
+ source_tn = '+15554443333',
+ destination_tn = '+15554442222',
+ message_status = 'RECEIVED',
+ message_direction = 'INBOUND',
+ message_type = 'sms',
+ segment_count = 1,
+ error_code = 9902,
+ receive_time = '2020-04-07T14:03:07Z',
+ carrier_name = 'other',
+ message_size = 27,
+ message_length = 18,
+ attachment_count = 1,
+ recipient_count = 1,
+ campaign_class = 'T',
+ campaign_id = 'CJEUMDK'
+ )
+ else :
+ return ListMessageItem(
+ )
+ """
+
+ def testListMessageItem(self):
+ """Test ListMessageItem"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_lookup_request.py b/test/unit/test_lookup_request.py
new file mode 100644
index 00000000..b9d21bce
--- /dev/null
+++ b/test/unit/test_lookup_request.py
@@ -0,0 +1,60 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.lookup_request import LookupRequest # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestLookupRequest(unittest.TestCase):
+ """LookupRequest unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test LookupRequest
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `LookupRequest`
+ """
+ model = bandwidth.models.lookup_request.LookupRequest() # noqa: E501
+ if include_optional :
+ return LookupRequest(
+ tns = [
+ ''
+ ]
+ )
+ else :
+ return LookupRequest(
+ tns = [
+ ''
+ ],
+ )
+ """
+
+ def testLookupRequest(self):
+ """Test LookupRequest"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_lookup_result.py b/test/unit/test_lookup_result.py
new file mode 100644
index 00000000..38fd0a33
--- /dev/null
+++ b/test/unit/test_lookup_result.py
@@ -0,0 +1,63 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.lookup_result import LookupResult # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestLookupResult(unittest.TestCase):
+ """LookupResult unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test LookupResult
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `LookupResult`
+ """
+ model = bandwidth.models.lookup_result.LookupResult() # noqa: E501
+ if include_optional :
+ return LookupResult(
+ response_code = 0,
+ message = 'NOERROR',
+ e_164_format = '+19195551234',
+ formatted = '(919) 555-1234',
+ country = 'US',
+ line_type = 'Mobile',
+ line_provider = 'Verizon Wireless',
+ mobile_country_code = '310',
+ mobile_network_code = '010'
+ )
+ else :
+ return LookupResult(
+ )
+ """
+
+ def testLookupResult(self):
+ """Test LookupResult"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_lookup_status.py b/test/unit/test_lookup_status.py
new file mode 100644
index 00000000..8be65daf
--- /dev/null
+++ b/test/unit/test_lookup_status.py
@@ -0,0 +1,69 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.lookup_status import LookupStatus # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestLookupStatus(unittest.TestCase):
+ """LookupStatus unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test LookupStatus
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `LookupStatus`
+ """
+ model = bandwidth.models.lookup_status.LookupStatus() # noqa: E501
+ if include_optional :
+ return LookupStatus(
+ request_id = '004223a0-8b17-41b1-bf81-20732adf5590',
+ status = 'COMPLETE',
+ result = [
+ bandwidth.models.lookup_result.lookupResult(
+ response_code = 0,
+ message = 'NOERROR',
+ e/164_format = '+19195551234',
+ formatted = '(919) 555-1234',
+ country = 'US',
+ line_type = 'Mobile',
+ line_provider = 'Verizon Wireless',
+ mobile_country_code = '310',
+ mobile_network_code = '010', )
+ ],
+ failed_telephone_numbers = ["+191955512345"]
+ )
+ else :
+ return LookupStatus(
+ )
+ """
+
+ def testLookupStatus(self):
+ """Test LookupStatus"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_lookup_status_enum.py b/test/unit/test_lookup_status_enum.py
new file mode 100644
index 00000000..abb4208e
--- /dev/null
+++ b/test/unit/test_lookup_status_enum.py
@@ -0,0 +1,37 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.lookup_status_enum import LookupStatusEnum # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestLookupStatusEnum(unittest.TestCase):
+ """LookupStatusEnum unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testLookupStatusEnum(self):
+ """Test LookupStatusEnum"""
+ # inst = LookupStatusEnum()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_machine_detection_complete_callback.py b/test/unit/test_machine_detection_complete_callback.py
new file mode 100644
index 00000000..f39febb4
--- /dev/null
+++ b/test/unit/test_machine_detection_complete_callback.py
@@ -0,0 +1,70 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.machine_detection_complete_callback import MachineDetectionCompleteCallback # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestMachineDetectionCompleteCallback(unittest.TestCase):
+ """MachineDetectionCompleteCallback unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test MachineDetectionCompleteCallback
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `MachineDetectionCompleteCallback`
+ """
+ model = bandwidth.models.machine_detection_complete_callback.MachineDetectionCompleteCallback() # noqa: E501
+ if include_optional :
+ return MachineDetectionCompleteCallback(
+ event_type = 'bridgeComplete',
+ event_time = '2022-06-17T22:19:40.375Z',
+ account_id = '920012',
+ application_id = '04e88489-df02-4e34-a0ee-27a91849555f',
+ var_from = '+15555555555',
+ to = '+15555555555',
+ direction = 'inbound',
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ enqueued_time = '2022-06-17T22:20Z',
+ start_time = '2022-06-17T22:19:40.375Z',
+ answer_time = '2022-06-17T22:20Z',
+ tag = 'exampleTag',
+ machine_detection_result = bandwidth.models.machine_detection_result.machineDetectionResult(
+ value = 'answering-machine',
+ duration = 'PT4.9891287S', )
+ )
+ else :
+ return MachineDetectionCompleteCallback(
+ )
+ """
+
+ def testMachineDetectionCompleteCallback(self):
+ """Test MachineDetectionCompleteCallback"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_machine_detection_configuration.py b/test/unit/test_machine_detection_configuration.py
new file mode 100644
index 00000000..2bb49ef7
--- /dev/null
+++ b/test/unit/test_machine_detection_configuration.py
@@ -0,0 +1,69 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.machine_detection_configuration import MachineDetectionConfiguration # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestMachineDetectionConfiguration(unittest.TestCase):
+ """MachineDetectionConfiguration unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test MachineDetectionConfiguration
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `MachineDetectionConfiguration`
+ """
+ model = bandwidth.models.machine_detection_configuration.MachineDetectionConfiguration() # noqa: E501
+ if include_optional :
+ return MachineDetectionConfiguration(
+ mode = 'async',
+ detection_timeout = 15,
+ silence_timeout = 10,
+ speech_threshold = 10,
+ speech_end_threshold = 5,
+ machine_speech_end_threshold = 5,
+ delay_result = False,
+ callback_url = 'https://myServer.example/bandwidth/webhooks/machineDetectionComplete',
+ callback_method = 'POST',
+ username = 'mySecretUsername',
+ password = 'mySecretPassword1!',
+ fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/machineDetectionComplete',
+ fallback_method = 'POST',
+ fallback_username = 'mySecretUsername',
+ fallback_password = 'mySecretPassword1!'
+ )
+ else :
+ return MachineDetectionConfiguration(
+ )
+ """
+
+ def testMachineDetectionConfiguration(self):
+ """Test MachineDetectionConfiguration"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_machine_detection_mode_enum.py b/test/unit/test_machine_detection_mode_enum.py
new file mode 100644
index 00000000..78928e99
--- /dev/null
+++ b/test/unit/test_machine_detection_mode_enum.py
@@ -0,0 +1,37 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.machine_detection_mode_enum import MachineDetectionModeEnum # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestMachineDetectionModeEnum(unittest.TestCase):
+ """MachineDetectionModeEnum unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testMachineDetectionModeEnum(self):
+ """Test MachineDetectionModeEnum"""
+ # inst = MachineDetectionModeEnum()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_machine_detection_result.py b/test/unit/test_machine_detection_result.py
new file mode 100644
index 00000000..845d3360
--- /dev/null
+++ b/test/unit/test_machine_detection_result.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.machine_detection_result import MachineDetectionResult # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestMachineDetectionResult(unittest.TestCase):
+ """MachineDetectionResult unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test MachineDetectionResult
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `MachineDetectionResult`
+ """
+ model = bandwidth.models.machine_detection_result.MachineDetectionResult() # noqa: E501
+ if include_optional :
+ return MachineDetectionResult(
+ value = 'answering-machine',
+ duration = 'PT4.9891287S'
+ )
+ else :
+ return MachineDetectionResult(
+ )
+ """
+
+ def testMachineDetectionResult(self):
+ """Test MachineDetectionResult"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_media.py b/test/unit/test_media.py
new file mode 100644
index 00000000..62011240
--- /dev/null
+++ b/test/unit/test_media.py
@@ -0,0 +1,57 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.media import Media # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestMedia(unittest.TestCase):
+ """Media unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Media
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Media`
+ """
+ model = bandwidth.models.media.Media() # noqa: E501
+ if include_optional :
+ return Media(
+ content = '',
+ content_length = 56,
+ media_name = ''
+ )
+ else :
+ return Media(
+ )
+ """
+
+ def testMedia(self):
+ """Test Media"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_message.py b/test/unit/test_message.py
new file mode 100644
index 00000000..b441fda4
--- /dev/null
+++ b/test/unit/test_message.py
@@ -0,0 +1,67 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.message import Message # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestMessage(unittest.TestCase):
+ """Message unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Message
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Message`
+ """
+ model = bandwidth.models.message.Message() # noqa: E501
+ if include_optional :
+ return Message(
+ id = '1589228074636lm4k2je7j7jklbn2',
+ owner = '+15554443333',
+ application_id = '93de2206-9669-4e07-948d-329f4b722ee2',
+ time = '2022-09-14T18:20:16Z',
+ segment_count = 2,
+ direction = 'in',
+ to = ["+15552223333"],
+ var_from = '+15553332222',
+ media = ["https://dev.bandwidth.com/images/bandwidth-logo.png"],
+ text = 'Hello world',
+ tag = 'custom tag',
+ priority = 'default',
+ expiration = '2021-02-01T11:29:18-05:00'
+ )
+ else :
+ return Message(
+ )
+ """
+
+ def testMessage(self):
+ """Test Message"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_message_delivered_callback.py b/test/unit/test_message_delivered_callback.py
new file mode 100644
index 00000000..28a9f494
--- /dev/null
+++ b/test/unit/test_message_delivered_callback.py
@@ -0,0 +1,88 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.message_delivered_callback import MessageDeliveredCallback # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestMessageDeliveredCallback(unittest.TestCase):
+ """MessageDeliveredCallback unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test MessageDeliveredCallback
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `MessageDeliveredCallback`
+ """
+ model = bandwidth.models.message_delivered_callback.MessageDeliveredCallback() # noqa: E501
+ if include_optional :
+ return MessageDeliveredCallback(
+ time = '2016-09-14T18:20:16Z',
+ type = 'message-delivered',
+ to = '+15552223333',
+ description = 'Message delivered to carrier.',
+ message = bandwidth.models.message_delivered_callback_message.messageDeliveredCallbackMessage(
+ id = '1661365814859loidf7mcwd4qacn7',
+ owner = '+15553332222',
+ application_id = '93de2206-9669-4e07-948d-329f4b722ee2',
+ time = '2016-09-14T18:20:16Z',
+ segment_count = 1,
+ direction = 'in',
+ 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 = 'default', )
+ )
+ else :
+ return MessageDeliveredCallback(
+ time = '2016-09-14T18:20:16Z',
+ type = 'message-delivered',
+ to = '+15552223333',
+ description = 'Message delivered to carrier.',
+ message = bandwidth.models.message_delivered_callback_message.messageDeliveredCallbackMessage(
+ id = '1661365814859loidf7mcwd4qacn7',
+ owner = '+15553332222',
+ application_id = '93de2206-9669-4e07-948d-329f4b722ee2',
+ time = '2016-09-14T18:20:16Z',
+ segment_count = 1,
+ direction = 'in',
+ 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 = 'default', ),
+ )
+ """
+
+ def testMessageDeliveredCallback(self):
+ """Test MessageDeliveredCallback"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_message_delivered_callback_message.py b/test/unit/test_message_delivered_callback_message.py
new file mode 100644
index 00000000..b7b31569
--- /dev/null
+++ b/test/unit/test_message_delivered_callback_message.py
@@ -0,0 +1,76 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.message_delivered_callback_message import MessageDeliveredCallbackMessage # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestMessageDeliveredCallbackMessage(unittest.TestCase):
+ """MessageDeliveredCallbackMessage unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test MessageDeliveredCallbackMessage
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `MessageDeliveredCallbackMessage`
+ """
+ model = bandwidth.models.message_delivered_callback_message.MessageDeliveredCallbackMessage() # noqa: E501
+ if include_optional :
+ return MessageDeliveredCallbackMessage(
+ id = '1661365814859loidf7mcwd4qacn7',
+ owner = '+15553332222',
+ application_id = '93de2206-9669-4e07-948d-329f4b722ee2',
+ time = '2016-09-14T18:20:16Z',
+ segment_count = 1,
+ direction = 'in',
+ to = ["+15552223333"],
+ var_from = '+15553332222',
+ text = 'Hello world',
+ tag = 'custom string',
+ media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"],
+ priority = 'default'
+ )
+ else :
+ return MessageDeliveredCallbackMessage(
+ id = '1661365814859loidf7mcwd4qacn7',
+ owner = '+15553332222',
+ application_id = '93de2206-9669-4e07-948d-329f4b722ee2',
+ time = '2016-09-14T18:20:16Z',
+ segment_count = 1,
+ direction = 'in',
+ to = ["+15552223333"],
+ var_from = '+15553332222',
+ text = 'Hello world',
+ tag = 'custom string',
+ )
+ """
+
+ def testMessageDeliveredCallbackMessage(self):
+ """Test MessageDeliveredCallbackMessage"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_message_direction_enum.py b/test/unit/test_message_direction_enum.py
new file mode 100644
index 00000000..d29a5719
--- /dev/null
+++ b/test/unit/test_message_direction_enum.py
@@ -0,0 +1,37 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.message_direction_enum import MessageDirectionEnum # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestMessageDirectionEnum(unittest.TestCase):
+ """MessageDirectionEnum unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testMessageDirectionEnum(self):
+ """Test MessageDirectionEnum"""
+ # inst = MessageDirectionEnum()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_message_failed_callback.py b/test/unit/test_message_failed_callback.py
new file mode 100644
index 00000000..08699c8b
--- /dev/null
+++ b/test/unit/test_message_failed_callback.py
@@ -0,0 +1,90 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.message_failed_callback import MessageFailedCallback # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestMessageFailedCallback(unittest.TestCase):
+ """MessageFailedCallback unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test MessageFailedCallback
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `MessageFailedCallback`
+ """
+ model = bandwidth.models.message_failed_callback.MessageFailedCallback() # noqa: E501
+ if include_optional :
+ return MessageFailedCallback(
+ time = '2016-09-14T18:20:16Z',
+ type = 'message-failed',
+ to = '+15552223333',
+ description = 'rejected-unallocated-from-number',
+ message = bandwidth.models.message_failed_callback_message.messageFailedCallbackMessage(
+ id = '1661365814859loidf7mcwd4qacn7',
+ owner = '+15553332222',
+ application_id = '93de2206-9669-4e07-948d-329f4b722ee2',
+ time = '2016-09-14T18:20:16Z',
+ segment_count = 1,
+ direction = 'in',
+ 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 = 'default', ),
+ error_code = 9902
+ )
+ else :
+ return MessageFailedCallback(
+ time = '2016-09-14T18:20:16Z',
+ type = 'message-failed',
+ to = '+15552223333',
+ description = 'rejected-unallocated-from-number',
+ message = bandwidth.models.message_failed_callback_message.messageFailedCallbackMessage(
+ id = '1661365814859loidf7mcwd4qacn7',
+ owner = '+15553332222',
+ application_id = '93de2206-9669-4e07-948d-329f4b722ee2',
+ time = '2016-09-14T18:20:16Z',
+ segment_count = 1,
+ direction = 'in',
+ 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 = 'default', ),
+ error_code = 9902,
+ )
+ """
+
+ def testMessageFailedCallback(self):
+ """Test MessageFailedCallback"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_message_failed_callback_message.py b/test/unit/test_message_failed_callback_message.py
new file mode 100644
index 00000000..71c42fb5
--- /dev/null
+++ b/test/unit/test_message_failed_callback_message.py
@@ -0,0 +1,77 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.message_failed_callback_message import MessageFailedCallbackMessage # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestMessageFailedCallbackMessage(unittest.TestCase):
+ """MessageFailedCallbackMessage unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test MessageFailedCallbackMessage
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `MessageFailedCallbackMessage`
+ """
+ model = bandwidth.models.message_failed_callback_message.MessageFailedCallbackMessage() # noqa: E501
+ if include_optional :
+ return MessageFailedCallbackMessage(
+ id = '1661365814859loidf7mcwd4qacn7',
+ owner = '+15553332222',
+ application_id = '93de2206-9669-4e07-948d-329f4b722ee2',
+ time = '2016-09-14T18:20:16Z',
+ segment_count = 1,
+ direction = 'in',
+ to = ["+15552223333"],
+ var_from = '+15553332222',
+ text = 'Hello world',
+ tag = 'custom string',
+ media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"],
+ priority = 'default'
+ )
+ else :
+ return MessageFailedCallbackMessage(
+ id = '1661365814859loidf7mcwd4qacn7',
+ owner = '+15553332222',
+ application_id = '93de2206-9669-4e07-948d-329f4b722ee2',
+ time = '2016-09-14T18:20:16Z',
+ segment_count = 1,
+ direction = 'in',
+ to = ["+15552223333"],
+ var_from = '+15553332222',
+ text = 'Hello world',
+ tag = 'custom string',
+ priority = 'default',
+ )
+ """
+
+ def testMessageFailedCallbackMessage(self):
+ """Test MessageFailedCallbackMessage"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_message_request.py b/test/unit/test_message_request.py
new file mode 100644
index 00000000..950d437a
--- /dev/null
+++ b/test/unit/test_message_request.py
@@ -0,0 +1,65 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.message_request import MessageRequest # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestMessageRequest(unittest.TestCase):
+ """MessageRequest unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test MessageRequest
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `MessageRequest`
+ """
+ model = bandwidth.models.message_request.MessageRequest() # noqa: E501
+ if include_optional :
+ return MessageRequest(
+ application_id = '93de2206-9669-4e07-948d-329f4b722ee2',
+ to = ["+15554443333","+15552223333"],
+ var_from = '+15551113333',
+ text = 'Hello world',
+ media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"],
+ tag = 'custom string',
+ priority = 'default',
+ expiration = '2021-02-01T11:29:18-05:00'
+ )
+ else :
+ return MessageRequest(
+ application_id = '93de2206-9669-4e07-948d-329f4b722ee2',
+ to = ["+15554443333","+15552223333"],
+ var_from = '+15551113333',
+ )
+ """
+
+ def testMessageRequest(self):
+ """Test MessageRequest"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_message_sending_callback.py b/test/unit/test_message_sending_callback.py
new file mode 100644
index 00000000..b2ab77f3
--- /dev/null
+++ b/test/unit/test_message_sending_callback.py
@@ -0,0 +1,88 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.message_sending_callback import MessageSendingCallback # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestMessageSendingCallback(unittest.TestCase):
+ """MessageSendingCallback unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test MessageSendingCallback
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `MessageSendingCallback`
+ """
+ model = bandwidth.models.message_sending_callback.MessageSendingCallback() # noqa: E501
+ if include_optional :
+ return MessageSendingCallback(
+ time = '2016-09-14T18:20:16Z',
+ type = 'message-sending',
+ to = '+15552223333',
+ description = 'Message is sending to carrier',
+ message = bandwidth.models.message_sending_callback_message.messageSendingCallbackMessage(
+ id = '1661365814859loidf7mcwd4qacn7',
+ owner = '+15553332222',
+ application_id = '93de2206-9669-4e07-948d-329f4b722ee2',
+ time = '2016-09-14T18:20:16Z',
+ segment_count = 1,
+ direction = 'in',
+ 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 = 'default', )
+ )
+ else :
+ return MessageSendingCallback(
+ time = '2016-09-14T18:20:16Z',
+ type = 'message-sending',
+ to = '+15552223333',
+ description = 'Message is sending to carrier',
+ message = bandwidth.models.message_sending_callback_message.messageSendingCallbackMessage(
+ id = '1661365814859loidf7mcwd4qacn7',
+ owner = '+15553332222',
+ application_id = '93de2206-9669-4e07-948d-329f4b722ee2',
+ time = '2016-09-14T18:20:16Z',
+ segment_count = 1,
+ direction = 'in',
+ 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 = 'default', ),
+ )
+ """
+
+ def testMessageSendingCallback(self):
+ """Test MessageSendingCallback"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_message_sending_callback_message.py b/test/unit/test_message_sending_callback_message.py
new file mode 100644
index 00000000..9899720f
--- /dev/null
+++ b/test/unit/test_message_sending_callback_message.py
@@ -0,0 +1,77 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.message_sending_callback_message import MessageSendingCallbackMessage # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestMessageSendingCallbackMessage(unittest.TestCase):
+ """MessageSendingCallbackMessage unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test MessageSendingCallbackMessage
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `MessageSendingCallbackMessage`
+ """
+ model = bandwidth.models.message_sending_callback_message.MessageSendingCallbackMessage() # noqa: E501
+ if include_optional :
+ return MessageSendingCallbackMessage(
+ id = '1661365814859loidf7mcwd4qacn7',
+ owner = '+15553332222',
+ application_id = '93de2206-9669-4e07-948d-329f4b722ee2',
+ time = '2016-09-14T18:20:16Z',
+ segment_count = 1,
+ direction = 'in',
+ to = ["+15552223333"],
+ var_from = '+15553332222',
+ text = 'Hello world',
+ tag = 'custom string',
+ media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"],
+ priority = 'default'
+ )
+ else :
+ return MessageSendingCallbackMessage(
+ id = '1661365814859loidf7mcwd4qacn7',
+ owner = '+15553332222',
+ application_id = '93de2206-9669-4e07-948d-329f4b722ee2',
+ time = '2016-09-14T18:20:16Z',
+ segment_count = 1,
+ direction = 'in',
+ to = ["+15552223333"],
+ var_from = '+15553332222',
+ text = 'Hello world',
+ media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"],
+ priority = 'default',
+ )
+ """
+
+ def testMessageSendingCallbackMessage(self):
+ """Test MessageSendingCallbackMessage"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_message_status_enum.py b/test/unit/test_message_status_enum.py
new file mode 100644
index 00000000..91d85764
--- /dev/null
+++ b/test/unit/test_message_status_enum.py
@@ -0,0 +1,37 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.message_status_enum import MessageStatusEnum # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestMessageStatusEnum(unittest.TestCase):
+ """MessageStatusEnum unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testMessageStatusEnum(self):
+ """Test MessageStatusEnum"""
+ # inst = MessageStatusEnum()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_message_type_enum.py b/test/unit/test_message_type_enum.py
new file mode 100644
index 00000000..05699d58
--- /dev/null
+++ b/test/unit/test_message_type_enum.py
@@ -0,0 +1,37 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.message_type_enum import MessageTypeEnum # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestMessageTypeEnum(unittest.TestCase):
+ """MessageTypeEnum unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testMessageTypeEnum(self):
+ """Test MessageTypeEnum"""
+ # inst = MessageTypeEnum()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_messages_list.py b/test/unit/test_messages_list.py
new file mode 100644
index 00000000..f2a556db
--- /dev/null
+++ b/test/unit/test_messages_list.py
@@ -0,0 +1,80 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.messages_list import MessagesList # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestMessagesList(unittest.TestCase):
+ """MessagesList unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test MessagesList
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `MessagesList`
+ """
+ model = bandwidth.models.messages_list.MessagesList() # noqa: E501
+ if include_optional :
+ return MessagesList(
+ total_count = 100,
+ page_info = bandwidth.models.page_info.PageInfo(
+ prev_page = 'https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&nextPage=DLAPE902',
+ next_page = 'https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&prevPage=GL83PD3C',
+ prev_page_token = 'DLAPE902',
+ next_page_token = 'GL83PD3C', ),
+ messages = [
+ bandwidth.models.list_message_item.listMessageItem(
+ message_id = '1589228074636lm4k2je7j7jklbn2',
+ account_id = '9900000',
+ source_tn = '+15554443333',
+ destination_tn = '+15554442222',
+ message_status = 'RECEIVED',
+ message_direction = 'INBOUND',
+ message_type = 'sms',
+ segment_count = 1,
+ error_code = 9902,
+ receive_time = '2020-04-07T14:03:07Z',
+ carrier_name = 'other',
+ message_size = 27,
+ message_length = 18,
+ attachment_count = 1,
+ recipient_count = 1,
+ campaign_class = 'T',
+ campaign_id = 'CJEUMDK', )
+ ]
+ )
+ else :
+ return MessagesList(
+ )
+ """
+
+ def testMessagesList(self):
+ """Test MessagesList"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_messaging_code_response.py b/test/unit/test_messaging_code_response.py
new file mode 100644
index 00000000..53578365
--- /dev/null
+++ b/test/unit/test_messaging_code_response.py
@@ -0,0 +1,55 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.messaging_code_response import MessagingCodeResponse # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestMessagingCodeResponse(unittest.TestCase):
+ """MessagingCodeResponse unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test MessagingCodeResponse
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `MessagingCodeResponse`
+ """
+ model = bandwidth.models.messaging_code_response.MessagingCodeResponse() # noqa: E501
+ if include_optional :
+ return MessagingCodeResponse(
+ message_id = '9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6'
+ )
+ else :
+ return MessagingCodeResponse(
+ )
+ """
+
+ def testMessagingCodeResponse(self):
+ """Test MessagingCodeResponse"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_messaging_request_error.py b/test/unit/test_messaging_request_error.py
new file mode 100644
index 00000000..ec14fc51
--- /dev/null
+++ b/test/unit/test_messaging_request_error.py
@@ -0,0 +1,58 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.messaging_request_error import MessagingRequestError # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestMessagingRequestError(unittest.TestCase):
+ """MessagingRequestError unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test MessagingRequestError
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `MessagingRequestError`
+ """
+ model = bandwidth.models.messaging_request_error.MessagingRequestError() # noqa: E501
+ if include_optional :
+ return MessagingRequestError(
+ type = '',
+ description = ''
+ )
+ else :
+ return MessagingRequestError(
+ type = '',
+ description = '',
+ )
+ """
+
+ def testMessagingRequestError(self):
+ """Test MessagingRequestError"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_mfa_forbidden_request_error.py b/test/unit/test_mfa_forbidden_request_error.py
new file mode 100644
index 00000000..5a754be2
--- /dev/null
+++ b/test/unit/test_mfa_forbidden_request_error.py
@@ -0,0 +1,55 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.mfa_forbidden_request_error import MfaForbiddenRequestError # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestMfaForbiddenRequestError(unittest.TestCase):
+ """MfaForbiddenRequestError unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test MfaForbiddenRequestError
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `MfaForbiddenRequestError`
+ """
+ model = bandwidth.models.mfa_forbidden_request_error.MfaForbiddenRequestError() # noqa: E501
+ if include_optional :
+ return MfaForbiddenRequestError(
+ message = 'Missing Authentication Token'
+ )
+ else :
+ return MfaForbiddenRequestError(
+ )
+ """
+
+ def testMfaForbiddenRequestError(self):
+ """Test MfaForbiddenRequestError"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_mfa_request_error.py b/test/unit/test_mfa_request_error.py
new file mode 100644
index 00000000..2e5423b9
--- /dev/null
+++ b/test/unit/test_mfa_request_error.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.mfa_request_error import MfaRequestError # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestMfaRequestError(unittest.TestCase):
+ """MfaRequestError unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test MfaRequestError
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `MfaRequestError`
+ """
+ model = bandwidth.models.mfa_request_error.MfaRequestError() # noqa: E501
+ if include_optional :
+ return MfaRequestError(
+ error = '400 Request is malformed or invalid',
+ request_id = '354cc8a3-6701-461e-8fa7-8671703dd898'
+ )
+ else :
+ return MfaRequestError(
+ )
+ """
+
+ def testMfaRequestError(self):
+ """Test MfaRequestError"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_mfa_unauthorized_request_error.py b/test/unit/test_mfa_unauthorized_request_error.py
new file mode 100644
index 00000000..c6e719ce
--- /dev/null
+++ b/test/unit/test_mfa_unauthorized_request_error.py
@@ -0,0 +1,55 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.mfa_unauthorized_request_error import MfaUnauthorizedRequestError # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestMfaUnauthorizedRequestError(unittest.TestCase):
+ """MfaUnauthorizedRequestError unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test MfaUnauthorizedRequestError
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `MfaUnauthorizedRequestError`
+ """
+ model = bandwidth.models.mfa_unauthorized_request_error.MfaUnauthorizedRequestError() # noqa: E501
+ if include_optional :
+ return MfaUnauthorizedRequestError(
+ message = 'Unauthorized'
+ )
+ else :
+ return MfaUnauthorizedRequestError(
+ )
+ """
+
+ def testMfaUnauthorizedRequestError(self):
+ """Test MfaUnauthorizedRequestError"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_page_info.py b/test/unit/test_page_info.py
new file mode 100644
index 00000000..07dc573a
--- /dev/null
+++ b/test/unit/test_page_info.py
@@ -0,0 +1,58 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.page_info import PageInfo # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestPageInfo(unittest.TestCase):
+ """PageInfo unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test PageInfo
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `PageInfo`
+ """
+ model = bandwidth.models.page_info.PageInfo() # noqa: E501
+ if include_optional :
+ return PageInfo(
+ prev_page = 'https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&nextPage=DLAPE902',
+ next_page = 'https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&prevPage=GL83PD3C',
+ prev_page_token = 'DLAPE902',
+ next_page_token = 'GL83PD3C'
+ )
+ else :
+ return PageInfo(
+ )
+ """
+
+ def testPageInfo(self):
+ """Test PageInfo"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_priority_enum.py b/test/unit/test_priority_enum.py
new file mode 100644
index 00000000..6111bb1d
--- /dev/null
+++ b/test/unit/test_priority_enum.py
@@ -0,0 +1,37 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.priority_enum import PriorityEnum # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestPriorityEnum(unittest.TestCase):
+ """PriorityEnum unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testPriorityEnum(self):
+ """Test PriorityEnum"""
+ # inst = PriorityEnum()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_recording_available_callback.py b/test/unit/test_recording_available_callback.py
new file mode 100644
index 00000000..09bc1902
--- /dev/null
+++ b/test/unit/test_recording_available_callback.py
@@ -0,0 +1,76 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.recording_available_callback import RecordingAvailableCallback # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestRecordingAvailableCallback(unittest.TestCase):
+ """RecordingAvailableCallback unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test RecordingAvailableCallback
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `RecordingAvailableCallback`
+ """
+ model = bandwidth.models.recording_available_callback.RecordingAvailableCallback() # noqa: E501
+ if include_optional :
+ return RecordingAvailableCallback(
+ event_type = 'bridgeComplete',
+ event_time = '2022-06-17T22:19:40.375Z',
+ account_id = '920012',
+ application_id = '04e88489-df02-4e34-a0ee-27a91849555f',
+ var_from = '+15555555555',
+ to = '+15555555555',
+ direction = 'inbound',
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d',
+ recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833',
+ media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media',
+ enqueued_time = '2022-06-17T22:20Z',
+ start_time = '2022-06-17T22:19:40.375Z',
+ end_time = '2022-06-17T22:20Z',
+ duration = 'PT13.67S',
+ file_format = 'wav',
+ channels = 'completed',
+ tag = 'exampleTag',
+ status = 'completed',
+ transfer_caller_id = '+15555555555',
+ transfer_to = '+15555555555)'
+ )
+ else :
+ return RecordingAvailableCallback(
+ )
+ """
+
+ def testRecordingAvailableCallback(self):
+ """Test RecordingAvailableCallback"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_recording_complete_callback.py b/test/unit/test_recording_complete_callback.py
new file mode 100644
index 00000000..c8a4c403
--- /dev/null
+++ b/test/unit/test_recording_complete_callback.py
@@ -0,0 +1,76 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.recording_complete_callback import RecordingCompleteCallback # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestRecordingCompleteCallback(unittest.TestCase):
+ """RecordingCompleteCallback unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test RecordingCompleteCallback
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `RecordingCompleteCallback`
+ """
+ model = bandwidth.models.recording_complete_callback.RecordingCompleteCallback() # noqa: E501
+ if include_optional :
+ return RecordingCompleteCallback(
+ event_type = 'bridgeComplete',
+ event_time = '2022-06-17T22:19:40.375Z',
+ account_id = '920012',
+ application_id = '04e88489-df02-4e34-a0ee-27a91849555f',
+ var_from = '+15555555555',
+ to = '+15555555555',
+ direction = 'inbound',
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d',
+ recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833',
+ media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media',
+ enqueued_time = '2022-06-17T22:20Z',
+ start_time = '2022-06-17T22:19:40.375Z',
+ answer_time = '2022-06-17T22:20Z',
+ end_time = '2022-06-17T22:20Z',
+ duration = 'PT13.67S',
+ file_format = 'wav',
+ channels = 1,
+ tag = 'exampleTag',
+ transfer_caller_id = '+15555555555',
+ transfer_to = '+15555555555)'
+ )
+ else :
+ return RecordingCompleteCallback(
+ )
+ """
+
+ def testRecordingCompleteCallback(self):
+ """Test RecordingCompleteCallback"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_recording_state_enum.py b/test/unit/test_recording_state_enum.py
new file mode 100644
index 00000000..de388697
--- /dev/null
+++ b/test/unit/test_recording_state_enum.py
@@ -0,0 +1,37 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.recording_state_enum import RecordingStateEnum # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestRecordingStateEnum(unittest.TestCase):
+ """RecordingStateEnum unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testRecordingStateEnum(self):
+ """Test RecordingStateEnum"""
+ # inst = RecordingStateEnum()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_redirect_callback.py b/test/unit/test_redirect_callback.py
new file mode 100644
index 00000000..83df0c06
--- /dev/null
+++ b/test/unit/test_redirect_callback.py
@@ -0,0 +1,70 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.redirect_callback import RedirectCallback # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestRedirectCallback(unittest.TestCase):
+ """RedirectCallback unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test RedirectCallback
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `RedirectCallback`
+ """
+ model = bandwidth.models.redirect_callback.RedirectCallback() # noqa: E501
+ if include_optional :
+ return RedirectCallback(
+ event_type = 'bridgeComplete',
+ event_time = '2022-06-17T22:19:40.375Z',
+ account_id = '920012',
+ application_id = '04e88489-df02-4e34-a0ee-27a91849555f',
+ var_from = '+15555555555',
+ to = '+15555555555',
+ direction = 'inbound',
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d',
+ enqueued_time = '2022-06-17T22:20Z',
+ start_time = '2022-06-17T22:19:40.375Z',
+ answer_time = '2022-06-17T22:20Z',
+ tag = 'exampleTag',
+ transfer_caller_id = '+15555555555',
+ transfer_to = '+15555555555)'
+ )
+ else :
+ return RedirectCallback(
+ )
+ """
+
+ def testRedirectCallback(self):
+ """Test RedirectCallback"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_redirect_method_enum.py b/test/unit/test_redirect_method_enum.py
new file mode 100644
index 00000000..b1908a31
--- /dev/null
+++ b/test/unit/test_redirect_method_enum.py
@@ -0,0 +1,37 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.redirect_method_enum import RedirectMethodEnum # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestRedirectMethodEnum(unittest.TestCase):
+ """RedirectMethodEnum unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testRedirectMethodEnum(self):
+ """Test RedirectMethodEnum"""
+ # inst = RedirectMethodEnum()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_statistics_api.py b/test/unit/test_statistics_api.py
new file mode 100644
index 00000000..103f3da2
--- /dev/null
+++ b/test/unit/test_statistics_api.py
@@ -0,0 +1,41 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+import bandwidth
+from bandwidth.api.statistics_api import StatisticsApi # noqa: E501
+from bandwidth.rest import ApiException
+
+
+class TestStatisticsApi(unittest.TestCase):
+ """StatisticsApi unit test stubs"""
+
+ def setUp(self):
+ self.api = bandwidth.api.statistics_api.StatisticsApi() # noqa: E501
+
+ def tearDown(self):
+ pass
+
+ def test_get_statistics(self):
+ """Test case for get_statistics
+
+ Get Account Statistics # noqa: E501
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_stir_shaken.py b/test/unit/test_stir_shaken.py
new file mode 100644
index 00000000..17fff122
--- /dev/null
+++ b/test/unit/test_stir_shaken.py
@@ -0,0 +1,57 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.stir_shaken import StirShaken # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestStirShaken(unittest.TestCase):
+ """StirShaken unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test StirShaken
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `StirShaken`
+ """
+ model = bandwidth.models.stir_shaken.StirShaken() # noqa: E501
+ if include_optional :
+ return StirShaken(
+ verstat = 'Tn-Verification-Passed',
+ attestation_indicator = 'A',
+ originating_id = '99759086-1335-11ed-9bcf-5f7d464e91af'
+ )
+ else :
+ return StirShaken(
+ )
+ """
+
+ def testStirShaken(self):
+ """Test StirShaken"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_tag.py b/test/unit/test_tag.py
new file mode 100644
index 00000000..c773cad7
--- /dev/null
+++ b/test/unit/test_tag.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.tag import Tag # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestTag(unittest.TestCase):
+ """Tag unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Tag
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Tag`
+ """
+ model = bandwidth.models.tag.Tag() # noqa: E501
+ if include_optional :
+ return Tag(
+ key = '',
+ value = ''
+ )
+ else :
+ return Tag(
+ )
+ """
+
+ def testTag(self):
+ """Test Tag"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_tn_lookup_request_error.py b/test/unit/test_tn_lookup_request_error.py
new file mode 100644
index 00000000..ae62fa79
--- /dev/null
+++ b/test/unit/test_tn_lookup_request_error.py
@@ -0,0 +1,55 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.tn_lookup_request_error import TnLookupRequestError # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestTnLookupRequestError(unittest.TestCase):
+ """TnLookupRequestError unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test TnLookupRequestError
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `TnLookupRequestError`
+ """
+ model = bandwidth.models.tn_lookup_request_error.TnLookupRequestError() # noqa: E501
+ if include_optional :
+ return TnLookupRequestError(
+ message = 'example error message'
+ )
+ else :
+ return TnLookupRequestError(
+ )
+ """
+
+ def testTnLookupRequestError(self):
+ """Test TnLookupRequestError"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_transcribe_recording.py b/test/unit/test_transcribe_recording.py
new file mode 100644
index 00000000..6bc69901
--- /dev/null
+++ b/test/unit/test_transcribe_recording.py
@@ -0,0 +1,61 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.transcribe_recording import TranscribeRecording # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestTranscribeRecording(unittest.TestCase):
+ """TranscribeRecording unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test TranscribeRecording
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `TranscribeRecording`
+ """
+ model = bandwidth.models.transcribe_recording.TranscribeRecording() # noqa: E501
+ if include_optional :
+ return TranscribeRecording(
+ callback_url = 'https://myServer.example/bandwidth/webhooks/transcriptionAvailable',
+ callback_method = 'POST',
+ username = 'mySecretUsername',
+ password = 'mySecretPassword1!',
+ tag = 'exampleTag',
+ callback_timeout = 5.5,
+ detect_language = True
+ )
+ else :
+ return TranscribeRecording(
+ )
+ """
+
+ def testTranscribeRecording(self):
+ """Test TranscribeRecording"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_transcription.py b/test/unit/test_transcription.py
new file mode 100644
index 00000000..0913bc68
--- /dev/null
+++ b/test/unit/test_transcription.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.transcription import Transcription # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestTranscription(unittest.TestCase):
+ """Transcription unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test Transcription
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Transcription`
+ """
+ model = bandwidth.models.transcription.Transcription() # noqa: E501
+ if include_optional :
+ return Transcription(
+ text = 'Nice talking to you, friend!',
+ confidence = 0.9
+ )
+ else :
+ return Transcription(
+ )
+ """
+
+ def testTranscription(self):
+ """Test Transcription"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_transcription_available_callback.py b/test/unit/test_transcription_available_callback.py
new file mode 100644
index 00000000..2cd8ea3e
--- /dev/null
+++ b/test/unit/test_transcription_available_callback.py
@@ -0,0 +1,77 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.transcription_available_callback import TranscriptionAvailableCallback # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestTranscriptionAvailableCallback(unittest.TestCase):
+ """TranscriptionAvailableCallback unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test TranscriptionAvailableCallback
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `TranscriptionAvailableCallback`
+ """
+ model = bandwidth.models.transcription_available_callback.TranscriptionAvailableCallback() # noqa: E501
+ if include_optional :
+ return TranscriptionAvailableCallback(
+ event_type = 'bridgeComplete',
+ event_time = '2022-06-17T22:19:40.375Z',
+ account_id = '920012',
+ application_id = '04e88489-df02-4e34-a0ee-27a91849555f',
+ var_from = '+15555555555',
+ to = '+15555555555',
+ direction = 'inbound',
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ media_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media',
+ parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d',
+ recording_id = 'r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833',
+ enqueued_time = '2022-06-17T22:20Z',
+ start_time = '2022-06-17T22:19:40.375Z',
+ end_time = '2022-06-17T22:20Z',
+ duration = 'PT13.67S',
+ file_format = 'wav',
+ tag = 'exampleTag',
+ transcription = bandwidth.models.transcription.transcription(
+ text = 'Nice talking to you, friend!',
+ confidence = 0.9, ),
+ transfer_caller_id = '+15555555555',
+ transfer_to = '+15555555555)'
+ )
+ else :
+ return TranscriptionAvailableCallback(
+ )
+ """
+
+ def testTranscriptionAvailableCallback(self):
+ """Test TranscriptionAvailableCallback"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_transcription_list.py b/test/unit/test_transcription_list.py
new file mode 100644
index 00000000..cba18c12
--- /dev/null
+++ b/test/unit/test_transcription_list.py
@@ -0,0 +1,59 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.transcription_list import TranscriptionList # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestTranscriptionList(unittest.TestCase):
+ """TranscriptionList unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test TranscriptionList
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `TranscriptionList`
+ """
+ model = bandwidth.models.transcription_list.TranscriptionList() # noqa: E501
+ if include_optional :
+ return TranscriptionList(
+ transcripts = [
+ bandwidth.models.transcription.transcription(
+ text = 'Nice talking to you, friend!',
+ confidence = 0.9, )
+ ]
+ )
+ else :
+ return TranscriptionList(
+ )
+ """
+
+ def testTranscriptionList(self):
+ """Test TranscriptionList"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_transcription_metadata.py b/test/unit/test_transcription_metadata.py
new file mode 100644
index 00000000..721ecb71
--- /dev/null
+++ b/test/unit/test_transcription_metadata.py
@@ -0,0 +1,58 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.transcription_metadata import TranscriptionMetadata # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestTranscriptionMetadata(unittest.TestCase):
+ """TranscriptionMetadata unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test TranscriptionMetadata
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `TranscriptionMetadata`
+ """
+ model = bandwidth.models.transcription_metadata.TranscriptionMetadata() # noqa: E501
+ if include_optional :
+ return TranscriptionMetadata(
+ id = 't-387bd648-18f3-4823-9d16-746bca0003c9',
+ status = 'completed',
+ completed_time = '2022-06-13T18:46:29.715Z',
+ url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/recordings/r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/transcription'
+ )
+ else :
+ return TranscriptionMetadata(
+ )
+ """
+
+ def testTranscriptionMetadata(self):
+ """Test TranscriptionMetadata"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_transfer_answer_callback.py b/test/unit/test_transfer_answer_callback.py
new file mode 100644
index 00000000..b010211f
--- /dev/null
+++ b/test/unit/test_transfer_answer_callback.py
@@ -0,0 +1,69 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.transfer_answer_callback import TransferAnswerCallback # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestTransferAnswerCallback(unittest.TestCase):
+ """TransferAnswerCallback unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test TransferAnswerCallback
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `TransferAnswerCallback`
+ """
+ model = bandwidth.models.transfer_answer_callback.TransferAnswerCallback() # noqa: E501
+ if include_optional :
+ return TransferAnswerCallback(
+ event_type = 'bridgeComplete',
+ event_time = '2022-06-17T22:19:40.375Z',
+ account_id = '920012',
+ application_id = '04e88489-df02-4e34-a0ee-27a91849555f',
+ var_from = '+15555555555',
+ to = '+15555555555',
+ direction = 'inbound',
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ enqueued_time = '2022-06-17T22:20Z',
+ start_time = '2022-06-17T22:19:40.375Z',
+ answer_time = '2022-06-17T22:20Z',
+ tag = 'exampleTag',
+ transfer_caller_id = '+15555555555',
+ transfer_to = '+15555555555)'
+ )
+ else :
+ return TransferAnswerCallback(
+ )
+ """
+
+ def testTransferAnswerCallback(self):
+ """Test TransferAnswerCallback"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_transfer_complete_callback.py b/test/unit/test_transfer_complete_callback.py
new file mode 100644
index 00000000..70dab471
--- /dev/null
+++ b/test/unit/test_transfer_complete_callback.py
@@ -0,0 +1,72 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.transfer_complete_callback import TransferCompleteCallback # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestTransferCompleteCallback(unittest.TestCase):
+ """TransferCompleteCallback unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test TransferCompleteCallback
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `TransferCompleteCallback`
+ """
+ model = bandwidth.models.transfer_complete_callback.TransferCompleteCallback() # noqa: E501
+ if include_optional :
+ return TransferCompleteCallback(
+ event_type = 'bridgeComplete',
+ event_time = '2022-06-17T22:19:40.375Z',
+ account_id = '920012',
+ application_id = '04e88489-df02-4e34-a0ee-27a91849555f',
+ var_from = '+15555555555',
+ to = '+15555555555',
+ direction = 'inbound',
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ enqueued_time = '2022-06-17T22:20Z',
+ start_time = '2022-06-17T22:19:40.375Z',
+ answer_time = '2022-06-17T22:20Z',
+ tag = 'exampleTag',
+ transfer_caller_id = '+15555555555',
+ transfer_to = '+15555555555)',
+ cause = 'busy',
+ error_message = 'Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call',
+ error_id = '4642074b-7b58-478b-96e4-3a60955c6765'
+ )
+ else :
+ return TransferCompleteCallback(
+ )
+ """
+
+ def testTransferCompleteCallback(self):
+ """Test TransferCompleteCallback"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_transfer_disconnect_callback.py b/test/unit/test_transfer_disconnect_callback.py
new file mode 100644
index 00000000..5fcf35d6
--- /dev/null
+++ b/test/unit/test_transfer_disconnect_callback.py
@@ -0,0 +1,74 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.transfer_disconnect_callback import TransferDisconnectCallback # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestTransferDisconnectCallback(unittest.TestCase):
+ """TransferDisconnectCallback unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test TransferDisconnectCallback
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `TransferDisconnectCallback`
+ """
+ model = bandwidth.models.transfer_disconnect_callback.TransferDisconnectCallback() # noqa: E501
+ if include_optional :
+ return TransferDisconnectCallback(
+ event_type = 'bridgeComplete',
+ event_time = '2022-06-17T22:19:40.375Z',
+ account_id = '920012',
+ application_id = '04e88489-df02-4e34-a0ee-27a91849555f',
+ var_from = '+15555555555',
+ to = '+15555555555',
+ direction = 'inbound',
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ call_url = 'https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85',
+ parent_call_id = 'c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d',
+ enqueued_time = '2022-06-17T22:20Z',
+ start_time = '2022-06-17T22:19:40.375Z',
+ answer_time = '2022-06-17T22:20Z',
+ end_time = '2022-06-17T22:20Z',
+ tag = 'exampleTag',
+ transfer_caller_id = '+15555555555',
+ transfer_to = '+15555555555)',
+ cause = 'busy',
+ error_message = 'Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call',
+ error_id = '4642074b-7b58-478b-96e4-3a60955c6765'
+ )
+ else :
+ return TransferDisconnectCallback(
+ )
+ """
+
+ def testTransferDisconnectCallback(self):
+ """Test TransferDisconnectCallback"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_update_call.py b/test/unit/test_update_call.py
new file mode 100644
index 00000000..a9ed57bd
--- /dev/null
+++ b/test/unit/test_update_call.py
@@ -0,0 +1,64 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.update_call import UpdateCall # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestUpdateCall(unittest.TestCase):
+ """UpdateCall unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test UpdateCall
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `UpdateCall`
+ """
+ model = bandwidth.models.update_call.UpdateCall() # noqa: E501
+ if include_optional :
+ return UpdateCall(
+ state = 'active',
+ redirect_url = 'https://myServer.example/bandwidth/webhooks/redirect',
+ redirect_method = 'POST',
+ username = 'mySecretUsername',
+ password = 'mySecretPassword1!',
+ redirect_fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/redirect',
+ redirect_fallback_method = 'POST',
+ fallback_username = 'mySecretUsername',
+ fallback_password = 'mySecretPassword1!',
+ tag = 'My Custom Tag'
+ )
+ else :
+ return UpdateCall(
+ )
+ """
+
+ def testUpdateCall(self):
+ """Test UpdateCall"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_update_call_recording.py b/test/unit/test_update_call_recording.py
new file mode 100644
index 00000000..a853acac
--- /dev/null
+++ b/test/unit/test_update_call_recording.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.update_call_recording import UpdateCallRecording # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestUpdateCallRecording(unittest.TestCase):
+ """UpdateCallRecording unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test UpdateCallRecording
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `UpdateCallRecording`
+ """
+ model = bandwidth.models.update_call_recording.UpdateCallRecording() # noqa: E501
+ if include_optional :
+ return UpdateCallRecording(
+ state = 'paused'
+ )
+ else :
+ return UpdateCallRecording(
+ state = 'paused',
+ )
+ """
+
+ def testUpdateCallRecording(self):
+ """Test UpdateCallRecording"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_update_conference.py b/test/unit/test_update_conference.py
new file mode 100644
index 00000000..ddf8509e
--- /dev/null
+++ b/test/unit/test_update_conference.py
@@ -0,0 +1,63 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.update_conference import UpdateConference # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestUpdateConference(unittest.TestCase):
+ """UpdateConference unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test UpdateConference
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `UpdateConference`
+ """
+ model = bandwidth.models.update_conference.UpdateConference() # noqa: E501
+ if include_optional :
+ return UpdateConference(
+ status = 'active',
+ redirect_url = 'https://myServer.example/bandwidth/webhooks/conferenceRedirect',
+ redirect_method = 'POST',
+ username = 'mySecretUsername',
+ password = 'mySecretPassword1!',
+ redirect_fallback_url = 'https://myFallbackServer.example/bandwidth/webhooks/conferenceRedirect',
+ redirect_fallback_method = 'POST',
+ fallback_username = 'mySecretUsername',
+ fallback_password = 'mySecretPassword1!'
+ )
+ else :
+ return UpdateConference(
+ )
+ """
+
+ def testUpdateConference(self):
+ """Test UpdateConference"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_update_conference_member.py b/test/unit/test_update_conference_member.py
new file mode 100644
index 00000000..0f153ff4
--- /dev/null
+++ b/test/unit/test_update_conference_member.py
@@ -0,0 +1,57 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.update_conference_member import UpdateConferenceMember # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestUpdateConferenceMember(unittest.TestCase):
+ """UpdateConferenceMember unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test UpdateConferenceMember
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `UpdateConferenceMember`
+ """
+ model = bandwidth.models.update_conference_member.UpdateConferenceMember() # noqa: E501
+ if include_optional :
+ return UpdateConferenceMember(
+ mute = False,
+ hold = False,
+ call_ids_to_coach = ["c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"]
+ )
+ else :
+ return UpdateConferenceMember(
+ )
+ """
+
+ def testUpdateConferenceMember(self):
+ """Test UpdateConferenceMember"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_verify_code_request.py b/test/unit/test_verify_code_request.py
new file mode 100644
index 00000000..5cefb99a
--- /dev/null
+++ b/test/unit/test_verify_code_request.py
@@ -0,0 +1,61 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.verify_code_request import VerifyCodeRequest # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestVerifyCodeRequest(unittest.TestCase):
+ """VerifyCodeRequest unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test VerifyCodeRequest
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `VerifyCodeRequest`
+ """
+ model = bandwidth.models.verify_code_request.VerifyCodeRequest() # noqa: E501
+ if include_optional :
+ return VerifyCodeRequest(
+ to = '+19195551234',
+ scope = '2FA',
+ expiration_time_in_minutes = 3,
+ code = '123456'
+ )
+ else :
+ return VerifyCodeRequest(
+ to = '+19195551234',
+ expiration_time_in_minutes = 3,
+ code = '123456',
+ )
+ """
+
+ def testVerifyCodeRequest(self):
+ """Test VerifyCodeRequest"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_verify_code_response.py b/test/unit/test_verify_code_response.py
new file mode 100644
index 00000000..e335d611
--- /dev/null
+++ b/test/unit/test_verify_code_response.py
@@ -0,0 +1,55 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.verify_code_response import VerifyCodeResponse # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestVerifyCodeResponse(unittest.TestCase):
+ """VerifyCodeResponse unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test VerifyCodeResponse
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `VerifyCodeResponse`
+ """
+ model = bandwidth.models.verify_code_response.VerifyCodeResponse() # noqa: E501
+ if include_optional :
+ return VerifyCodeResponse(
+ valid = True
+ )
+ else :
+ return VerifyCodeResponse(
+ )
+ """
+
+ def testVerifyCodeResponse(self):
+ """Test VerifyCodeResponse"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_voice_api_error.py b/test/unit/test_voice_api_error.py
new file mode 100644
index 00000000..837b75c6
--- /dev/null
+++ b/test/unit/test_voice_api_error.py
@@ -0,0 +1,57 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.voice_api_error import VoiceApiError # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestVoiceApiError(unittest.TestCase):
+ """VoiceApiError unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test VoiceApiError
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `VoiceApiError`
+ """
+ model = bandwidth.models.voice_api_error.VoiceApiError() # noqa: E501
+ if include_optional :
+ return VoiceApiError(
+ type = '',
+ description = '',
+ id = ''
+ )
+ else :
+ return VoiceApiError(
+ )
+ """
+
+ def testVoiceApiError(self):
+ """Test VoiceApiError"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/unit/test_voice_code_response.py b/test/unit/test_voice_code_response.py
new file mode 100644
index 00000000..71950960
--- /dev/null
+++ b/test/unit/test_voice_code_response.py
@@ -0,0 +1,55 @@
+# coding: utf-8
+
+"""
+ Bandwidth
+
+ Bandwidth's Communication APIs
+
+ The version of the OpenAPI document: 1.0.0
+ Contact: letstalk@bandwidth.com
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+import bandwidth
+from bandwidth.models.voice_code_response import VoiceCodeResponse # noqa: E501
+from bandwidth.rest import ApiException
+
+class TestVoiceCodeResponse(unittest.TestCase):
+ """VoiceCodeResponse unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional):
+ """Test VoiceCodeResponse
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `VoiceCodeResponse`
+ """
+ model = bandwidth.models.voice_code_response.VoiceCodeResponse() # noqa: E501
+ if include_optional :
+ return VoiceCodeResponse(
+ call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85'
+ )
+ else :
+ return VoiceCodeResponse(
+ )
+ """
+
+ def testVoiceCodeResponse(self):
+ """Test VoiceCodeResponse"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/utils/__init__.py b/test/utils/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/test/utils/call_cleanup.py b/test/utils/call_cleanup.py
new file mode 100644
index 00000000..3fe65491
--- /dev/null
+++ b/test/utils/call_cleanup.py
@@ -0,0 +1,43 @@
+import time
+from bandwidth.exceptions import NotFoundException
+from test.utils.env_variables import *
+from bandwidth.models.call_state import CallState
+from bandwidth.models.call_state_enum import CallStateEnum
+from bandwidth.models.update_call import UpdateCall
+
+TEST_SLEEP = 3
+MAX_RETRIES = 10
+
+def callCleanup(self):
+ """
+ Whenever we create an actual call, we'll add the call_id to the callIdArray. Then when the integration test is done, as part of tearDown we'll:
+ Do a get to check is the call status is still active
+ If so, update to completed to end the call
+ If not, pop that callID off the array
+ Once we go through the whole array, we clear the array so it's empty for the next integration test.
+ if the status is active, send UpdateCall to change to completed
+ """
+
+ if len(self.callIdArray) > 0:
+ for callId in self.callIdArray:
+ retries = 1
+ repeat = True
+ body = UpdateCall(state=CallStateEnum("completed"))
+
+ while (repeat and retries <= MAX_RETRIES):
+ try:
+ get_call_response: CallState = self.calls_api_instance.get_call_state(BW_ACCOUNT_ID, callId, _return_http_data_only=False)
+ if get_call_response.state == 'active':
+ self.calls_api_instance.update_call(BW_ACCOUNT_ID, callId, body, _return_http_data_only=False)
+ elif get_call_response.state == 'complete':
+ self.callIdArray.remove(callId)
+
+ # We succeeded, break the loop
+ repeat = False
+ except NotFoundException:
+ retries += 1
+ print(f"Call ID was not registered, trying again attempt {retries}")
+ time.sleep(TEST_SLEEP)
+
+ self.callIdArray.clear()
+ pass
diff --git a/test/utils/env_variables.py b/test/utils/env_variables.py
new file mode 100644
index 00000000..efff46fb
--- /dev/null
+++ b/test/utils/env_variables.py
@@ -0,0 +1,28 @@
+import os
+
+try:
+ BW_USERNAME = os.environ['BW_USERNAME']
+ BW_PASSWORD = os.environ['BW_PASSWORD']
+ BW_ACCOUNT_ID = os.environ['BW_ACCOUNT_ID']
+ BW_MESSAGING_APPLICATION_ID = os.environ['BW_MESSAGING_APPLICATION_ID']
+ BW_VOICE_APPLICATION_ID = os.environ['BW_VOICE_APPLICATION_ID']
+ BASE_CALLBACK_URL = os.environ['BASE_CALLBACK_URL']
+ BW_NUMBER_PROVIDER = os.environ['BW_NUMBER_PROVIDER']
+ BW_NUMBER = os.environ['BW_NUMBER']
+ VZW_NUMBER = os.environ['VZW_NUMBER']
+ ATT_NUMBER = os.environ['ATT_NUMBER']
+ T_MOBILE_NUMBER = os.environ['T_MOBILE_NUMBER']
+ USER_NUMBER = os.environ['USER_NUMBER']
+ FORBIDDEN_USERNAME = os.environ['BW_USERNAME_FORBIDDEN']
+ FORBIDDEN_PASSWORD = os.environ['BW_PASSWORD_FORBIDDEN']
+ MANTECA_ACTIVE_NUMBER = os.environ['MANTECA_ACTIVE_NUMBER']
+ MANTECA_IDLE_NUMBER = os.environ['MANTECA_IDLE_NUMBER']
+ MANTECA_BASE_URL = os.environ['MANTECA_BASE_URL']
+ MANTECA_STATUS_URL = MANTECA_BASE_URL + 'tests/'
+ MANTECA_APPLICATION_ID = os.environ['MANTECA_APPLICATION_ID']
+ PYTHON_VERSION = os.environ['PYTHON_VERSION']
+ OPERATING_SYSTEM = os.environ['OPERATING_SYSTEM']
+ RUNNER_OS = os.environ['RUNNER_OS']
+
+except KeyError as e:
+ raise Exception('Environmental variables not found')
\ No newline at end of file
diff --git a/tox.ini b/tox.ini
index 1e5bd967..ec82ea1d 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,7 +1,9 @@
-[tox]
-envlist = py35
-
-[testenv]
-commands = nosetests
-deps =
- nose
+[tox]
+envlist = py3
+
+[testenv]
+deps=-r{toxinidir}/requirements.txt
+ -r{toxinidir}/test-requirements.txt
+
+commands=
+ pytest --cov=bandwidth