diff --git a/.github/actions/deploy/Dockerfile b/.github/actions/deploy/Dockerfile
deleted file mode 100644
index a120746d..00000000
--- a/.github/actions/deploy/Dockerfile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Container image that runs your code
-FROM ruby:latest
-
-# Copies your code file from your action repository to the filesystem path `/` of the container
-COPY entrypoint.sh /entrypoint.sh
-
-#Make entrypoint.sh exacutable
-RUN chmod +x /entrypoint.sh
-
-# Code file to execute when the docker container starts up (`entrypoint.sh`)
-ENTRYPOINT ["/entrypoint.sh"]
diff --git a/.github/actions/deploy/action.yml b/.github/actions/deploy/action.yml
deleted file mode 100644
index 6b866b4b..00000000
--- a/.github/actions/deploy/action.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-# action.yml
-name: "Deploy"
-description: "Deploys the ruby sdk to Rubygems"
-runs:
- using: "docker"
- image: "Dockerfile"
diff --git a/.github/actions/deploy/entrypoint.sh b/.github/actions/deploy/entrypoint.sh
deleted file mode 100644
index 3fc4ff22..00000000
--- a/.github/actions/deploy/entrypoint.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-mkdir ~/.gem #Rubygems needs this directory for auth
-echo "---\n:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials #The file to store rubygems auth. Must be in this format
-chmod 0600 ~/.gem/credentials #Rubygems expects this permissions
-gem build *.gemspec
-gem push *.gem -k rubygems
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 023f6390..747b47d9 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -7,48 +7,7 @@ on:
jobs:
deploy:
- name: Deploy to Rubygems
- if: ${{ !github.event.release.prerelease && github.event.release.target_commitish == 'main' }}
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v3
-
- - name: Setup Ruby
- uses: ruby/setup-ruby@v1
- with:
- ruby-version: "3.0"
-
- - name: Install Packages
- run: bundle install
-
- - name: Test
- env:
- BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }}
- BW_USERNAME: ${{ secrets.BW_USERNAME }}
- BW_PASSWORD: ${{ secrets.BW_PASSWORD }}
- BW_VOICE_APPLICATION_ID: ${{ secrets.BW_VOICE_APPLICATION_ID }}
- BW_MESSAGING_APPLICATION_ID: ${{ secrets.BW_MESSAGING_APPLICATION_ID }}
- BW_NUMBER: ${{ secrets.BW_NUMBER }}
- USER_NUMBER: ${{ secrets.USER_NUMBER }}
- BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }}
- run: rake
-
- - name: Deploy to Rubygems
- uses: ./.github/actions/deploy
- env:
- RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
-
- - uses: Bandwidth/build-notify-slack-action@v1.0.0
- if: always()
- with:
- job-status: ${{ job.status }}
- slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
- slack-channel: ${{ secrets.SLACK_CHANNEL }}
-
- deploy_pre_release:
- name: Deploy OpenAPI Generator Client Pre-Release to Rubygems
- if: ${{ github.event.release.prerelease && github.event.release.target_commitish == 'feature/openapi-generator-sdk' }}
+ name: Deploy SDK to Rubygems
runs-on: ubuntu-latest
env:
BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }}
@@ -61,49 +20,53 @@ jobs:
BW_NUMBER: ${{ secrets.BW_NUMBER }}
USER_NUMBER: ${{ secrets.USER_NUMBER }}
BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }}
- RUBY_VERSION: '3.0'
- OPERATING_SYSTEM: 'ubuntu'
+ RUBY_VERSION: "3.0"
+ OPERATING_SYSTEM: "ubuntu"
MANTECA_ACTIVE_NUMBER: ${{ secrets.MANTECA_ACTIVE_NUMBER }}
MANTECA_IDLE_NUMBER: ${{ secrets.MANTECA_IDLE_NUMBER }}
MANTECA_BASE_URL: ${{ secrets.MANTECA_BASE_URL }}
MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }}
BW_NUMBER_PROVIDER: ${{ secrets.BW_NUMBER_PROVIDER }}
-
+
steps:
- name: Set Release Version
- run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
-
- - name: Check Release Tag Format
run: |
- re=[0-9]+\.[0-9]+\.[0-9]+\.pre\.beta\.[0-9]+\.?[0-9]*\.?[0-9]*
- if ! [[ $RELEASE_VERSION =~ $re ]]; then
- echo 'Tag does not match expected regex pattern for beta releases (v[0-9]+\.[0-9]+\.[0-9]+\.pre\.beta\.[0-9]+\.?[0-9]*\.?[0-9]*)'
+ RELEASE_VERSION=${GITHUB_REF#refs/tags/v}
+ re=[0-9]+\.[0-9]+\.[0-9]+
+ if [[ $RELEASE_VERSION =~ $re ]]; then
+ echo "GEM_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
+ else
+ echo "Tag does not match expected semver regex pattern (v$re)"
echo $RELEASE_VERSION
echo 'Please update your tag to match the expected regex pattern'
exit 1
fi
-
+
- name: Checkout
uses: actions/checkout@v3
- with:
- ref: feature/openapi-generator-sdk
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.0"
- - name: Install Packages
- run: bundle install
+ - name: Update Gem Version
+ run: sed -i "s/VERSION = '.*'/VERSION = '$GEM_VERSION'/g" lib/bandwidth-sdk/version.rb
+
+ - name: Install Packages and Test
+ run: |
+ bundle install
+ rake
- - name: Test
- run: rake
-
- name: Deploy to Rubygems
- uses: ./.github/actions/deploy
- env:
- RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
-
+ run: |
+ mkdir ~/.gem
+ touch ~/.gem/credentials
+ chmod 0600 ~/.gem/credentials
+ printf -- "---\n:rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}\n" > ~/.gem/credentials
+ gem build *.gemspec
+ gem push *.gem
+
- uses: Bandwidth/build-notify-slack-action@v1.0.0
if: always()
with:
diff --git a/.github/workflows/test-nightly.yml b/.github/workflows/test-nightly.yml
index b071634c..97a8d317 100644
--- a/.github/workflows/test-nightly.yml
+++ b/.github/workflows/test-nightly.yml
@@ -1,4 +1,4 @@
-name: Test Main and Feature Branch Nightly
+name: Test Main Branch Nightly
on:
schedule:
@@ -31,12 +31,12 @@ jobs:
strategy:
matrix:
os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-22.04]
- ruby-version: [2.6, 2.7, 3.0]
+ ruby-version: [2.7, 3.0, 3.1, 3.2]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
- ref: 'main'
+ ref: "main"
- name: Set up Ruby
uses: ruby/setup-ruby@v1
@@ -47,37 +47,13 @@ jobs:
run: |
bundle install
rake
-
- test_feature:
- name: Test Feature Branch Nightly
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-22.04]
- ruby-version: [2.7, 3.0, 3.1, 3.2]
- steps:
- - name: Checkout
- uses: actions/checkout@v3
- with:
- ref: 'feature/openapi-generator-sdk'
-
- - name: Set up Ruby
- uses: ruby/setup-ruby@v1
- with:
- ruby-version: ${{ matrix.ruby-version }}
-
- - name: Install Packages and Test
env:
RUBY_VERSION: ${{ matrix.ruby-version }}
OPERATING_SYSTEM: ${{ matrix.os }}
- GEM_VERSION: "11.0.0"
- run: |
- bundle install
- rake
notify_for_failures:
name: Notify for Failures
- needs: [test_main, test_feature]
+ needs: [test_main]
if: failure()
runs-on: ubuntu-latest
steps:
diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml
index 58fc5f5c..f9c336ce 100644
--- a/.github/workflows/test-pr.yml
+++ b/.github/workflows/test-pr.yml
@@ -24,13 +24,13 @@ env:
MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }}
jobs:
- test_pr_main:
+ test_pr:
name: Test PR
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-22.04]
- ruby-version: [2.6, 2.7, 3.0]
+ ruby-version: [2.7, 3.0, 3.1, 3.2]
steps:
- name: Checkout
uses: actions/checkout@v3
@@ -44,3 +44,6 @@ jobs:
run: |
bundle install
rake
+ env:
+ RUBY_VERSION: ${{ matrix.ruby-version }}
+ OPERATING_SYSTEM: ${{ matrix.os }}
diff --git a/.github/workflows/update-sdk.yml b/.github/workflows/update-sdk.yml
new file mode 100644
index 00000000..5707747f
--- /dev/null
+++ b/.github/workflows/update-sdk.yml
@@ -0,0 +1,106 @@
+name: Update SDK
+
+on:
+ schedule:
+ - cron: "0 14 * * 2"
+ workflow_dispatch:
+
+jobs:
+ update-sdk:
+ name: Update SDK if Necessary
+ runs-on: ubuntu-latest
+ outputs:
+ generate: ${{ steps.compare.outputs.generate }}
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+
+ - name: Combine Product Specs
+ uses: Bandwidth/api-specs-combine-action@v1.0.0
+ with:
+ token: ${{ secrets.DX_GITHUB_TOKEN }}
+
+ - name: Determine if a New SDK is Needed
+ id: compare
+ run: |
+ if cmp -s "bandwidth.yml" "api-specs/bandwidth.yml"; then :; else mv -f api-specs/bandwidth.yml bandwidth.yml; rm -r -f api-specs; echo "generate=true" >> $GITHUB_OUTPUT; fi
+
+ - name: Create JIRA Card for SDK Update
+ if: ${{ steps.compare.outputs.generate == 'true' }}
+ id: jira
+ run: |
+ JIRA_KEY=$(jq -r '.key' <<< $(curl -s -u $JIRA_USERNAME:$JIRA_TOKEN \
+ -X POST https://bandwidth-jira.atlassian.net/rest/api/2/issue \
+ -H "Content-Type: application/json" \
+ --data-binary @- << EOF
+ {
+ "fields": {
+ "project": {
+ "key": "SWI"
+ },
+ "summary": "[$LANGUAGE] Update SDK for New Spec Version",
+ "description": "Prepare the $LANGUAGE SDK for release based on the latest spec changes.",
+ "issuetype": {
+ "name": "Story"
+ },
+ "customfield_12108": "$LANGUAGE SDK is ready for release. Tests are created/updated if need be.",
+ "customfield_10205": "$EPIC",
+ "components": [{
+ "name": "Client SDKs"
+ }]
+ }
+ }
+ EOF
+ ))
+ echo "jira-key=$JIRA_KEY" >> $GITHUB_OUTPUT
+ env:
+ LANGUAGE: Ruby
+ EPIC: SWI-1876
+ JIRA_USERNAME: ${{ secrets.JIRA_USERNAME }}
+ JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }}
+
+ - name: Build SDK
+ id: build
+ if: ${{ startsWith(steps.jira.outputs.jira-key, 'SWI') }}
+ uses: Bandwidth/generate-sdk-action@v3.0.0
+ with:
+ branch-name: ${{ steps.jira.outputs.jira-key }}
+ token: ${{ secrets.DX_GITHUB_TOKEN }}
+ openapi-generator-version: 7.0.0
+ language: ruby
+ config: ./openapi-config.yml
+
+ - name: Setup Ruby
+ if: steps.build.outputs.changes
+ uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: "3.0"
+
+ - name: Clean SDK
+ if: steps.build.outputs.changes
+ run: |
+ bundle install
+ rubocop -A
+ git add .
+ git commit -m "Clean SDK using Rubocop"
+ git push origin ${{ steps.jira.outputs.jira-key }}
+
+ - name: Open Pull Request
+ if: steps.build.outputs.changes
+ run: |
+ gh pr create -B main -H Bandwidth:${{ steps.jira.outputs.jira-key }} -t '${{ steps.jira.outputs.jira-key }} Update SDK Based on Recent Spec Changes' -b 'Auto-generated by Update SDK Workflow'
+ env:
+ GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}
+
+ notify-for-failures:
+ name: Notify for Failures
+ needs: [update-sdk]
+ if: failure()
+ runs-on: ubuntu-latest
+ steps:
+ - name: Notify Slack of Failures
+ uses: Bandwidth/build-notify-slack-action@v1.0.0
+ with:
+ job-status: failure
+ slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
+ slack-channel: ${{ secrets.SLACK_CHANNEL }}
diff --git a/.gitignore b/.gitignore
index eac0157b..1e47cd99 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,41 @@
-Gemfile.lock
+# Generated by: https://openapi-generator.tech
+#
+
+*.gem
+*.rbc
+/.config
+/coverage/
+/InstalledFiles
+/pkg/
+/spec/reports/
+/spec/examples.txt
+/test/tmp/
+/test/version_tmp/
+/tmp/
+
+## Specific to RubyMotion:
+.dat*
+.repl_history
+build/
+
+## Documentation cache and generated files:
+/.yardoc/
+/_yardoc/
+/doc/
+/rdoc/
+
+## Environment normalization:
+/.bundle/
+/vendor/bundle
+/lib/bundler/man/
+
+# for a library or gem, you might want to ignore these files since the code is
+# intended to run in multiple environments; otherwise, check them in:
+Gemfile.lock
+# .ruby-version
+# .ruby-gemset
+
+# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
+.rvmrc
+
+.DS_Store
diff --git a/.gitkeep b/.gitkeep
deleted file mode 100644
index 7804e232..00000000
--- a/.gitkeep
+++ /dev/null
@@ -1,4 +0,0 @@
-README.md
-lib/bandwidth/voice_lib/bxml/*
-lib/bandwidth/web_rtc_lib/utils/*
-test/integration/*
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 00000000..3a253c45
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,26 @@
+.ruby: &ruby
+ variables:
+ LANG: "C.UTF-8"
+ before_script:
+ - ruby -v
+ - bundle config set --local deployment true
+ - bundle install -j $(nproc)
+ parallel:
+ matrix:
+ - RUBY_VERSION: ['2.7', '3.0', '3.1']
+ image: "ruby:$RUBY_VERSION"
+ cache:
+ paths:
+ - vendor/ruby
+ key: 'ruby-$RUBY_VERSION'
+
+gem:
+ extends: .ruby
+ script:
+ - bundle exec rspec
+ - bundle exec rake build
+ - bundle exec rake install
+ artifacts:
+ paths:
+ - pkg/*.gem
+
diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore
new file mode 100644
index 00000000..a74a4808
--- /dev/null
+++ b/.openapi-generator-ignore
@@ -0,0 +1,7 @@
+# OpenAPI Generator Ignore
+# Generated by openapi-generator https://github.com/openapitools/openapi-generator
+
+/spec/**
+Rakefile
+.gitignore
+.rubocop.yml
diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES
new file mode 100644
index 00000000..b98a4270
--- /dev/null
+++ b/.openapi-generator/FILES
@@ -0,0 +1,204 @@
+.gitlab-ci.yml
+.rspec
+.travis.yml
+Gemfile
+README.md
+bandwidth-sdk.gemspec
+docs/AccountStatistics.md
+docs/AnswerCallback.md
+docs/BridgeCompleteCallback.md
+docs/BridgeTargetCompleteCallback.md
+docs/CallDirectionEnum.md
+docs/CallRecordingMetadata.md
+docs/CallState.md
+docs/CallStateEnum.md
+docs/CallbackMethodEnum.md
+docs/CallsApi.md
+docs/CodeRequest.md
+docs/Conference.md
+docs/ConferenceCompletedCallback.md
+docs/ConferenceCreatedCallback.md
+docs/ConferenceMember.md
+docs/ConferenceMemberExitCallback.md
+docs/ConferenceMemberJoinCallback.md
+docs/ConferenceRecordingAvailableCallback.md
+docs/ConferenceRecordingMetadata.md
+docs/ConferenceRedirectCallback.md
+docs/ConferenceStateEnum.md
+docs/ConferencesApi.md
+docs/CreateCall.md
+docs/CreateCallResponse.md
+docs/CreateLookupResponse.md
+docs/CreateMessageRequestError.md
+docs/DeferredResult.md
+docs/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
+lib/bandwidth-sdk.rb
+lib/bandwidth-sdk/api/calls_api.rb
+lib/bandwidth-sdk/api/conferences_api.rb
+lib/bandwidth-sdk/api/media_api.rb
+lib/bandwidth-sdk/api/messages_api.rb
+lib/bandwidth-sdk/api/mfa_api.rb
+lib/bandwidth-sdk/api/phone_number_lookup_api.rb
+lib/bandwidth-sdk/api/recordings_api.rb
+lib/bandwidth-sdk/api/statistics_api.rb
+lib/bandwidth-sdk/api_client.rb
+lib/bandwidth-sdk/api_error.rb
+lib/bandwidth-sdk/configuration.rb
+lib/bandwidth-sdk/models/account_statistics.rb
+lib/bandwidth-sdk/models/answer_callback.rb
+lib/bandwidth-sdk/models/bridge_complete_callback.rb
+lib/bandwidth-sdk/models/bridge_target_complete_callback.rb
+lib/bandwidth-sdk/models/call_direction_enum.rb
+lib/bandwidth-sdk/models/call_recording_metadata.rb
+lib/bandwidth-sdk/models/call_state.rb
+lib/bandwidth-sdk/models/call_state_enum.rb
+lib/bandwidth-sdk/models/callback_method_enum.rb
+lib/bandwidth-sdk/models/code_request.rb
+lib/bandwidth-sdk/models/conference.rb
+lib/bandwidth-sdk/models/conference_completed_callback.rb
+lib/bandwidth-sdk/models/conference_created_callback.rb
+lib/bandwidth-sdk/models/conference_member.rb
+lib/bandwidth-sdk/models/conference_member_exit_callback.rb
+lib/bandwidth-sdk/models/conference_member_join_callback.rb
+lib/bandwidth-sdk/models/conference_recording_available_callback.rb
+lib/bandwidth-sdk/models/conference_recording_metadata.rb
+lib/bandwidth-sdk/models/conference_redirect_callback.rb
+lib/bandwidth-sdk/models/conference_state_enum.rb
+lib/bandwidth-sdk/models/create_call.rb
+lib/bandwidth-sdk/models/create_call_response.rb
+lib/bandwidth-sdk/models/create_lookup_response.rb
+lib/bandwidth-sdk/models/create_message_request_error.rb
+lib/bandwidth-sdk/models/deferred_result.rb
+lib/bandwidth-sdk/models/disconnect_callback.rb
+lib/bandwidth-sdk/models/diversion.rb
+lib/bandwidth-sdk/models/dtmf_callback.rb
+lib/bandwidth-sdk/models/field_error.rb
+lib/bandwidth-sdk/models/file_format_enum.rb
+lib/bandwidth-sdk/models/gather_callback.rb
+lib/bandwidth-sdk/models/inbound_message_callback.rb
+lib/bandwidth-sdk/models/inbound_message_callback_message.rb
+lib/bandwidth-sdk/models/initiate_callback.rb
+lib/bandwidth-sdk/models/list_message_direction_enum.rb
+lib/bandwidth-sdk/models/list_message_item.rb
+lib/bandwidth-sdk/models/lookup_request.rb
+lib/bandwidth-sdk/models/lookup_result.rb
+lib/bandwidth-sdk/models/lookup_status.rb
+lib/bandwidth-sdk/models/lookup_status_enum.rb
+lib/bandwidth-sdk/models/machine_detection_complete_callback.rb
+lib/bandwidth-sdk/models/machine_detection_configuration.rb
+lib/bandwidth-sdk/models/machine_detection_mode_enum.rb
+lib/bandwidth-sdk/models/machine_detection_result.rb
+lib/bandwidth-sdk/models/media.rb
+lib/bandwidth-sdk/models/message.rb
+lib/bandwidth-sdk/models/message_delivered_callback.rb
+lib/bandwidth-sdk/models/message_delivered_callback_message.rb
+lib/bandwidth-sdk/models/message_direction_enum.rb
+lib/bandwidth-sdk/models/message_failed_callback.rb
+lib/bandwidth-sdk/models/message_failed_callback_message.rb
+lib/bandwidth-sdk/models/message_request.rb
+lib/bandwidth-sdk/models/message_sending_callback.rb
+lib/bandwidth-sdk/models/message_sending_callback_message.rb
+lib/bandwidth-sdk/models/message_status_enum.rb
+lib/bandwidth-sdk/models/message_type_enum.rb
+lib/bandwidth-sdk/models/messages_list.rb
+lib/bandwidth-sdk/models/messaging_code_response.rb
+lib/bandwidth-sdk/models/messaging_request_error.rb
+lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb
+lib/bandwidth-sdk/models/mfa_request_error.rb
+lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb
+lib/bandwidth-sdk/models/page_info.rb
+lib/bandwidth-sdk/models/priority_enum.rb
+lib/bandwidth-sdk/models/recording_available_callback.rb
+lib/bandwidth-sdk/models/recording_complete_callback.rb
+lib/bandwidth-sdk/models/recording_state_enum.rb
+lib/bandwidth-sdk/models/redirect_callback.rb
+lib/bandwidth-sdk/models/redirect_method_enum.rb
+lib/bandwidth-sdk/models/stir_shaken.rb
+lib/bandwidth-sdk/models/tag.rb
+lib/bandwidth-sdk/models/tn_lookup_request_error.rb
+lib/bandwidth-sdk/models/transcribe_recording.rb
+lib/bandwidth-sdk/models/transcription.rb
+lib/bandwidth-sdk/models/transcription_available_callback.rb
+lib/bandwidth-sdk/models/transcription_list.rb
+lib/bandwidth-sdk/models/transcription_metadata.rb
+lib/bandwidth-sdk/models/transfer_answer_callback.rb
+lib/bandwidth-sdk/models/transfer_complete_callback.rb
+lib/bandwidth-sdk/models/transfer_disconnect_callback.rb
+lib/bandwidth-sdk/models/update_call.rb
+lib/bandwidth-sdk/models/update_call_recording.rb
+lib/bandwidth-sdk/models/update_conference.rb
+lib/bandwidth-sdk/models/update_conference_member.rb
+lib/bandwidth-sdk/models/verify_code_request.rb
+lib/bandwidth-sdk/models/verify_code_response.rb
+lib/bandwidth-sdk/models/voice_api_error.rb
+lib/bandwidth-sdk/models/voice_code_response.rb
+lib/bandwidth-sdk/version.rb
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/.rspec b/.rspec
new file mode 100644
index 00000000..83e16f80
--- /dev/null
+++ b/.rspec
@@ -0,0 +1,2 @@
+--color
+--require spec_helper
diff --git a/.rubocop.yml b/.rubocop.yml
index 0b18990d..06fb0407 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -1,34 +1,159 @@
-Metrics/ClassLength:
- Enabled: false
-
-Metrics/MethodLength:
- Enabled: false
-
-Metrics/BlockLength:
- Enabled: false
-
-Metrics/ParameterLists:
- Enabled: false
-
-Metrics/AbcSize:
- Enabled: false
-
-Metrics/CyclomaticComplexity:
- Enabled: false
-
-Metrics/PerceivedComplexity:
- Enabled: false
-
-Lint/UnderscorePrefixedVariableName:
- Enabled: false
-
-Naming/AccessorMethodName:
- Enabled: false
-
-Style/AsciiComments:
- Enabled: false
-
-AllCops:
- Exclude:
- - './test/**/*'
- - './*'
\ No newline at end of file
+# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license)
+# Automatically generated by OpenAPI Generator (https://openapi-generator.tech)
+AllCops:
+ TargetRubyVersion: 2.4
+ # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
+ # to ignore them, so only the ones explicitly set in this file are enabled.
+ DisabledByDefault: true
+ Exclude:
+ - '**/templates/**/*'
+ - '**/vendor/**/*'
+ - 'actionpack/lib/action_dispatch/journey/parser.rb'
+
+# Prefer &&/|| over and/or.
+Style/AndOr:
+ Enabled: true
+
+# Align `when` with `case`.
+Layout/CaseIndentation:
+ Enabled: true
+
+# Align comments with method definitions.
+Layout/CommentIndentation:
+ Enabled: true
+
+Layout/ElseAlignment:
+ Enabled: true
+
+Layout/EmptyLineAfterMagicComment:
+ Enabled: true
+
+# In a regular class definition, no empty lines around the body.
+Layout/EmptyLinesAroundClassBody:
+ Enabled: true
+
+# In a regular method definition, no empty lines around the body.
+Layout/EmptyLinesAroundMethodBody:
+ Enabled: true
+
+# In a regular module definition, no empty lines around the body.
+Layout/EmptyLinesAroundModuleBody:
+ Enabled: true
+
+Layout/EmptyLinesAroundBlockBody:
+ Enabled: true
+
+Layout/FirstArgumentIndentation:
+ Enabled: true
+
+# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
+Style/HashSyntax:
+ Enabled: false
+
+# Method definitions after `private` or `protected` isolated calls need one
+# extra level of indentation.
+Layout/IndentationConsistency:
+ Enabled: true
+ EnforcedStyle: indented_internal_methods
+
+# Two spaces, no tabs (for indentation).
+Layout/IndentationWidth:
+ Enabled: true
+
+Layout/LeadingCommentSpace:
+ Enabled: true
+
+Layout/SpaceAfterColon:
+ Enabled: true
+
+Layout/SpaceAfterComma:
+ Enabled: true
+
+Layout/SpaceAroundEqualsInParameterDefault:
+ Enabled: true
+
+Layout/SpaceAroundKeyword:
+ Enabled: true
+
+Layout/SpaceAroundOperators:
+ Enabled: true
+
+Layout/SpaceBeforeComma:
+ Enabled: true
+
+Layout/SpaceBeforeFirstArg:
+ Enabled: true
+
+Style/DefWithParentheses:
+ Enabled: true
+
+# Defining a method with parameters needs parentheses.
+Style/MethodDefParentheses:
+ Enabled: true
+
+Style/FrozenStringLiteralComment:
+ Enabled: false
+ EnforcedStyle: always
+
+# Use `foo {}` not `foo{}`.
+Layout/SpaceBeforeBlockBraces:
+ Enabled: true
+
+# Use `foo { bar }` not `foo {bar}`.
+Layout/SpaceInsideBlockBraces:
+ Enabled: true
+
+# Use `{ a: 1 }` not `{a:1}`.
+Layout/SpaceInsideHashLiteralBraces:
+ Enabled: true
+
+Layout/SpaceInsideParens:
+ Enabled: true
+
+# Check quotes usage according to lint rule below.
+Style/StringLiterals:
+ Enabled: true
+ EnforcedStyle: single_quotes
+ Exclude:
+ - lib/bandwidth-sdk/api_client.rb
+ - lib/bandwidth-sdk/configuration.rb
+
+#Check quotes inside the string interpolation.
+Style/StringLiteralsInInterpolation:
+ Enabled: true
+ EnforcedStyle: single_quotes
+
+# Detect hard tabs, no hard tabs.
+Layout/IndentationStyle:
+ Enabled: true
+
+# Blank lines should not have any spaces.
+Layout/TrailingEmptyLines:
+ Enabled: true
+
+# No trailing whitespace.
+Layout/TrailingWhitespace:
+ Enabled: false
+
+# Use quotes for string literals when they are enough.
+Style/RedundantPercentQ:
+ Enabled: true
+
+# Align `end` with the matching keyword or starting expression except for
+# assignments, where it should be aligned with the LHS.
+Layout/EndAlignment:
+ Enabled: true
+ EnforcedStyleAlignWith: variable
+ AutoCorrect: true
+
+# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
+Lint/RequireParentheses:
+ Enabled: true
+
+Style/RedundantReturn:
+ Enabled: true
+ AllowMultipleReturnValues: true
+
+Style/Semicolon:
+ Enabled: true
+ AllowAsExpressionSeparator: true
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 00000000..2e321fcc
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,11 @@
+language: ruby
+cache: bundler
+rvm:
+ - 2.7
+ - 3.0
+ - 3.1
+script:
+ - bundle install --path vendor/bundle
+ - bundle exec rspec
+ - gem build bandwidth-sdk.gemspec
+ - gem install ./bandwidth-sdk-11.0.0.gem
diff --git a/Gemfile b/Gemfile
index 02d11b16..ed673756 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,7 +1,11 @@
-source 'https://rubygems.org'
-
-group :test do
- gem 'rake'
-end
-
-gemspec
+source 'https://rubygems.org'
+
+gemspec
+
+group :development, :test do
+ gem 'rake', '~> 13.0.1'
+ gem 'pry-byebug'
+ gem 'rubocop', '~> 1.52.0'
+ gem 'webmock', '~> 3.18.0'
+ gem 'simplecov', '~> 0.21.2'
+end
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 749af7fb..00000000
--- a/LICENSE
+++ /dev/null
@@ -1,28 +0,0 @@
-License:
-========
-The MIT License (MIT)
-http://opensource.org/licenses/MIT
-
-Copyright (c) 2014 - 2020 APIMATIC Limited
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-Trade Mark:
-==========
-APIMATIC is a trade mark for APIMATIC Limited
\ No newline at end of file
diff --git a/README.md b/README.md
index 1fdd91e9..36980169 100644
--- a/README.md
+++ b/README.md
@@ -1,175 +1,240 @@
-# Bandwidth Ruby SDK
+# bandwidth-sdk
-[![Nightly Tests](https://github.com/Bandwidth/ruby-sdk/actions/workflows/test-nightly.yml/badge.svg)](https://github.com/Bandwidth/ruby-sdk/actions/workflows/test-nightly.yml)
+[![Gem Version](https://badge.fury.io/rb/bandwidth-sdk.svg)](https://badge.fury.io/rb/bandwidth-sdk)
+[![Tests](https://github.com/Bandwidth/ruby-sdk/actions/workflows/test-nightly.yml/badge.svg)](https://github.com/Bandwidth/ruby-sdk/actions/workflows/test-nightly.yml)
+[![Ruby Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop/rubocop)
| **OS** | **Ruby** |
|:---:|:---:|
-| Windows 2016 | 2.6, 2.7, 3.0 |
-| Windows 2019 | 2.6, 2.7, 3.0 |
-| Ubuntu 20.04 | 2.6, 2.7, 3.0 |
-| Ubuntu 22.04 | 2.6, 2.7, 3.0 |
+| Windows 2019 | 2.7, 3.0, 3.1, 3.2 |
+| Windows 2022 | 2.7, 3.0, 3.1, 3.2 |
+| Ubuntu 20.04 | 2.7, 3.0, 3.1, 3.2 |
+| Ubuntu 22.04 | 2.7, 3.0, 3.1, 3.2 |
-## Getting Started
+Bandwidth - the Ruby gem for the Bandwidth
-### Installation
+# Generated with the command:
+`openapi-generator generate -g ruby -i bandwidth.yml -c openapi-config.yml -o ./`
-```
-gem install bandwidth-sdk
-```
+Bandwidth's Communication APIs
-### Initialize
+This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
-```ruby
-require 'bandwidth'
-
-include Bandwidth
-include Bandwidth::Voice
-include Bandwidth::Messaging
-include Bandwidth::WebRtc
-include Bandwidth::TwoFactorAuth
-
-bandwidth_client = Bandwidth::Client.new(
- voice_basic_auth_user_name: 'username',
- voice_basic_auth_password: 'password',
- messaging_basic_auth_user_name: 'username',
- messaging_basic_auth_password: 'username',
- two_factor_auth_basic_auth_user_name: 'username',
- two_factor_auth_basic_auth_password: 'password',
- web_rtc_basic_auth_user_name: 'username',
- web_rtc_basic_auth_password: 'password'
-)
-account_id = "12345"
-```
+- API version: 1.0.0
+- Package version: 11.0.0
+- Build package: org.openapitools.codegen.languages.RubyClientCodegen
+For more information, please visit [https://dev.bandwidth.com](https://dev.bandwidth.com)
-### Create Phone Call
+## Installation
-```ruby
-voice_client = bandwidth_client.voice_client.client
+### Build a gem
-body = ApiCreateCallRequest.new
-body.from = '+16666666666'
-body.to = '+17777777777'
-body.answer_url = 'https://test.com'
-body.application_id = '3-d-4-b-5'
+To build the Ruby code into a gem:
-begin
- response = voice_client.create_call(account_id,:body => body)
- puts response.data.call_id #c-d45a41e5-bcb12581-b18e-4bdc-9874-6r3235dfweao
- puts response.status_code #201
-rescue Bandwidth::ErrorResponseException => e
- puts e.description #Invalid to: must be an E164 telephone number
- puts e.response_code #400
-end
+```shell
+gem build bandwidth-sdk.gemspec
```
-### Generate BXML
-
-```ruby
-response = Bandwidth::Voice::Response.new()
-hangup = Bandwidth::Voice::Hangup.new()
+Then either install the gem locally:
-response.push(hangup)
-puts response.to_bxml()
+```shell
+gem install ./bandwidth-sdk-11.0.0.gem
```
-### Send Text Message
+(for development, run `gem install --dev ./bandwidth-sdk-11.0.0.gem` to install the development dependencies)
-```ruby
-messaging_client = bandwidth_client.messaging_client.client
+or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
-body = MessageRequest.new
-body.application_id = '1-2-3'
-body.to = ['+17777777777']
-body.from = '+18888888888'
-body.text = 'Hello from Bandwidth'
+Finally add this to the Gemfile:
-begin
- response = messaging_client.create_message(account_id, body)
- puts response.data.id #1570740275373xbn7mbhsfewasdr
- puts response.status_code #202
-rescue Bandwidth::GenericClientException => e
- puts e.description #Access is denied
- puts e.response_code #403
-rescue Bandwidth::PathClientException => e
- puts e.message #Your request could not be accepted.
- puts e.response_code #400
-end
-```
+ gem 'bandwidth-sdk', '~> 11.0.0'
-### Create A MFA Request
+### Install from Git
-```ruby
-auth_client = bandwidth_client.two_factor_auth_client.mfa
-
-from_phone = "+18888888888"
-to_phone = "+17777777777"
-messaging_application_id = "1-d-b"
-scope = "scope"
-digits = 6
-
-body = TwoFactorCodeRequestSchema.new
-body.from = from_phone
-body.to = to_phone
-body.application_id = messaging_application_id
-body.scope = scope
-body.digits = digits
-body.message = "Your temporary {NAME} {SCOPE} code is {CODE}"
-
-auth_client.create_messaging_two_factor(account_id, body)
-
-code = "123456" #This is the user input to validate
-
-body = TwoFactorVerifyRequestSchema.new
-body.from = from_phone
-body.to = to_phone
-body.application_id = application_id
-body.scope = scope
-body.code = code
-body.digits = digits
-body.expiration_time_in_minutes = 3
-
-response = auth_client.create_verify_two_factor(account_id, body)
-puts "Auth status: " + response.data.valid.to_s
-```
+If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
-### WebRtc Participant & Session Management
-
-```ruby
-web_rtc_client = bandwidth_client.web_rtc_client.client
+ gem 'bandwidth-sdk', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
-create_session_body = Session.new
-create_session_body.tag = 'new-session'
+### Include the Ruby code directly
-create_session_response = web_rtc_client.create_session(account_id, :body => create_session_body)
-session_id = create_session_response.data.id
-puts session_id
+Include the Ruby code directly using `-I` as follows:
-create_participant_body = Participant.new
-create_participant_body.publish_permissions = [
- PublishPermissionEnum::AUDIO,
- PublishPermissionEnum::VIDEO
-]
-create_participant_body.callback_url = "https://sample.com"
+```shell
+ruby -Ilib script.rb
+```
-create_participant_response = web_rtc_client.create_participant(account_id, :body => create_participant_body)
-participant_id = create_participant_response.data.participant.id
-puts participant_id
+## Getting Started
-body = Subscriptions.new
-body.session_id = "1234-abcd"
+Please follow the [installation](#installation) procedure and then run the following code:
-web_rtc_client.add_participant_to_session(account_id, session_id, participant_id, body: body)
-```
-
-## Supported Ruby Versions
+```ruby
+# Load the gem
+require 'bandwidth-sdk'
+
+# Setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR_USERNAME'
+ config.password = 'YOUR_PASSWORD'
+ # Configure faraday connection
+ config.configure_faraday_connection { |connection| 'YOUR CONNECTION CONFIG PROC' }
+end
-This package can be used with Ruby >= 2.0
+api_instance = Bandwidth::CallsApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+create_call = Bandwidth::CreateCall.new({to: '+19195551234', from: '+19195554321', application_id: '1234-qwer-5679-tyui', answer_url: 'https://www.myCallbackServer.example/webhooks/answer'}) # CreateCall | JSON object containing information to create an outbound call
-## Documentation
+begin
+ #Create Call
+ result = api_instance.create_call(account_id, create_call)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Exception when calling CallsApi->create_call: #{e}"
+end
-Documentation for this package can be found at https://dev.bandwidth.com/sdks/ruby.html
+```
-## Credentials
+## Documentation for API Endpoints
+
+All URIs are relative to *http://localhost*
+
+Class | Method | HTTP request | Description
+------------ | ------------- | ------------- | -------------
+*Bandwidth::CallsApi* | [**create_call**](docs/CallsApi.md#create_call) | **POST** /accounts/{accountId}/calls | Create Call
+*Bandwidth::CallsApi* | [**get_call_state**](docs/CallsApi.md#get_call_state) | **GET** /accounts/{accountId}/calls/{callId} | Get Call State Information
+*Bandwidth::CallsApi* | [**update_call**](docs/CallsApi.md#update_call) | **POST** /accounts/{accountId}/calls/{callId} | Update Call
+*Bandwidth::CallsApi* | [**update_call_bxml**](docs/CallsApi.md#update_call_bxml) | **PUT** /accounts/{accountId}/calls/{callId}/bxml | Update Call BXML
+*Bandwidth::ConferencesApi* | [**download_conference_recording**](docs/ConferencesApi.md#download_conference_recording) | **GET** /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}/media | Download Conference Recording
+*Bandwidth::ConferencesApi* | [**get_conference**](docs/ConferencesApi.md#get_conference) | **GET** /accounts/{accountId}/conferences/{conferenceId} | Get Conference Information
+*Bandwidth::ConferencesApi* | [**get_conference_member**](docs/ConferencesApi.md#get_conference_member) | **GET** /accounts/{accountId}/conferences/{conferenceId}/members/{memberId} | Get Conference Member
+*Bandwidth::ConferencesApi* | [**get_conference_recording**](docs/ConferencesApi.md#get_conference_recording) | **GET** /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId} | Get Conference Recording Information
+*Bandwidth::ConferencesApi* | [**list_conference_recordings**](docs/ConferencesApi.md#list_conference_recordings) | **GET** /accounts/{accountId}/conferences/{conferenceId}/recordings | Get Conference Recordings
+*Bandwidth::ConferencesApi* | [**list_conferences**](docs/ConferencesApi.md#list_conferences) | **GET** /accounts/{accountId}/conferences | Get Conferences
+*Bandwidth::ConferencesApi* | [**update_conference**](docs/ConferencesApi.md#update_conference) | **POST** /accounts/{accountId}/conferences/{conferenceId} | Update Conference
+*Bandwidth::ConferencesApi* | [**update_conference_bxml**](docs/ConferencesApi.md#update_conference_bxml) | **PUT** /accounts/{accountId}/conferences/{conferenceId}/bxml | Update Conference BXML
+*Bandwidth::ConferencesApi* | [**update_conference_member**](docs/ConferencesApi.md#update_conference_member) | **PUT** /accounts/{accountId}/conferences/{conferenceId}/members/{memberId} | Update Conference Member
+*Bandwidth::MFAApi* | [**generate_messaging_code**](docs/MFAApi.md#generate_messaging_code) | **POST** /accounts/{accountId}/code/messaging | Messaging Authentication Code
+*Bandwidth::MFAApi* | [**generate_voice_code**](docs/MFAApi.md#generate_voice_code) | **POST** /accounts/{accountId}/code/voice | Voice Authentication Code
+*Bandwidth::MFAApi* | [**verify_code**](docs/MFAApi.md#verify_code) | **POST** /accounts/{accountId}/code/verify | Verify Authentication Code
+*Bandwidth::MediaApi* | [**delete_media**](docs/MediaApi.md#delete_media) | **DELETE** /users/{accountId}/media/{mediaId} | Delete Media
+*Bandwidth::MediaApi* | [**get_media**](docs/MediaApi.md#get_media) | **GET** /users/{accountId}/media/{mediaId} | Get Media
+*Bandwidth::MediaApi* | [**list_media**](docs/MediaApi.md#list_media) | **GET** /users/{accountId}/media | List Media
+*Bandwidth::MediaApi* | [**upload_media**](docs/MediaApi.md#upload_media) | **PUT** /users/{accountId}/media/{mediaId} | Upload Media
+*Bandwidth::MessagesApi* | [**create_message**](docs/MessagesApi.md#create_message) | **POST** /users/{accountId}/messages | Create Message
+*Bandwidth::MessagesApi* | [**list_messages**](docs/MessagesApi.md#list_messages) | **GET** /users/{accountId}/messages | List Messages
+*Bandwidth::PhoneNumberLookupApi* | [**create_lookup**](docs/PhoneNumberLookupApi.md#create_lookup) | **POST** /accounts/{accountId}/tnlookup | Create Lookup
+*Bandwidth::PhoneNumberLookupApi* | [**get_lookup_status**](docs/PhoneNumberLookupApi.md#get_lookup_status) | **GET** /accounts/{accountId}/tnlookup/{requestId} | Get Lookup Request Status
+*Bandwidth::RecordingsApi* | [**delete_call_transcription**](docs/RecordingsApi.md#delete_call_transcription) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Delete Transcription
+*Bandwidth::RecordingsApi* | [**delete_recording**](docs/RecordingsApi.md#delete_recording) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId} | Delete Recording
+*Bandwidth::RecordingsApi* | [**delete_recording_media**](docs/RecordingsApi.md#delete_recording_media) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media | Delete Recording Media
+*Bandwidth::RecordingsApi* | [**download_call_recording**](docs/RecordingsApi.md#download_call_recording) | **GET** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media | Download Recording
+*Bandwidth::RecordingsApi* | [**get_call_recording**](docs/RecordingsApi.md#get_call_recording) | **GET** /accounts/{accountId}/calls/{callId}/recordings/{recordingId} | Get Call Recording
+*Bandwidth::RecordingsApi* | [**get_call_transcription**](docs/RecordingsApi.md#get_call_transcription) | **GET** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Get Transcription
+*Bandwidth::RecordingsApi* | [**list_account_call_recordings**](docs/RecordingsApi.md#list_account_call_recordings) | **GET** /accounts/{accountId}/recordings | Get Call Recordings
+*Bandwidth::RecordingsApi* | [**list_call_recordings**](docs/RecordingsApi.md#list_call_recordings) | **GET** /accounts/{accountId}/calls/{callId}/recordings | List Call Recordings
+*Bandwidth::RecordingsApi* | [**transcribe_call_recording**](docs/RecordingsApi.md#transcribe_call_recording) | **POST** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Create Transcription Request
+*Bandwidth::RecordingsApi* | [**update_call_recording_state**](docs/RecordingsApi.md#update_call_recording_state) | **PUT** /accounts/{accountId}/calls/{callId}/recording | Update Recording
+*Bandwidth::StatisticsApi* | [**get_statistics**](docs/StatisticsApi.md#get_statistics) | **GET** /accounts/{accountId}/statistics | Get Account Statistics
+
+
+## Documentation for Models
+
+ - [Bandwidth::AccountStatistics](docs/AccountStatistics.md)
+ - [Bandwidth::AnswerCallback](docs/AnswerCallback.md)
+ - [Bandwidth::BridgeCompleteCallback](docs/BridgeCompleteCallback.md)
+ - [Bandwidth::BridgeTargetCompleteCallback](docs/BridgeTargetCompleteCallback.md)
+ - [Bandwidth::CallDirectionEnum](docs/CallDirectionEnum.md)
+ - [Bandwidth::CallRecordingMetadata](docs/CallRecordingMetadata.md)
+ - [Bandwidth::CallState](docs/CallState.md)
+ - [Bandwidth::CallStateEnum](docs/CallStateEnum.md)
+ - [Bandwidth::CallbackMethodEnum](docs/CallbackMethodEnum.md)
+ - [Bandwidth::CodeRequest](docs/CodeRequest.md)
+ - [Bandwidth::Conference](docs/Conference.md)
+ - [Bandwidth::ConferenceCompletedCallback](docs/ConferenceCompletedCallback.md)
+ - [Bandwidth::ConferenceCreatedCallback](docs/ConferenceCreatedCallback.md)
+ - [Bandwidth::ConferenceMember](docs/ConferenceMember.md)
+ - [Bandwidth::ConferenceMemberExitCallback](docs/ConferenceMemberExitCallback.md)
+ - [Bandwidth::ConferenceMemberJoinCallback](docs/ConferenceMemberJoinCallback.md)
+ - [Bandwidth::ConferenceRecordingAvailableCallback](docs/ConferenceRecordingAvailableCallback.md)
+ - [Bandwidth::ConferenceRecordingMetadata](docs/ConferenceRecordingMetadata.md)
+ - [Bandwidth::ConferenceRedirectCallback](docs/ConferenceRedirectCallback.md)
+ - [Bandwidth::ConferenceStateEnum](docs/ConferenceStateEnum.md)
+ - [Bandwidth::CreateCall](docs/CreateCall.md)
+ - [Bandwidth::CreateCallResponse](docs/CreateCallResponse.md)
+ - [Bandwidth::CreateLookupResponse](docs/CreateLookupResponse.md)
+ - [Bandwidth::CreateMessageRequestError](docs/CreateMessageRequestError.md)
+ - [Bandwidth::DeferredResult](docs/DeferredResult.md)
+ - [Bandwidth::DisconnectCallback](docs/DisconnectCallback.md)
+ - [Bandwidth::Diversion](docs/Diversion.md)
+ - [Bandwidth::DtmfCallback](docs/DtmfCallback.md)
+ - [Bandwidth::FieldError](docs/FieldError.md)
+ - [Bandwidth::FileFormatEnum](docs/FileFormatEnum.md)
+ - [Bandwidth::GatherCallback](docs/GatherCallback.md)
+ - [Bandwidth::InboundMessageCallback](docs/InboundMessageCallback.md)
+ - [Bandwidth::InboundMessageCallbackMessage](docs/InboundMessageCallbackMessage.md)
+ - [Bandwidth::InitiateCallback](docs/InitiateCallback.md)
+ - [Bandwidth::ListMessageDirectionEnum](docs/ListMessageDirectionEnum.md)
+ - [Bandwidth::ListMessageItem](docs/ListMessageItem.md)
+ - [Bandwidth::LookupRequest](docs/LookupRequest.md)
+ - [Bandwidth::LookupResult](docs/LookupResult.md)
+ - [Bandwidth::LookupStatus](docs/LookupStatus.md)
+ - [Bandwidth::LookupStatusEnum](docs/LookupStatusEnum.md)
+ - [Bandwidth::MachineDetectionCompleteCallback](docs/MachineDetectionCompleteCallback.md)
+ - [Bandwidth::MachineDetectionConfiguration](docs/MachineDetectionConfiguration.md)
+ - [Bandwidth::MachineDetectionModeEnum](docs/MachineDetectionModeEnum.md)
+ - [Bandwidth::MachineDetectionResult](docs/MachineDetectionResult.md)
+ - [Bandwidth::Media](docs/Media.md)
+ - [Bandwidth::Message](docs/Message.md)
+ - [Bandwidth::MessageDeliveredCallback](docs/MessageDeliveredCallback.md)
+ - [Bandwidth::MessageDeliveredCallbackMessage](docs/MessageDeliveredCallbackMessage.md)
+ - [Bandwidth::MessageDirectionEnum](docs/MessageDirectionEnum.md)
+ - [Bandwidth::MessageFailedCallback](docs/MessageFailedCallback.md)
+ - [Bandwidth::MessageFailedCallbackMessage](docs/MessageFailedCallbackMessage.md)
+ - [Bandwidth::MessageRequest](docs/MessageRequest.md)
+ - [Bandwidth::MessageSendingCallback](docs/MessageSendingCallback.md)
+ - [Bandwidth::MessageSendingCallbackMessage](docs/MessageSendingCallbackMessage.md)
+ - [Bandwidth::MessageStatusEnum](docs/MessageStatusEnum.md)
+ - [Bandwidth::MessageTypeEnum](docs/MessageTypeEnum.md)
+ - [Bandwidth::MessagesList](docs/MessagesList.md)
+ - [Bandwidth::MessagingCodeResponse](docs/MessagingCodeResponse.md)
+ - [Bandwidth::MessagingRequestError](docs/MessagingRequestError.md)
+ - [Bandwidth::MfaForbiddenRequestError](docs/MfaForbiddenRequestError.md)
+ - [Bandwidth::MfaRequestError](docs/MfaRequestError.md)
+ - [Bandwidth::MfaUnauthorizedRequestError](docs/MfaUnauthorizedRequestError.md)
+ - [Bandwidth::PageInfo](docs/PageInfo.md)
+ - [Bandwidth::PriorityEnum](docs/PriorityEnum.md)
+ - [Bandwidth::RecordingAvailableCallback](docs/RecordingAvailableCallback.md)
+ - [Bandwidth::RecordingCompleteCallback](docs/RecordingCompleteCallback.md)
+ - [Bandwidth::RecordingStateEnum](docs/RecordingStateEnum.md)
+ - [Bandwidth::RedirectCallback](docs/RedirectCallback.md)
+ - [Bandwidth::RedirectMethodEnum](docs/RedirectMethodEnum.md)
+ - [Bandwidth::StirShaken](docs/StirShaken.md)
+ - [Bandwidth::Tag](docs/Tag.md)
+ - [Bandwidth::TnLookupRequestError](docs/TnLookupRequestError.md)
+ - [Bandwidth::TranscribeRecording](docs/TranscribeRecording.md)
+ - [Bandwidth::Transcription](docs/Transcription.md)
+ - [Bandwidth::TranscriptionAvailableCallback](docs/TranscriptionAvailableCallback.md)
+ - [Bandwidth::TranscriptionList](docs/TranscriptionList.md)
+ - [Bandwidth::TranscriptionMetadata](docs/TranscriptionMetadata.md)
+ - [Bandwidth::TransferAnswerCallback](docs/TransferAnswerCallback.md)
+ - [Bandwidth::TransferCompleteCallback](docs/TransferCompleteCallback.md)
+ - [Bandwidth::TransferDisconnectCallback](docs/TransferDisconnectCallback.md)
+ - [Bandwidth::UpdateCall](docs/UpdateCall.md)
+ - [Bandwidth::UpdateCallRecording](docs/UpdateCallRecording.md)
+ - [Bandwidth::UpdateConference](docs/UpdateConference.md)
+ - [Bandwidth::UpdateConferenceMember](docs/UpdateConferenceMember.md)
+ - [Bandwidth::VerifyCodeRequest](docs/VerifyCodeRequest.md)
+ - [Bandwidth::VerifyCodeResponse](docs/VerifyCodeResponse.md)
+ - [Bandwidth::VoiceApiError](docs/VoiceApiError.md)
+ - [Bandwidth::VoiceCodeResponse](docs/VoiceCodeResponse.md)
+
+
+## Documentation for Authorization
+
+
+Authentication schemes defined for the API:
+### Basic
+
+- **Type**: HTTP basic authentication
-Information for credentials for this package can be found at https://dev.bandwidth.com/guides/accountCredentials.html
diff --git a/Rakefile b/Rakefile
index 6bf529f4..55a4d0a1 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,13 +1,30 @@
-lib = File.expand_path('../lib', __FILE__)
-$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
-
-require "bundler/gem_tasks"
-require 'rake/testtask'
-
-Rake::TestTask.new(:test) do |t|
- t.libs << "test"
- t.test_files = FileList['test/**/test_*.rb', 'spec/**/*_spec.rb']
- t.warning = false
-end
-
-task :default => :test
+require 'bundler/gem_tasks'
+
+begin
+ require 'rspec/core/rake_task'
+
+ desc 'Run All Tests'
+ RSpec::Core::RakeTask.new(:spec)
+
+ desc 'Run Only Unit Tests'
+ RSpec::Core::RakeTask.new(:unit) do |t|
+ t.pattern = './spec/api/**/*_spec.rb'
+ end
+ RSpec::Core::RakeTask.new(:unit) do |t|
+ t.pattern = './spec/models/**/*_spec.rb'
+ end
+
+ desc 'Run Only Integration Tests'
+ RSpec::Core::RakeTask.new(:integration) do |t|
+ t.pattern = './spec/integration/*_spec.rb'
+ end
+
+ desc 'Run Only Client Unit Tests'
+ RSpec::Core::RakeTask.new(:client) do |t|
+ t.pattern = './spec/*_spec.rb'
+ end
+
+ task default: :spec
+rescue LoadError
+ # no rspec available
+end
diff --git a/bandwidth-sdk.gemspec b/bandwidth-sdk.gemspec
new file mode 100644
index 00000000..3ed52c1c
--- /dev/null
+++ b/bandwidth-sdk.gemspec
@@ -0,0 +1,40 @@
+# -*- encoding: utf-8 -*-
+
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+$:.push File.expand_path('../lib', __FILE__)
+require 'bandwidth-sdk/version'
+
+Gem::Specification.new do |s|
+ s.name = 'bandwidth-sdk'
+ s.version = Bandwidth::VERSION
+ s.platform = Gem::Platform::RUBY
+ s.authors = ['Bandwidth']
+ s.email = ['dx@bandwidth.com']
+ s.homepage = 'https://github.com/Bandwidth/ruby-sdk'
+ s.summary = 'Bandwidth Ruby SDK'
+ s.description = 'The official client SDK for Bandwidth's Voice, Messaging, MFA, and WebRTC APIs'
+ s.license = 'MIT'
+ s.required_ruby_version = '>=2.7'
+
+ s.add_runtime_dependency 'faraday', '>= 1.0.1', '< 3.0'
+ s.add_runtime_dependency 'faraday-multipart'
+ s.add_runtime_dependency 'ox', '~> 2.4'
+
+ s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
+
+ s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
+ s.test_files = `find spec/*`.split("\n")
+ s.executables = []
+ s.require_paths = ['lib']
+end
diff --git a/bandwidth.gemspec b/bandwidth.gemspec
deleted file mode 100644
index 78bbecea..00000000
--- a/bandwidth.gemspec
+++ /dev/null
@@ -1,23 +0,0 @@
-Gem::Specification.new do |s|
- s.name = 'bandwidth-sdk'
- s.version = '10.5.0'
- s.summary = 'Bandwidth'
- s.description = 'The official client SDK for Bandwidht\'s Voice, Messaging, MFA, and WebRTC APIs'
- s.authors = ['Bandwidth']
- s.email = 'dx@bandwidth.com'
- s.homepage = 'https://github.com/Bandwidth/ruby-sdk'
- s.license = 'MIT'
- s.add_dependency('logging', '~> 2.3')
- s.add_dependency('faraday', '>= 1.0', '< 3.0')
- s.add_dependency('faraday-follow_redirects', '~> 0.3')
- s.add_dependency('faraday-multipart', '~> 1.0')
- s.add_dependency('faraday-retry', '~> 1.0')
- s.add_dependency('faraday-http-cache', '~> 2.2')
- s.add_dependency('builder', '~> 3.2.4')
- s.add_development_dependency('minitest', '~> 5.14', '>= 5.14.1')
- s.add_development_dependency('minitest-proveit', '~> 1.0')
- s.add_development_dependency('test-unit')
- s.required_ruby_version = ['>= 2.0']
- s.files = Dir['{bin,lib,man,test,spec}/**/*', 'README*', 'LICENSE*']
- s.require_paths = ['lib']
-end
diff --git a/bandwidth.yml b/bandwidth.yml
new file mode 100644
index 00000000..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/custom_templates/Gemfile.mustache b/custom_templates/Gemfile.mustache
new file mode 100644
index 00000000..ed673756
--- /dev/null
+++ b/custom_templates/Gemfile.mustache
@@ -0,0 +1,11 @@
+source 'https://rubygems.org'
+
+gemspec
+
+group :development, :test do
+ gem 'rake', '~> 13.0.1'
+ gem 'pry-byebug'
+ gem 'rubocop', '~> 1.52.0'
+ gem 'webmock', '~> 3.18.0'
+ gem 'simplecov', '~> 0.21.2'
+end
diff --git a/custom_templates/README.mustache b/custom_templates/README.mustache
new file mode 100644
index 00000000..9ca7a51d
--- /dev/null
+++ b/custom_templates/README.mustache
@@ -0,0 +1,173 @@
+# {{gemName}}
+
+[![Gem Version](https://badge.fury.io/rb/bandwidth-sdk.svg)](https://badge.fury.io/rb/bandwidth-sdk)
+[![Tests](https://github.com/Bandwidth/ruby-sdk/actions/workflows/test-nightly.yml/badge.svg)](https://github.com/Bandwidth/ruby-sdk/actions/workflows/test-nightly.yml)
+[![Ruby Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop/rubocop)
+
+
+| **OS** | **Ruby** |
+|:---:|:---:|
+| Windows 2019 | 2.7, 3.0, 3.1, 3.2 |
+| Windows 2022 | 2.7, 3.0, 3.1, 3.2 |
+| Ubuntu 20.04 | 2.7, 3.0, 3.1, 3.2 |
+| Ubuntu 22.04 | 2.7, 3.0, 3.1, 3.2 |
+
+{{moduleName}} - the Ruby gem for the {{appName}}
+
+# Generated with the command:
+`openapi-generator generate -g ruby -i bandwidth.yml -c openapi-config.yml -o ./`
+
+{{#appDescriptionWithNewLines}}
+{{{.}}}
+{{/appDescriptionWithNewLines}}
+
+This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
+
+- API version: {{appVersion}}
+- Package version: {{gemVersion}}
+{{^hideGenerationTimestamp}}
+- Build date: {{generatedDate}}
+{{/hideGenerationTimestamp}}
+- Build package: {{generatorClass}}
+{{#infoUrl}}
+For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
+{{/infoUrl}}
+
+## Installation
+
+### Build a gem
+
+To build the Ruby code into a gem:
+
+```shell
+gem build {{{gemName}}}.gemspec
+```
+
+Then either install the gem locally:
+
+```shell
+gem install ./{{{gemName}}}-{{{gemVersion}}}.gem
+```
+
+(for development, run `gem install --dev ./{{{gemName}}}-{{{gemVersion}}}.gem` to install the development dependencies)
+
+or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
+
+Finally add this to the Gemfile:
+
+ gem '{{{gemName}}}', '~> {{{gemVersion}}}'
+
+### Install from Git
+
+If the Ruby gem is hosted at a git repository: https://{{gitHost}}/{{gitUserId}}{{^gitUserId}}YOUR_GIT_USERNAME{{/gitUserId}}/{{gitRepoId}}{{^gitRepoId}}YOUR_GIT_REPO{{/gitRepoId}}, then add the following in the Gemfile:
+
+ gem '{{{gemName}}}', :git => 'https://{{gitHost}}/{{gitUserId}}{{^gitUserId}}YOUR_GIT_USERNAME{{/gitUserId}}/{{gitRepoId}}{{^gitRepoId}}YOUR_GIT_REPO{{/gitRepoId}}.git'
+
+### Include the Ruby code directly
+
+Include the Ruby code directly using `-I` as follows:
+
+```shell
+ruby -Ilib script.rb
+```
+
+## Getting Started
+
+Please follow the [installation](#installation) procedure and then run the following code:
+
+```ruby
+# Load the gem
+require '{{{gemName}}}'
+{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}{{#hasAuthMethods}}
+# Setup authorization
+{{{moduleName}}}.configure do |config|{{#authMethods}}{{#isBasic}}{{#isBasicBasic}}
+ # Configure HTTP basic authorization: {{{name}}}
+ config.username = 'YOUR_USERNAME'
+ config.password = 'YOUR_PASSWORD'{{/isBasicBasic}}{{#isBasicBearer}}
+ # Configure Bearer authorization{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}: {{{name}}}
+ config.access_token = 'YOUR_BEARER_TOKEN'
+ # Configure a proc to get access tokens in lieu of the static access_token configuration
+ config.access_token_getter = -> { 'YOUR TOKEN GETTER PROC' } {{/isBasicBearer}}{{/isBasic}}{{#isApiKey}}
+ # Configure API key authorization: {{{name}}}
+ config.api_key['{{{name}}}'] = 'YOUR API KEY'
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
+ # config.api_key_prefix['{{{name}}}'] = 'Bearer'{{/isApiKey}}{{#isOAuth}}
+ # Configure OAuth2 access token for authorization: {{{name}}}
+ config.access_token = 'YOUR ACCESS TOKEN'
+ # Configure a proc to get access tokens in lieu of the static access_token configuration
+ config.access_token_getter = -> { 'YOUR TOKEN GETTER PROC' } {{/isOAuth}}
+ {{#isFaraday}}
+ # Configure faraday connection
+ config.configure_faraday_connection { |connection| 'YOUR CONNECTION CONFIG PROC' }
+ {{/isFaraday}}
+{{/authMethods}}end
+{{/hasAuthMethods}}
+
+api_instance = {{{moduleName}}}::{{{classname}}}.new
+{{#requiredParams}}
+{{{paramName}}} = {{{vendorExtensions.x-ruby-example}}} # {{{dataType}}} | {{{description}}}
+{{/requiredParams}}
+{{#optionalParams}}
+{{#-first}}
+opts = {
+{{/-first}}
+ {{{paramName}}}: {{{vendorExtensions.x-ruby-example}}}{{^-last}},{{/-last}} # {{{dataType}}} | {{{description}}}
+{{#-last}}
+}
+{{/-last}}
+{{/optionalParams}}
+
+begin
+{{#summary}} #{{{.}}}
+{{/summary}} {{#returnType}}result = {{/returnType}}api_instance.{{{operationId}}}{{#hasParams}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-last}}{{#hasRequiredParams}}, {{/hasRequiredParams}}opts{{/-last}}{{/optionalParams}}){{/hasParams}}{{#returnType}}
+ p result{{/returnType}}
+rescue {{{moduleName}}}::ApiError => e
+ puts "Exception when calling {{classname}}->{{{operationId}}}: #{e}"
+end
+{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}}
+```
+
+## Documentation for API Endpoints
+
+All URIs are relative to *{{basePath}}*
+
+Class | Method | HTTP request | Description
+------------ | ------------- | ------------- | -------------
+{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{moduleName}}::{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{{summary}}}
+{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
+
+## Documentation for Models
+
+{{#models}}{{#model}} - [{{moduleName}}::{{classname}}]({{modelDocPath}}{{classname}}.md)
+{{/model}}{{/models}}
+
+## Documentation for Authorization
+
+{{^authMethods}}Endpoints do not require authorization.{{/authMethods}}
+{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}}
+{{#authMethods}}
+### {{name}}
+
+{{#isApiKey}}
+
+- **Type**: API key
+- **API key parameter name**: {{keyParamName}}
+- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}
+{{/isApiKey}}
+{{#isBasic}}
+{{#isBasicBasic}}- **Type**: HTTP basic authentication
+{{/isBasicBasic}}{{#isBasicBearer}}- **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}
+{{/isBasicBearer}}{{#isHttpSignature}}- **Type**: HTTP signature authentication
+{{/isHttpSignature}}
+{{/isBasic}}
+{{#isOAuth}}
+
+- **Type**: OAuth
+- **Flow**: {{flow}}
+- **Authorization URL**: {{authorizationUrl}}
+- **Scopes**: {{^scopes}}N/A{{/scopes}}
+{{#scopes}} - {{scope}}: {{description}}
+{{/scopes}}
+{{/isOAuth}}
+
+{{/authMethods}}
diff --git a/custom_templates/gem.mustache b/custom_templates/gem.mustache
new file mode 100644
index 00000000..ed66ea55
--- /dev/null
+++ b/custom_templates/gem.mustache
@@ -0,0 +1,99 @@
+=begin
+{{> api_info}}
+=end
+
+# Common files
+require '{{gemName}}/api_client'
+require '{{gemName}}/api_error'
+require '{{gemName}}/version'
+require '{{gemName}}/configuration'
+
+# Models
+{{^useAutoload}}
+{{#models}}
+{{#model}}
+{{^parent}}
+require '{{gemName}}/{{modelPackage}}/{{classFilename}}'
+{{/parent}}
+{{/model}}
+{{/models}}
+{{#models}}
+{{#model}}
+{{#parent}}
+require '{{gemName}}/{{modelPackage}}/{{classFilename}}'
+{{/parent}}
+{{/model}}
+{{/models}}
+{{/useAutoload}}
+{{#useAutoload}}
+{{#models}}
+{{#model}}
+{{moduleName}}.autoload :{{classname}}, '{{gemName}}/{{modelPackage}}/{{classFilename}}'
+{{/model}}
+{{/models}}
+{{/useAutoload}}
+
+# BXML
+require 'bandwidth-sdk/models/bxml/root'
+require 'bandwidth-sdk/models/bxml/bxml'
+require 'bandwidth-sdk/models/bxml/response'
+require 'bandwidth-sdk/models/bxml/verb'
+require 'bandwidth-sdk/models/bxml/nestable_verb'
+require 'bandwidth-sdk/models/bxml/verbs/bridge'
+require 'bandwidth-sdk/models/bxml/verbs/conference'
+require 'bandwidth-sdk/models/bxml/verbs/custom_param'
+require 'bandwidth-sdk/models/bxml/verbs/forward'
+require 'bandwidth-sdk/models/bxml/verbs/gather'
+require 'bandwidth-sdk/models/bxml/verbs/hangup'
+require 'bandwidth-sdk/models/bxml/verbs/pause_recording'
+require 'bandwidth-sdk/models/bxml/verbs/pause'
+require 'bandwidth-sdk/models/bxml/verbs/phone_number'
+require 'bandwidth-sdk/models/bxml/verbs/play_audio'
+require 'bandwidth-sdk/models/bxml/verbs/record'
+require 'bandwidth-sdk/models/bxml/verbs/redirect'
+require 'bandwidth-sdk/models/bxml/verbs/resume_recording'
+require 'bandwidth-sdk/models/bxml/verbs/ring'
+require 'bandwidth-sdk/models/bxml/verbs/send_dtmf'
+require 'bandwidth-sdk/models/bxml/verbs/sip_uri'
+require 'bandwidth-sdk/models/bxml/verbs/speak_sentence'
+require 'bandwidth-sdk/models/bxml/verbs/start_gather'
+require 'bandwidth-sdk/models/bxml/verbs/start_recording'
+require 'bandwidth-sdk/models/bxml/verbs/start_stream'
+require 'bandwidth-sdk/models/bxml/verbs/start_transcription'
+require 'bandwidth-sdk/models/bxml/verbs/stop_gather'
+require 'bandwidth-sdk/models/bxml/verbs/stop_recording'
+require 'bandwidth-sdk/models/bxml/verbs/stop_stream'
+require 'bandwidth-sdk/models/bxml/verbs/stop_transcription'
+require 'bandwidth-sdk/models/bxml/verbs/stream_param'
+require 'bandwidth-sdk/models/bxml/verbs/tag'
+require 'bandwidth-sdk/models/bxml/verbs/transfer'
+
+# APIs
+{{#apiInfo}}
+{{#apis}}
+{{^useAutoload}}
+require '{{importPath}}'
+{{/useAutoload}}
+{{#useAutoload}}
+{{moduleName}}.autoload :{{classname}}, '{{importPath}}'
+{{/useAutoload}}
+{{/apis}}
+{{/apiInfo}}
+
+module {{moduleName}}
+ class << self
+ # Customize default settings for the SDK using block.
+ # {{moduleName}}.configure do |config|
+ # config.username = "xxx"
+ # config.password = "xxx"
+ # end
+ # If no block given, return the default Configuration object.
+ def configure
+ if block_given?
+ yield(Configuration.default)
+ else
+ Configuration.default
+ end
+ end
+ end
+end
diff --git a/custom_templates/gemspec.mustache b/custom_templates/gemspec.mustache
new file mode 100644
index 00000000..5442f71b
--- /dev/null
+++ b/custom_templates/gemspec.mustache
@@ -0,0 +1,37 @@
+# -*- encoding: utf-8 -*-
+
+=begin
+{{> api_info}}
+=end
+
+$:.push File.expand_path("../lib", __FILE__)
+require "{{gemName}}/version"
+
+Gem::Specification.new do |s|
+ s.name = "{{gemName}}{{^gemName}}{{{appName}}}{{/gemName}}"
+ s.version = {{moduleName}}::VERSION
+ s.platform = Gem::Platform::RUBY
+ s.authors = ["{{gemAuthor}}{{^gemAuthor}}OpenAPI-Generator{{/gemAuthor}}"]
+ s.email = ["{{gemAuthorEmail}}{{^gemAuthorEmail}}{{infoEmail}}{{/gemAuthorEmail}}"]
+ s.homepage = "{{gemHomepage}}{{^gemHomepage}}https://openapi-generator.tech{{/gemHomepage}}"
+ s.summary = "{{gemSummary}}{{^gemSummary}}{{{appName}}} Ruby Gem{{/gemSummary}}"
+ s.description = "{{gemDescription}}{{^gemDescription}}{{{appDescription}}}{{^appDescription}}{{{appName}}} Ruby Gem{{/appDescription}}{{/gemDescription}}"
+ s.license = "{{{gemLicense}}}{{^gemLicense}}Unlicense{{/gemLicense}}"
+ s.required_ruby_version = "{{{gemRequiredRubyVersion}}}{{^gemRequiredRubyVersion}}>= 2.7{{/gemRequiredRubyVersion}}"
+
+ {{#isFaraday}}
+ s.add_runtime_dependency 'faraday', '>= 1.0.1', '< 3.0'
+ s.add_runtime_dependency 'faraday-multipart'
+ {{/isFaraday}}
+ {{^isFaraday}}
+ s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
+ {{/isFaraday}}
+ s.add_runtime_dependency 'ox', '~> 2.4'
+
+ s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
+
+ s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
+ s.test_files = `find spec/*`.split("\n")
+ s.executables = []
+ s.require_paths = ["lib"]
+end
diff --git a/docs/AccountStatistics.md b/docs/AccountStatistics.md
new file mode 100644
index 00000000..7786deb4
--- /dev/null
+++ b/docs/AccountStatistics.md
@@ -0,0 +1,20 @@
+# Bandwidth::AccountStatistics
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **current_call_queue_size** | **Integer** | The number of calls currently enqueued. | [optional] |
+| **max_call_queue_size** | **Integer** | The maximum size of the queue before outgoing calls start being rejected. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::AccountStatistics.new(
+ current_call_queue_size: 0,
+ max_call_queue_size: 900
+)
+```
+
diff --git a/docs/AnswerCallback.md b/docs/AnswerCallback.md
new file mode 100644
index 00000000..c3989f6b
--- /dev/null
+++ b/docs/AnswerCallback.md
@@ -0,0 +1,44 @@
+# Bandwidth::AnswerCallback
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] |
+| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
+| **account_id** | **String** | The user account associated with the call. | [optional] |
+| **application_id** | **String** | The id of the application associated with the call. | [optional] |
+| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
+| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
+| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] |
+| **call_id** | **String** | The call id associated with the event. | [optional] |
+| **call_url** | **String** | The URL of the call associated with the event. | [optional] |
+| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] |
+| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] |
+| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] |
+| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] |
+| **machine_detection_result** | [**MachineDetectionResult**](MachineDetectionResult.md) | | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::AnswerCallback.new(
+ event_type: bridgeComplete,
+ event_time: 2022-06-17T22:19:40.375Z,
+ account_id: 920012,
+ application_id: 04e88489-df02-4e34-a0ee-27a91849555f,
+ from: +15555555555,
+ to: +15555555555,
+ direction: null,
+ call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ call_url: https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ enqueued_time: 2022-06-17T22:20Z,
+ start_time: 2022-06-17T22:19:40.375Z,
+ answer_time: 2022-06-17T22:20Z,
+ tag: exampleTag,
+ machine_detection_result: null
+)
+```
+
diff --git a/docs/BridgeCompleteCallback.md b/docs/BridgeCompleteCallback.md
new file mode 100644
index 00000000..916ef99f
--- /dev/null
+++ b/docs/BridgeCompleteCallback.md
@@ -0,0 +1,48 @@
+# Bandwidth::BridgeCompleteCallback
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] |
+| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
+| **account_id** | **String** | The user account associated with the call. | [optional] |
+| **application_id** | **String** | The id of the application associated with the call. | [optional] |
+| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
+| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
+| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] |
+| **call_id** | **String** | The call id associated with the event. | [optional] |
+| **call_url** | **String** | The URL of the call associated with the event. | [optional] |
+| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] |
+| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] |
+| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] |
+| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] |
+| **cause** | **String** | Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown. | [optional] |
+| **error_message** | **String** | Text explaining the reason that caused the call to fail in case of errors. | [optional] |
+| **error_id** | **String** | Bandwidth's internal id that references the error event. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::BridgeCompleteCallback.new(
+ event_type: bridgeComplete,
+ event_time: 2022-06-17T22:19:40.375Z,
+ account_id: 920012,
+ application_id: 04e88489-df02-4e34-a0ee-27a91849555f,
+ from: +15555555555,
+ to: +15555555555,
+ direction: null,
+ call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ call_url: https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ enqueued_time: 2022-06-17T22:20Z,
+ start_time: 2022-06-17T22:19:40.375Z,
+ answer_time: 2022-06-17T22:20Z,
+ tag: exampleTag,
+ cause: busy,
+ error_message: Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call,
+ error_id: 4642074b-7b58-478b-96e4-3a60955c6765
+)
+```
+
diff --git a/docs/BridgeTargetCompleteCallback.md b/docs/BridgeTargetCompleteCallback.md
new file mode 100644
index 00000000..273fd538
--- /dev/null
+++ b/docs/BridgeTargetCompleteCallback.md
@@ -0,0 +1,42 @@
+# Bandwidth::BridgeTargetCompleteCallback
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] |
+| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
+| **account_id** | **String** | The user account associated with the call. | [optional] |
+| **application_id** | **String** | The id of the application associated with the call. | [optional] |
+| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
+| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
+| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] |
+| **call_id** | **String** | The call id associated with the event. | [optional] |
+| **call_url** | **String** | The URL of the call associated with the event. | [optional] |
+| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] |
+| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] |
+| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] |
+| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::BridgeTargetCompleteCallback.new(
+ event_type: bridgeComplete,
+ event_time: 2022-06-17T22:19:40.375Z,
+ account_id: 920012,
+ application_id: 04e88489-df02-4e34-a0ee-27a91849555f,
+ from: +15555555555,
+ to: +15555555555,
+ direction: null,
+ call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ call_url: https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ enqueued_time: 2022-06-17T22:20Z,
+ start_time: 2022-06-17T22:19:40.375Z,
+ answer_time: 2022-06-17T22:20Z,
+ tag: exampleTag
+)
+```
+
diff --git a/docs/CallDirectionEnum.md b/docs/CallDirectionEnum.md
new file mode 100644
index 00000000..be53c1e2
--- /dev/null
+++ b/docs/CallDirectionEnum.md
@@ -0,0 +1,15 @@
+# Bandwidth::CallDirectionEnum
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::CallDirectionEnum.new()
+```
+
diff --git a/docs/CallRecordingMetadata.md b/docs/CallRecordingMetadata.md
new file mode 100644
index 00000000..a099923c
--- /dev/null
+++ b/docs/CallRecordingMetadata.md
@@ -0,0 +1,52 @@
+# Bandwidth::CallRecordingMetadata
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **application_id** | **String** | The id of the application associated with the call. | [optional] |
+| **account_id** | **String** | The user account associated with the call. | [optional] |
+| **call_id** | **String** | The call id associated with the event. | [optional] |
+| **parent_call_id** | **String** | (optional) If the event is related to the B leg of a <Transfer>, the call id of the original call leg that executed the <Transfer>. Otherwise, this field will not be present. | [optional] |
+| **recording_id** | **String** | The unique ID of this recording | [optional] |
+| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
+| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
+| **transfer_caller_id** | **String** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] |
+| **transfer_to** | **String** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] |
+| **duration** | **String** | The duration of the recording in ISO-8601 format | [optional] |
+| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] |
+| **channels** | **Integer** | Always `1` for conference recordings; multi-channel recordings are not supported on conferences. | [optional] |
+| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] |
+| **end_time** | **Time** | The time that the recording ended in ISO-8601 format | [optional] |
+| **file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional] |
+| **status** | **String** | The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional] |
+| **media_url** | **String** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional] |
+| **transcription** | [**TranscriptionMetadata**](TranscriptionMetadata.md) | | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::CallRecordingMetadata.new(
+ application_id: 04e88489-df02-4e34-a0ee-27a91849555f,
+ account_id: 920012,
+ call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ parent_call_id: c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d,
+ recording_id: r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833,
+ to: +15555555555,
+ from: +15555555555,
+ transfer_caller_id: +15555555555,
+ transfer_to: +15555555555),
+ duration: PT13.67S,
+ direction: null,
+ channels: 1,
+ start_time: 2022-06-17T22:19:40.375Z,
+ end_time: 2022-06-17T22:20Z,
+ file_format: null,
+ status: completed,
+ media_url: https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media,
+ transcription: null
+)
+```
+
diff --git a/docs/CallState.md b/docs/CallState.md
new file mode 100644
index 00000000..4c4240e3
--- /dev/null
+++ b/docs/CallState.md
@@ -0,0 +1,52 @@
+# Bandwidth::CallState
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **application_id** | **String** | The application id associated with the call. | [optional] |
+| **account_id** | **String** | The account id associated with the call. | [optional] |
+| **call_id** | **String** | The programmable voice API call ID. | [optional] |
+| **parent_call_id** | **String** | The A-leg call id, set only if this call is the B-leg of a [`<Transfer>`](/docs/voice/bxml/transfer). | [optional] |
+| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555), or if the call was to a SIP URI, the SIP URI. | [optional] |
+| **from** | **String** | The phone number that made the call, in E.164 format (e.g. +15555555555). | [optional] |
+| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] |
+| **state** | **String** | The current state of the call. Current possible values are `queued`, `initiated`, `answered` and `disconnected`. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional] |
+| **stir_shaken** | **Hash<String, String>** | For inbound calls, the Bandwidth STIR/SHAKEN implementation will verify the information provided in the inbound invite request `Identity` header. The verification status is stored in the call state `stirShaken` property as follows. | Property | Description | |:------------------|:------------| | verstat | (optional) The verification status indicating whether the verification was successful or not. Possible values are `TN-Verification-Passed` or `TN-Verification-Failed`. | | attestationIndicator | (optional) The attestation level verified by Bandwidth. Possible values are `A` (full), `B` (partial) or `C` (gateway). | | originatingId | (optional) A unique origination identifier. | Note that these are common properties but that the `stirShaken` object is free form and can contain other key-value pairs. More information: [Understanding STIR/SHAKEN](https://www.bandwidth.com/regulations/stir-shaken). | [optional] |
+| **identity** | **String** | The value of the `Identity` header from the inbound invite request. Only present for inbound calls and if the account is configured to forward this header. | [optional] |
+| **enqueued_time** | **Time** | The time this call was placed in queue. | [optional] |
+| **start_time** | **Time** | The time the call was initiated, in ISO 8601 format. `null` if the call is still in your queue. | [optional] |
+| **answer_time** | **Time** | Populated once the call has been answered, with the time in ISO 8601 format. | [optional] |
+| **end_time** | **Time** | Populated once the call has ended, with the time in ISO 8601 format. | [optional] |
+| **disconnect_cause** | **String** | | Cause | Description | |:------|:------------| | `hangup`| One party hung up the call, a [`<Hangup>`](../../bxml/verbs/hangup.md) verb was executed, or there was no more BXML to execute; it indicates that the call ended normally. | | `busy` | Callee was busy. | | `timeout` | Call wasn't answered before the `callTimeout` was reached. | | `cancel` | Call was cancelled by its originator while it was ringing. | | `rejected` | Call was rejected by the callee. | | `callback-error` | BXML callback couldn't be delivered to your callback server. | | `invalid-bxml` | Invalid BXML was returned in response to a callback. | | `application-error` | An unsupported action was tried on the call, e.g. trying to play a .ogg audio. | | `account-limit` | Account rate limits were reached. | | `node-capacity-exceeded` | System maximum capacity was reached. | | `error` | Some error not described in any of the other causes happened on the call. | | `unknown` | Unknown error happened on the call. | Note: This list is not exhaustive and other values can appear in the future. | [optional] |
+| **error_message** | **String** | Populated only if the call ended with an error, with text explaining the reason. | [optional] |
+| **error_id** | **String** | Populated only if the call ended with an error, with a Bandwidth internal id that references the error event. | [optional] |
+| **last_update** | **Time** | The last time the call had a state update, in ISO 8601 format. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::CallState.new(
+ application_id: 04e88489-df02-4e34-a0ee-27a91849555f,
+ account_id: 9900000,
+ call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ parent_call_id: c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ to: +19195551234,
+ from: 19195554321,
+ direction: null,
+ state: disconnected,
+ stir_shaken: {"verstat":"TN-Verification-Passed","attestationIndicator":"A","originatingId":"abc123"},
+ identity: eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9idy1zaGFrZW4tY2VydC1wdWIuczMuYW1hem9uYXdzLmNvbS9iYW5kd2lkdGgtc2hha2VuLWNlcnRfMjAyMzA3MTYucGVtIn0.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTg0MjgyMDI4MCJdfSwiaWF0IjoxNjU2NTM0MzM2LCJvcmlnIjp7InRuIjoiMTkxOTQ0NDI2ODMifSwib3JpZ2lkIjoiNDk0NTlhOGEtNDJmNi0zNTFjLTkzNjEtYWRmNTdhOWUwOGNhIn0.56un9sRw_uH-sbJvnUsqdevlVxbOVjn8MVlGTlBMicjaZuRRwxfiNp-C9zYCMKTTCbc-QdYPN05F61XNVN4D3w;info=<https://bw-shaken-cert-pub.s3.amazonaws.com/bandwidth-shaken-cert_20230716.pem>;alg=ES256;ppt=shaken,
+ enqueued_time: 2022-06-16T13:15:07.160Z,
+ start_time: 2022-06-16T13:15:07.160Z,
+ answer_time: 2022-06-16T13:15:18.126Z,
+ end_time: 2022-06-16T13:15:18.314Z,
+ disconnect_cause: null,
+ error_message: null,
+ error_id: null,
+ last_update: 2022-06-16T13:15:18.314Z
+)
+```
+
diff --git a/docs/CallStateEnum.md b/docs/CallStateEnum.md
new file mode 100644
index 00000000..483b4a8c
--- /dev/null
+++ b/docs/CallStateEnum.md
@@ -0,0 +1,15 @@
+# Bandwidth::CallStateEnum
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::CallStateEnum.new()
+```
+
diff --git a/docs/CallbackMethodEnum.md b/docs/CallbackMethodEnum.md
new file mode 100644
index 00000000..5f8a72bb
--- /dev/null
+++ b/docs/CallbackMethodEnum.md
@@ -0,0 +1,15 @@
+# Bandwidth::CallbackMethodEnum
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::CallbackMethodEnum.new()
+```
+
diff --git a/docs/CallsApi.md b/docs/CallsApi.md
new file mode 100644
index 00000000..36c7f190
--- /dev/null
+++ b/docs/CallsApi.md
@@ -0,0 +1,304 @@
+# Bandwidth::CallsApi
+
+All URIs are relative to *http://localhost*
+
+| Method | HTTP request | Description |
+| ------ | ------------ | ----------- |
+| [**create_call**](CallsApi.md#create_call) | **POST** /accounts/{accountId}/calls | Create Call |
+| [**get_call_state**](CallsApi.md#get_call_state) | **GET** /accounts/{accountId}/calls/{callId} | Get Call State Information |
+| [**update_call**](CallsApi.md#update_call) | **POST** /accounts/{accountId}/calls/{callId} | Update Call |
+| [**update_call_bxml**](CallsApi.md#update_call_bxml) | **PUT** /accounts/{accountId}/calls/{callId}/bxml | Update Call BXML |
+
+
+## create_call
+
+> create_call(account_id, create_call)
+
+Create Call
+
+Creates an outbound phone call. All calls are initially queued. Your outbound calls will initiated at a specific dequeueing rate, enabling your application to \"fire and forget\" when creating calls. Queued calls may not be modified until they are dequeued and placed, but may be removed from your queue on demand. Please note: Calls submitted to your queue will be placed approximately in order, but exact ordering is not guaranteed.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::CallsApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+create_call = Bandwidth::CreateCall.new({to: '+19195551234', from: '+19195554321', application_id: '1234-qwer-5679-tyui', answer_url: 'https://www.myCallbackServer.example/webhooks/answer'}) # CreateCall | JSON object containing information to create an outbound call
+
+begin
+ # Create Call
+ result = api_instance.create_call(account_id, create_call)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling CallsApi->create_call: #{e}"
+end
+```
+
+#### Using the create_call_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> create_call_with_http_info(account_id, create_call)
+
+```ruby
+begin
+ # Create Call
+ data, status_code, headers = api_instance.create_call_with_http_info(account_id, create_call)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Bandwidth::ApiError => e
+ puts "Error when calling CallsApi->create_call_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **create_call** | [**CreateCall**](CreateCall.md) | JSON object containing information to create an outbound call | |
+
+### Return type
+
+[**CreateCallResponse**](CreateCallResponse.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
+
+## get_call_state
+
+> get_call_state(account_id, call_id)
+
+Get Call State Information
+
+Retrieve the current state of a specific call. This information is near-realtime, so it may take a few minutes for your call to be accessible using this endpoint. **Note**: Call information is kept for 7 days after the calls are hung up. If you attempt to retrieve information for a call that is older than 7 days, you will get an HTTP 404 response.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::CallsApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID.
+
+begin
+ # Get Call State Information
+ result = api_instance.get_call_state(account_id, call_id)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling CallsApi->get_call_state: #{e}"
+end
+```
+
+#### Using the get_call_state_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> get_call_state_with_http_info(account_id, call_id)
+
+```ruby
+begin
+ # Get Call State Information
+ data, status_code, headers = api_instance.get_call_state_with_http_info(account_id, call_id)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Bandwidth::ApiError => e
+ puts "Error when calling CallsApi->get_call_state_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **call_id** | **String** | Programmable Voice API Call ID. | |
+
+### Return type
+
+[**CallState**](CallState.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## update_call
+
+> update_call(account_id, call_id, update_call)
+
+Update Call
+
+Interrupts and redirects a call to a different URL that should return a BXML document.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::CallsApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID.
+update_call = Bandwidth::UpdateCall.new # UpdateCall | JSON object containing information to redirect an existing call to a new BXML document
+
+begin
+ # Update Call
+ api_instance.update_call(account_id, call_id, update_call)
+rescue Bandwidth::ApiError => e
+ puts "Error when calling CallsApi->update_call: #{e}"
+end
+```
+
+#### Using the update_call_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> update_call_with_http_info(account_id, call_id, update_call)
+
+```ruby
+begin
+ # Update Call
+ data, status_code, headers = api_instance.update_call_with_http_info(account_id, call_id, update_call)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Bandwidth::ApiError => e
+ puts "Error when calling CallsApi->update_call_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **call_id** | **String** | Programmable Voice API Call ID. | |
+| **update_call** | [**UpdateCall**](UpdateCall.md) | JSON object containing information to redirect an existing call to a new BXML document | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
+
+## update_call_bxml
+
+> update_call_bxml(account_id, call_id, body)
+
+Update Call BXML
+
+Interrupts and replaces an active call's BXML document.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::CallsApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID.
+body = '
+
+ This is a test sentence.
+' # String |
+
+begin
+ # Update Call BXML
+ api_instance.update_call_bxml(account_id, call_id, body)
+rescue Bandwidth::ApiError => e
+ puts "Error when calling CallsApi->update_call_bxml: #{e}"
+end
+```
+
+#### Using the update_call_bxml_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> update_call_bxml_with_http_info(account_id, call_id, body)
+
+```ruby
+begin
+ # Update Call BXML
+ data, status_code, headers = api_instance.update_call_bxml_with_http_info(account_id, call_id, body)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Bandwidth::ApiError => e
+ puts "Error when calling CallsApi->update_call_bxml_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **call_id** | **String** | Programmable Voice API Call ID. | |
+| **body** | **String** | | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: application/xml
+- **Accept**: application/json
+
diff --git a/docs/CodeRequest.md b/docs/CodeRequest.md
new file mode 100644
index 00000000..c9070ceb
--- /dev/null
+++ b/docs/CodeRequest.md
@@ -0,0 +1,28 @@
+# Bandwidth::CodeRequest
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **to** | **String** | The phone number to send the mfa code to. | |
+| **from** | **String** | The application phone number, the sender of the mfa code. | |
+| **application_id** | **String** | The application unique ID, obtained from Bandwidth. | |
+| **scope** | **String** | An optional field to denote what scope or action the mfa code is addressing. If not supplied, defaults to \"2FA\". | [optional] |
+| **message** | **String** | The message format of the mfa code. There are three values that the system will replace \"{CODE}\", \"{NAME}\", \"{SCOPE}\". The \"{SCOPE}\" and \"{NAME} value template are optional, while \"{CODE}\" must be supplied. As the name would suggest, code will be replace with the actual mfa code. Name is replaced with the application name, configured during provisioning of mfa. The scope value is the same value sent during the call and partitioned by the server. | |
+| **digits** | **Integer** | The number of digits for your mfa code. The valid number ranges from 2 to 8, inclusively. | |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::CodeRequest.new(
+ to: +19195551234,
+ from: +19195554321,
+ application_id: 66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1,
+ scope: 2FA,
+ message: Your temporary {NAME} {SCOPE} code is {CODE},
+ digits: 6
+)
+```
+
diff --git a/docs/Conference.md b/docs/Conference.md
new file mode 100644
index 00000000..5ca36db6
--- /dev/null
+++ b/docs/Conference.md
@@ -0,0 +1,32 @@
+# Bandwidth::Conference
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **id** | **String** | The Bandwidth-generated conference ID. | [optional] |
+| **name** | **String** | The name of the conference, as specified by your application. | [optional] |
+| **created_time** | **Time** | The time the conference was initiated, in ISO 8601 format. | [optional] |
+| **completed_time** | **Time** | The time the conference was terminated, in ISO 8601 format. | [optional] |
+| **conference_event_url** | **String** | The URL to send the conference-related events. | [optional] |
+| **conference_event_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional][default to 'POST'] |
+| **tag** | **String** | The custom string attached to the conference that will be sent with callbacks. | [optional] |
+| **active_members** | [**Array<ConferenceMember>**](ConferenceMember.md) | A list of active members of the conference. Omitted if this is a response to the [Get Conferences endpoint](/apis/voice#tag/Conferences/operation/listConferences). | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::Conference.new(
+ id: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9,
+ name: my-conference-name,
+ created_time: 2022-06-17T22:19:40.375Z,
+ completed_time: 2022-06-17T22:20Z,
+ conference_event_url: https://myServer.example/bandwidth/webhooks/conferenceEvent,
+ conference_event_method: null,
+ tag: my custom tag,
+ active_members: null
+)
+```
+
diff --git a/docs/ConferenceCompletedCallback.md b/docs/ConferenceCompletedCallback.md
new file mode 100644
index 00000000..5815eb66
--- /dev/null
+++ b/docs/ConferenceCompletedCallback.md
@@ -0,0 +1,26 @@
+# Bandwidth::ConferenceCompletedCallback
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] |
+| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
+| **conference_id** | **String** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] |
+| **name** | **String** | The user-specified name of the conference that was recorded | [optional] |
+| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::ConferenceCompletedCallback.new(
+ 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
+)
+```
+
diff --git a/docs/ConferenceCreatedCallback.md b/docs/ConferenceCreatedCallback.md
new file mode 100644
index 00000000..2ddc9335
--- /dev/null
+++ b/docs/ConferenceCreatedCallback.md
@@ -0,0 +1,26 @@
+# Bandwidth::ConferenceCreatedCallback
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] |
+| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
+| **conference_id** | **String** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] |
+| **name** | **String** | The user-specified name of the conference that was recorded | [optional] |
+| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::ConferenceCreatedCallback.new(
+ 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
+)
+```
+
diff --git a/docs/ConferenceMember.md b/docs/ConferenceMember.md
new file mode 100644
index 00000000..6948cfc4
--- /dev/null
+++ b/docs/ConferenceMember.md
@@ -0,0 +1,28 @@
+# Bandwidth::ConferenceMember
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **call_id** | **String** | The call id associated with the event. | [optional] |
+| **conference_id** | **String** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] |
+| **member_url** | **String** | A URL that may be used to retrieve information about or update the state of this conference member. This is the URL of this member's [Get Conference Member](/apis/voice/#operation/getConferenceMember) endpoint and [Modify Conference Member](/apis/voice/#operation/updateConferenceMember) endpoint. | [optional] |
+| **mute** | **Boolean** | Whether or not this member is currently muted. Members who are muted are still able to hear other participants. If used in a PUT request, updates this member's mute status. Has no effect if omitted. | [optional] |
+| **hold** | **Boolean** | Whether or not this member is currently on hold. Members who are on hold are not able to hear or speak in the conference. If used in a PUT request, updates this member's hold status. Has no effect if omitted. | [optional] |
+| **call_ids_to_coach** | **Array<String>** | If this member had a value set for `callIdsToCoach` in its [Conference](/docs/voice/bxml/conference) verb or this list was added with a previous PUT request to modify the member, this is that list of calls. If present in a PUT request, modifies the calls that this member is coaching. Has no effect if omitted. See the documentation for the [Conference](/docs/voice/bxml/conference) verb for more details about coaching. Note that this will not add the matching calls to the conference; each call must individually execute a Conference verb to join. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::ConferenceMember.new(
+ call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ conference_id: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9,
+ member_url: https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/members/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ mute: false,
+ hold: false,
+ call_ids_to_coach: ["c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"]
+)
+```
+
diff --git a/docs/ConferenceMemberExitCallback.md b/docs/ConferenceMemberExitCallback.md
new file mode 100644
index 00000000..89479dae
--- /dev/null
+++ b/docs/ConferenceMemberExitCallback.md
@@ -0,0 +1,32 @@
+# Bandwidth::ConferenceMemberExitCallback
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] |
+| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
+| **conference_id** | **String** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] |
+| **name** | **String** | The user-specified name of the conference that was recorded | [optional] |
+| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
+| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
+| **call_id** | **String** | The call id associated with the event. | [optional] |
+| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::ConferenceMemberExitCallback.new(
+ event_type: bridgeComplete,
+ event_time: 2022-06-17T22:19:40.375Z,
+ conference_id: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9,
+ name: my-conference-name,
+ from: +15555555555,
+ to: +15555555555,
+ call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ tag: exampleTag
+)
+```
+
diff --git a/docs/ConferenceMemberJoinCallback.md b/docs/ConferenceMemberJoinCallback.md
new file mode 100644
index 00000000..f8e2708f
--- /dev/null
+++ b/docs/ConferenceMemberJoinCallback.md
@@ -0,0 +1,32 @@
+# Bandwidth::ConferenceMemberJoinCallback
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] |
+| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
+| **conference_id** | **String** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] |
+| **name** | **String** | The user-specified name of the conference that was recorded | [optional] |
+| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
+| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
+| **call_id** | **String** | The call id associated with the event. | [optional] |
+| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::ConferenceMemberJoinCallback.new(
+ event_type: bridgeComplete,
+ event_time: 2022-06-17T22:19:40.375Z,
+ conference_id: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9,
+ name: my-conference-name,
+ from: +15555555555,
+ to: +15555555555,
+ call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ tag: exampleTag
+)
+```
+
diff --git a/docs/ConferenceRecordingAvailableCallback.md b/docs/ConferenceRecordingAvailableCallback.md
new file mode 100644
index 00000000..4b193a68
--- /dev/null
+++ b/docs/ConferenceRecordingAvailableCallback.md
@@ -0,0 +1,44 @@
+# Bandwidth::ConferenceRecordingAvailableCallback
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] |
+| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
+| **conference_id** | **String** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] |
+| **name** | **String** | The user-specified name of the conference that was recorded | [optional] |
+| **account_id** | **String** | The user account associated with the call. | [optional] |
+| **recording_id** | **String** | The unique ID of this recording | [optional] |
+| **channels** | **Integer** | Always `1` for conference recordings; multi-channel recordings are not supported on conferences. | [optional] |
+| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] |
+| **end_time** | **Time** | The time that the recording ended in ISO-8601 format | [optional] |
+| **duration** | **String** | The duration of the recording in ISO-8601 format | [optional] |
+| **file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional] |
+| **media_url** | **String** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional] |
+| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] |
+| **status** | **String** | The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::ConferenceRecordingAvailableCallback.new(
+ event_type: bridgeComplete,
+ event_time: 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: null,
+ media_url: https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media,
+ tag: exampleTag,
+ status: completed
+)
+```
+
diff --git a/docs/ConferenceRecordingMetadata.md b/docs/ConferenceRecordingMetadata.md
new file mode 100644
index 00000000..effcaea7
--- /dev/null
+++ b/docs/ConferenceRecordingMetadata.md
@@ -0,0 +1,38 @@
+# Bandwidth::ConferenceRecordingMetadata
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | The user account associated with the call. | [optional] |
+| **conference_id** | **String** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] |
+| **name** | **String** | The user-specified name of the conference that was recorded | [optional] |
+| **recording_id** | **String** | The unique ID of this recording | [optional] |
+| **duration** | **String** | The duration of the recording in ISO-8601 format | [optional] |
+| **channels** | **Integer** | Always `1` for conference recordings; multi-channel recordings are not supported on conferences. | [optional] |
+| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] |
+| **end_time** | **Time** | The time that the recording ended in ISO-8601 format | [optional] |
+| **file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional] |
+| **status** | **String** | The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional] |
+| **media_url** | **String** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::ConferenceRecordingMetadata.new(
+ account_id: 920012,
+ conference_id: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9,
+ name: my-conference-name,
+ recording_id: r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833,
+ duration: PT13.67S,
+ channels: 1,
+ start_time: 2022-06-17T22:19:40.375Z,
+ end_time: 2022-06-17T22:20Z,
+ file_format: null,
+ status: completed,
+ media_url: https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media
+)
+```
+
diff --git a/docs/ConferenceRedirectCallback.md b/docs/ConferenceRedirectCallback.md
new file mode 100644
index 00000000..2b218d01
--- /dev/null
+++ b/docs/ConferenceRedirectCallback.md
@@ -0,0 +1,26 @@
+# Bandwidth::ConferenceRedirectCallback
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] |
+| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
+| **conference_id** | **String** | The unique, Bandwidth-generated ID of the conference that was recorded | [optional] |
+| **name** | **String** | The user-specified name of the conference that was recorded | [optional] |
+| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::ConferenceRedirectCallback.new(
+ 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
+)
+```
+
diff --git a/docs/ConferenceStateEnum.md b/docs/ConferenceStateEnum.md
new file mode 100644
index 00000000..fac69498
--- /dev/null
+++ b/docs/ConferenceStateEnum.md
@@ -0,0 +1,15 @@
+# Bandwidth::ConferenceStateEnum
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::ConferenceStateEnum.new()
+```
+
diff --git a/docs/ConferencesApi.md b/docs/ConferencesApi.md
new file mode 100644
index 00000000..e8b0945b
--- /dev/null
+++ b/docs/ConferencesApi.md
@@ -0,0 +1,688 @@
+# Bandwidth::ConferencesApi
+
+All URIs are relative to *http://localhost*
+
+| Method | HTTP request | Description |
+| ------ | ------------ | ----------- |
+| [**download_conference_recording**](ConferencesApi.md#download_conference_recording) | **GET** /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}/media | Download Conference Recording |
+| [**get_conference**](ConferencesApi.md#get_conference) | **GET** /accounts/{accountId}/conferences/{conferenceId} | Get Conference Information |
+| [**get_conference_member**](ConferencesApi.md#get_conference_member) | **GET** /accounts/{accountId}/conferences/{conferenceId}/members/{memberId} | Get Conference Member |
+| [**get_conference_recording**](ConferencesApi.md#get_conference_recording) | **GET** /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId} | Get Conference Recording Information |
+| [**list_conference_recordings**](ConferencesApi.md#list_conference_recordings) | **GET** /accounts/{accountId}/conferences/{conferenceId}/recordings | Get Conference Recordings |
+| [**list_conferences**](ConferencesApi.md#list_conferences) | **GET** /accounts/{accountId}/conferences | Get Conferences |
+| [**update_conference**](ConferencesApi.md#update_conference) | **POST** /accounts/{accountId}/conferences/{conferenceId} | Update Conference |
+| [**update_conference_bxml**](ConferencesApi.md#update_conference_bxml) | **PUT** /accounts/{accountId}/conferences/{conferenceId}/bxml | Update Conference BXML |
+| [**update_conference_member**](ConferencesApi.md#update_conference_member) | **PUT** /accounts/{accountId}/conferences/{conferenceId}/members/{memberId} | Update Conference Member |
+
+
+## download_conference_recording
+
+> File download_conference_recording(account_id, conference_id, recording_id)
+
+Download Conference Recording
+
+Downloads the specified recording file.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::ConferencesApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID.
+recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID.
+
+begin
+ # Download Conference Recording
+ result = api_instance.download_conference_recording(account_id, conference_id, recording_id)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling ConferencesApi->download_conference_recording: #{e}"
+end
+```
+
+#### Using the download_conference_recording_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> download_conference_recording_with_http_info(account_id, conference_id, recording_id)
+
+```ruby
+begin
+ # Download Conference Recording
+ data, status_code, headers = api_instance.download_conference_recording_with_http_info(account_id, conference_id, recording_id)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => File
+rescue Bandwidth::ApiError => e
+ puts "Error when calling ConferencesApi->download_conference_recording_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **conference_id** | **String** | Programmable Voice API Conference ID. | |
+| **recording_id** | **String** | Programmable Voice API Recording ID. | |
+
+### Return type
+
+**File**
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: audio/vnd.wave, audio/mpeg, application/json
+
+
+## get_conference
+
+> get_conference(account_id, conference_id)
+
+Get Conference Information
+
+Returns information about the specified conference.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::ConferencesApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID.
+
+begin
+ # Get Conference Information
+ result = api_instance.get_conference(account_id, conference_id)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling ConferencesApi->get_conference: #{e}"
+end
+```
+
+#### Using the get_conference_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> get_conference_with_http_info(account_id, conference_id)
+
+```ruby
+begin
+ # Get Conference Information
+ data, status_code, headers = api_instance.get_conference_with_http_info(account_id, conference_id)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Bandwidth::ApiError => e
+ puts "Error when calling ConferencesApi->get_conference_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **conference_id** | **String** | Programmable Voice API Conference ID. | |
+
+### Return type
+
+[**Conference**](Conference.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## get_conference_member
+
+> get_conference_member(account_id, conference_id, member_id)
+
+Get Conference Member
+
+Returns information about the specified conference member.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::ConferencesApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID.
+member_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Conference Member ID.
+
+begin
+ # Get Conference Member
+ result = api_instance.get_conference_member(account_id, conference_id, member_id)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling ConferencesApi->get_conference_member: #{e}"
+end
+```
+
+#### Using the get_conference_member_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> get_conference_member_with_http_info(account_id, conference_id, member_id)
+
+```ruby
+begin
+ # Get Conference Member
+ data, status_code, headers = api_instance.get_conference_member_with_http_info(account_id, conference_id, member_id)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Bandwidth::ApiError => e
+ puts "Error when calling ConferencesApi->get_conference_member_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **conference_id** | **String** | Programmable Voice API Conference ID. | |
+| **member_id** | **String** | Programmable Voice API Conference Member ID. | |
+
+### Return type
+
+[**ConferenceMember**](ConferenceMember.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## get_conference_recording
+
+> get_conference_recording(account_id, conference_id, recording_id)
+
+Get Conference Recording Information
+
+Returns metadata for the specified recording.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::ConferencesApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID.
+recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID.
+
+begin
+ # Get Conference Recording Information
+ result = api_instance.get_conference_recording(account_id, conference_id, recording_id)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling ConferencesApi->get_conference_recording: #{e}"
+end
+```
+
+#### Using the get_conference_recording_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> get_conference_recording_with_http_info(account_id, conference_id, recording_id)
+
+```ruby
+begin
+ # Get Conference Recording Information
+ data, status_code, headers = api_instance.get_conference_recording_with_http_info(account_id, conference_id, recording_id)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Bandwidth::ApiError => e
+ puts "Error when calling ConferencesApi->get_conference_recording_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **conference_id** | **String** | Programmable Voice API Conference ID. | |
+| **recording_id** | **String** | Programmable Voice API Recording ID. | |
+
+### Return type
+
+[**ConferenceRecordingMetadata**](ConferenceRecordingMetadata.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## list_conference_recordings
+
+> > list_conference_recordings(account_id, conference_id)
+
+Get Conference Recordings
+
+Returns a (potentially empty) list of metadata for the recordings that took place during the specified conference.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::ConferencesApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID.
+
+begin
+ # Get Conference Recordings
+ result = api_instance.list_conference_recordings(account_id, conference_id)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling ConferencesApi->list_conference_recordings: #{e}"
+end
+```
+
+#### Using the list_conference_recordings_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> >, Integer, Hash)> list_conference_recordings_with_http_info(account_id, conference_id)
+
+```ruby
+begin
+ # Get Conference Recordings
+ data, status_code, headers = api_instance.list_conference_recordings_with_http_info(account_id, conference_id)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => >
+rescue Bandwidth::ApiError => e
+ puts "Error when calling ConferencesApi->list_conference_recordings_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **conference_id** | **String** | Programmable Voice API Conference ID. | |
+
+### Return type
+
+[**Array<ConferenceRecordingMetadata>**](ConferenceRecordingMetadata.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## list_conferences
+
+> > list_conferences(account_id, opts)
+
+Get Conferences
+
+Returns a max of 1000 conferences, sorted by `createdTime` from oldest to newest. **NOTE:** If the number of conferences in the account is bigger than `pageSize`, a `Link` header (with format `<{url}>; rel=\"next\"`) will be returned in the response. The url can be used to retrieve the next page of conference records.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::ConferencesApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+opts = {
+ name: 'my-custom-name', # String | Filter results by the `name` field.
+ min_created_time: '2022-06-21T19:13:21Z', # String | Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format).
+ max_created_time: '2022-06-21T19:13:21Z', # String | Filter results to conferences which have a `createdTime` before or at `maxCreatedTime` (in ISO8601 format).
+ page_size: 500, # Integer | Specifies the max number of conferences that will be returned.
+ page_token: 'page_token_example' # String | Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description.
+}
+
+begin
+ # Get Conferences
+ result = api_instance.list_conferences(account_id, opts)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling ConferencesApi->list_conferences: #{e}"
+end
+```
+
+#### Using the list_conferences_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> >, Integer, Hash)> list_conferences_with_http_info(account_id, opts)
+
+```ruby
+begin
+ # Get Conferences
+ data, status_code, headers = api_instance.list_conferences_with_http_info(account_id, opts)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => >
+rescue Bandwidth::ApiError => e
+ puts "Error when calling ConferencesApi->list_conferences_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **name** | **String** | Filter results by the `name` field. | [optional] |
+| **min_created_time** | **String** | Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format). | [optional] |
+| **max_created_time** | **String** | Filter results to conferences which have a `createdTime` before or at `maxCreatedTime` (in ISO8601 format). | [optional] |
+| **page_size** | **Integer** | Specifies the max number of conferences that will be returned. | [optional][default to 1000] |
+| **page_token** | **String** | Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description. | [optional] |
+
+### Return type
+
+[**Array<Conference>**](Conference.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## update_conference
+
+> update_conference(account_id, conference_id, update_conference)
+
+Update Conference
+
+Update the conference state.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::ConferencesApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID.
+update_conference = Bandwidth::UpdateConference.new # UpdateConference |
+
+begin
+ # Update Conference
+ api_instance.update_conference(account_id, conference_id, update_conference)
+rescue Bandwidth::ApiError => e
+ puts "Error when calling ConferencesApi->update_conference: #{e}"
+end
+```
+
+#### Using the update_conference_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> update_conference_with_http_info(account_id, conference_id, update_conference)
+
+```ruby
+begin
+ # Update Conference
+ data, status_code, headers = api_instance.update_conference_with_http_info(account_id, conference_id, update_conference)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Bandwidth::ApiError => e
+ puts "Error when calling ConferencesApi->update_conference_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **conference_id** | **String** | Programmable Voice API Conference ID. | |
+| **update_conference** | [**UpdateConference**](UpdateConference.md) | | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
+
+## update_conference_bxml
+
+> update_conference_bxml(account_id, conference_id, body)
+
+Update Conference BXML
+
+Update the conference BXML document.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::ConferencesApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID.
+body = '
+
+
+' # String |
+
+begin
+ # Update Conference BXML
+ api_instance.update_conference_bxml(account_id, conference_id, body)
+rescue Bandwidth::ApiError => e
+ puts "Error when calling ConferencesApi->update_conference_bxml: #{e}"
+end
+```
+
+#### Using the update_conference_bxml_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> update_conference_bxml_with_http_info(account_id, conference_id, body)
+
+```ruby
+begin
+ # Update Conference BXML
+ data, status_code, headers = api_instance.update_conference_bxml_with_http_info(account_id, conference_id, body)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Bandwidth::ApiError => e
+ puts "Error when calling ConferencesApi->update_conference_bxml_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **conference_id** | **String** | Programmable Voice API Conference ID. | |
+| **body** | **String** | | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: application/xml
+- **Accept**: application/json
+
+
+## update_conference_member
+
+> update_conference_member(account_id, conference_id, member_id, update_conference_member)
+
+Update Conference Member
+
+Updates settings for a particular conference member.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::ConferencesApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' # String | Programmable Voice API Conference ID.
+member_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Conference Member ID.
+update_conference_member = Bandwidth::UpdateConferenceMember.new # UpdateConferenceMember |
+
+begin
+ # Update Conference Member
+ api_instance.update_conference_member(account_id, conference_id, member_id, update_conference_member)
+rescue Bandwidth::ApiError => e
+ puts "Error when calling ConferencesApi->update_conference_member: #{e}"
+end
+```
+
+#### Using the update_conference_member_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> update_conference_member_with_http_info(account_id, conference_id, member_id, update_conference_member)
+
+```ruby
+begin
+ # Update Conference Member
+ data, status_code, headers = api_instance.update_conference_member_with_http_info(account_id, conference_id, member_id, update_conference_member)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Bandwidth::ApiError => e
+ puts "Error when calling ConferencesApi->update_conference_member_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **conference_id** | **String** | Programmable Voice API Conference ID. | |
+| **member_id** | **String** | Programmable Voice API Conference Member ID. | |
+| **update_conference_member** | [**UpdateConferenceMember**](UpdateConferenceMember.md) | | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
diff --git a/docs/CreateCall.md b/docs/CreateCall.md
new file mode 100644
index 00000000..a38537ca
--- /dev/null
+++ b/docs/CreateCall.md
@@ -0,0 +1,56 @@
+# Bandwidth::CreateCall
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **to** | **String** | The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.example`)). | |
+| **from** | **String** | A Bandwidth phone number on your account the call should come from (must be in E.164 format, like `+15555551212`, or be one of the following strings: `Restricted`, `Anonymous`, `Private`, or `Unavailable`). | |
+| **display_name** | **String** | The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. | [optional] |
+| **uui** | **String** | A comma-separated list of 'User-To-User' headers to be sent in the INVITE when calling a SIP URI. Each value must end with an 'encoding' parameter as described in <a href='https://tools.ietf.org/html/rfc7433'>RFC 7433</a>. Only 'jwt' and 'base64' encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators. | [optional] |
+| **application_id** | **String** | The id of the application associated with the `from` number. | |
+| **answer_url** | **String** | The full URL to send the <a href='/docs/voice/webhooks/answer'>Answer</a> event to when the called party answers. This endpoint should return the first <a href='/docs/voice/bxml'>BXML document</a> to be executed in the call. Must use `https` if specifying `username` and `password`. | |
+| **answer_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional][default to 'POST'] |
+| **username** | **String** | Basic auth username. | [optional] |
+| **password** | **String** | Basic auth password. | [optional] |
+| **answer_fallback_url** | **String** | A fallback url which, if provided, will be used to retry the `answer` webhook delivery in case `answerUrl` fails to respond Must use `https` if specifying `fallbackUsername` and `fallbackPassword`. | [optional] |
+| **answer_fallback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional][default to 'POST'] |
+| **fallback_username** | **String** | Basic auth username. | [optional] |
+| **fallback_password** | **String** | Basic auth password. | [optional] |
+| **disconnect_url** | **String** | The URL to send the <a href='/docs/voice/webhooks/disconnect'>Disconnect</a> event to when the call ends. This event does not expect a BXML response. | [optional] |
+| **disconnect_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional][default to 'POST'] |
+| **call_timeout** | **Float** | The timeout (in seconds) for the callee to answer the call after it starts ringing. If the call does not start ringing within 30s, the call will be cancelled regardless of this value. Can be any numeric value (including decimals) between 1 and 300. | [optional][default to 30] |
+| **callback_timeout** | **Float** | This is the timeout (in seconds) to use when delivering webhooks for the call. Can be any numeric value (including decimals) between 1 and 25. | [optional][default to 15] |
+| **machine_detection** | [**MachineDetectionConfiguration**](MachineDetectionConfiguration.md) | | [optional] |
+| **priority** | **Integer** | The priority of this call over other calls from your account. For example, if during a call your application needs to place a new call and bridge it with the current call, you might want to create the call with priority 1 so that it will be the next call picked off your queue, ahead of other less time sensitive calls. A lower value means higher priority, so a priority 1 call takes precedence over a priority 2 call. | [optional][default to 5] |
+| **tag** | **String** | A custom string that will be sent with all webhooks for this call unless overwritten by a future <a href='/docs/voice/bxml/tag'>`<Tag>`</a> verb or `tag` attribute on another verb, or cleared. May be cleared by setting `tag=\"\"` Max length 256 characters. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::CreateCall.new(
+ to: +19195551234,
+ from: +19195554321,
+ 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: null,
+ username: mySecretUsername,
+ password: mySecretPassword1!,
+ answer_fallback_url: https://www.myFallbackServer.example/webhooks/answer,
+ answer_fallback_method: null,
+ fallback_username: mySecretUsername,
+ fallback_password: mySecretPassword1!,
+ disconnect_url: https://www.myCallbackServer.example/webhooks/disconnect,
+ disconnect_method: null,
+ call_timeout: 30,
+ callback_timeout: 15,
+ machine_detection: null,
+ priority: 5,
+ tag: arbitrary text here
+)
+```
+
diff --git a/docs/CreateCallResponse.md b/docs/CreateCallResponse.md
new file mode 100644
index 00000000..e6412103
--- /dev/null
+++ b/docs/CreateCallResponse.md
@@ -0,0 +1,58 @@
+# Bandwidth::CreateCallResponse
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **application_id** | **String** | The id of the application associated with the `from` number. | |
+| **account_id** | **String** | The bandwidth account ID associated with the call. | |
+| **call_id** | **String** | Programmable Voice API Call ID. | |
+| **to** | **String** | Recipient of the outgoing call. | |
+| **from** | **String** | Phone number that created the outbound call. | |
+| **enqueued_time** | **Time** | The time at which the call was accepted into the queue. | [optional] |
+| **call_url** | **String** | The URL to update this call's state. | |
+| **call_timeout** | **Float** | The timeout (in seconds) for the callee to answer the call after it starts ringing. | [optional] |
+| **callback_timeout** | **Float** | This is the timeout (in seconds) to use when delivering webhooks for the call. | [optional] |
+| **tag** | **String** | Custom tag value. | [optional] |
+| **answer_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [default to 'POST'] |
+| **answer_url** | **String** | URL to deliver the `answer` event webhook. | |
+| **answer_fallback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional][default to 'POST'] |
+| **answer_fallback_url** | **String** | Fallback URL to deliver the `answer` event webhook. | [optional] |
+| **disconnect_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [default to 'POST'] |
+| **disconnect_url** | **String** | URL to deliver the `disconnect` event webhook. | [optional] |
+| **username** | **String** | Basic auth username. | [optional] |
+| **password** | **String** | Basic auth password. | [optional] |
+| **fallback_username** | **String** | Basic auth username. | [optional] |
+| **fallback_password** | **String** | Basic auth password. | [optional] |
+| **priority** | **Integer** | The priority of this call over other calls from your account. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::CreateCallResponse.new(
+ application_id: 04e88489-df02-4e34-a0ee-27a91849555f,
+ account_id: 9900000,
+ call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ to: +19195551234,
+ from: +19195554321,
+ enqueued_time: 2022-06-16T13:15:07.160Z,
+ call_url: https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ call_timeout: 30,
+ callback_timeout: 15,
+ tag: My custom tag value,
+ answer_method: null,
+ answer_url: https://myServer.example/bandwidth/webhooks/answer,
+ answer_fallback_method: null,
+ answer_fallback_url: https://myFallbackServer.example/bandwidth/webhooks/answer,
+ disconnect_method: null,
+ disconnect_url: https://myServer.example/bandwidth/webhooks/disconnect,
+ username: mySecretUsername,
+ password: mySecretPassword1!,
+ fallback_username: mySecretUsername,
+ fallback_password: mySecretPassword1!,
+ priority: 5
+)
+```
+
diff --git a/docs/CreateLookupResponse.md b/docs/CreateLookupResponse.md
new file mode 100644
index 00000000..dae614e2
--- /dev/null
+++ b/docs/CreateLookupResponse.md
@@ -0,0 +1,20 @@
+# Bandwidth::CreateLookupResponse
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **request_id** | **String** | The phone number lookup request ID from Bandwidth. | [optional] |
+| **status** | [**LookupStatusEnum**](LookupStatusEnum.md) | | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::CreateLookupResponse.new(
+ request_id: null,
+ status: null
+)
+```
+
diff --git a/docs/CreateMessageRequestError.md b/docs/CreateMessageRequestError.md
new file mode 100644
index 00000000..fd6aee11
--- /dev/null
+++ b/docs/CreateMessageRequestError.md
@@ -0,0 +1,22 @@
+# Bandwidth::CreateMessageRequestError
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **type** | **String** | | |
+| **description** | **String** | | |
+| **field_errors** | [**Array<FieldError>**](FieldError.md) | | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::CreateMessageRequestError.new(
+ type: null,
+ description: null,
+ field_errors: null
+)
+```
+
diff --git a/docs/CreateParticipantRequest.md b/docs/CreateParticipantRequest.md
new file mode 100644
index 00000000..9e3d2159
--- /dev/null
+++ b/docs/CreateParticipantRequest.md
@@ -0,0 +1,24 @@
+# Bandwidth::CreateParticipantRequest
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **callback_url** | **String** | Full callback url to use for notifications about this participant. | [optional] |
+| **publish_permissions** | [**Array<PublishPermissionsEnum>**](PublishPermissionsEnum.md) | Defines if this participant can publish audio or video. | [optional] |
+| **tag** | **String** | User defined tag to associate with the participant. | [optional] |
+| **device_api_version** | [**DeviceApiVersionEnum**](DeviceApiVersionEnum.md) | | [optional][default to 'V3'] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::CreateParticipantRequest.new(
+ callback_url: https://example.com/callback,
+ publish_permissions: ["VIDEO","AUDIO"],
+ tag: participant1,
+ device_api_version: null
+)
+```
+
diff --git a/docs/CreateParticipantResponse.md b/docs/CreateParticipantResponse.md
new file mode 100644
index 00000000..03f94266
--- /dev/null
+++ b/docs/CreateParticipantResponse.md
@@ -0,0 +1,20 @@
+# Bandwidth::CreateParticipantResponse
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **participant** | [**Participant**](Participant.md) | | [optional] |
+| **token** | **String** | Auth token for the returned participant. This should be passed to the participant so that they can connect to the platform. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::CreateParticipantResponse.new(
+ participant: null,
+ token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwiaWF0IjoxNTE2MjM5MDIyfQ.L8i6g3PfcHlioHCCPURC9pmXT7gdJpx3kOoyAfNUwCc
+)
+```
+
diff --git a/docs/DeferredResult.md b/docs/DeferredResult.md
new file mode 100644
index 00000000..602bcacc
--- /dev/null
+++ b/docs/DeferredResult.md
@@ -0,0 +1,20 @@
+# Bandwidth::DeferredResult
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **result** | **Object** | | [optional] |
+| **set_or_expired** | **Boolean** | | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::DeferredResult.new(
+ result: null,
+ set_or_expired: null
+)
+```
+
diff --git a/docs/DeviceApiVersionEnum.md b/docs/DeviceApiVersionEnum.md
new file mode 100644
index 00000000..30970c47
--- /dev/null
+++ b/docs/DeviceApiVersionEnum.md
@@ -0,0 +1,15 @@
+# Bandwidth::DeviceApiVersionEnum
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::DeviceApiVersionEnum.new()
+```
+
diff --git a/docs/DisconenctCallback.md b/docs/DisconenctCallback.md
new file mode 100644
index 00000000..a0f462d6
--- /dev/null
+++ b/docs/DisconenctCallback.md
@@ -0,0 +1,50 @@
+# Bandwidth::DisconenctCallback
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] |
+| **event_time** | **String** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
+| **account_id** | **String** | The user account associated with the call. | [optional] |
+| **application_id** | **String** | The id of the application associated with the call. | [optional] |
+| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
+| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
+| **call_id** | **String** | The call id associated with the event. | [optional] |
+| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] |
+| **call_url** | **String** | The URL of the call associated with the event. | [optional] |
+| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] |
+| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] |
+| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] |
+| **end_time** | **Time** | The time that the recording ended in ISO-8601 format | [optional] |
+| **cause** | **String** | Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown. | [optional] |
+| **error_message** | **String** | Text explaining the reason that caused the call to fail in case of errors. | [optional] |
+| **error_id** | **String** | Bandwidth's internal id that references the error event. | [optional] |
+| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::DisconenctCallback.new(
+ event_type: bridgeComplete,
+ event_time: null,
+ account_id: 920012,
+ application_id: 04e88489-df02-4e34-a0ee-27a91849555f,
+ from: +15555555555,
+ to: +15555555555,
+ call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ direction: null,
+ call_url: https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ enqueued_time: 2022-06-17T22:20Z,
+ start_time: 2022-06-17T22:19:40.375Z,
+ answer_time: 2022-06-17T22:20Z,
+ end_time: 2022-06-17T22:20Z,
+ cause: busy,
+ error_message: Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call,
+ error_id: 4642074b-7b58-478b-96e4-3a60955c6765,
+ tag: exampleTag
+)
+```
+
diff --git a/docs/DisconnectCallback.md b/docs/DisconnectCallback.md
new file mode 100644
index 00000000..9f04b862
--- /dev/null
+++ b/docs/DisconnectCallback.md
@@ -0,0 +1,50 @@
+# Bandwidth::DisconnectCallback
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] |
+| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
+| **account_id** | **String** | The user account associated with the call. | [optional] |
+| **application_id** | **String** | The id of the application associated with the call. | [optional] |
+| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
+| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
+| **call_id** | **String** | The call id associated with the event. | [optional] |
+| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] |
+| **call_url** | **String** | The URL of the call associated with the event. | [optional] |
+| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] |
+| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] |
+| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] |
+| **end_time** | **Time** | The time that the recording ended in ISO-8601 format | [optional] |
+| **cause** | **String** | Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown. | [optional] |
+| **error_message** | **String** | Text explaining the reason that caused the call to fail in case of errors. | [optional] |
+| **error_id** | **String** | Bandwidth's internal id that references the error event. | [optional] |
+| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::DisconnectCallback.new(
+ event_type: bridgeComplete,
+ event_time: 2022-06-17T22:19:40.375Z,
+ account_id: 920012,
+ application_id: 04e88489-df02-4e34-a0ee-27a91849555f,
+ from: +15555555555,
+ to: +15555555555,
+ call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ direction: null,
+ call_url: https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ enqueued_time: 2022-06-17T22:20Z,
+ start_time: 2022-06-17T22:19:40.375Z,
+ answer_time: 2022-06-17T22:20Z,
+ end_time: 2022-06-17T22:20Z,
+ cause: busy,
+ error_message: Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call,
+ error_id: 4642074b-7b58-478b-96e4-3a60955c6765,
+ tag: exampleTag
+)
+```
+
diff --git a/docs/Diversion.md b/docs/Diversion.md
new file mode 100644
index 00000000..e7c81b08
--- /dev/null
+++ b/docs/Diversion.md
@@ -0,0 +1,30 @@
+# Bandwidth::Diversion
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **reason** | **String** | The reason for the diversion. Common values: unknown, user-busy, no-answer, unavailable, unconditional, time-of-day, do-not-disturb, deflection, follow-me, out-of-service, away. | [optional] |
+| **privacy** | **String** | off or full | [optional] |
+| **screen** | **String** | No if the number was provided by the user, yes if the number was provided by the network | [optional] |
+| **counter** | **String** | The number of diversions that have occurred | [optional] |
+| **limit** | **String** | The maximum number of diversions allowed for this session | [optional] |
+| **unknown** | **String** | The normal list of values is not exhaustive. Your application must be tolerant of unlisted keys and unlisted values of those keys. | [optional] |
+| **orig_to** | **String** | Always present. Indicates the last telephone number that the call was diverted from. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::Diversion.new(
+ reason: unavailable,
+ privacy: off,
+ screen: no,
+ counter: 2,
+ limit: 3,
+ unknown: unknownValue,
+ orig_to: +15558884444
+)
+```
+
diff --git a/docs/DtmfCallback.md b/docs/DtmfCallback.md
new file mode 100644
index 00000000..f2732b6b
--- /dev/null
+++ b/docs/DtmfCallback.md
@@ -0,0 +1,50 @@
+# Bandwidth::DtmfCallback
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] |
+| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
+| **account_id** | **String** | The user account associated with the call. | [optional] |
+| **application_id** | **String** | The id of the application associated with the call. | [optional] |
+| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
+| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
+| **call_id** | **String** | The call id associated with the event. | [optional] |
+| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] |
+| **digit** | **String** | The digit collected in the call. | [optional] |
+| **call_url** | **String** | The URL of the call associated with the event. | [optional] |
+| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] |
+| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] |
+| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] |
+| **parent_call_id** | **String** | (optional) If the event is related to the B leg of a <Transfer>, the call id of the original call leg that executed the <Transfer>. Otherwise, this field will not be present. | [optional] |
+| **transfer_caller_id** | **String** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] |
+| **transfer_to** | **String** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] |
+| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::DtmfCallback.new(
+ event_type: bridgeComplete,
+ event_time: 2022-06-17T22:19:40.375Z,
+ account_id: 920012,
+ application_id: 04e88489-df02-4e34-a0ee-27a91849555f,
+ from: +15555555555,
+ to: +15555555555,
+ call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ direction: null,
+ digit: 2,
+ call_url: https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ enqueued_time: 2022-06-17T22:20Z,
+ start_time: 2022-06-17T22:19:40.375Z,
+ answer_time: 2022-06-17T22:20Z,
+ parent_call_id: c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d,
+ transfer_caller_id: +15555555555,
+ transfer_to: +15555555555),
+ tag: exampleTag
+)
+```
+
diff --git a/docs/FieldError.md b/docs/FieldError.md
new file mode 100644
index 00000000..fbd0167e
--- /dev/null
+++ b/docs/FieldError.md
@@ -0,0 +1,20 @@
+# Bandwidth::FieldError
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **field_name** | **String** | The name of the field that contains the error | [optional] |
+| **description** | **String** | The error associated with the field | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::FieldError.new(
+ field_name: from,
+ description: '+invalid' must be replaced with a valid E164 formatted telephone number
+)
+```
+
diff --git a/docs/FileFormatEnum.md b/docs/FileFormatEnum.md
new file mode 100644
index 00000000..d3b2dd44
--- /dev/null
+++ b/docs/FileFormatEnum.md
@@ -0,0 +1,15 @@
+# Bandwidth::FileFormatEnum
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::FileFormatEnum.new()
+```
+
diff --git a/docs/ForbiddenRequest.md b/docs/ForbiddenRequest.md
new file mode 100644
index 00000000..ab75cf43
--- /dev/null
+++ b/docs/ForbiddenRequest.md
@@ -0,0 +1,18 @@
+# Bandwidth::ForbiddenRequest
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **message** | **String** | The message containing the reason behind the request being forbidden. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::ForbiddenRequest.new(
+ message: Missing Authentication Token
+)
+```
+
diff --git a/docs/GatherCallback.md b/docs/GatherCallback.md
new file mode 100644
index 00000000..6489e6a2
--- /dev/null
+++ b/docs/GatherCallback.md
@@ -0,0 +1,52 @@
+# Bandwidth::GatherCallback
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] |
+| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
+| **account_id** | **String** | The user account associated with the call. | [optional] |
+| **application_id** | **String** | The id of the application associated with the call. | [optional] |
+| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
+| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
+| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] |
+| **call_id** | **String** | The call id associated with the event. | [optional] |
+| **digits** | **String** | (optional) The digits, letters, and/or symbols entered by the user. The string is empty if a timeout occurred before any buttons were pressed. | [optional] |
+| **call_url** | **String** | The URL of the call associated with the event. | [optional] |
+| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] |
+| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] |
+| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] |
+| **parent_call_id** | **String** | (optional) If the event is related to the B leg of a <Transfer>, the call id of the original call leg that executed the <Transfer>. Otherwise, this field will not be present. | [optional] |
+| **terminating_digit** | **String** | (optional) The digit the user pressed to end the gather. Empty string value if no terminating digit was pressed. | [optional] |
+| **transfer_caller_id** | **String** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] |
+| **transfer_to** | **String** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] |
+| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::GatherCallback.new(
+ event_type: bridgeComplete,
+ event_time: 2022-06-17T22:19:40.375Z,
+ account_id: 920012,
+ application_id: 04e88489-df02-4e34-a0ee-27a91849555f,
+ from: +15555555555,
+ to: +15555555555,
+ direction: null,
+ call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ digits: 123,
+ call_url: https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ enqueued_time: 2022-06-17T22:20Z,
+ start_time: 2022-06-17T22:19:40.375Z,
+ answer_time: 2022-06-17T22:20Z,
+ parent_call_id: c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d,
+ terminating_digit: #,
+ transfer_caller_id: +15555555555,
+ transfer_to: +15555555555),
+ tag: exampleTag
+)
+```
+
diff --git a/docs/InboundMessageCallback.md b/docs/InboundMessageCallback.md
new file mode 100644
index 00000000..73d327f0
--- /dev/null
+++ b/docs/InboundMessageCallback.md
@@ -0,0 +1,26 @@
+# Bandwidth::InboundMessageCallback
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **time** | **Time** | | |
+| **type** | **String** | | |
+| **to** | **String** | | |
+| **description** | **String** | | |
+| **message** | [**InboundMessageCallbackMessage**](InboundMessageCallbackMessage.md) | | |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::InboundMessageCallback.new(
+ time: 2016-09-14T18:20:16Z,
+ type: message-received,
+ to: +15552223333,
+ description: Incoming message received,
+ message: null
+)
+```
+
diff --git a/docs/InboundMessageCallbackMessage.md b/docs/InboundMessageCallbackMessage.md
new file mode 100644
index 00000000..4ef3b41f
--- /dev/null
+++ b/docs/InboundMessageCallbackMessage.md
@@ -0,0 +1,40 @@
+# Bandwidth::InboundMessageCallbackMessage
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **id** | **String** | | |
+| **owner** | **String** | | |
+| **application_id** | **String** | | |
+| **time** | **Time** | | |
+| **segment_count** | **Integer** | | |
+| **direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | | |
+| **to** | **Array<String>** | | |
+| **from** | **String** | | |
+| **text** | **String** | | |
+| **tag** | **String** | | [optional] |
+| **media** | **Array<String>** | | [optional] |
+| **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::InboundMessageCallbackMessage.new(
+ id: 1661365814859loidf7mcwd4qacn7,
+ owner: +15553332222,
+ application_id: 93de2206-9669-4e07-948d-329f4b722ee2,
+ time: 2016-09-14T18:20:16Z,
+ segment_count: 1,
+ direction: null,
+ to: ["+15552223333"],
+ from: +15553332222,
+ text: Hello world,
+ tag: custom string,
+ media: ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"],
+ priority: null
+)
+```
+
diff --git a/docs/InitiateCallback.md b/docs/InitiateCallback.md
new file mode 100644
index 00000000..e30039f8
--- /dev/null
+++ b/docs/InitiateCallback.md
@@ -0,0 +1,40 @@
+# Bandwidth::InitiateCallback
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] |
+| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
+| **account_id** | **String** | The user account associated with the call. | [optional] |
+| **application_id** | **String** | The id of the application associated with the call. | [optional] |
+| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
+| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
+| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] |
+| **call_id** | **String** | The call id associated with the event. | [optional] |
+| **call_url** | **String** | The URL of the call associated with the event. | [optional] |
+| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] |
+| **diversion** | [**Diversion**](Diversion.md) | | [optional] |
+| **stir_shaken** | [**StirShaken**](StirShaken.md) | | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::InitiateCallback.new(
+ event_type: bridgeComplete,
+ event_time: 2022-06-17T22:19:40.375Z,
+ account_id: 920012,
+ application_id: 04e88489-df02-4e34-a0ee-27a91849555f,
+ from: +15555555555,
+ to: +15555555555,
+ direction: null,
+ call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ call_url: https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ start_time: 2022-06-17T22:19:40.375Z,
+ diversion: null,
+ stir_shaken: null
+)
+```
+
diff --git a/docs/ListMessageDirectionEnum.md b/docs/ListMessageDirectionEnum.md
new file mode 100644
index 00000000..c1f6d09b
--- /dev/null
+++ b/docs/ListMessageDirectionEnum.md
@@ -0,0 +1,15 @@
+# Bandwidth::ListMessageDirectionEnum
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::ListMessageDirectionEnum.new()
+```
+
diff --git a/docs/ListMessageItem.md b/docs/ListMessageItem.md
new file mode 100644
index 00000000..1c2b8ea1
--- /dev/null
+++ b/docs/ListMessageItem.md
@@ -0,0 +1,50 @@
+# Bandwidth::ListMessageItem
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **message_id** | **String** | The message id | [optional] |
+| **account_id** | **String** | The account id associated with this message. | [optional] |
+| **source_tn** | **String** | The source phone number of the message. | [optional] |
+| **destination_tn** | **String** | The recipient phone number of the message. | [optional] |
+| **message_status** | [**MessageStatusEnum**](MessageStatusEnum.md) | | [optional] |
+| **message_direction** | [**ListMessageDirectionEnum**](ListMessageDirectionEnum.md) | | [optional] |
+| **message_type** | [**MessageTypeEnum**](MessageTypeEnum.md) | | [optional] |
+| **segment_count** | **Integer** | The number of segments the message was sent as. | [optional] |
+| **error_code** | **Integer** | The numeric error code of the message. | [optional] |
+| **receive_time** | **Time** | The ISO 8601 datetime of the message. | [optional] |
+| **carrier_name** | **String** | The name of the carrier. Not currently supported for MMS coming soon. | [optional] |
+| **message_size** | **Integer** | The size of the message including message content and headers. | [optional] |
+| **message_length** | **Integer** | The length of the message content. | [optional] |
+| **attachment_count** | **Integer** | The number of attachments the message has. | [optional] |
+| **recipient_count** | **Integer** | The number of recipients the message has. | [optional] |
+| **campaign_class** | **String** | The campaign class of the message if it has one. | [optional] |
+| **campaign_id** | **String** | The campaign ID of the message if it has one. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::ListMessageItem.new(
+ message_id: 1589228074636lm4k2je7j7jklbn2,
+ account_id: 9900000,
+ source_tn: +15554443333,
+ destination_tn: +15554442222,
+ message_status: null,
+ message_direction: null,
+ message_type: null,
+ segment_count: 1,
+ error_code: 9902,
+ receive_time: 2020-04-07T14:03:07Z,
+ carrier_name: other,
+ message_size: 27,
+ message_length: 18,
+ attachment_count: 1,
+ recipient_count: 1,
+ campaign_class: T,
+ campaign_id: CJEUMDK
+)
+```
+
diff --git a/docs/LookupRequest.md b/docs/LookupRequest.md
new file mode 100644
index 00000000..566786c8
--- /dev/null
+++ b/docs/LookupRequest.md
@@ -0,0 +1,18 @@
+# Bandwidth::LookupRequest
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **tns** | **Array<String>** | | |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::LookupRequest.new(
+ tns: null
+)
+```
+
diff --git a/docs/LookupResult.md b/docs/LookupResult.md
new file mode 100644
index 00000000..647963b8
--- /dev/null
+++ b/docs/LookupResult.md
@@ -0,0 +1,34 @@
+# Bandwidth::LookupResult
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **response_code** | **Integer** | Our vendor's response code. | [optional] |
+| **message** | **String** | Message associated with the response code. | [optional] |
+| **e_164_format** | **String** | The telephone number in E.164 format. | [optional] |
+| **formatted** | **String** | The formatted version of the telephone number. | [optional] |
+| **country** | **String** | The country of the telephone number. | [optional] |
+| **line_type** | **String** | The line type of the telephone number. | [optional] |
+| **line_provider** | **String** | The messaging service provider of the telephone number. | [optional] |
+| **mobile_country_code** | **String** | The first half of the Home Network Identity (HNI). | [optional] |
+| **mobile_network_code** | **String** | The second half of the HNI. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::LookupResult.new(
+ response_code: 0,
+ message: NOERROR,
+ e_164_format: +19195551234,
+ formatted: (919) 555-1234,
+ country: US,
+ line_type: Mobile,
+ line_provider: Verizon Wireless,
+ mobile_country_code: 310,
+ mobile_network_code: 010
+)
+```
+
diff --git a/docs/LookupStatus.md b/docs/LookupStatus.md
new file mode 100644
index 00000000..4864c861
--- /dev/null
+++ b/docs/LookupStatus.md
@@ -0,0 +1,24 @@
+# Bandwidth::LookupStatus
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **request_id** | **String** | The requestId. | [optional] |
+| **status** | [**LookupStatusEnum**](LookupStatusEnum.md) | | [optional] |
+| **result** | [**Array<LookupResult>**](LookupResult.md) | The carrier information results for the specified telephone number. | [optional] |
+| **failed_telephone_numbers** | **Array<String>** | The telephone numbers whose lookup failed. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::LookupStatus.new(
+ request_id: 004223a0-8b17-41b1-bf81-20732adf5590,
+ status: null,
+ result: null,
+ failed_telephone_numbers: ["+191955512345"]
+)
+```
+
diff --git a/docs/LookupStatusEnum.md b/docs/LookupStatusEnum.md
new file mode 100644
index 00000000..f3dbe4d0
--- /dev/null
+++ b/docs/LookupStatusEnum.md
@@ -0,0 +1,15 @@
+# Bandwidth::LookupStatusEnum
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::LookupStatusEnum.new()
+```
+
diff --git a/docs/MFAApi.md b/docs/MFAApi.md
new file mode 100644
index 00000000..bef6c1fb
--- /dev/null
+++ b/docs/MFAApi.md
@@ -0,0 +1,226 @@
+# Bandwidth::MFAApi
+
+All URIs are relative to *http://localhost*
+
+| Method | HTTP request | Description |
+| ------ | ------------ | ----------- |
+| [**generate_messaging_code**](MFAApi.md#generate_messaging_code) | **POST** /accounts/{accountId}/code/messaging | Messaging Authentication Code |
+| [**generate_voice_code**](MFAApi.md#generate_voice_code) | **POST** /accounts/{accountId}/code/voice | Voice Authentication Code |
+| [**verify_code**](MFAApi.md#verify_code) | **POST** /accounts/{accountId}/code/verify | Verify Authentication Code |
+
+
+## generate_messaging_code
+
+> generate_messaging_code(account_id, code_request)
+
+Messaging Authentication Code
+
+Send an MFA code via text message (SMS).
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::MFAApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+code_request = Bandwidth::CodeRequest.new({to: '+19195551234', from: '+19195554321', application_id: '66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1', message: 'Your temporary {NAME} {SCOPE} code is {CODE}', digits: 6}) # CodeRequest | MFA code request body.
+
+begin
+ # Messaging Authentication Code
+ result = api_instance.generate_messaging_code(account_id, code_request)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling MFAApi->generate_messaging_code: #{e}"
+end
+```
+
+#### Using the generate_messaging_code_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> generate_messaging_code_with_http_info(account_id, code_request)
+
+```ruby
+begin
+ # Messaging Authentication Code
+ data, status_code, headers = api_instance.generate_messaging_code_with_http_info(account_id, code_request)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Bandwidth::ApiError => e
+ puts "Error when calling MFAApi->generate_messaging_code_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | 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
+
+
+## generate_voice_code
+
+> generate_voice_code(account_id, code_request)
+
+Voice Authentication Code
+
+Send an MFA Code via a phone call.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::MFAApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+code_request = Bandwidth::CodeRequest.new({to: '+19195551234', from: '+19195554321', application_id: '66fd98ae-ac8d-a00f-7fcd-ba3280aeb9b1', message: 'Your temporary {NAME} {SCOPE} code is {CODE}', digits: 6}) # CodeRequest | MFA code request body.
+
+begin
+ # Voice Authentication Code
+ result = api_instance.generate_voice_code(account_id, code_request)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling MFAApi->generate_voice_code: #{e}"
+end
+```
+
+#### Using the generate_voice_code_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> generate_voice_code_with_http_info(account_id, code_request)
+
+```ruby
+begin
+ # Voice Authentication Code
+ data, status_code, headers = api_instance.generate_voice_code_with_http_info(account_id, code_request)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Bandwidth::ApiError => e
+ puts "Error when calling MFAApi->generate_voice_code_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | 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
+
+
+## verify_code
+
+> verify_code(account_id, verify_code_request)
+
+Verify Authentication Code
+
+Verify a previously sent MFA code.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::MFAApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+verify_code_request = Bandwidth::VerifyCodeRequest.new({to: '+19195551234', expiration_time_in_minutes: 3, code: '123456'}) # VerifyCodeRequest | MFA code verify request body.
+
+begin
+ # Verify Authentication Code
+ result = api_instance.verify_code(account_id, verify_code_request)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling MFAApi->verify_code: #{e}"
+end
+```
+
+#### Using the verify_code_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> verify_code_with_http_info(account_id, verify_code_request)
+
+```ruby
+begin
+ # Verify Authentication Code
+ data, status_code, headers = api_instance.verify_code_with_http_info(account_id, verify_code_request)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Bandwidth::ApiError => e
+ puts "Error when calling MFAApi->verify_code_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | 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
+
diff --git a/docs/MachineDetectionCompleteCallback.md b/docs/MachineDetectionCompleteCallback.md
new file mode 100644
index 00000000..2b7b0ccb
--- /dev/null
+++ b/docs/MachineDetectionCompleteCallback.md
@@ -0,0 +1,44 @@
+# Bandwidth::MachineDetectionCompleteCallback
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] |
+| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
+| **account_id** | **String** | The user account associated with the call. | [optional] |
+| **application_id** | **String** | The id of the application associated with the call. | [optional] |
+| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
+| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
+| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] |
+| **call_id** | **String** | The call id associated with the event. | [optional] |
+| **call_url** | **String** | The URL of the call associated with the event. | [optional] |
+| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] |
+| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] |
+| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] |
+| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] |
+| **machine_detection_result** | [**MachineDetectionResult**](MachineDetectionResult.md) | | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::MachineDetectionCompleteCallback.new(
+ event_type: bridgeComplete,
+ event_time: 2022-06-17T22:19:40.375Z,
+ account_id: 920012,
+ application_id: 04e88489-df02-4e34-a0ee-27a91849555f,
+ from: +15555555555,
+ to: +15555555555,
+ direction: null,
+ call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ call_url: https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ enqueued_time: 2022-06-17T22:20Z,
+ start_time: 2022-06-17T22:19:40.375Z,
+ answer_time: 2022-06-17T22:20Z,
+ tag: exampleTag,
+ machine_detection_result: null
+)
+```
+
diff --git a/docs/MachineDetectionConfiguration.md b/docs/MachineDetectionConfiguration.md
new file mode 100644
index 00000000..737b3da4
--- /dev/null
+++ b/docs/MachineDetectionConfiguration.md
@@ -0,0 +1,46 @@
+# Bandwidth::MachineDetectionConfiguration
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **mode** | [**MachineDetectionModeEnum**](MachineDetectionModeEnum.md) | | [optional][default to 'async'] |
+| **detection_timeout** | **Float** | The timeout used for the whole operation, in seconds. If no result is determined in this period, a callback with a `timeout` result is sent. | [optional][default to 15] |
+| **silence_timeout** | **Float** | If no speech is detected in this period, a callback with a 'silence' result is sent. | [optional][default to 10] |
+| **speech_threshold** | **Float** | When speech has ended and a result couldn't be determined based on the audio content itself, this value is used to determine if the speaker is a machine based on the speech duration. If the length of the speech detected is greater than or equal to this threshold, the result will be 'answering-machine'. If the length of speech detected is below this threshold, the result will be 'human'. | [optional][default to 10] |
+| **speech_end_threshold** | **Float** | Amount of silence (in seconds) before assuming the callee has finished speaking. | [optional][default to 5] |
+| **machine_speech_end_threshold** | **Float** | When an answering machine is detected, the amount of silence (in seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value. | [optional] |
+| **delay_result** | **Boolean** | If set to 'true' and if an answering machine is detected, the 'answering-machine' callback will be delayed until the machine is done speaking, or an end of message tone is detected, or until the 'detectionTimeout' is exceeded. If false, the 'answering-machine' result is sent immediately. | [optional][default to false] |
+| **callback_url** | **String** | The URL to send the 'machineDetectionComplete' webhook when the detection is completed. Only for 'async' mode. | [optional] |
+| **callback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional][default to 'POST'] |
+| **username** | **String** | Basic auth username. | [optional] |
+| **password** | **String** | Basic auth password. | [optional] |
+| **fallback_url** | **String** | A fallback URL which, if provided, will be used to retry the machine detection complete webhook delivery in case `callbackUrl` fails to respond | [optional] |
+| **fallback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional][default to 'POST'] |
+| **fallback_username** | **String** | Basic auth username. | [optional] |
+| **fallback_password** | **String** | Basic auth password. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::MachineDetectionConfiguration.new(
+ mode: null,
+ detection_timeout: 15,
+ silence_timeout: 10,
+ speech_threshold: 10,
+ speech_end_threshold: 5,
+ machine_speech_end_threshold: 5,
+ delay_result: false,
+ callback_url: https://myServer.example/bandwidth/webhooks/machineDetectionComplete,
+ callback_method: null,
+ username: mySecretUsername,
+ password: mySecretPassword1!,
+ fallback_url: https://myFallbackServer.example/bandwidth/webhooks/machineDetectionComplete,
+ fallback_method: null,
+ fallback_username: mySecretUsername,
+ fallback_password: mySecretPassword1!
+)
+```
+
diff --git a/docs/MachineDetectionModeEnum.md b/docs/MachineDetectionModeEnum.md
new file mode 100644
index 00000000..3e9f9b4f
--- /dev/null
+++ b/docs/MachineDetectionModeEnum.md
@@ -0,0 +1,15 @@
+# Bandwidth::MachineDetectionModeEnum
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::MachineDetectionModeEnum.new()
+```
+
diff --git a/docs/MachineDetectionResult.md b/docs/MachineDetectionResult.md
new file mode 100644
index 00000000..f349841d
--- /dev/null
+++ b/docs/MachineDetectionResult.md
@@ -0,0 +1,20 @@
+# Bandwidth::MachineDetectionResult
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **value** | **String** | Possible values are answering-machine, human, silence, timeout, or error. | [optional] |
+| **duration** | **String** | The amount of time it took to determine the result. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::MachineDetectionResult.new(
+ value: answering-machine,
+ duration: PT4.9891287S
+)
+```
+
diff --git a/docs/Media.md b/docs/Media.md
new file mode 100644
index 00000000..73427243
--- /dev/null
+++ b/docs/Media.md
@@ -0,0 +1,22 @@
+# Bandwidth::Media
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **content** | **String** | | [optional] |
+| **content_length** | **Integer** | | [optional] |
+| **media_name** | **String** | | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::Media.new(
+ content: null,
+ content_length: null,
+ media_name: null
+)
+```
+
diff --git a/docs/MediaApi.md b/docs/MediaApi.md
new file mode 100644
index 00000000..ac0c433e
--- /dev/null
+++ b/docs/MediaApi.md
@@ -0,0 +1,307 @@
+# Bandwidth::MediaApi
+
+All URIs are relative to *http://localhost*
+
+| Method | HTTP request | Description |
+| ------ | ------------ | ----------- |
+| [**delete_media**](MediaApi.md#delete_media) | **DELETE** /users/{accountId}/media/{mediaId} | Delete Media |
+| [**get_media**](MediaApi.md#get_media) | **GET** /users/{accountId}/media/{mediaId} | Get Media |
+| [**list_media**](MediaApi.md#list_media) | **GET** /users/{accountId}/media | List Media |
+| [**upload_media**](MediaApi.md#upload_media) | **PUT** /users/{accountId}/media/{mediaId} | Upload Media |
+
+
+## delete_media
+
+> delete_media(account_id, media_id)
+
+Delete Media
+
+Deletes a media file from Bandwidth API server. Make sure you don't have any application scripts still using the media before you delete. If you accidentally delete a media file you can immediately upload a new file with the same name.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::MediaApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+media_id = '14762070468292kw2fuqty55yp2b2/0/bw.png' # String | Media ID to retrieve.
+
+begin
+ # Delete Media
+ api_instance.delete_media(account_id, media_id)
+rescue Bandwidth::ApiError => e
+ puts "Error when calling MediaApi->delete_media: #{e}"
+end
+```
+
+#### Using the delete_media_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> delete_media_with_http_info(account_id, media_id)
+
+```ruby
+begin
+ # Delete Media
+ data, status_code, headers = api_instance.delete_media_with_http_info(account_id, media_id)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Bandwidth::ApiError => e
+ puts "Error when calling MediaApi->delete_media_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **media_id** | **String** | Media ID to retrieve. | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## get_media
+
+> File get_media(account_id, media_id)
+
+Get Media
+
+Downloads a media file you previously uploaded.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::MediaApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+media_id = '14762070468292kw2fuqty55yp2b2/0/bw.png' # String | Media ID to retrieve.
+
+begin
+ # Get Media
+ result = api_instance.get_media(account_id, media_id)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling MediaApi->get_media: #{e}"
+end
+```
+
+#### Using the get_media_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> get_media_with_http_info(account_id, media_id)
+
+```ruby
+begin
+ # Get Media
+ data, status_code, headers = api_instance.get_media_with_http_info(account_id, media_id)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => File
+rescue Bandwidth::ApiError => e
+ puts "Error when calling MediaApi->get_media_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **media_id** | **String** | Media ID to retrieve. | |
+
+### Return type
+
+**File**
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/octet-stream, application/json
+
+
+## list_media
+
+> > list_media(account_id, opts)
+
+List Media
+
+Gets a list of your media files. No query parameters are supported.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::MediaApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+opts = {
+ continuation_token: '1XEi2tsFtLo1JbtLwETnM1ZJ+PqAa8w6ENvC5QKvwyrCDYII663Gy5M4s40owR1tjkuWUif6qbWvFtQJR5/ipqbUnfAqL254LKNlPy6tATCzioKSuHuOqgzloDkSwRtX0LtcL2otHS69hK343m+SjdL+vlj71tT39' # String | Continuation token used to retrieve subsequent media.
+}
+
+begin
+ # List Media
+ result = api_instance.list_media(account_id, opts)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling MediaApi->list_media: #{e}"
+end
+```
+
+#### Using the list_media_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> >, Integer, Hash)> list_media_with_http_info(account_id, opts)
+
+```ruby
+begin
+ # List Media
+ data, status_code, headers = api_instance.list_media_with_http_info(account_id, opts)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => >
+rescue Bandwidth::ApiError => e
+ puts "Error when calling MediaApi->list_media_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **continuation_token** | **String** | Continuation token used to retrieve subsequent media. | [optional] |
+
+### Return type
+
+[**Array<Media>**](Media.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## upload_media
+
+> upload_media(account_id, media_id, body, opts)
+
+Upload Media
+
+Upload a file. You may add headers to the request in order to provide some control to your media file. If a file is uploaded with the same name as a file that already exists under this account, the previous file will be overwritten. A list of supported media types can be found [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-).
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::MediaApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+media_id = '14762070468292kw2fuqty55yp2b2/0/bw.png' # String | Media ID to retrieve.
+body = File.new('/path/to/some/file') # File |
+opts = {
+ content_type: 'audio/wav', # String | The media type of the entity-body.
+ cache_control: 'no-cache' # String | General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain.
+}
+
+begin
+ # Upload Media
+ api_instance.upload_media(account_id, media_id, body, opts)
+rescue Bandwidth::ApiError => e
+ puts "Error when calling MediaApi->upload_media: #{e}"
+end
+```
+
+#### Using the upload_media_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> upload_media_with_http_info(account_id, media_id, body, opts)
+
+```ruby
+begin
+ # Upload Media
+ data, status_code, headers = api_instance.upload_media_with_http_info(account_id, media_id, body, opts)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Bandwidth::ApiError => e
+ puts "Error when calling MediaApi->upload_media_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **media_id** | **String** | Media ID to retrieve. | |
+| **body** | **File** | | |
+| **content_type** | **String** | The media type of the entity-body. | [optional] |
+| **cache_control** | **String** | General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. | [optional] |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: application/json, application/ogg, application/pdf, application/rtf, application/zip, application/x-tar, application/xml, application/gzip, application/x-bzip2, application/x-gzip, application/smil, application/javascript, audio/mp4, audio/mpeg, audio/ogg, audio/flac, audio/webm, audio/wav, audio/amr, audio/3gpp, image/bmp, image/gif, image/jpeg, image/pjpeg, image/png, image/svg+xml, image/tiff, image/webp, image/x-icon, text/css, text/csv, text/calendar, text/plain, text/javascript, text/vcard, text/vnd.wap.wml, text/xml, video/avi, video/mp4, video/mpeg, video/ogg, video/quicktime, video/webm, video/x-ms-wmv
+- **Accept**: application/json
+
diff --git a/docs/Message.md b/docs/Message.md
new file mode 100644
index 00000000..266db3a5
--- /dev/null
+++ b/docs/Message.md
@@ -0,0 +1,42 @@
+# Bandwidth::Message
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **id** | **String** | The id of the message. | [optional] |
+| **owner** | **String** | The Bandwidth phone number associated with the message. | [optional] |
+| **application_id** | **String** | The application ID associated with the message. | [optional] |
+| **time** | **Time** | The datetime stamp of the message in ISO 8601 | [optional] |
+| **segment_count** | **Integer** | The number of segments the original message from the user is broken into before sending over to carrier networks. | [optional] |
+| **direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | | [optional] |
+| **to** | **Array<String>** | The phone number recipients of the message. | [optional] |
+| **from** | **String** | The phone number the message was sent from. | [optional] |
+| **media** | **Array<String>** | The list of media URLs sent in the message. Including a `filename` field in the `Content-Disposition` header of the media linked with a URL will set the displayed file name. This is a best practice to ensure that your media has a readable file name. | [optional] |
+| **text** | **String** | The contents of the message. | [optional] |
+| **tag** | **String** | The custom string set by the user. | [optional] |
+| **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] |
+| **expiration** | **Time** | The expiration date-time set by the user. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::Message.new(
+ id: 1589228074636lm4k2je7j7jklbn2,
+ owner: +15554443333,
+ application_id: 93de2206-9669-4e07-948d-329f4b722ee2,
+ time: 2022-09-14T18:20:16Z,
+ segment_count: 2,
+ direction: null,
+ to: ["+15552223333"],
+ from: +15553332222,
+ media: ["https://dev.bandwidth.com/images/bandwidth-logo.png"],
+ text: Hello world,
+ tag: custom tag,
+ priority: null,
+ expiration: 2021-02-01T11:29:18-05:00
+)
+```
+
diff --git a/docs/MessageDeliveredCallback.md b/docs/MessageDeliveredCallback.md
new file mode 100644
index 00000000..a28ffd85
--- /dev/null
+++ b/docs/MessageDeliveredCallback.md
@@ -0,0 +1,26 @@
+# Bandwidth::MessageDeliveredCallback
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **time** | **Time** | | |
+| **type** | **String** | | |
+| **to** | **String** | | |
+| **description** | **String** | | |
+| **message** | [**MessageDeliveredCallbackMessage**](MessageDeliveredCallbackMessage.md) | | |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::MessageDeliveredCallback.new(
+ time: 2016-09-14T18:20:16Z,
+ type: message-delivered,
+ to: +15552223333,
+ description: Message delivered to carrier.,
+ message: null
+)
+```
+
diff --git a/docs/MessageDeliveredCallbackMessage.md b/docs/MessageDeliveredCallbackMessage.md
new file mode 100644
index 00000000..197d583d
--- /dev/null
+++ b/docs/MessageDeliveredCallbackMessage.md
@@ -0,0 +1,40 @@
+# Bandwidth::MessageDeliveredCallbackMessage
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **id** | **String** | | |
+| **owner** | **String** | | |
+| **application_id** | **String** | | |
+| **time** | **Time** | | |
+| **segment_count** | **Integer** | | |
+| **direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | | |
+| **to** | **Array<String>** | | |
+| **from** | **String** | | |
+| **text** | **String** | | |
+| **tag** | **String** | | |
+| **media** | **Array<String>** | | [optional] |
+| **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::MessageDeliveredCallbackMessage.new(
+ id: 1661365814859loidf7mcwd4qacn7,
+ owner: +15553332222,
+ application_id: 93de2206-9669-4e07-948d-329f4b722ee2,
+ time: 2016-09-14T18:20:16Z,
+ segment_count: 1,
+ direction: null,
+ to: ["+15552223333"],
+ from: +15553332222,
+ text: Hello world,
+ tag: custom string,
+ media: ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"],
+ priority: null
+)
+```
+
diff --git a/docs/MessageDirectionEnum.md b/docs/MessageDirectionEnum.md
new file mode 100644
index 00000000..c79aeb2b
--- /dev/null
+++ b/docs/MessageDirectionEnum.md
@@ -0,0 +1,15 @@
+# Bandwidth::MessageDirectionEnum
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::MessageDirectionEnum.new()
+```
+
diff --git a/docs/MessageFailedCallback.md b/docs/MessageFailedCallback.md
new file mode 100644
index 00000000..d9d65772
--- /dev/null
+++ b/docs/MessageFailedCallback.md
@@ -0,0 +1,28 @@
+# Bandwidth::MessageFailedCallback
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **time** | **Time** | | |
+| **type** | **String** | | |
+| **to** | **String** | | |
+| **description** | **String** | | |
+| **message** | [**MessageFailedCallbackMessage**](MessageFailedCallbackMessage.md) | | |
+| **error_code** | **Integer** | | |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::MessageFailedCallback.new(
+ time: 2016-09-14T18:20:16Z,
+ type: message-failed,
+ to: +15552223333,
+ description: rejected-unallocated-from-number,
+ message: null,
+ error_code: 9902
+)
+```
+
diff --git a/docs/MessageFailedCallbackMessage.md b/docs/MessageFailedCallbackMessage.md
new file mode 100644
index 00000000..7716c6a9
--- /dev/null
+++ b/docs/MessageFailedCallbackMessage.md
@@ -0,0 +1,40 @@
+# Bandwidth::MessageFailedCallbackMessage
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **id** | **String** | | |
+| **owner** | **String** | | |
+| **application_id** | **String** | | |
+| **time** | **Time** | | |
+| **segment_count** | **Integer** | | |
+| **direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | | |
+| **to** | **Array<String>** | | |
+| **from** | **String** | | |
+| **text** | **String** | | |
+| **tag** | **String** | | |
+| **media** | **Array<String>** | | [optional] |
+| **priority** | [**PriorityEnum**](PriorityEnum.md) | | |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::MessageFailedCallbackMessage.new(
+ id: 1661365814859loidf7mcwd4qacn7,
+ owner: +15553332222,
+ application_id: 93de2206-9669-4e07-948d-329f4b722ee2,
+ time: 2016-09-14T18:20:16Z,
+ segment_count: 1,
+ direction: null,
+ to: ["+15552223333"],
+ from: +15553332222,
+ text: Hello world,
+ tag: custom string,
+ media: ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"],
+ priority: null
+)
+```
+
diff --git a/docs/MessageRequest.md b/docs/MessageRequest.md
new file mode 100644
index 00000000..d5f64c2e
--- /dev/null
+++ b/docs/MessageRequest.md
@@ -0,0 +1,32 @@
+# Bandwidth::MessageRequest
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **application_id** | **String** | The ID of the Application your from number is associated with in the Bandwidth Phone Number Dashboard. | |
+| **to** | **Array<String>** | The phone number(s) the message should be sent to in E164 format. | |
+| **from** | **String** | One of your telephone numbers the message should come from in E164 format. | |
+| **text** | **String** | The contents of the text message. Must be 2048 characters or less. | [optional] |
+| **media** | **Array<String>** | A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters. | [optional] |
+| **tag** | **String** | A custom string that will be included in callback events of the message. Max 1024 characters. | [optional] |
+| **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] |
+| **expiration** | **Time** | A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. Not supported on MMS. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::MessageRequest.new(
+ application_id: 93de2206-9669-4e07-948d-329f4b722ee2,
+ to: ["+15554443333","+15552223333"],
+ from: +15551113333,
+ text: Hello world,
+ media: ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"],
+ tag: custom string,
+ priority: null,
+ expiration: 2021-02-01T11:29:18-05:00
+)
+```
+
diff --git a/docs/MessageSendingCallback.md b/docs/MessageSendingCallback.md
new file mode 100644
index 00000000..cd233d8e
--- /dev/null
+++ b/docs/MessageSendingCallback.md
@@ -0,0 +1,26 @@
+# Bandwidth::MessageSendingCallback
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **time** | **Time** | | |
+| **type** | **String** | | |
+| **to** | **String** | | |
+| **description** | **String** | | |
+| **message** | [**MessageSendingCallbackMessage**](MessageSendingCallbackMessage.md) | | |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::MessageSendingCallback.new(
+ time: 2016-09-14T18:20:16Z,
+ type: message-sending,
+ to: +15552223333,
+ description: Message is sending to carrier,
+ message: null
+)
+```
+
diff --git a/docs/MessageSendingCallbackMessage.md b/docs/MessageSendingCallbackMessage.md
new file mode 100644
index 00000000..79b530aa
--- /dev/null
+++ b/docs/MessageSendingCallbackMessage.md
@@ -0,0 +1,40 @@
+# Bandwidth::MessageSendingCallbackMessage
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **id** | **String** | | |
+| **owner** | **String** | | |
+| **application_id** | **String** | | |
+| **time** | **Time** | | |
+| **segment_count** | **Integer** | | |
+| **direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | | |
+| **to** | **Array<String>** | | |
+| **from** | **String** | | |
+| **text** | **String** | | |
+| **tag** | **String** | | [optional] |
+| **media** | **Array<String>** | | |
+| **priority** | [**PriorityEnum**](PriorityEnum.md) | | |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::MessageSendingCallbackMessage.new(
+ id: 1661365814859loidf7mcwd4qacn7,
+ owner: +15553332222,
+ application_id: 93de2206-9669-4e07-948d-329f4b722ee2,
+ time: 2016-09-14T18:20:16Z,
+ segment_count: 1,
+ direction: null,
+ to: ["+15552223333"],
+ from: +15553332222,
+ text: Hello world,
+ tag: custom string,
+ media: ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"],
+ priority: null
+)
+```
+
diff --git a/docs/MessageStatusEnum.md b/docs/MessageStatusEnum.md
new file mode 100644
index 00000000..4e9f67e4
--- /dev/null
+++ b/docs/MessageStatusEnum.md
@@ -0,0 +1,15 @@
+# Bandwidth::MessageStatusEnum
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::MessageStatusEnum.new()
+```
+
diff --git a/docs/MessageTypeEnum.md b/docs/MessageTypeEnum.md
new file mode 100644
index 00000000..325d06ca
--- /dev/null
+++ b/docs/MessageTypeEnum.md
@@ -0,0 +1,15 @@
+# Bandwidth::MessageTypeEnum
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::MessageTypeEnum.new()
+```
+
diff --git a/docs/MessagesApi.md b/docs/MessagesApi.md
new file mode 100644
index 00000000..b32f532d
--- /dev/null
+++ b/docs/MessagesApi.md
@@ -0,0 +1,183 @@
+# Bandwidth::MessagesApi
+
+All URIs are relative to *http://localhost*
+
+| Method | HTTP request | Description |
+| ------ | ------------ | ----------- |
+| [**create_message**](MessagesApi.md#create_message) | **POST** /users/{accountId}/messages | Create Message |
+| [**list_messages**](MessagesApi.md#list_messages) | **GET** /users/{accountId}/messages | List Messages |
+
+
+## create_message
+
+> create_message(account_id, message_request)
+
+Create Message
+
+Endpoint for sending text messages and picture messages using V2 messaging.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::MessagesApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+message_request = Bandwidth::MessageRequest.new({application_id: '93de2206-9669-4e07-948d-329f4b722ee2', to: ["+15554443333", "+15552223333"], from: '+15551113333'}) # MessageRequest |
+
+begin
+ # Create Message
+ result = api_instance.create_message(account_id, message_request)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling MessagesApi->create_message: #{e}"
+end
+```
+
+#### Using the create_message_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> create_message_with_http_info(account_id, message_request)
+
+```ruby
+begin
+ # Create Message
+ data, status_code, headers = api_instance.create_message_with_http_info(account_id, message_request)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Bandwidth::ApiError => e
+ puts "Error when calling MessagesApi->create_message_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **message_request** | [**MessageRequest**](MessageRequest.md) | | |
+
+### Return type
+
+[**Message**](Message.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
+
+## list_messages
+
+> list_messages(account_id, opts)
+
+List Messages
+
+Returns a list of messages based on query parameters.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::MessagesApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+opts = {
+ message_id: '9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6', # String | The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter.
+ source_tn: '%2B15554443333', # String | The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919').
+ destination_tn: '%2B15554443333', # String | The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919').
+ message_status: Bandwidth::MessageStatusEnum::RECEIVED, # MessageStatusEnum | The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED.
+ message_direction: Bandwidth::ListMessageDirectionEnum::INBOUND, # ListMessageDirectionEnum | The direction of the message. One of INBOUND OUTBOUND.
+ carrier_name: 'Verizon', # String | The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T).
+ message_type: Bandwidth::MessageTypeEnum::SMS, # MessageTypeEnum | The type of message. Either sms or mms.
+ error_code: 9902, # Integer | The error code of the message.
+ from_date_time: '2022-09-14T18:20:16.000Z', # String | The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days.
+ to_date_time: '2022-09-14T18:20:16.000Z', # String | The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days.
+ campaign_id: 'CJEUMDK', # String | The campaign ID of the message.
+ sort: 'sourceTn:desc', # String | The field and direction to sort by combined with a colon. Direction is either asc or desc.
+ page_token: 'gdEewhcJLQRB5', # String | A base64 encoded value used for pagination of results.
+ limit: 50, # Integer | The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000.
+ limit_total_count: true # Boolean | When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results.
+}
+
+begin
+ # List Messages
+ result = api_instance.list_messages(account_id, opts)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling MessagesApi->list_messages: #{e}"
+end
+```
+
+#### Using the list_messages_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> list_messages_with_http_info(account_id, opts)
+
+```ruby
+begin
+ # List Messages
+ data, status_code, headers = api_instance.list_messages_with_http_info(account_id, opts)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Bandwidth::ApiError => e
+ puts "Error when calling MessagesApi->list_messages_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **message_id** | **String** | The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. | [optional] |
+| **source_tn** | **String** | The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). | [optional] |
+| **destination_tn** | **String** | The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). | [optional] |
+| **message_status** | [**MessageStatusEnum**](.md) | The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. | [optional] |
+| **message_direction** | [**ListMessageDirectionEnum**](.md) | The direction of the message. One of INBOUND OUTBOUND. | [optional] |
+| **carrier_name** | **String** | The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). | [optional] |
+| **message_type** | [**MessageTypeEnum**](.md) | The type of message. Either sms or mms. | [optional] |
+| **error_code** | **Integer** | The error code of the message. | [optional] |
+| **from_date_time** | **String** | The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. | [optional] |
+| **to_date_time** | **String** | The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. | [optional] |
+| **campaign_id** | **String** | The campaign ID of the message. | [optional] |
+| **sort** | **String** | The field and direction to sort by combined with a colon. Direction is either asc or desc. | [optional] |
+| **page_token** | **String** | A base64 encoded value used for pagination of results. | [optional] |
+| **limit** | **Integer** | The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. | [optional] |
+| **limit_total_count** | **Boolean** | When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. | [optional] |
+
+### Return type
+
+[**MessagesList**](MessagesList.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
diff --git a/docs/MessagesList.md b/docs/MessagesList.md
new file mode 100644
index 00000000..8eae4842
--- /dev/null
+++ b/docs/MessagesList.md
@@ -0,0 +1,22 @@
+# Bandwidth::MessagesList
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **total_count** | **Integer** | The total number of messages matched by the search. When the request has limitTotalCount set to true this value is limited to 10,000. | [optional] |
+| **page_info** | [**PageInfo**](PageInfo.md) | | [optional] |
+| **messages** | [**Array<ListMessageItem>**](ListMessageItem.md) | | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::MessagesList.new(
+ total_count: 100,
+ page_info: null,
+ messages: null
+)
+```
+
diff --git a/docs/MessagingCodeResponse.md b/docs/MessagingCodeResponse.md
new file mode 100644
index 00000000..0f1d7930
--- /dev/null
+++ b/docs/MessagingCodeResponse.md
@@ -0,0 +1,18 @@
+# Bandwidth::MessagingCodeResponse
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **message_id** | **String** | Messaging API Message ID. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::MessagingCodeResponse.new(
+ message_id: 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6
+)
+```
+
diff --git a/docs/MessagingRequestError.md b/docs/MessagingRequestError.md
new file mode 100644
index 00000000..26ec1624
--- /dev/null
+++ b/docs/MessagingRequestError.md
@@ -0,0 +1,20 @@
+# Bandwidth::MessagingRequestError
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **type** | **String** | | |
+| **description** | **String** | | |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::MessagingRequestError.new(
+ type: null,
+ description: null
+)
+```
+
diff --git a/docs/MfaForbiddenRequestError.md b/docs/MfaForbiddenRequestError.md
new file mode 100644
index 00000000..4e311511
--- /dev/null
+++ b/docs/MfaForbiddenRequestError.md
@@ -0,0 +1,18 @@
+# Bandwidth::MfaForbiddenRequestError
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **message** | **String** | The message containing the reason behind the request being forbidden. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::MfaForbiddenRequestError.new(
+ message: Missing Authentication Token
+)
+```
+
diff --git a/docs/MfaRequestError.md b/docs/MfaRequestError.md
new file mode 100644
index 00000000..6fd9adbe
--- /dev/null
+++ b/docs/MfaRequestError.md
@@ -0,0 +1,20 @@
+# Bandwidth::MfaRequestError
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **error** | **String** | A message describing the error with your request. | [optional] |
+| **request_id** | **String** | The associated requestId from AWS. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::MfaRequestError.new(
+ error: 400 Request is malformed or invalid,
+ request_id: 354cc8a3-6701-461e-8fa7-8671703dd898
+)
+```
+
diff --git a/docs/MfaUnauthorizedRequestError.md b/docs/MfaUnauthorizedRequestError.md
new file mode 100644
index 00000000..c1dec158
--- /dev/null
+++ b/docs/MfaUnauthorizedRequestError.md
@@ -0,0 +1,18 @@
+# Bandwidth::MfaUnauthorizedRequestError
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **message** | **String** | Unauthorized | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::MfaUnauthorizedRequestError.new(
+ message: Unauthorized
+)
+```
+
diff --git a/docs/PageInfo.md b/docs/PageInfo.md
new file mode 100644
index 00000000..8a0a864d
--- /dev/null
+++ b/docs/PageInfo.md
@@ -0,0 +1,24 @@
+# Bandwidth::PageInfo
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **prev_page** | **String** | The link to the previous page for pagination. | [optional] |
+| **next_page** | **String** | The link to the next page for pagination. | [optional] |
+| **prev_page_token** | **String** | The isolated pagination token for the previous page. | [optional] |
+| **next_page_token** | **String** | The isolated pagination token for the next page. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::PageInfo.new(
+ prev_page: https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&nextPage=DLAPE902,
+ next_page: https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&prevPage=GL83PD3C,
+ prev_page_token: DLAPE902,
+ next_page_token: GL83PD3C
+)
+```
+
diff --git a/docs/Participant.md b/docs/Participant.md
new file mode 100644
index 00000000..4d57b803
--- /dev/null
+++ b/docs/Participant.md
@@ -0,0 +1,30 @@
+# Bandwidth::Participant
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **id** | **String** | Unique id of the participant. | [optional][readonly] |
+| **callback_url** | **String** | Full callback url to use for notifications about this participant. | [optional] |
+| **publish_permissions** | [**Array<PublishPermissionsEnum>**](PublishPermissionsEnum.md) | Defines if this participant can publish audio or video. | [optional] |
+| **sessions** | **Array<String>** | List of session ids this participant is associated with Capped to one Upon creation of a Participant, returns as an empty array. | [optional][readonly] |
+| **subscriptions** | [**Subscriptions**](Subscriptions.md) | | [optional] |
+| **tag** | **String** | User defined tag to associate with the participant. | [optional] |
+| **device_api_version** | [**DeviceApiVersionEnum**](DeviceApiVersionEnum.md) | | [optional][default to 'V3'] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::Participant.new(
+ id: 320e2af6-13ec-498d-8b51-daba52c37853,
+ callback_url: https://example.com/callback,
+ publish_permissions: ["VIDEO","AUDIO"],
+ sessions: ["75c21163-e110-41bc-bd76-1bb428ec85d5"],
+ subscriptions: null,
+ tag: participant1,
+ device_api_version: null
+)
+```
+
diff --git a/docs/ParticipantSubscription.md b/docs/ParticipantSubscription.md
new file mode 100644
index 00000000..913d50dc
--- /dev/null
+++ b/docs/ParticipantSubscription.md
@@ -0,0 +1,20 @@
+# Bandwidth::ParticipantSubscription
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **participant_id** | **String** | The Participant the subscriber will be subscribed to | |
+| **stream_aliases** | **Array<String>** | (optional) An array of specific streamAliases owned by the Participant that the subscriber will be subscribed to. Background: A streamAlias is created by a WebRTC client when it connects and declares a name for the related stream. The client is responsible for informing the application of any created streamAliases to enable the application to subscribe to specific streamAliases. Subscribing to a `streamAlias` that does not exist is undefined. If the array is empty all aliases are assumed. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::ParticipantSubscription.new(
+ participant_id: 568749d5-04d5-483d-adf5-deac7dd3d521,
+ stream_aliases: ["alias_1","alias_2"]
+)
+```
+
diff --git a/docs/ParticipantsApi.md b/docs/ParticipantsApi.md
new file mode 100644
index 00000000..3b18501d
--- /dev/null
+++ b/docs/ParticipantsApi.md
@@ -0,0 +1,227 @@
+# Bandwidth::ParticipantsApi
+
+All URIs are relative to *http://localhost*
+
+| Method | HTTP request | Description |
+| ------ | ------------ | ----------- |
+| [**create_participant**](ParticipantsApi.md#create_participant) | **POST** /accounts/{accountId}/participants | Create Participant |
+| [**delete_participant**](ParticipantsApi.md#delete_participant) | **DELETE** /accounts/{accountId}/participants/{participantId} | Delete Participant |
+| [**get_participant**](ParticipantsApi.md#get_participant) | **GET** /accounts/{accountId}/participants/{participantId} | Get Participant |
+
+
+## create_participant
+
+> create_participant(account_id, opts)
+
+Create Participant
+
+Create a new participant under this account. Participants are idempotent, so relevant parameters must be set in this function if desired.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::ParticipantsApi.new
+account_id = '9900000' # String | Account ID
+opts = {
+ create_participant_request: Bandwidth::CreateParticipantRequest.new # CreateParticipantRequest | Create participant request body.
+}
+
+begin
+ # Create Participant
+ result = api_instance.create_participant(account_id, opts)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling ParticipantsApi->create_participant: #{e}"
+end
+```
+
+#### Using the create_participant_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> create_participant_with_http_info(account_id, opts)
+
+```ruby
+begin
+ # Create Participant
+ data, status_code, headers = api_instance.create_participant_with_http_info(account_id, opts)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Bandwidth::ApiError => e
+ puts "Error when calling ParticipantsApi->create_participant_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Account ID | |
+| **create_participant_request** | [**CreateParticipantRequest**](CreateParticipantRequest.md) | Create participant request body. | [optional] |
+
+### Return type
+
+[**CreateParticipantResponse**](CreateParticipantResponse.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
+
+## delete_participant
+
+> delete_participant(account_id, participant_id)
+
+Delete Participant
+
+Delete participant by ID.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::ParticipantsApi.new
+account_id = '9900000' # String | Account ID
+participant_id = '62e0ecb9-0b1b-5115-aae4-4f36123d6bb1' # String | Participant ID
+
+begin
+ # Delete Participant
+ api_instance.delete_participant(account_id, participant_id)
+rescue Bandwidth::ApiError => e
+ puts "Error when calling ParticipantsApi->delete_participant: #{e}"
+end
+```
+
+#### Using the delete_participant_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> delete_participant_with_http_info(account_id, participant_id)
+
+```ruby
+begin
+ # Delete Participant
+ data, status_code, headers = api_instance.delete_participant_with_http_info(account_id, participant_id)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Bandwidth::ApiError => e
+ puts "Error when calling ParticipantsApi->delete_participant_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Account ID | |
+| **participant_id** | **String** | Participant ID | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## get_participant
+
+> get_participant(account_id, participant_id)
+
+Get Participant
+
+Get participant by ID.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::ParticipantsApi.new
+account_id = '9900000' # String | Account ID
+participant_id = '62e0ecb9-0b1b-5115-aae4-4f36123d6bb1' # String | Participant ID
+
+begin
+ # Get Participant
+ result = api_instance.get_participant(account_id, participant_id)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling ParticipantsApi->get_participant: #{e}"
+end
+```
+
+#### Using the get_participant_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> get_participant_with_http_info(account_id, participant_id)
+
+```ruby
+begin
+ # Get Participant
+ data, status_code, headers = api_instance.get_participant_with_http_info(account_id, participant_id)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Bandwidth::ApiError => e
+ puts "Error when calling ParticipantsApi->get_participant_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Account ID | |
+| **participant_id** | **String** | Participant ID | |
+
+### Return type
+
+[**Participant**](Participant.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
diff --git a/docs/PhoneNumberLookupApi.md b/docs/PhoneNumberLookupApi.md
new file mode 100644
index 00000000..52a9d1cb
--- /dev/null
+++ b/docs/PhoneNumberLookupApi.md
@@ -0,0 +1,153 @@
+# Bandwidth::PhoneNumberLookupApi
+
+All URIs are relative to *http://localhost*
+
+| Method | HTTP request | Description |
+| ------ | ------------ | ----------- |
+| [**create_lookup**](PhoneNumberLookupApi.md#create_lookup) | **POST** /accounts/{accountId}/tnlookup | Create Lookup |
+| [**get_lookup_status**](PhoneNumberLookupApi.md#get_lookup_status) | **GET** /accounts/{accountId}/tnlookup/{requestId} | Get Lookup Request Status |
+
+
+## create_lookup
+
+> create_lookup(account_id, lookup_request)
+
+Create Lookup
+
+Create a Phone Number Lookup Request.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::PhoneNumberLookupApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+lookup_request = Bandwidth::LookupRequest.new({tns: ['tns_example']}) # LookupRequest | Phone number lookup request.
+
+begin
+ # Create Lookup
+ result = api_instance.create_lookup(account_id, lookup_request)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling PhoneNumberLookupApi->create_lookup: #{e}"
+end
+```
+
+#### Using the create_lookup_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> create_lookup_with_http_info(account_id, lookup_request)
+
+```ruby
+begin
+ # Create Lookup
+ data, status_code, headers = api_instance.create_lookup_with_http_info(account_id, lookup_request)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Bandwidth::ApiError => e
+ puts "Error when calling PhoneNumberLookupApi->create_lookup_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | 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
+
+
+## get_lookup_status
+
+> get_lookup_status(account_id, request_id)
+
+Get Lookup Request Status
+
+Get an existing Phone Number Lookup Request.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::PhoneNumberLookupApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+request_id = '004223a0-8b17-41b1-bf81-20732adf5590' # String | The phone number lookup request ID from Bandwidth.
+
+begin
+ # Get Lookup Request Status
+ result = api_instance.get_lookup_status(account_id, request_id)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling PhoneNumberLookupApi->get_lookup_status: #{e}"
+end
+```
+
+#### Using the get_lookup_status_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> get_lookup_status_with_http_info(account_id, request_id)
+
+```ruby
+begin
+ # Get Lookup Request Status
+ data, status_code, headers = api_instance.get_lookup_status_with_http_info(account_id, request_id)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Bandwidth::ApiError => e
+ puts "Error when calling PhoneNumberLookupApi->get_lookup_status_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **request_id** | **String** | The phone number lookup request ID from Bandwidth. | |
+
+### Return type
+
+[**LookupStatus**](LookupStatus.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
diff --git a/docs/PriorityEnum.md b/docs/PriorityEnum.md
new file mode 100644
index 00000000..34dab6d7
--- /dev/null
+++ b/docs/PriorityEnum.md
@@ -0,0 +1,15 @@
+# Bandwidth::PriorityEnum
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::PriorityEnum.new()
+```
+
diff --git a/docs/PublishPermissionsEnum.md b/docs/PublishPermissionsEnum.md
new file mode 100644
index 00000000..6b103580
--- /dev/null
+++ b/docs/PublishPermissionsEnum.md
@@ -0,0 +1,15 @@
+# Bandwidth::PublishPermissionsEnum
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::PublishPermissionsEnum.new()
+```
+
diff --git a/docs/RecordingAvailableCallback.md b/docs/RecordingAvailableCallback.md
new file mode 100644
index 00000000..1d8527ee
--- /dev/null
+++ b/docs/RecordingAvailableCallback.md
@@ -0,0 +1,60 @@
+# Bandwidth::RecordingAvailableCallback
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] |
+| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
+| **account_id** | **String** | The user account associated with the call. | [optional] |
+| **application_id** | **String** | The id of the application associated with the call. | [optional] |
+| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
+| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
+| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] |
+| **call_id** | **String** | The call id associated with the event. | [optional] |
+| **call_url** | **String** | The URL of the call associated with the event. | [optional] |
+| **parent_call_id** | **String** | (optional) If the event is related to the B leg of a <Transfer>, the call id of the original call leg that executed the <Transfer>. Otherwise, this field will not be present. | [optional] |
+| **recording_id** | **String** | The unique ID of this recording | [optional] |
+| **media_url** | **String** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional] |
+| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] |
+| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] |
+| **end_time** | **Time** | The time that the recording ended in ISO-8601 format | [optional] |
+| **duration** | **String** | The duration of the recording in ISO-8601 format | [optional] |
+| **file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional] |
+| **channels** | **String** | The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional] |
+| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] |
+| **status** | **String** | The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional] |
+| **transfer_caller_id** | **String** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] |
+| **transfer_to** | **String** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::RecordingAvailableCallback.new(
+ event_type: bridgeComplete,
+ event_time: 2022-06-17T22:19:40.375Z,
+ account_id: 920012,
+ application_id: 04e88489-df02-4e34-a0ee-27a91849555f,
+ from: +15555555555,
+ to: +15555555555,
+ direction: null,
+ call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ call_url: https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ parent_call_id: c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d,
+ recording_id: r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833,
+ media_url: https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media,
+ enqueued_time: 2022-06-17T22:20Z,
+ start_time: 2022-06-17T22:19:40.375Z,
+ end_time: 2022-06-17T22:20Z,
+ duration: PT13.67S,
+ file_format: null,
+ channels: completed,
+ tag: exampleTag,
+ status: completed,
+ transfer_caller_id: +15555555555,
+ transfer_to: +15555555555)
+)
+```
+
diff --git a/docs/RecordingCompleteCallback.md b/docs/RecordingCompleteCallback.md
new file mode 100644
index 00000000..29ccb1b7
--- /dev/null
+++ b/docs/RecordingCompleteCallback.md
@@ -0,0 +1,60 @@
+# Bandwidth::RecordingCompleteCallback
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] |
+| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
+| **account_id** | **String** | The user account associated with the call. | [optional] |
+| **application_id** | **String** | The id of the application associated with the call. | [optional] |
+| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
+| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
+| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] |
+| **call_id** | **String** | The call id associated with the event. | [optional] |
+| **call_url** | **String** | The URL of the call associated with the event. | [optional] |
+| **parent_call_id** | **String** | (optional) If the event is related to the B leg of a <Transfer>, the call id of the original call leg that executed the <Transfer>. Otherwise, this field will not be present. | [optional] |
+| **recording_id** | **String** | The unique ID of this recording | [optional] |
+| **media_url** | **String** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional] |
+| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] |
+| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] |
+| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] |
+| **end_time** | **Time** | The time that the recording ended in ISO-8601 format | [optional] |
+| **duration** | **String** | The duration of the recording in ISO-8601 format | [optional] |
+| **file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional] |
+| **channels** | **Integer** | Always `1` for conference recordings; multi-channel recordings are not supported on conferences. | [optional] |
+| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] |
+| **transfer_caller_id** | **String** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] |
+| **transfer_to** | **String** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::RecordingCompleteCallback.new(
+ event_type: bridgeComplete,
+ event_time: 2022-06-17T22:19:40.375Z,
+ account_id: 920012,
+ application_id: 04e88489-df02-4e34-a0ee-27a91849555f,
+ from: +15555555555,
+ to: +15555555555,
+ direction: null,
+ call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ call_url: https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ parent_call_id: c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d,
+ recording_id: r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833,
+ media_url: https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media,
+ enqueued_time: 2022-06-17T22:20Z,
+ start_time: 2022-06-17T22:19:40.375Z,
+ answer_time: 2022-06-17T22:20Z,
+ end_time: 2022-06-17T22:20Z,
+ duration: PT13.67S,
+ file_format: null,
+ channels: 1,
+ tag: exampleTag,
+ transfer_caller_id: +15555555555,
+ transfer_to: +15555555555)
+)
+```
+
diff --git a/docs/RecordingStateEnum.md b/docs/RecordingStateEnum.md
new file mode 100644
index 00000000..1a847b60
--- /dev/null
+++ b/docs/RecordingStateEnum.md
@@ -0,0 +1,15 @@
+# Bandwidth::RecordingStateEnum
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::RecordingStateEnum.new()
+```
+
diff --git a/docs/RecordingsApi.md b/docs/RecordingsApi.md
new file mode 100644
index 00000000..7faa3d73
--- /dev/null
+++ b/docs/RecordingsApi.md
@@ -0,0 +1,758 @@
+# Bandwidth::RecordingsApi
+
+All URIs are relative to *http://localhost*
+
+| Method | HTTP request | Description |
+| ------ | ------------ | ----------- |
+| [**delete_call_transcription**](RecordingsApi.md#delete_call_transcription) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Delete Transcription |
+| [**delete_recording**](RecordingsApi.md#delete_recording) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId} | Delete Recording |
+| [**delete_recording_media**](RecordingsApi.md#delete_recording_media) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media | Delete Recording Media |
+| [**download_call_recording**](RecordingsApi.md#download_call_recording) | **GET** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media | Download Recording |
+| [**get_call_recording**](RecordingsApi.md#get_call_recording) | **GET** /accounts/{accountId}/calls/{callId}/recordings/{recordingId} | Get Call Recording |
+| [**get_call_transcription**](RecordingsApi.md#get_call_transcription) | **GET** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Get Transcription |
+| [**list_account_call_recordings**](RecordingsApi.md#list_account_call_recordings) | **GET** /accounts/{accountId}/recordings | Get Call Recordings |
+| [**list_call_recordings**](RecordingsApi.md#list_call_recordings) | **GET** /accounts/{accountId}/calls/{callId}/recordings | List Call Recordings |
+| [**transcribe_call_recording**](RecordingsApi.md#transcribe_call_recording) | **POST** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Create Transcription Request |
+| [**update_call_recording_state**](RecordingsApi.md#update_call_recording_state) | **PUT** /accounts/{accountId}/calls/{callId}/recording | Update Recording |
+
+
+## delete_call_transcription
+
+> delete_call_transcription(account_id, call_id, recording_id)
+
+Delete Transcription
+
+Deletes the specified recording's transcription. Note: After the deletion is requested and a `204` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::RecordingsApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID.
+recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID.
+
+begin
+ # Delete Transcription
+ api_instance.delete_call_transcription(account_id, call_id, recording_id)
+rescue Bandwidth::ApiError => e
+ puts "Error when calling RecordingsApi->delete_call_transcription: #{e}"
+end
+```
+
+#### Using the delete_call_transcription_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> delete_call_transcription_with_http_info(account_id, call_id, recording_id)
+
+```ruby
+begin
+ # Delete Transcription
+ data, status_code, headers = api_instance.delete_call_transcription_with_http_info(account_id, call_id, recording_id)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Bandwidth::ApiError => e
+ puts "Error when calling RecordingsApi->delete_call_transcription_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **call_id** | **String** | Programmable Voice API Call ID. | |
+| **recording_id** | **String** | Programmable Voice API Recording ID. | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## delete_recording
+
+> delete_recording(account_id, call_id, recording_id)
+
+Delete Recording
+
+Delete the recording information, media and transcription. Note: After the deletion is requested and a `204` is returned, neither the recording metadata nor the actual media nor its transcription will be accessible anymore. However, the media of the specified recording is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::RecordingsApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID.
+recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID.
+
+begin
+ # Delete Recording
+ api_instance.delete_recording(account_id, call_id, recording_id)
+rescue Bandwidth::ApiError => e
+ puts "Error when calling RecordingsApi->delete_recording: #{e}"
+end
+```
+
+#### Using the delete_recording_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> delete_recording_with_http_info(account_id, call_id, recording_id)
+
+```ruby
+begin
+ # Delete Recording
+ data, status_code, headers = api_instance.delete_recording_with_http_info(account_id, call_id, recording_id)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Bandwidth::ApiError => e
+ puts "Error when calling RecordingsApi->delete_recording_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **call_id** | **String** | Programmable Voice API Call ID. | |
+| **recording_id** | **String** | Programmable Voice API Recording ID. | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## delete_recording_media
+
+> delete_recording_media(account_id, call_id, recording_id)
+
+Delete Recording Media
+
+Deletes the specified recording's media.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::RecordingsApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID.
+recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID.
+
+begin
+ # Delete Recording Media
+ api_instance.delete_recording_media(account_id, call_id, recording_id)
+rescue Bandwidth::ApiError => e
+ puts "Error when calling RecordingsApi->delete_recording_media: #{e}"
+end
+```
+
+#### Using the delete_recording_media_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> delete_recording_media_with_http_info(account_id, call_id, recording_id)
+
+```ruby
+begin
+ # Delete Recording Media
+ data, status_code, headers = api_instance.delete_recording_media_with_http_info(account_id, call_id, recording_id)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Bandwidth::ApiError => e
+ puts "Error when calling RecordingsApi->delete_recording_media_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **call_id** | **String** | Programmable Voice API Call ID. | |
+| **recording_id** | **String** | Programmable Voice API Recording ID. | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## download_call_recording
+
+> File download_call_recording(account_id, call_id, recording_id)
+
+Download Recording
+
+Downloads the specified recording.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::RecordingsApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID.
+recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID.
+
+begin
+ # Download Recording
+ result = api_instance.download_call_recording(account_id, call_id, recording_id)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling RecordingsApi->download_call_recording: #{e}"
+end
+```
+
+#### Using the download_call_recording_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> download_call_recording_with_http_info(account_id, call_id, recording_id)
+
+```ruby
+begin
+ # Download Recording
+ data, status_code, headers = api_instance.download_call_recording_with_http_info(account_id, call_id, recording_id)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => File
+rescue Bandwidth::ApiError => e
+ puts "Error when calling RecordingsApi->download_call_recording_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **call_id** | **String** | Programmable Voice API Call ID. | |
+| **recording_id** | **String** | Programmable Voice API Recording ID. | |
+
+### Return type
+
+**File**
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: audio/vnd.wave, audio/mpeg, application/json
+
+
+## get_call_recording
+
+> get_call_recording(account_id, call_id, recording_id)
+
+Get Call Recording
+
+Returns metadata for the specified recording.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::RecordingsApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID.
+recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID.
+
+begin
+ # Get Call Recording
+ result = api_instance.get_call_recording(account_id, call_id, recording_id)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling RecordingsApi->get_call_recording: #{e}"
+end
+```
+
+#### Using the get_call_recording_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> get_call_recording_with_http_info(account_id, call_id, recording_id)
+
+```ruby
+begin
+ # Get Call Recording
+ data, status_code, headers = api_instance.get_call_recording_with_http_info(account_id, call_id, recording_id)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Bandwidth::ApiError => e
+ puts "Error when calling RecordingsApi->get_call_recording_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **call_id** | **String** | Programmable Voice API Call ID. | |
+| **recording_id** | **String** | Programmable Voice API Recording ID. | |
+
+### Return type
+
+[**CallRecordingMetadata**](CallRecordingMetadata.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## get_call_transcription
+
+> get_call_transcription(account_id, call_id, recording_id)
+
+Get Transcription
+
+Downloads the specified transcription. If the transcribed recording was multi-channel, then there will be 2 transcripts. The caller/called party transcript will be the first item while [``](/docs/voice/bxml/playAudio) and [``](/docs/voice/bxml/speakSentence) transcript will be the second item. During a [``](/docs/voice/bxml/transfer) the A-leg transcript will be the first item while the B-leg transcript will be the second item.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::RecordingsApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID.
+recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID.
+
+begin
+ # Get Transcription
+ result = api_instance.get_call_transcription(account_id, call_id, recording_id)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling RecordingsApi->get_call_transcription: #{e}"
+end
+```
+
+#### Using the get_call_transcription_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> get_call_transcription_with_http_info(account_id, call_id, recording_id)
+
+```ruby
+begin
+ # Get Transcription
+ data, status_code, headers = api_instance.get_call_transcription_with_http_info(account_id, call_id, recording_id)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Bandwidth::ApiError => e
+ puts "Error when calling RecordingsApi->get_call_transcription_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **call_id** | **String** | Programmable Voice API Call ID. | |
+| **recording_id** | **String** | Programmable Voice API Recording ID. | |
+
+### Return type
+
+[**TranscriptionList**](TranscriptionList.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## list_account_call_recordings
+
+> > list_account_call_recordings(account_id, opts)
+
+Get Call Recordings
+
+Returns a list of metadata for the recordings associated with the specified account. The list can be filtered by the optional from, to, minStartTime, and maxStartTime arguments. The list is capped at 1000 entries and may be empty if no recordings match the specified criteria.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::RecordingsApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+opts = {
+ to: '%2b19195551234', # String | Filter results by the `to` field.
+ from: '%2b19195554321', # String | Filter results by the `from` field.
+ min_start_time: '2022-06-21T19:13:21Z', # String | Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format).
+ max_start_time: '2022-06-21T19:13:21Z' # String | Filter results to recordings which have a `startTime` before `maxStartTime` (in ISO8601 format).
+}
+
+begin
+ # Get Call Recordings
+ result = api_instance.list_account_call_recordings(account_id, opts)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling RecordingsApi->list_account_call_recordings: #{e}"
+end
+```
+
+#### Using the list_account_call_recordings_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> >, Integer, Hash)> list_account_call_recordings_with_http_info(account_id, opts)
+
+```ruby
+begin
+ # Get Call Recordings
+ data, status_code, headers = api_instance.list_account_call_recordings_with_http_info(account_id, opts)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => >
+rescue Bandwidth::ApiError => e
+ puts "Error when calling RecordingsApi->list_account_call_recordings_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **to** | **String** | Filter results by the `to` field. | [optional] |
+| **from** | **String** | Filter results by the `from` field. | [optional] |
+| **min_start_time** | **String** | Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format). | [optional] |
+| **max_start_time** | **String** | Filter results to recordings which have a `startTime` before `maxStartTime` (in ISO8601 format). | [optional] |
+
+### Return type
+
+[**Array<CallRecordingMetadata>**](CallRecordingMetadata.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## list_call_recordings
+
+> > list_call_recordings(account_id, call_id)
+
+List Call Recordings
+
+Returns a (potentially empty) list of metadata for the recordings that took place during the specified call.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::RecordingsApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID.
+
+begin
+ # List Call Recordings
+ result = api_instance.list_call_recordings(account_id, call_id)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling RecordingsApi->list_call_recordings: #{e}"
+end
+```
+
+#### Using the list_call_recordings_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> >, Integer, Hash)> list_call_recordings_with_http_info(account_id, call_id)
+
+```ruby
+begin
+ # List Call Recordings
+ data, status_code, headers = api_instance.list_call_recordings_with_http_info(account_id, call_id)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => >
+rescue Bandwidth::ApiError => e
+ puts "Error when calling RecordingsApi->list_call_recordings_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **call_id** | **String** | Programmable Voice API Call ID. | |
+
+### Return type
+
+[**Array<CallRecordingMetadata>**](CallRecordingMetadata.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## transcribe_call_recording
+
+> transcribe_call_recording(account_id, call_id, recording_id, transcribe_recording)
+
+Create Transcription Request
+
+Generate the transcription for a specific recording. Transcription can succeed only for recordings of length greater than 500 milliseconds and less than 4 hours.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::RecordingsApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID.
+recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Recording ID.
+transcribe_recording = Bandwidth::TranscribeRecording.new # TranscribeRecording |
+
+begin
+ # Create Transcription Request
+ api_instance.transcribe_call_recording(account_id, call_id, recording_id, transcribe_recording)
+rescue Bandwidth::ApiError => e
+ puts "Error when calling RecordingsApi->transcribe_call_recording: #{e}"
+end
+```
+
+#### Using the transcribe_call_recording_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> transcribe_call_recording_with_http_info(account_id, call_id, recording_id, transcribe_recording)
+
+```ruby
+begin
+ # Create Transcription Request
+ data, status_code, headers = api_instance.transcribe_call_recording_with_http_info(account_id, call_id, recording_id, transcribe_recording)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Bandwidth::ApiError => e
+ puts "Error when calling RecordingsApi->transcribe_call_recording_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **call_id** | **String** | Programmable Voice API Call ID. | |
+| **recording_id** | **String** | Programmable Voice API Recording ID. | |
+| **transcribe_recording** | [**TranscribeRecording**](TranscribeRecording.md) | | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
+
+## update_call_recording_state
+
+> update_call_recording_state(account_id, call_id, update_call_recording)
+
+Update Recording
+
+Pause or resume a recording on an active phone call.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::RecordingsApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' # String | Programmable Voice API Call ID.
+update_call_recording = Bandwidth::UpdateCallRecording.new({state: Bandwidth::RecordingStateEnum::PAUSED}) # UpdateCallRecording |
+
+begin
+ # Update Recording
+ api_instance.update_call_recording_state(account_id, call_id, update_call_recording)
+rescue Bandwidth::ApiError => e
+ puts "Error when calling RecordingsApi->update_call_recording_state: #{e}"
+end
+```
+
+#### Using the update_call_recording_state_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> update_call_recording_state_with_http_info(account_id, call_id, update_call_recording)
+
+```ruby
+begin
+ # Update Recording
+ data, status_code, headers = api_instance.update_call_recording_state_with_http_info(account_id, call_id, update_call_recording)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Bandwidth::ApiError => e
+ puts "Error when calling RecordingsApi->update_call_recording_state_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+| **call_id** | **String** | Programmable Voice API Call ID. | |
+| **update_call_recording** | [**UpdateCallRecording**](UpdateCallRecording.md) | | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
diff --git a/docs/RedirectCallback.md b/docs/RedirectCallback.md
new file mode 100644
index 00000000..4d433b30
--- /dev/null
+++ b/docs/RedirectCallback.md
@@ -0,0 +1,48 @@
+# Bandwidth::RedirectCallback
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] |
+| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
+| **account_id** | **String** | The user account associated with the call. | [optional] |
+| **application_id** | **String** | The id of the application associated with the call. | [optional] |
+| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
+| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
+| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] |
+| **call_id** | **String** | The call id associated with the event. | [optional] |
+| **call_url** | **String** | The URL of the call associated with the event. | [optional] |
+| **parent_call_id** | **String** | (optional) If the event is related to the B leg of a <Transfer>, the call id of the original call leg that executed the <Transfer>. Otherwise, this field will not be present. | [optional] |
+| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] |
+| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] |
+| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] |
+| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] |
+| **transfer_caller_id** | **String** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] |
+| **transfer_to** | **String** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::RedirectCallback.new(
+ event_type: bridgeComplete,
+ event_time: 2022-06-17T22:19:40.375Z,
+ account_id: 920012,
+ application_id: 04e88489-df02-4e34-a0ee-27a91849555f,
+ from: +15555555555,
+ to: +15555555555,
+ direction: null,
+ call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ call_url: https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ parent_call_id: c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d,
+ enqueued_time: 2022-06-17T22:20Z,
+ start_time: 2022-06-17T22:19:40.375Z,
+ answer_time: 2022-06-17T22:20Z,
+ tag: exampleTag,
+ transfer_caller_id: +15555555555,
+ transfer_to: +15555555555)
+)
+```
+
diff --git a/docs/RedirectMethodEnum.md b/docs/RedirectMethodEnum.md
new file mode 100644
index 00000000..6a3b89cf
--- /dev/null
+++ b/docs/RedirectMethodEnum.md
@@ -0,0 +1,15 @@
+# Bandwidth::RedirectMethodEnum
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::RedirectMethodEnum.new()
+```
+
diff --git a/docs/RequestError.md b/docs/RequestError.md
new file mode 100644
index 00000000..435a830b
--- /dev/null
+++ b/docs/RequestError.md
@@ -0,0 +1,20 @@
+# Bandwidth::RequestError
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **error** | **String** | A message describing the error with your request. | [optional] |
+| **request_id** | **String** | The associated requestId from AWS. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::RequestError.new(
+ error: Internal error,
+ request_id: 12af78d1-5f88-4917-925d-17c1ac8fda7a
+)
+```
+
diff --git a/docs/Session.md b/docs/Session.md
new file mode 100644
index 00000000..3ecaf79a
--- /dev/null
+++ b/docs/Session.md
@@ -0,0 +1,20 @@
+# Bandwidth::Session
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **id** | **String** | Unique id of the session. | [optional] |
+| **tag** | **String** | User defined tag to associate with the session. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::Session.new(
+ id: 75c21163-e110-41bc-bd76-1bb428ec85d5,
+ tag: session1
+)
+```
+
diff --git a/docs/SessionsApi.md b/docs/SessionsApi.md
new file mode 100644
index 00000000..83a64520
--- /dev/null
+++ b/docs/SessionsApi.md
@@ -0,0 +1,605 @@
+# Bandwidth::SessionsApi
+
+All URIs are relative to *http://localhost*
+
+| Method | HTTP request | Description |
+| ------ | ------------ | ----------- |
+| [**add_participant_to_session**](SessionsApi.md#add_participant_to_session) | **PUT** /accounts/{accountId}/sessions/{sessionId}/participants/{participantId} | Add Participant to Session |
+| [**create_session**](SessionsApi.md#create_session) | **POST** /accounts/{accountId}/sessions | Create Session |
+| [**delete_session**](SessionsApi.md#delete_session) | **DELETE** /accounts/{accountId}/sessions/{sessionId} | Delete Session |
+| [**get_participant_subscriptions**](SessionsApi.md#get_participant_subscriptions) | **GET** /accounts/{accountId}/sessions/{sessionId}/participants/{participantId}/subscriptions | Get Participant Subscriptions |
+| [**get_session**](SessionsApi.md#get_session) | **GET** /accounts/{accountId}/sessions/{sessionId} | Get Session |
+| [**list_session_participants**](SessionsApi.md#list_session_participants) | **GET** /accounts/{accountId}/sessions/{sessionId}/participants | List Participants in Session |
+| [**remove_participant_from_session**](SessionsApi.md#remove_participant_from_session) | **DELETE** /accounts/{accountId}/sessions/{sessionId}/participants/{participantId} | Remove Participant from Session |
+| [**update_participant_subscriptions**](SessionsApi.md#update_participant_subscriptions) | **PUT** /accounts/{accountId}/sessions/{sessionId}/participants/{participantId}/subscriptions | Update Participant Subscriptions |
+
+
+## add_participant_to_session
+
+> add_participant_to_session(account_id, session_id, participant_id, opts)
+
+Add Participant to Session
+
+Add a participant to a session. Subscriptions can optionally be provided as part of this call.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::SessionsApi.new
+account_id = '9900000' # String | Account ID
+session_id = 'cb5054ee-a69b-41ac-9ab2-04d6370826b4' # String | Session ID
+participant_id = '62e0ecb9-0b1b-5115-aae4-4f36123d6bb1' # String | Participant ID
+opts = {
+ subscriptions: Bandwidth::Subscriptions.new # Subscriptions | The Body describes an optional set of subscriptions to apply to the participant. Calling this endpoint with no/empty body will only add the participant to the session, and will not subscribe the Participant to any media. The request body for this endpoint is OPTIONAL and provided as a convenience to avoid additional calls to the Update Participant Subscriptions endpoint. --- If a body is provided it will result in direct control over what Participants are subscribed to. - if the participants Array is provided and not empty, that list of Participants will be subscribed To - if the participants Array is missing or empty, and the sessionId is provided, the participant will be subscribed to the session, including all subsequent changes to the membership of the session - if the sessionId and the participant Array are both missing or empty, no subscriptions will be created
+}
+
+begin
+ # Add Participant to Session
+ api_instance.add_participant_to_session(account_id, session_id, participant_id, opts)
+rescue Bandwidth::ApiError => e
+ puts "Error when calling SessionsApi->add_participant_to_session: #{e}"
+end
+```
+
+#### Using the add_participant_to_session_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> add_participant_to_session_with_http_info(account_id, session_id, participant_id, opts)
+
+```ruby
+begin
+ # Add Participant to Session
+ data, status_code, headers = api_instance.add_participant_to_session_with_http_info(account_id, session_id, participant_id, opts)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Bandwidth::ApiError => e
+ puts "Error when calling SessionsApi->add_participant_to_session_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Account ID | |
+| **session_id** | **String** | Session ID | |
+| **participant_id** | **String** | Participant ID | |
+| **subscriptions** | [**Subscriptions**](Subscriptions.md) | The Body describes an optional set of subscriptions to apply to the participant. Calling this endpoint with no/empty body will only add the participant to the session, and will not subscribe the Participant to any media. The request body for this endpoint is OPTIONAL and provided as a convenience to avoid additional calls to the Update Participant Subscriptions endpoint. --- If a body is provided it will result in direct control over what Participants are subscribed to. - if the participants Array is provided and not empty, that list of Participants will be subscribed To - if the participants Array is missing or empty, and the sessionId is provided, the participant will be subscribed to the session, including all subsequent changes to the membership of the session - if the sessionId and the participant Array are both missing or empty, no subscriptions will be created | [optional] |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
+
+## create_session
+
+> create_session(account_id, opts)
+
+Create Session
+
+Create a new session. Sessions are idempotent, so relevant parameters must be set in this function if desired.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::SessionsApi.new
+account_id = '9900000' # String | Account ID
+opts = {
+ session: Bandwidth::Session.new # Session | Create session request body.
+}
+
+begin
+ # Create Session
+ result = api_instance.create_session(account_id, opts)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling SessionsApi->create_session: #{e}"
+end
+```
+
+#### Using the create_session_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> create_session_with_http_info(account_id, opts)
+
+```ruby
+begin
+ # Create Session
+ data, status_code, headers = api_instance.create_session_with_http_info(account_id, opts)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Bandwidth::ApiError => e
+ puts "Error when calling SessionsApi->create_session_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Account ID | |
+| **session** | [**Session**](Session.md) | Create session request body. | [optional] |
+
+### Return type
+
+[**Session**](Session.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
+
+## delete_session
+
+> delete_session(account_id, session_id)
+
+Delete Session
+
+Delete session by ID.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::SessionsApi.new
+account_id = '9900000' # String | Account ID
+session_id = 'cb5054ee-a69b-41ac-9ab2-04d6370826b4' # String | Session ID
+
+begin
+ # Delete Session
+ api_instance.delete_session(account_id, session_id)
+rescue Bandwidth::ApiError => e
+ puts "Error when calling SessionsApi->delete_session: #{e}"
+end
+```
+
+#### Using the delete_session_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> delete_session_with_http_info(account_id, session_id)
+
+```ruby
+begin
+ # Delete Session
+ data, status_code, headers = api_instance.delete_session_with_http_info(account_id, session_id)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Bandwidth::ApiError => e
+ puts "Error when calling SessionsApi->delete_session_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Account ID | |
+| **session_id** | **String** | Session ID | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## get_participant_subscriptions
+
+> get_participant_subscriptions(account_id, session_id, participant_id)
+
+Get Participant Subscriptions
+
+Get a participant's subscriptions.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::SessionsApi.new
+account_id = '9900000' # String | Account ID
+session_id = 'cb5054ee-a69b-41ac-9ab2-04d6370826b4' # String | Session ID
+participant_id = '62e0ecb9-0b1b-5115-aae4-4f36123d6bb1' # String | Participant ID
+
+begin
+ # Get Participant Subscriptions
+ result = api_instance.get_participant_subscriptions(account_id, session_id, participant_id)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling SessionsApi->get_participant_subscriptions: #{e}"
+end
+```
+
+#### Using the get_participant_subscriptions_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> get_participant_subscriptions_with_http_info(account_id, session_id, participant_id)
+
+```ruby
+begin
+ # Get Participant Subscriptions
+ data, status_code, headers = api_instance.get_participant_subscriptions_with_http_info(account_id, session_id, participant_id)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Bandwidth::ApiError => e
+ puts "Error when calling SessionsApi->get_participant_subscriptions_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Account ID | |
+| **session_id** | **String** | Session ID | |
+| **participant_id** | **String** | Participant ID | |
+
+### Return type
+
+[**Subscriptions**](Subscriptions.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## get_session
+
+> get_session(account_id, session_id)
+
+Get Session
+
+Get session by ID.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::SessionsApi.new
+account_id = '9900000' # String | Account ID
+session_id = 'cb5054ee-a69b-41ac-9ab2-04d6370826b4' # String | Session ID
+
+begin
+ # Get Session
+ result = api_instance.get_session(account_id, session_id)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling SessionsApi->get_session: #{e}"
+end
+```
+
+#### Using the get_session_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> get_session_with_http_info(account_id, session_id)
+
+```ruby
+begin
+ # Get Session
+ data, status_code, headers = api_instance.get_session_with_http_info(account_id, session_id)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Bandwidth::ApiError => e
+ puts "Error when calling SessionsApi->get_session_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Account ID | |
+| **session_id** | **String** | Session ID | |
+
+### Return type
+
+[**Session**](Session.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## list_session_participants
+
+> > list_session_participants(account_id, session_id)
+
+List Participants in Session
+
+List participants in a session.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::SessionsApi.new
+account_id = '9900000' # String | Account ID
+session_id = 'cb5054ee-a69b-41ac-9ab2-04d6370826b4' # String | Session ID
+
+begin
+ # List Participants in Session
+ result = api_instance.list_session_participants(account_id, session_id)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling SessionsApi->list_session_participants: #{e}"
+end
+```
+
+#### Using the list_session_participants_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> >, Integer, Hash)> list_session_participants_with_http_info(account_id, session_id)
+
+```ruby
+begin
+ # List Participants in Session
+ data, status_code, headers = api_instance.list_session_participants_with_http_info(account_id, session_id)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => >
+rescue Bandwidth::ApiError => e
+ puts "Error when calling SessionsApi->list_session_participants_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Account ID | |
+| **session_id** | **String** | Session ID | |
+
+### Return type
+
+[**Array<Participant>**](Participant.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## remove_participant_from_session
+
+> remove_participant_from_session(account_id, session_id, participant_id)
+
+Remove Participant from Session
+
+Remove a participant from a session. This will automatically remove any subscriptions the participant has associated with this session.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::SessionsApi.new
+account_id = '9900000' # String | Account ID
+session_id = 'cb5054ee-a69b-41ac-9ab2-04d6370826b4' # String | Session ID
+participant_id = '62e0ecb9-0b1b-5115-aae4-4f36123d6bb1' # String | Participant ID
+
+begin
+ # Remove Participant from Session
+ api_instance.remove_participant_from_session(account_id, session_id, participant_id)
+rescue Bandwidth::ApiError => e
+ puts "Error when calling SessionsApi->remove_participant_from_session: #{e}"
+end
+```
+
+#### Using the remove_participant_from_session_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> remove_participant_from_session_with_http_info(account_id, session_id, participant_id)
+
+```ruby
+begin
+ # Remove Participant from Session
+ data, status_code, headers = api_instance.remove_participant_from_session_with_http_info(account_id, session_id, participant_id)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Bandwidth::ApiError => e
+ puts "Error when calling SessionsApi->remove_participant_from_session_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Account ID | |
+| **session_id** | **String** | Session ID | |
+| **participant_id** | **String** | Participant ID | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## update_participant_subscriptions
+
+> update_participant_subscriptions(account_id, session_id, participant_id, opts)
+
+Update Participant Subscriptions
+
+Update a participant's subscriptions. This is a full update that will replace the participant's subscriptions. It allows subscription to the entire Session, a subset list of Participants in that Session, or specific media streams on any of the listed Participants. First call `getParticipantSubscriptions` if you need the current subscriptions. Calling this API with no `Subscriptions` object to remove all subscriptions.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::SessionsApi.new
+account_id = '9900000' # String | Account ID
+session_id = 'cb5054ee-a69b-41ac-9ab2-04d6370826b4' # String | Session ID
+participant_id = '62e0ecb9-0b1b-5115-aae4-4f36123d6bb1' # String | Participant ID
+opts = {
+ subscriptions: Bandwidth::Subscriptions.new # Subscriptions | The body describes the desired subscriptions for the Participant. --- If a body is provided it will result in direct control over what Participants are subscribed to. - if the participants Array is provided and not empty, that list of Participants will be subscribed To - if the participants Array is missing or empty, and the sessionId is provided, the participant will be subscribed to the session, including all subsequent changes to the membership of the session - if the sessionId and the participant Array are both missing or empty, no subscriptions will be created
+}
+
+begin
+ # Update Participant Subscriptions
+ api_instance.update_participant_subscriptions(account_id, session_id, participant_id, opts)
+rescue Bandwidth::ApiError => e
+ puts "Error when calling SessionsApi->update_participant_subscriptions: #{e}"
+end
+```
+
+#### Using the update_participant_subscriptions_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> update_participant_subscriptions_with_http_info(account_id, session_id, participant_id, opts)
+
+```ruby
+begin
+ # Update Participant Subscriptions
+ data, status_code, headers = api_instance.update_participant_subscriptions_with_http_info(account_id, session_id, participant_id, opts)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Bandwidth::ApiError => e
+ puts "Error when calling SessionsApi->update_participant_subscriptions_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Account ID | |
+| **session_id** | **String** | Session ID | |
+| **participant_id** | **String** | Participant ID | |
+| **subscriptions** | [**Subscriptions**](Subscriptions.md) | The body describes the desired subscriptions for the Participant. --- If a body is provided it will result in direct control over what Participants are subscribed to. - if the participants Array is provided and not empty, that list of Participants will be subscribed To - if the participants Array is missing or empty, and the sessionId is provided, the participant will be subscribed to the session, including all subsequent changes to the membership of the session - if the sessionId and the participant Array are both missing or empty, no subscriptions will be created | [optional] |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
diff --git a/docs/StatisticsApi.md b/docs/StatisticsApi.md
new file mode 100644
index 00000000..8809fd44
--- /dev/null
+++ b/docs/StatisticsApi.md
@@ -0,0 +1,78 @@
+# Bandwidth::StatisticsApi
+
+All URIs are relative to *http://localhost*
+
+| Method | HTTP request | Description |
+| ------ | ------------ | ----------- |
+| [**get_statistics**](StatisticsApi.md#get_statistics) | **GET** /accounts/{accountId}/statistics | Get Account Statistics |
+
+
+## get_statistics
+
+> get_statistics(account_id)
+
+Get Account Statistics
+
+Returns details about the current state of the account.
+
+### Examples
+
+```ruby
+require 'time'
+require 'bandwidth-sdk'
+# setup authorization
+Bandwidth.configure do |config|
+ # Configure HTTP basic authorization: Basic
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Bandwidth::StatisticsApi.new
+account_id = '9900000' # String | Your Bandwidth Account ID.
+
+begin
+ # Get Account Statistics
+ result = api_instance.get_statistics(account_id)
+ p result
+rescue Bandwidth::ApiError => e
+ puts "Error when calling StatisticsApi->get_statistics: #{e}"
+end
+```
+
+#### Using the get_statistics_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> get_statistics_with_http_info(account_id)
+
+```ruby
+begin
+ # Get Account Statistics
+ data, status_code, headers = api_instance.get_statistics_with_http_info(account_id)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Bandwidth::ApiError => e
+ puts "Error when calling StatisticsApi->get_statistics_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **account_id** | **String** | Your Bandwidth Account ID. | |
+
+### Return type
+
+[**AccountStatistics**](AccountStatistics.md)
+
+### Authorization
+
+[Basic](../README.md#Basic)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
diff --git a/docs/StirShaken.md b/docs/StirShaken.md
new file mode 100644
index 00000000..42f1e965
--- /dev/null
+++ b/docs/StirShaken.md
@@ -0,0 +1,22 @@
+# Bandwidth::StirShaken
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **verstat** | **String** | (optional) The verification status indicating whether the verification was successful or not. Possible values are TN-Verification-Passed and TN-Verification-Failed. | [optional] |
+| **attestation_indicator** | **String** | (optional) The attestation level verified by Bandwidth. Possible values are A (full), B (partial) or C (gateway). | [optional] |
+| **originating_id** | **String** | (optional) A unique origination identifier. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::StirShaken.new(
+ verstat: Tn-Verification-Passed,
+ attestation_indicator: A,
+ originating_id: 99759086-1335-11ed-9bcf-5f7d464e91af
+)
+```
+
diff --git a/docs/Subscriptions.md b/docs/Subscriptions.md
new file mode 100644
index 00000000..ada96411
--- /dev/null
+++ b/docs/Subscriptions.md
@@ -0,0 +1,20 @@
+# Bandwidth::Subscriptions
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **session_id** | **String** | If present, and not overridden by the array of participants, it represents the session the subscriptions are associated with. If this is the only field, the subscriber will be subscribed to all participants in the session (including any participants that are later added to the session). Upon creation of a Participant, returns as an empty object. | [optional] |
+| **participants** | [**Array<ParticipantSubscription>**](ParticipantSubscription.md) | (optional) A list of participants in the session that will be subscribed to. If present and not empty or null, this will override any sessionId specified in the body. Returns empty if used during the creation of a Participant. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::Subscriptions.new(
+ session_id: d8886aad-b956-4e1b-b2f4-d7c9f8162772,
+ participants: [{"participantId":"568749d5-04d5-483d-adf5-deac7dd3d521"},{"participantId":"0275e47f-dd21-4cf0-a1e1-dfdc719e73a7","streamAliases":["alias_1","alias_2"]}]
+)
+```
+
diff --git a/docs/Tag.md b/docs/Tag.md
new file mode 100644
index 00000000..0c2a8756
--- /dev/null
+++ b/docs/Tag.md
@@ -0,0 +1,20 @@
+# Bandwidth::Tag
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **key** | **String** | | [optional] |
+| **value** | **String** | | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::Tag.new(
+ key: null,
+ value: null
+)
+```
+
diff --git a/docs/TnLookupRequestError.md b/docs/TnLookupRequestError.md
new file mode 100644
index 00000000..ed31bd7f
--- /dev/null
+++ b/docs/TnLookupRequestError.md
@@ -0,0 +1,18 @@
+# Bandwidth::TnLookupRequestError
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **message** | **String** | A description of what validation error occurred. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::TnLookupRequestError.new(
+ message: example error message
+)
+```
+
diff --git a/docs/TranscribeRecording.md b/docs/TranscribeRecording.md
new file mode 100644
index 00000000..de2ab0f9
--- /dev/null
+++ b/docs/TranscribeRecording.md
@@ -0,0 +1,30 @@
+# Bandwidth::TranscribeRecording
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **callback_url** | **String** | The URL to send the [TranscriptionAvailable](/docs/voice/webhooks/transcriptionAvailable) event to. You should not include sensitive or personally-identifiable information in the callbackUrl field! Always use the proper username and password fields for authorization. | [optional] |
+| **callback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional][default to 'POST'] |
+| **username** | **String** | Basic auth username. | [optional] |
+| **password** | **String** | Basic auth password. | [optional] |
+| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] |
+| **callback_timeout** | **Float** | This is the timeout (in seconds) to use when delivering the webhook to `callbackUrl`. Can be any numeric value (including decimals) between 1 and 25. | [optional][default to 15] |
+| **detect_language** | **Boolean** | A boolean value to indicate that the recording may not be in English, and the transcription service will need to detect the dominant language the recording is in and transcribe accordingly. Current supported languages are English, French, and Spanish. | [optional][default to false] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::TranscribeRecording.new(
+ callback_url: https://myServer.example/bandwidth/webhooks/transcriptionAvailable,
+ callback_method: null,
+ username: mySecretUsername,
+ password: mySecretPassword1!,
+ tag: exampleTag,
+ callback_timeout: 5.5,
+ detect_language: true
+)
+```
+
diff --git a/docs/Transcription.md b/docs/Transcription.md
new file mode 100644
index 00000000..7caa4d2a
--- /dev/null
+++ b/docs/Transcription.md
@@ -0,0 +1,20 @@
+# Bandwidth::Transcription
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **text** | **String** | The transcribed text | [optional] |
+| **confidence** | **Float** | The confidence on the recognized content, ranging from `0.0` to `1.0` with `1.0` being the highest confidence. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::Transcription.new(
+ text: Nice talking to you, friend!,
+ confidence: 0.9
+)
+```
+
diff --git a/docs/TranscriptionAvailableCallback.md b/docs/TranscriptionAvailableCallback.md
new file mode 100644
index 00000000..e5b28e5c
--- /dev/null
+++ b/docs/TranscriptionAvailableCallback.md
@@ -0,0 +1,58 @@
+# Bandwidth::TranscriptionAvailableCallback
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] |
+| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
+| **account_id** | **String** | The user account associated with the call. | [optional] |
+| **application_id** | **String** | The id of the application associated with the call. | [optional] |
+| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
+| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
+| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] |
+| **call_id** | **String** | The call id associated with the event. | [optional] |
+| **call_url** | **String** | The URL of the call associated with the event. | [optional] |
+| **media_url** | **String** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional] |
+| **parent_call_id** | **String** | (optional) If the event is related to the B leg of a <Transfer>, the call id of the original call leg that executed the <Transfer>. Otherwise, this field will not be present. | [optional] |
+| **recording_id** | **String** | The unique ID of this recording | [optional] |
+| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] |
+| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] |
+| **end_time** | **Time** | The time that the recording ended in ISO-8601 format | [optional] |
+| **duration** | **String** | The duration of the recording in ISO-8601 format | [optional] |
+| **file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional] |
+| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] |
+| **transcription** | [**Transcription**](Transcription.md) | | [optional] |
+| **transfer_caller_id** | **String** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] |
+| **transfer_to** | **String** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::TranscriptionAvailableCallback.new(
+ event_type: bridgeComplete,
+ event_time: 2022-06-17T22:19:40.375Z,
+ account_id: 920012,
+ application_id: 04e88489-df02-4e34-a0ee-27a91849555f,
+ from: +15555555555,
+ to: +15555555555,
+ direction: null,
+ call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ call_url: https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ media_url: https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media,
+ parent_call_id: c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d,
+ recording_id: r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833,
+ enqueued_time: 2022-06-17T22:20Z,
+ start_time: 2022-06-17T22:19:40.375Z,
+ end_time: 2022-06-17T22:20Z,
+ duration: PT13.67S,
+ file_format: null,
+ tag: exampleTag,
+ transcription: null,
+ transfer_caller_id: +15555555555,
+ transfer_to: +15555555555)
+)
+```
+
diff --git a/docs/TranscriptionList.md b/docs/TranscriptionList.md
new file mode 100644
index 00000000..949c92cf
--- /dev/null
+++ b/docs/TranscriptionList.md
@@ -0,0 +1,18 @@
+# Bandwidth::TranscriptionList
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **transcripts** | [**Array<Transcription>**](Transcription.md) | | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::TranscriptionList.new(
+ transcripts: null
+)
+```
+
diff --git a/docs/TranscriptionMetadata.md b/docs/TranscriptionMetadata.md
new file mode 100644
index 00000000..b9a4d61f
--- /dev/null
+++ b/docs/TranscriptionMetadata.md
@@ -0,0 +1,24 @@
+# Bandwidth::TranscriptionMetadata
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **id** | **String** | The unique transcription ID | [optional] |
+| **status** | **String** | The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional] |
+| **completed_time** | **String** | The time that the transcription was completed | [optional] |
+| **url** | **String** | The URL of the [transcription](#operation/getCallTranscription) | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::TranscriptionMetadata.new(
+ id: t-387bd648-18f3-4823-9d16-746bca0003c9,
+ status: completed,
+ completed_time: 2022-06-13T18:46:29.715Z,
+ url: https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/recordings/r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/transcription
+)
+```
+
diff --git a/docs/TransferAnswerCallback.md b/docs/TransferAnswerCallback.md
new file mode 100644
index 00000000..b1b09035
--- /dev/null
+++ b/docs/TransferAnswerCallback.md
@@ -0,0 +1,46 @@
+# Bandwidth::TransferAnswerCallback
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] |
+| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
+| **account_id** | **String** | The user account associated with the call. | [optional] |
+| **application_id** | **String** | The id of the application associated with the call. | [optional] |
+| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
+| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
+| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] |
+| **call_id** | **String** | The call id associated with the event. | [optional] |
+| **call_url** | **String** | The URL of the call associated with the event. | [optional] |
+| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] |
+| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] |
+| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] |
+| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] |
+| **transfer_caller_id** | **String** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] |
+| **transfer_to** | **String** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::TransferAnswerCallback.new(
+ event_type: bridgeComplete,
+ event_time: 2022-06-17T22:19:40.375Z,
+ account_id: 920012,
+ application_id: 04e88489-df02-4e34-a0ee-27a91849555f,
+ from: +15555555555,
+ to: +15555555555,
+ direction: null,
+ call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ call_url: https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ enqueued_time: 2022-06-17T22:20Z,
+ start_time: 2022-06-17T22:19:40.375Z,
+ answer_time: 2022-06-17T22:20Z,
+ tag: exampleTag,
+ transfer_caller_id: +15555555555,
+ transfer_to: +15555555555)
+)
+```
+
diff --git a/docs/TransferCompleteCallback.md b/docs/TransferCompleteCallback.md
new file mode 100644
index 00000000..b4c530cc
--- /dev/null
+++ b/docs/TransferCompleteCallback.md
@@ -0,0 +1,52 @@
+# Bandwidth::TransferCompleteCallback
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] |
+| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
+| **account_id** | **String** | The user account associated with the call. | [optional] |
+| **application_id** | **String** | The id of the application associated with the call. | [optional] |
+| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
+| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
+| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] |
+| **call_id** | **String** | The call id associated with the event. | [optional] |
+| **call_url** | **String** | The URL of the call associated with the event. | [optional] |
+| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] |
+| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] |
+| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] |
+| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] |
+| **transfer_caller_id** | **String** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] |
+| **transfer_to** | **String** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] |
+| **cause** | **String** | Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown. | [optional] |
+| **error_message** | **String** | Text explaining the reason that caused the call to fail in case of errors. | [optional] |
+| **error_id** | **String** | Bandwidth's internal id that references the error event. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::TransferCompleteCallback.new(
+ event_type: bridgeComplete,
+ event_time: 2022-06-17T22:19:40.375Z,
+ account_id: 920012,
+ application_id: 04e88489-df02-4e34-a0ee-27a91849555f,
+ from: +15555555555,
+ to: +15555555555,
+ direction: null,
+ call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ call_url: https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ enqueued_time: 2022-06-17T22:20Z,
+ start_time: 2022-06-17T22:19:40.375Z,
+ answer_time: 2022-06-17T22:20Z,
+ tag: exampleTag,
+ transfer_caller_id: +15555555555,
+ transfer_to: +15555555555),
+ cause: busy,
+ error_message: Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call,
+ error_id: 4642074b-7b58-478b-96e4-3a60955c6765
+)
+```
+
diff --git a/docs/TransferDisconnectCallback.md b/docs/TransferDisconnectCallback.md
new file mode 100644
index 00000000..8933cc88
--- /dev/null
+++ b/docs/TransferDisconnectCallback.md
@@ -0,0 +1,56 @@
+# Bandwidth::TransferDisconnectCallback
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **event_type** | **String** | The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect. | [optional] |
+| **event_time** | **Time** | The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution. | [optional] |
+| **account_id** | **String** | The user account associated with the call. | [optional] |
+| **application_id** | **String** | The id of the application associated with the call. | [optional] |
+| **from** | **String** | The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous. | [optional] |
+| **to** | **String** | The phone number that received the call, in E.164 format (e.g. +15555555555). | [optional] |
+| **direction** | [**CallDirectionEnum**](CallDirectionEnum.md) | | [optional] |
+| **call_id** | **String** | The call id associated with the event. | [optional] |
+| **call_url** | **String** | The URL of the call associated with the event. | [optional] |
+| **parent_call_id** | **String** | (optional) If the event is related to the B leg of a <Transfer>, the call id of the original call leg that executed the <Transfer>. Otherwise, this field will not be present. | [optional] |
+| **enqueued_time** | **Time** | (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format. | [optional] |
+| **start_time** | **Time** | Time the call was started, in ISO 8601 format. | [optional] |
+| **answer_time** | **Time** | Time the call was answered, in ISO 8601 format. | [optional] |
+| **end_time** | **Time** | The time that the recording ended in ISO-8601 format | [optional] |
+| **tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] |
+| **transfer_caller_id** | **String** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] |
+| **transfer_to** | **String** | The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555). | [optional] |
+| **cause** | **String** | Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown. | [optional] |
+| **error_message** | **String** | Text explaining the reason that caused the call to fail in case of errors. | [optional] |
+| **error_id** | **String** | Bandwidth's internal id that references the error event. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::TransferDisconnectCallback.new(
+ event_type: bridgeComplete,
+ event_time: 2022-06-17T22:19:40.375Z,
+ account_id: 920012,
+ application_id: 04e88489-df02-4e34-a0ee-27a91849555f,
+ from: +15555555555,
+ to: +15555555555,
+ direction: null,
+ call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ call_url: https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85,
+ parent_call_id: c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d,
+ enqueued_time: 2022-06-17T22:20Z,
+ start_time: 2022-06-17T22:19:40.375Z,
+ answer_time: 2022-06-17T22:20Z,
+ end_time: 2022-06-17T22:20Z,
+ tag: exampleTag,
+ transfer_caller_id: +15555555555,
+ transfer_to: +15555555555),
+ cause: busy,
+ error_message: Call c-2a913f94-6a486f3a-3cae-4034-bcc3-f0c9fa77ca2f is already bridged with another call,
+ error_id: 4642074b-7b58-478b-96e4-3a60955c6765
+)
+```
+
diff --git a/docs/UnauthorizedRequest.md b/docs/UnauthorizedRequest.md
new file mode 100644
index 00000000..e307c8bf
--- /dev/null
+++ b/docs/UnauthorizedRequest.md
@@ -0,0 +1,18 @@
+# Bandwidth::UnauthorizedRequest
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **message** | **String** | Unauthorized | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::UnauthorizedRequest.new(
+ message: Unauthorized
+)
+```
+
diff --git a/docs/UpdateCall.md b/docs/UpdateCall.md
new file mode 100644
index 00000000..f8f4a16f
--- /dev/null
+++ b/docs/UpdateCall.md
@@ -0,0 +1,36 @@
+# Bandwidth::UpdateCall
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **state** | [**CallStateEnum**](CallStateEnum.md) | | [optional][default to 'active'] |
+| **redirect_url** | **String** | The URL to send the [Redirect](/docs/voice/bxml/redirect) event to which will provide new BXML. Required if `state` is `active`. Not allowed if `state` is `completed`. | [optional] |
+| **redirect_method** | [**RedirectMethodEnum**](RedirectMethodEnum.md) | | [optional][default to 'POST'] |
+| **username** | **String** | Basic auth username. | [optional] |
+| **password** | **String** | Basic auth password. | [optional] |
+| **redirect_fallback_url** | **String** | A fallback url which, if provided, will be used to retry the redirect callback delivery in case `redirectUrl` fails to respond. | [optional] |
+| **redirect_fallback_method** | [**RedirectMethodEnum**](RedirectMethodEnum.md) | | [optional][default to 'POST'] |
+| **fallback_username** | **String** | Basic auth username. | [optional] |
+| **fallback_password** | **String** | Basic auth password. | [optional] |
+| **tag** | **String** | A custom string that will be sent with this and all future callbacks unless overwritten by a future `tag` attribute or [`<Tag>`](/docs/voice/bxml/tag) verb, or cleared. May be cleared by setting `tag=\"\"`. Max length 256 characters. Not allowed if `state` is `completed`. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::UpdateCall.new(
+ state: null,
+ redirect_url: https://myServer.example/bandwidth/webhooks/redirect,
+ redirect_method: null,
+ username: mySecretUsername,
+ password: mySecretPassword1!,
+ redirect_fallback_url: https://myFallbackServer.example/bandwidth/webhooks/redirect,
+ redirect_fallback_method: null,
+ fallback_username: mySecretUsername,
+ fallback_password: mySecretPassword1!,
+ tag: My Custom Tag
+)
+```
+
diff --git a/docs/UpdateCallRecording.md b/docs/UpdateCallRecording.md
new file mode 100644
index 00000000..f57cf27d
--- /dev/null
+++ b/docs/UpdateCallRecording.md
@@ -0,0 +1,18 @@
+# Bandwidth::UpdateCallRecording
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **state** | [**RecordingStateEnum**](RecordingStateEnum.md) | | |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::UpdateCallRecording.new(
+ state: null
+)
+```
+
diff --git a/docs/UpdateConference.md b/docs/UpdateConference.md
new file mode 100644
index 00000000..9843a89d
--- /dev/null
+++ b/docs/UpdateConference.md
@@ -0,0 +1,34 @@
+# Bandwidth::UpdateConference
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **status** | [**ConferenceStateEnum**](ConferenceStateEnum.md) | | [optional][default to 'active'] |
+| **redirect_url** | **String** | The URL to send the [conferenceRedirect](/docs/voice/webhooks/conferenceRedirect) event which will provide new BXML. Not allowed if `state` is `completed`, but required if `state` is `active`. | [optional] |
+| **redirect_method** | [**RedirectMethodEnum**](RedirectMethodEnum.md) | | [optional][default to 'POST'] |
+| **username** | **String** | Basic auth username. | [optional] |
+| **password** | **String** | Basic auth password. | [optional] |
+| **redirect_fallback_url** | **String** | A fallback url which, if provided, will be used to retry the `conferenceRedirect` webhook delivery in case `redirectUrl` fails to respond. Not allowed if `state` is `completed`. | [optional] |
+| **redirect_fallback_method** | [**RedirectMethodEnum**](RedirectMethodEnum.md) | | [optional][default to 'POST'] |
+| **fallback_username** | **String** | Basic auth username. | [optional] |
+| **fallback_password** | **String** | Basic auth password. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::UpdateConference.new(
+ status: null,
+ redirect_url: https://myServer.example/bandwidth/webhooks/conferenceRedirect,
+ redirect_method: null,
+ username: mySecretUsername,
+ password: mySecretPassword1!,
+ redirect_fallback_url: https://myFallbackServer.example/bandwidth/webhooks/conferenceRedirect,
+ redirect_fallback_method: null,
+ fallback_username: mySecretUsername,
+ fallback_password: mySecretPassword1!
+)
+```
+
diff --git a/docs/UpdateConferenceMember.md b/docs/UpdateConferenceMember.md
new file mode 100644
index 00000000..2e3ad699
--- /dev/null
+++ b/docs/UpdateConferenceMember.md
@@ -0,0 +1,22 @@
+# Bandwidth::UpdateConferenceMember
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **mute** | **Boolean** | Whether or not this member is currently muted. Members who are muted are still able to hear other participants. Updates this member's mute status. Has no effect if omitted. | [optional] |
+| **hold** | **Boolean** | Whether or not this member is currently on hold. Members who are on hold are not able to hear or speak in the conference. Updates this member's hold status. Has no effect if omitted. | [optional] |
+| **call_ids_to_coach** | **Array<String>** | If this member had a value set for `callIdsToCoach` in its [Conference](/docs/voice/bxml/conference) verb or this list was added with a previous PUT request to modify the member, this is that list of calls. Modifies the calls that this member is coaching. Has no effect if omitted. See the documentation for the [Conference](/docs/voice/bxml/conference) verb for more details about coaching. Note that this will not add the matching calls to the conference; each call must individually execute a Conference verb to join. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::UpdateConferenceMember.new(
+ mute: false,
+ hold: false,
+ call_ids_to_coach: ["c-25ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"]
+)
+```
+
diff --git a/docs/VerifyCodeRequest.md b/docs/VerifyCodeRequest.md
new file mode 100644
index 00000000..b85de500
--- /dev/null
+++ b/docs/VerifyCodeRequest.md
@@ -0,0 +1,24 @@
+# Bandwidth::VerifyCodeRequest
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **to** | **String** | The phone number to send the mfa code to. | |
+| **scope** | **String** | An optional field to denote what scope or action the mfa code is addressing. If not supplied, defaults to \"2FA\". | [optional] |
+| **expiration_time_in_minutes** | **Float** | The time period, in minutes, to validate the mfa code. By setting this to 3 minutes, it will mean any code generated within the last 3 minutes are still valid. The valid range for expiration time is between 0 and 15 minutes, exclusively and inclusively, respectively. | |
+| **code** | **String** | The generated mfa code to check if valid. | |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::VerifyCodeRequest.new(
+ to: +19195551234,
+ scope: 2FA,
+ expiration_time_in_minutes: 3,
+ code: 123456
+)
+```
+
diff --git a/docs/VerifyCodeResponse.md b/docs/VerifyCodeResponse.md
new file mode 100644
index 00000000..7a34c68c
--- /dev/null
+++ b/docs/VerifyCodeResponse.md
@@ -0,0 +1,18 @@
+# Bandwidth::VerifyCodeResponse
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **valid** | **Boolean** | Whether or not the supplied code is valid. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::VerifyCodeResponse.new(
+ valid: true
+)
+```
+
diff --git a/docs/VoiceApiError.md b/docs/VoiceApiError.md
new file mode 100644
index 00000000..b7e2d143
--- /dev/null
+++ b/docs/VoiceApiError.md
@@ -0,0 +1,22 @@
+# Bandwidth::VoiceApiError
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **type** | **String** | | [optional] |
+| **description** | **String** | | [optional] |
+| **id** | **String** | | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::VoiceApiError.new(
+ type: null,
+ description: null,
+ id: null
+)
+```
+
diff --git a/docs/VoiceCodeResponse.md b/docs/VoiceCodeResponse.md
new file mode 100644
index 00000000..3d16cefc
--- /dev/null
+++ b/docs/VoiceCodeResponse.md
@@ -0,0 +1,18 @@
+# Bandwidth::VoiceCodeResponse
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **call_id** | **String** | Programmable Voice API Call ID. | [optional] |
+
+## Example
+
+```ruby
+require 'bandwidth-sdk'
+
+instance = Bandwidth::VoiceCodeResponse.new(
+ call_id: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85
+)
+```
+
diff --git a/git_push.sh b/git_push.sh
new file mode 100644
index 00000000..f53a75d4
--- /dev/null
+++ b/git_push.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
+#
+# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
+
+git_user_id=$1
+git_repo_id=$2
+release_note=$3
+git_host=$4
+
+if [ "$git_host" = "" ]; then
+ git_host="github.com"
+ echo "[INFO] No command line input provided. Set \$git_host to $git_host"
+fi
+
+if [ "$git_user_id" = "" ]; then
+ git_user_id="GIT_USER_ID"
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
+fi
+
+if [ "$git_repo_id" = "" ]; then
+ git_repo_id="GIT_REPO_ID"
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
+fi
+
+if [ "$release_note" = "" ]; then
+ release_note="Minor update"
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
+fi
+
+# Initialize the local directory as a Git repository
+git init
+
+# Adds the files in the local repository and stages them for commit.
+git add .
+
+# Commits the tracked changes and prepares them to be pushed to a remote repository.
+git commit -m "$release_note"
+
+# Sets the new remote
+git_remote=$(git remote)
+if [ "$git_remote" = "" ]; then # git remote not defined
+
+ if [ "$GIT_TOKEN" = "" ]; then
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
+ git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
+ else
+ git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
+ fi
+
+fi
+
+git pull origin master
+
+# Pushes (Forces) the changes in the local repository up to the remote repository
+echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
+git push origin master 2>&1 | grep -v 'To https'
diff --git a/lib/bandwidth-sdk.rb b/lib/bandwidth-sdk.rb
new file mode 100644
index 00000000..87f7417f
--- /dev/null
+++ b/lib/bandwidth-sdk.rb
@@ -0,0 +1,170 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+# Common files
+require 'bandwidth-sdk/api_client'
+require 'bandwidth-sdk/api_error'
+require 'bandwidth-sdk/version'
+require 'bandwidth-sdk/configuration'
+
+# Models
+require 'bandwidth-sdk/models/account_statistics'
+require 'bandwidth-sdk/models/answer_callback'
+require 'bandwidth-sdk/models/bridge_complete_callback'
+require 'bandwidth-sdk/models/bridge_target_complete_callback'
+require 'bandwidth-sdk/models/call_direction_enum'
+require 'bandwidth-sdk/models/call_recording_metadata'
+require 'bandwidth-sdk/models/call_state'
+require 'bandwidth-sdk/models/call_state_enum'
+require 'bandwidth-sdk/models/callback_method_enum'
+require 'bandwidth-sdk/models/code_request'
+require 'bandwidth-sdk/models/conference'
+require 'bandwidth-sdk/models/conference_completed_callback'
+require 'bandwidth-sdk/models/conference_created_callback'
+require 'bandwidth-sdk/models/conference_member'
+require 'bandwidth-sdk/models/conference_member_exit_callback'
+require 'bandwidth-sdk/models/conference_member_join_callback'
+require 'bandwidth-sdk/models/conference_recording_available_callback'
+require 'bandwidth-sdk/models/conference_recording_metadata'
+require 'bandwidth-sdk/models/conference_redirect_callback'
+require 'bandwidth-sdk/models/conference_state_enum'
+require 'bandwidth-sdk/models/create_call'
+require 'bandwidth-sdk/models/create_call_response'
+require 'bandwidth-sdk/models/create_lookup_response'
+require 'bandwidth-sdk/models/create_message_request_error'
+require 'bandwidth-sdk/models/deferred_result'
+require 'bandwidth-sdk/models/disconnect_callback'
+require 'bandwidth-sdk/models/diversion'
+require 'bandwidth-sdk/models/dtmf_callback'
+require 'bandwidth-sdk/models/field_error'
+require 'bandwidth-sdk/models/file_format_enum'
+require 'bandwidth-sdk/models/gather_callback'
+require 'bandwidth-sdk/models/inbound_message_callback'
+require 'bandwidth-sdk/models/inbound_message_callback_message'
+require 'bandwidth-sdk/models/initiate_callback'
+require 'bandwidth-sdk/models/list_message_direction_enum'
+require 'bandwidth-sdk/models/list_message_item'
+require 'bandwidth-sdk/models/lookup_request'
+require 'bandwidth-sdk/models/lookup_result'
+require 'bandwidth-sdk/models/lookup_status'
+require 'bandwidth-sdk/models/lookup_status_enum'
+require 'bandwidth-sdk/models/machine_detection_complete_callback'
+require 'bandwidth-sdk/models/machine_detection_configuration'
+require 'bandwidth-sdk/models/machine_detection_mode_enum'
+require 'bandwidth-sdk/models/machine_detection_result'
+require 'bandwidth-sdk/models/media'
+require 'bandwidth-sdk/models/message'
+require 'bandwidth-sdk/models/message_delivered_callback'
+require 'bandwidth-sdk/models/message_delivered_callback_message'
+require 'bandwidth-sdk/models/message_direction_enum'
+require 'bandwidth-sdk/models/message_failed_callback'
+require 'bandwidth-sdk/models/message_failed_callback_message'
+require 'bandwidth-sdk/models/message_request'
+require 'bandwidth-sdk/models/message_sending_callback'
+require 'bandwidth-sdk/models/message_sending_callback_message'
+require 'bandwidth-sdk/models/message_status_enum'
+require 'bandwidth-sdk/models/message_type_enum'
+require 'bandwidth-sdk/models/messages_list'
+require 'bandwidth-sdk/models/messaging_code_response'
+require 'bandwidth-sdk/models/messaging_request_error'
+require 'bandwidth-sdk/models/mfa_forbidden_request_error'
+require 'bandwidth-sdk/models/mfa_request_error'
+require 'bandwidth-sdk/models/mfa_unauthorized_request_error'
+require 'bandwidth-sdk/models/page_info'
+require 'bandwidth-sdk/models/priority_enum'
+require 'bandwidth-sdk/models/recording_available_callback'
+require 'bandwidth-sdk/models/recording_complete_callback'
+require 'bandwidth-sdk/models/recording_state_enum'
+require 'bandwidth-sdk/models/redirect_callback'
+require 'bandwidth-sdk/models/redirect_method_enum'
+require 'bandwidth-sdk/models/stir_shaken'
+require 'bandwidth-sdk/models/tag'
+require 'bandwidth-sdk/models/tn_lookup_request_error'
+require 'bandwidth-sdk/models/transcribe_recording'
+require 'bandwidth-sdk/models/transcription'
+require 'bandwidth-sdk/models/transcription_available_callback'
+require 'bandwidth-sdk/models/transcription_list'
+require 'bandwidth-sdk/models/transcription_metadata'
+require 'bandwidth-sdk/models/transfer_answer_callback'
+require 'bandwidth-sdk/models/transfer_complete_callback'
+require 'bandwidth-sdk/models/transfer_disconnect_callback'
+require 'bandwidth-sdk/models/update_call'
+require 'bandwidth-sdk/models/update_call_recording'
+require 'bandwidth-sdk/models/update_conference'
+require 'bandwidth-sdk/models/update_conference_member'
+require 'bandwidth-sdk/models/verify_code_request'
+require 'bandwidth-sdk/models/verify_code_response'
+require 'bandwidth-sdk/models/voice_api_error'
+require 'bandwidth-sdk/models/voice_code_response'
+
+# BXML
+require 'bandwidth-sdk/models/bxml/root'
+require 'bandwidth-sdk/models/bxml/bxml'
+require 'bandwidth-sdk/models/bxml/response'
+require 'bandwidth-sdk/models/bxml/verb'
+require 'bandwidth-sdk/models/bxml/nestable_verb'
+require 'bandwidth-sdk/models/bxml/verbs/bridge'
+require 'bandwidth-sdk/models/bxml/verbs/conference'
+require 'bandwidth-sdk/models/bxml/verbs/custom_param'
+require 'bandwidth-sdk/models/bxml/verbs/forward'
+require 'bandwidth-sdk/models/bxml/verbs/gather'
+require 'bandwidth-sdk/models/bxml/verbs/hangup'
+require 'bandwidth-sdk/models/bxml/verbs/pause_recording'
+require 'bandwidth-sdk/models/bxml/verbs/pause'
+require 'bandwidth-sdk/models/bxml/verbs/phone_number'
+require 'bandwidth-sdk/models/bxml/verbs/play_audio'
+require 'bandwidth-sdk/models/bxml/verbs/record'
+require 'bandwidth-sdk/models/bxml/verbs/redirect'
+require 'bandwidth-sdk/models/bxml/verbs/resume_recording'
+require 'bandwidth-sdk/models/bxml/verbs/ring'
+require 'bandwidth-sdk/models/bxml/verbs/send_dtmf'
+require 'bandwidth-sdk/models/bxml/verbs/sip_uri'
+require 'bandwidth-sdk/models/bxml/verbs/speak_sentence'
+require 'bandwidth-sdk/models/bxml/verbs/start_gather'
+require 'bandwidth-sdk/models/bxml/verbs/start_recording'
+require 'bandwidth-sdk/models/bxml/verbs/start_stream'
+require 'bandwidth-sdk/models/bxml/verbs/start_transcription'
+require 'bandwidth-sdk/models/bxml/verbs/stop_gather'
+require 'bandwidth-sdk/models/bxml/verbs/stop_recording'
+require 'bandwidth-sdk/models/bxml/verbs/stop_stream'
+require 'bandwidth-sdk/models/bxml/verbs/stop_transcription'
+require 'bandwidth-sdk/models/bxml/verbs/stream_param'
+require 'bandwidth-sdk/models/bxml/verbs/tag'
+require 'bandwidth-sdk/models/bxml/verbs/transfer'
+
+# APIs
+require 'bandwidth-sdk/api/calls_api'
+require 'bandwidth-sdk/api/conferences_api'
+require 'bandwidth-sdk/api/mfa_api'
+require 'bandwidth-sdk/api/media_api'
+require 'bandwidth-sdk/api/messages_api'
+require 'bandwidth-sdk/api/phone_number_lookup_api'
+require 'bandwidth-sdk/api/recordings_api'
+require 'bandwidth-sdk/api/statistics_api'
+
+module Bandwidth
+ class << self
+ # Customize default settings for the SDK using block.
+ # Bandwidth.configure do |config|
+ # config.username = "xxx"
+ # config.password = "xxx"
+ # end
+ # If no block given, return the default Configuration object.
+ def configure
+ if block_given?
+ yield(Configuration.default)
+ else
+ Configuration.default
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/api/calls_api.rb b/lib/bandwidth-sdk/api/calls_api.rb
new file mode 100644
index 00000000..4ab1d659
--- /dev/null
+++ b/lib/bandwidth-sdk/api/calls_api.rb
@@ -0,0 +1,325 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'cgi'
+
+module Bandwidth
+ class CallsApi
+ attr_accessor :api_client
+
+ def initialize(api_client = ApiClient.default)
+ @api_client = api_client
+ end
+ # Create Call
+ # Creates an outbound phone call. All calls are initially queued. Your outbound calls will initiated at a specific dequeueing rate, enabling your application to \"fire and forget\" when creating calls. Queued calls may not be modified until they are dequeued and placed, but may be removed from your queue on demand. Please note: Calls submitted to your queue will be placed approximately in order, but exact ordering is not guaranteed.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param create_call [CreateCall] JSON object containing information to create an outbound call
+ # @param [Hash] opts the optional parameters
+ # @return [CreateCallResponse]
+ def create_call(account_id, create_call, opts = {})
+ data, _status_code, _headers = create_call_with_http_info(account_id, create_call, opts)
+ data
+ end
+
+ # Create Call
+ # Creates an outbound phone call. All calls are initially queued. Your outbound calls will initiated at a specific dequeueing rate, enabling your application to \"fire and forget\" when creating calls. Queued calls may not be modified until they are dequeued and placed, but may be removed from your queue on demand. <b>Please note:</b> Calls submitted to your queue will be placed approximately in order, but exact ordering is not guaranteed.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param create_call [CreateCall] JSON object containing information to create an outbound call
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(CreateCallResponse, Integer, Hash)>] CreateCallResponse data, response status code and response headers
+ def create_call_with_http_info(account_id, create_call, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: CallsApi.create_call ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling CallsApi.create_call"
+ end
+ # verify the required parameter 'create_call' is set
+ if @api_client.config.client_side_validation && create_call.nil?
+ fail ArgumentError, "Missing the required parameter 'create_call' when calling CallsApi.create_call"
+ end
+ # resource path
+ local_var_path = '/accounts/{accountId}/calls'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_call)
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'CreateCallResponse'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"CallsApi.create_call",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: CallsApi#create_call\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Get Call State Information
+ # Retrieve the current state of a specific call. This information is near-realtime, so it may take a few minutes for your call to be accessible using this endpoint. **Note**: Call information is kept for 7 days after the calls are hung up. If you attempt to retrieve information for a call that is older than 7 days, you will get an HTTP 404 response.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param call_id [String] Programmable Voice API Call ID.
+ # @param [Hash] opts the optional parameters
+ # @return [CallState]
+ def get_call_state(account_id, call_id, opts = {})
+ data, _status_code, _headers = get_call_state_with_http_info(account_id, call_id, opts)
+ data
+ end
+
+ # Get Call State Information
+ # Retrieve the current state of a specific call. This information is near-realtime, so it may take a few minutes for your call to be accessible using this endpoint. **Note**: Call information is kept for 7 days after the calls are hung up. If you attempt to retrieve information for a call that is older than 7 days, you will get an HTTP 404 response.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param call_id [String] Programmable Voice API Call ID.
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(CallState, Integer, Hash)>] CallState data, response status code and response headers
+ def get_call_state_with_http_info(account_id, call_id, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: CallsApi.get_call_state ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling CallsApi.get_call_state"
+ end
+ # verify the required parameter 'call_id' is set
+ if @api_client.config.client_side_validation && call_id.nil?
+ fail ArgumentError, "Missing the required parameter 'call_id' when calling CallsApi.get_call_state"
+ end
+ # resource path
+ local_var_path = '/accounts/{accountId}/calls/{callId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'CallState'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"CallsApi.get_call_state",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: CallsApi#get_call_state\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Update Call
+ # Interrupts and redirects a call to a different URL that should return a BXML document.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param call_id [String] Programmable Voice API Call ID.
+ # @param update_call [UpdateCall] JSON object containing information to redirect an existing call to a new BXML document
+ # @param [Hash] opts the optional parameters
+ # @return [nil]
+ def update_call(account_id, call_id, update_call, opts = {})
+ update_call_with_http_info(account_id, call_id, update_call, opts)
+ nil
+ end
+
+ # Update Call
+ # Interrupts and redirects a call to a different URL that should return a BXML document.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param call_id [String] Programmable Voice API Call ID.
+ # @param update_call [UpdateCall] JSON object containing information to redirect an existing call to a new BXML document
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def update_call_with_http_info(account_id, call_id, update_call, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: CallsApi.update_call ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling CallsApi.update_call"
+ end
+ # verify the required parameter 'call_id' is set
+ if @api_client.config.client_side_validation && call_id.nil?
+ fail ArgumentError, "Missing the required parameter 'call_id' when calling CallsApi.update_call"
+ end
+ # verify the required parameter 'update_call' is set
+ if @api_client.config.client_side_validation && update_call.nil?
+ fail ArgumentError, "Missing the required parameter 'update_call' when calling CallsApi.update_call"
+ end
+ # resource path
+ local_var_path = '/accounts/{accountId}/calls/{callId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_call)
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"CallsApi.update_call",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: CallsApi#update_call\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Update Call BXML
+ # Interrupts and replaces an active call's BXML document.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param call_id [String] Programmable Voice API Call ID.
+ # @param body [String]
+ # @param [Hash] opts the optional parameters
+ # @return [nil]
+ def update_call_bxml(account_id, call_id, body, opts = {})
+ update_call_bxml_with_http_info(account_id, call_id, body, opts)
+ nil
+ end
+
+ # Update Call BXML
+ # Interrupts and replaces an active call's BXML document.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param call_id [String] Programmable Voice API Call ID.
+ # @param body [String]
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def update_call_bxml_with_http_info(account_id, call_id, body, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: CallsApi.update_call_bxml ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling CallsApi.update_call_bxml"
+ end
+ # verify the required parameter 'call_id' is set
+ if @api_client.config.client_side_validation && call_id.nil?
+ fail ArgumentError, "Missing the required parameter 'call_id' when calling CallsApi.update_call_bxml"
+ end
+ # verify the required parameter 'body' is set
+ if @api_client.config.client_side_validation && body.nil?
+ fail ArgumentError, "Missing the required parameter 'body' when calling CallsApi.update_call_bxml"
+ end
+ # resource path
+ local_var_path = '/accounts/{accountId}/calls/{callId}/bxml'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/xml'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"CallsApi.update_call_bxml",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: CallsApi#update_call_bxml\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/api/conferences_api.rb b/lib/bandwidth-sdk/api/conferences_api.rb
new file mode 100644
index 00000000..28adc783
--- /dev/null
+++ b/lib/bandwidth-sdk/api/conferences_api.rb
@@ -0,0 +1,717 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'cgi'
+
+module Bandwidth
+ class ConferencesApi
+ attr_accessor :api_client
+
+ def initialize(api_client = ApiClient.default)
+ @api_client = api_client
+ end
+ # Download Conference Recording
+ # Downloads the specified recording file.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param conference_id [String] Programmable Voice API Conference ID.
+ # @param recording_id [String] Programmable Voice API Recording ID.
+ # @param [Hash] opts the optional parameters
+ # @return [File]
+ def download_conference_recording(account_id, conference_id, recording_id, opts = {})
+ data, _status_code, _headers = download_conference_recording_with_http_info(account_id, conference_id, recording_id, opts)
+ data
+ end
+
+ # Download Conference Recording
+ # Downloads the specified recording file.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param conference_id [String] Programmable Voice API Conference ID.
+ # @param recording_id [String] Programmable Voice API Recording ID.
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
+ def download_conference_recording_with_http_info(account_id, conference_id, recording_id, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: ConferencesApi.download_conference_recording ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling ConferencesApi.download_conference_recording"
+ end
+ # verify the required parameter 'conference_id' is set
+ if @api_client.config.client_side_validation && conference_id.nil?
+ fail ArgumentError, "Missing the required parameter 'conference_id' when calling ConferencesApi.download_conference_recording"
+ end
+ # verify the required parameter 'recording_id' is set
+ if @api_client.config.client_side_validation && recording_id.nil?
+ fail ArgumentError, "Missing the required parameter 'recording_id' when calling ConferencesApi.download_conference_recording"
+ end
+ # resource path
+ local_var_path = '/accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}/media'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'conferenceId' + '}', CGI.escape(conference_id.to_s)).sub('{' + 'recordingId' + '}', CGI.escape(recording_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['audio/vnd.wave', 'audio/mpeg', 'application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'File'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"ConferencesApi.download_conference_recording",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: ConferencesApi#download_conference_recording\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Get Conference Information
+ # Returns information about the specified conference.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param conference_id [String] Programmable Voice API Conference ID.
+ # @param [Hash] opts the optional parameters
+ # @return [Conference]
+ def get_conference(account_id, conference_id, opts = {})
+ data, _status_code, _headers = get_conference_with_http_info(account_id, conference_id, opts)
+ data
+ end
+
+ # Get Conference Information
+ # Returns information about the specified conference.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param conference_id [String] Programmable Voice API Conference ID.
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(Conference, Integer, Hash)>] Conference data, response status code and response headers
+ def get_conference_with_http_info(account_id, conference_id, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: ConferencesApi.get_conference ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling ConferencesApi.get_conference"
+ end
+ # verify the required parameter 'conference_id' is set
+ if @api_client.config.client_side_validation && conference_id.nil?
+ fail ArgumentError, "Missing the required parameter 'conference_id' when calling ConferencesApi.get_conference"
+ end
+ # resource path
+ local_var_path = '/accounts/{accountId}/conferences/{conferenceId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'conferenceId' + '}', CGI.escape(conference_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'Conference'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"ConferencesApi.get_conference",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: ConferencesApi#get_conference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Get Conference Member
+ # Returns information about the specified conference member.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param conference_id [String] Programmable Voice API Conference ID.
+ # @param member_id [String] Programmable Voice API Conference Member ID.
+ # @param [Hash] opts the optional parameters
+ # @return [ConferenceMember]
+ def get_conference_member(account_id, conference_id, member_id, opts = {})
+ data, _status_code, _headers = get_conference_member_with_http_info(account_id, conference_id, member_id, opts)
+ data
+ end
+
+ # Get Conference Member
+ # Returns information about the specified conference member.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param conference_id [String] Programmable Voice API Conference ID.
+ # @param member_id [String] Programmable Voice API Conference Member ID.
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(ConferenceMember, Integer, Hash)>] ConferenceMember data, response status code and response headers
+ def get_conference_member_with_http_info(account_id, conference_id, member_id, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: ConferencesApi.get_conference_member ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling ConferencesApi.get_conference_member"
+ end
+ # verify the required parameter 'conference_id' is set
+ if @api_client.config.client_side_validation && conference_id.nil?
+ fail ArgumentError, "Missing the required parameter 'conference_id' when calling ConferencesApi.get_conference_member"
+ end
+ # verify the required parameter 'member_id' is set
+ if @api_client.config.client_side_validation && member_id.nil?
+ fail ArgumentError, "Missing the required parameter 'member_id' when calling ConferencesApi.get_conference_member"
+ end
+ # resource path
+ local_var_path = '/accounts/{accountId}/conferences/{conferenceId}/members/{memberId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'conferenceId' + '}', CGI.escape(conference_id.to_s)).sub('{' + 'memberId' + '}', CGI.escape(member_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'ConferenceMember'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"ConferencesApi.get_conference_member",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: ConferencesApi#get_conference_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Get Conference Recording Information
+ # Returns metadata for the specified recording.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param conference_id [String] Programmable Voice API Conference ID.
+ # @param recording_id [String] Programmable Voice API Recording ID.
+ # @param [Hash] opts the optional parameters
+ # @return [ConferenceRecordingMetadata]
+ def get_conference_recording(account_id, conference_id, recording_id, opts = {})
+ data, _status_code, _headers = get_conference_recording_with_http_info(account_id, conference_id, recording_id, opts)
+ data
+ end
+
+ # Get Conference Recording Information
+ # Returns metadata for the specified recording.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param conference_id [String] Programmable Voice API Conference ID.
+ # @param recording_id [String] Programmable Voice API Recording ID.
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(ConferenceRecordingMetadata, Integer, Hash)>] ConferenceRecordingMetadata data, response status code and response headers
+ def get_conference_recording_with_http_info(account_id, conference_id, recording_id, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: ConferencesApi.get_conference_recording ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling ConferencesApi.get_conference_recording"
+ end
+ # verify the required parameter 'conference_id' is set
+ if @api_client.config.client_side_validation && conference_id.nil?
+ fail ArgumentError, "Missing the required parameter 'conference_id' when calling ConferencesApi.get_conference_recording"
+ end
+ # verify the required parameter 'recording_id' is set
+ if @api_client.config.client_side_validation && recording_id.nil?
+ fail ArgumentError, "Missing the required parameter 'recording_id' when calling ConferencesApi.get_conference_recording"
+ end
+ # resource path
+ local_var_path = '/accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'conferenceId' + '}', CGI.escape(conference_id.to_s)).sub('{' + 'recordingId' + '}', CGI.escape(recording_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'ConferenceRecordingMetadata'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"ConferencesApi.get_conference_recording",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: ConferencesApi#get_conference_recording\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Get Conference Recordings
+ # Returns a (potentially empty) list of metadata for the recordings that took place during the specified conference.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param conference_id [String] Programmable Voice API Conference ID.
+ # @param [Hash] opts the optional parameters
+ # @return [Array]
+ def list_conference_recordings(account_id, conference_id, opts = {})
+ data, _status_code, _headers = list_conference_recordings_with_http_info(account_id, conference_id, opts)
+ data
+ end
+
+ # Get Conference Recordings
+ # Returns a (potentially empty) list of metadata for the recordings that took place during the specified conference.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param conference_id [String] Programmable Voice API Conference ID.
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers
+ def list_conference_recordings_with_http_info(account_id, conference_id, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: ConferencesApi.list_conference_recordings ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling ConferencesApi.list_conference_recordings"
+ end
+ # verify the required parameter 'conference_id' is set
+ if @api_client.config.client_side_validation && conference_id.nil?
+ fail ArgumentError, "Missing the required parameter 'conference_id' when calling ConferencesApi.list_conference_recordings"
+ end
+ # resource path
+ local_var_path = '/accounts/{accountId}/conferences/{conferenceId}/recordings'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'conferenceId' + '}', CGI.escape(conference_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'Array'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"ConferencesApi.list_conference_recordings",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: ConferencesApi#list_conference_recordings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Get Conferences
+ # Returns a max of 1000 conferences, sorted by `createdTime` from oldest to newest. **NOTE:** If the number of conferences in the account is bigger than `pageSize`, a `Link` header (with format `<{url}>; rel=\"next\"`) will be returned in the response. The url can be used to retrieve the next page of conference records.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param [Hash] opts the optional parameters
+ # @option opts [String] :name Filter results by the `name` field.
+ # @option opts [String] :min_created_time Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format).
+ # @option opts [String] :max_created_time Filter results to conferences which have a `createdTime` before or at `maxCreatedTime` (in ISO8601 format).
+ # @option opts [Integer] :page_size Specifies the max number of conferences that will be returned. (default to 1000)
+ # @option opts [String] :page_token Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description.
+ # @return [Array]
+ def list_conferences(account_id, opts = {})
+ data, _status_code, _headers = list_conferences_with_http_info(account_id, opts)
+ data
+ end
+
+ # Get Conferences
+ # Returns a max of 1000 conferences, sorted by `createdTime` from oldest to newest. **NOTE:** If the number of conferences in the account is bigger than `pageSize`, a `Link` header (with format `<{url}>; rel=\"next\"`) will be returned in the response. The url can be used to retrieve the next page of conference records.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param [Hash] opts the optional parameters
+ # @option opts [String] :name Filter results by the `name` field.
+ # @option opts [String] :min_created_time Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format).
+ # @option opts [String] :max_created_time Filter results to conferences which have a `createdTime` before or at `maxCreatedTime` (in ISO8601 format).
+ # @option opts [Integer] :page_size Specifies the max number of conferences that will be returned. (default to 1000)
+ # @option opts [String] :page_token Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description.
+ # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers
+ def list_conferences_with_http_info(account_id, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: ConferencesApi.list_conferences ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling ConferencesApi.list_conferences"
+ end
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ConferencesApi.list_conferences, must be smaller than or equal to 1000.'
+ end
+
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ConferencesApi.list_conferences, must be greater than or equal to 1.'
+ end
+
+ # resource path
+ local_var_path = '/accounts/{accountId}/conferences'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+ query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
+ query_params[:'minCreatedTime'] = opts[:'min_created_time'] if !opts[:'min_created_time'].nil?
+ query_params[:'maxCreatedTime'] = opts[:'max_created_time'] if !opts[:'max_created_time'].nil?
+ query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
+ query_params[:'pageToken'] = opts[:'page_token'] if !opts[:'page_token'].nil?
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'Array'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"ConferencesApi.list_conferences",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: ConferencesApi#list_conferences\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Update Conference
+ # Update the conference state.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param conference_id [String] Programmable Voice API Conference ID.
+ # @param update_conference [UpdateConference]
+ # @param [Hash] opts the optional parameters
+ # @return [nil]
+ def update_conference(account_id, conference_id, update_conference, opts = {})
+ update_conference_with_http_info(account_id, conference_id, update_conference, opts)
+ nil
+ end
+
+ # Update Conference
+ # Update the conference state.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param conference_id [String] Programmable Voice API Conference ID.
+ # @param update_conference [UpdateConference]
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def update_conference_with_http_info(account_id, conference_id, update_conference, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: ConferencesApi.update_conference ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling ConferencesApi.update_conference"
+ end
+ # verify the required parameter 'conference_id' is set
+ if @api_client.config.client_side_validation && conference_id.nil?
+ fail ArgumentError, "Missing the required parameter 'conference_id' when calling ConferencesApi.update_conference"
+ end
+ # verify the required parameter 'update_conference' is set
+ if @api_client.config.client_side_validation && update_conference.nil?
+ fail ArgumentError, "Missing the required parameter 'update_conference' when calling ConferencesApi.update_conference"
+ end
+ # resource path
+ local_var_path = '/accounts/{accountId}/conferences/{conferenceId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'conferenceId' + '}', CGI.escape(conference_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_conference)
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"ConferencesApi.update_conference",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: ConferencesApi#update_conference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Update Conference BXML
+ # Update the conference BXML document.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param conference_id [String] Programmable Voice API Conference ID.
+ # @param body [String]
+ # @param [Hash] opts the optional parameters
+ # @return [nil]
+ def update_conference_bxml(account_id, conference_id, body, opts = {})
+ update_conference_bxml_with_http_info(account_id, conference_id, body, opts)
+ nil
+ end
+
+ # Update Conference BXML
+ # Update the conference BXML document.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param conference_id [String] Programmable Voice API Conference ID.
+ # @param body [String]
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def update_conference_bxml_with_http_info(account_id, conference_id, body, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: ConferencesApi.update_conference_bxml ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling ConferencesApi.update_conference_bxml"
+ end
+ # verify the required parameter 'conference_id' is set
+ if @api_client.config.client_side_validation && conference_id.nil?
+ fail ArgumentError, "Missing the required parameter 'conference_id' when calling ConferencesApi.update_conference_bxml"
+ end
+ # verify the required parameter 'body' is set
+ if @api_client.config.client_side_validation && body.nil?
+ fail ArgumentError, "Missing the required parameter 'body' when calling ConferencesApi.update_conference_bxml"
+ end
+ # resource path
+ local_var_path = '/accounts/{accountId}/conferences/{conferenceId}/bxml'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'conferenceId' + '}', CGI.escape(conference_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/xml'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"ConferencesApi.update_conference_bxml",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: ConferencesApi#update_conference_bxml\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Update Conference Member
+ # Updates settings for a particular conference member.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param conference_id [String] Programmable Voice API Conference ID.
+ # @param member_id [String] Programmable Voice API Conference Member ID.
+ # @param update_conference_member [UpdateConferenceMember]
+ # @param [Hash] opts the optional parameters
+ # @return [nil]
+ def update_conference_member(account_id, conference_id, member_id, update_conference_member, opts = {})
+ update_conference_member_with_http_info(account_id, conference_id, member_id, update_conference_member, opts)
+ nil
+ end
+
+ # Update Conference Member
+ # Updates settings for a particular conference member.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param conference_id [String] Programmable Voice API Conference ID.
+ # @param member_id [String] Programmable Voice API Conference Member ID.
+ # @param update_conference_member [UpdateConferenceMember]
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def update_conference_member_with_http_info(account_id, conference_id, member_id, update_conference_member, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: ConferencesApi.update_conference_member ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling ConferencesApi.update_conference_member"
+ end
+ # verify the required parameter 'conference_id' is set
+ if @api_client.config.client_side_validation && conference_id.nil?
+ fail ArgumentError, "Missing the required parameter 'conference_id' when calling ConferencesApi.update_conference_member"
+ end
+ # verify the required parameter 'member_id' is set
+ if @api_client.config.client_side_validation && member_id.nil?
+ fail ArgumentError, "Missing the required parameter 'member_id' when calling ConferencesApi.update_conference_member"
+ end
+ # verify the required parameter 'update_conference_member' is set
+ if @api_client.config.client_side_validation && update_conference_member.nil?
+ fail ArgumentError, "Missing the required parameter 'update_conference_member' when calling ConferencesApi.update_conference_member"
+ end
+ # resource path
+ local_var_path = '/accounts/{accountId}/conferences/{conferenceId}/members/{memberId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'conferenceId' + '}', CGI.escape(conference_id.to_s)).sub('{' + 'memberId' + '}', CGI.escape(member_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_conference_member)
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"ConferencesApi.update_conference_member",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: ConferencesApi#update_conference_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/api/media_api.rb b/lib/bandwidth-sdk/api/media_api.rb
new file mode 100644
index 00000000..bad2d8e5
--- /dev/null
+++ b/lib/bandwidth-sdk/api/media_api.rb
@@ -0,0 +1,312 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'cgi'
+
+module Bandwidth
+ class MediaApi
+ attr_accessor :api_client
+
+ def initialize(api_client = ApiClient.default)
+ @api_client = api_client
+ end
+ # Delete Media
+ # Deletes a media file from Bandwidth API server. Make sure you don't have any application scripts still using the media before you delete. If you accidentally delete a media file you can immediately upload a new file with the same name.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param media_id [String] Media ID to retrieve.
+ # @param [Hash] opts the optional parameters
+ # @return [nil]
+ def delete_media(account_id, media_id, opts = {})
+ delete_media_with_http_info(account_id, media_id, opts)
+ nil
+ end
+
+ # Delete Media
+ # Deletes a media file from Bandwidth API server. Make sure you don't have any application scripts still using the media before you delete. If you accidentally delete a media file you can immediately upload a new file with the same name.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param media_id [String] Media ID to retrieve.
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def delete_media_with_http_info(account_id, media_id, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: MediaApi.delete_media ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling MediaApi.delete_media"
+ end
+ # verify the required parameter 'media_id' is set
+ if @api_client.config.client_side_validation && media_id.nil?
+ fail ArgumentError, "Missing the required parameter 'media_id' when calling MediaApi.delete_media"
+ end
+ # resource path
+ local_var_path = '/users/{accountId}/media/{mediaId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'mediaId' + '}', CGI.escape(media_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"MediaApi.delete_media",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: MediaApi#delete_media\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Get Media
+ # Downloads a media file you previously uploaded.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param media_id [String] Media ID to retrieve.
+ # @param [Hash] opts the optional parameters
+ # @return [File]
+ def get_media(account_id, media_id, opts = {})
+ data, _status_code, _headers = get_media_with_http_info(account_id, media_id, opts)
+ data
+ end
+
+ # Get Media
+ # Downloads a media file you previously uploaded.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param media_id [String] Media ID to retrieve.
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
+ def get_media_with_http_info(account_id, media_id, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: MediaApi.get_media ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling MediaApi.get_media"
+ end
+ # verify the required parameter 'media_id' is set
+ if @api_client.config.client_side_validation && media_id.nil?
+ fail ArgumentError, "Missing the required parameter 'media_id' when calling MediaApi.get_media"
+ end
+ # resource path
+ local_var_path = '/users/{accountId}/media/{mediaId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'mediaId' + '}', CGI.escape(media_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream', 'application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'File'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"MediaApi.get_media",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: MediaApi#get_media\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # List Media
+ # Gets a list of your media files. No query parameters are supported.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param [Hash] opts the optional parameters
+ # @option opts [String] :continuation_token Continuation token used to retrieve subsequent media.
+ # @return [Array]
+ def list_media(account_id, opts = {})
+ data, _status_code, _headers = list_media_with_http_info(account_id, opts)
+ data
+ end
+
+ # List Media
+ # Gets a list of your media files. No query parameters are supported.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param [Hash] opts the optional parameters
+ # @option opts [String] :continuation_token Continuation token used to retrieve subsequent media.
+ # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers
+ def list_media_with_http_info(account_id, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: MediaApi.list_media ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling MediaApi.list_media"
+ end
+ # resource path
+ local_var_path = '/users/{accountId}/media'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ header_params[:'Continuation-Token'] = opts[:'continuation_token'] if !opts[:'continuation_token'].nil?
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'Array'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"MediaApi.list_media",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: MediaApi#list_media\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Upload Media
+ # Upload a file. You may add headers to the request in order to provide some control to your media file. If a file is uploaded with the same name as a file that already exists under this account, the previous file will be overwritten. A list of supported media types can be found [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-).
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param media_id [String] Media ID to retrieve.
+ # @param body [File]
+ # @param [Hash] opts the optional parameters
+ # @option opts [String] :content_type The media type of the entity-body.
+ # @option opts [String] :cache_control General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain.
+ # @return [nil]
+ def upload_media(account_id, media_id, body, opts = {})
+ upload_media_with_http_info(account_id, media_id, body, opts)
+ nil
+ end
+
+ # Upload Media
+ # Upload a file. You may add headers to the request in order to provide some control to your media file. If a file is uploaded with the same name as a file that already exists under this account, the previous file will be overwritten. A list of supported media types can be found [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-).
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param media_id [String] Media ID to retrieve.
+ # @param body [File]
+ # @param [Hash] opts the optional parameters
+ # @option opts [String] :content_type The media type of the entity-body.
+ # @option opts [String] :cache_control General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain.
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def upload_media_with_http_info(account_id, media_id, body, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: MediaApi.upload_media ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling MediaApi.upload_media"
+ end
+ # verify the required parameter 'media_id' is set
+ if @api_client.config.client_side_validation && media_id.nil?
+ fail ArgumentError, "Missing the required parameter 'media_id' when calling MediaApi.upload_media"
+ end
+ # verify the required parameter 'body' is set
+ if @api_client.config.client_side_validation && body.nil?
+ fail ArgumentError, "Missing the required parameter 'body' when calling MediaApi.upload_media"
+ end
+ # resource path
+ local_var_path = '/users/{accountId}/media/{mediaId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'mediaId' + '}', CGI.escape(media_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json', 'application/ogg', 'application/pdf', 'application/rtf', 'application/zip', 'application/x-tar', 'application/xml', 'application/gzip', 'application/x-bzip2', 'application/x-gzip', 'application/smil', 'application/javascript', 'audio/mp4', 'audio/mpeg', 'audio/ogg', 'audio/flac', 'audio/webm', 'audio/wav', 'audio/amr', 'audio/3gpp', 'image/bmp', 'image/gif', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/svg+xml', 'image/tiff', 'image/webp', 'image/x-icon', 'text/css', 'text/csv', 'text/calendar', 'text/plain', 'text/javascript', 'text/vcard', 'text/vnd.wap.wml', 'text/xml', 'video/avi', 'video/mp4', 'video/mpeg', 'video/ogg', 'video/quicktime', 'video/webm', 'video/x-ms-wmv'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+ header_params[:'Content-Type'] = opts[:'content_type'] if !opts[:'content_type'].nil?
+ header_params[:'Cache-Control'] = opts[:'cache_control'] if !opts[:'cache_control'].nil?
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"MediaApi.upload_media",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: MediaApi#upload_media\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/api/messages_api.rb b/lib/bandwidth-sdk/api/messages_api.rb
new file mode 100644
index 00000000..4f1cdc1f
--- /dev/null
+++ b/lib/bandwidth-sdk/api/messages_api.rb
@@ -0,0 +1,204 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'cgi'
+
+module Bandwidth
+ class MessagesApi
+ attr_accessor :api_client
+
+ def initialize(api_client = ApiClient.default)
+ @api_client = api_client
+ end
+ # Create Message
+ # Endpoint for sending text messages and picture messages using V2 messaging.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param message_request [MessageRequest]
+ # @param [Hash] opts the optional parameters
+ # @return [Message]
+ def create_message(account_id, message_request, opts = {})
+ data, _status_code, _headers = create_message_with_http_info(account_id, message_request, opts)
+ data
+ end
+
+ # Create Message
+ # Endpoint for sending text messages and picture messages using V2 messaging.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param message_request [MessageRequest]
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(Message, Integer, Hash)>] Message data, response status code and response headers
+ def create_message_with_http_info(account_id, message_request, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: MessagesApi.create_message ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling MessagesApi.create_message"
+ end
+ # verify the required parameter 'message_request' is set
+ if @api_client.config.client_side_validation && message_request.nil?
+ fail ArgumentError, "Missing the required parameter 'message_request' when calling MessagesApi.create_message"
+ end
+ # resource path
+ local_var_path = '/users/{accountId}/messages'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(message_request)
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'Message'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"MessagesApi.create_message",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: MessagesApi#create_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # List Messages
+ # Returns a list of messages based on query parameters.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param [Hash] opts the optional parameters
+ # @option opts [String] :message_id The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter.
+ # @option opts [String] :source_tn The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919').
+ # @option opts [String] :destination_tn The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919').
+ # @option opts [MessageStatusEnum] :message_status The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED.
+ # @option opts [ListMessageDirectionEnum] :message_direction The direction of the message. One of INBOUND OUTBOUND.
+ # @option opts [String] :carrier_name The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T).
+ # @option opts [MessageTypeEnum] :message_type The type of message. Either sms or mms.
+ # @option opts [Integer] :error_code The error code of the message.
+ # @option opts [String] :from_date_time The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days.
+ # @option opts [String] :to_date_time The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days.
+ # @option opts [String] :campaign_id The campaign ID of the message.
+ # @option opts [String] :sort The field and direction to sort by combined with a colon. Direction is either asc or desc.
+ # @option opts [String] :page_token A base64 encoded value used for pagination of results.
+ # @option opts [Integer] :limit The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000.
+ # @option opts [Boolean] :limit_total_count When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results.
+ # @return [MessagesList]
+ def list_messages(account_id, opts = {})
+ data, _status_code, _headers = list_messages_with_http_info(account_id, opts)
+ data
+ end
+
+ # List Messages
+ # Returns a list of messages based on query parameters.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param [Hash] opts the optional parameters
+ # @option opts [String] :message_id The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter.
+ # @option opts [String] :source_tn The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919').
+ # @option opts [String] :destination_tn The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919').
+ # @option opts [MessageStatusEnum] :message_status The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED.
+ # @option opts [ListMessageDirectionEnum] :message_direction The direction of the message. One of INBOUND OUTBOUND.
+ # @option opts [String] :carrier_name The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T).
+ # @option opts [MessageTypeEnum] :message_type The type of message. Either sms or mms.
+ # @option opts [Integer] :error_code The error code of the message.
+ # @option opts [String] :from_date_time The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days.
+ # @option opts [String] :to_date_time The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days.
+ # @option opts [String] :campaign_id The campaign ID of the message.
+ # @option opts [String] :sort The field and direction to sort by combined with a colon. Direction is either asc or desc.
+ # @option opts [String] :page_token A base64 encoded value used for pagination of results.
+ # @option opts [Integer] :limit The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000.
+ # @option opts [Boolean] :limit_total_count When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results.
+ # @return [Array<(MessagesList, Integer, Hash)>] MessagesList data, response status code and response headers
+ def list_messages_with_http_info(account_id, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: MessagesApi.list_messages ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling MessagesApi.list_messages"
+ end
+ # resource path
+ local_var_path = '/users/{accountId}/messages'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+ query_params[:'messageId'] = opts[:'message_id'] if !opts[:'message_id'].nil?
+ query_params[:'sourceTn'] = opts[:'source_tn'] if !opts[:'source_tn'].nil?
+ query_params[:'destinationTn'] = opts[:'destination_tn'] if !opts[:'destination_tn'].nil?
+ query_params[:'messageStatus'] = opts[:'message_status'] if !opts[:'message_status'].nil?
+ query_params[:'messageDirection'] = opts[:'message_direction'] if !opts[:'message_direction'].nil?
+ query_params[:'carrierName'] = opts[:'carrier_name'] if !opts[:'carrier_name'].nil?
+ query_params[:'messageType'] = opts[:'message_type'] if !opts[:'message_type'].nil?
+ query_params[:'errorCode'] = opts[:'error_code'] if !opts[:'error_code'].nil?
+ query_params[:'fromDateTime'] = opts[:'from_date_time'] if !opts[:'from_date_time'].nil?
+ query_params[:'toDateTime'] = opts[:'to_date_time'] if !opts[:'to_date_time'].nil?
+ query_params[:'campaignId'] = opts[:'campaign_id'] if !opts[:'campaign_id'].nil?
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
+ query_params[:'pageToken'] = opts[:'page_token'] if !opts[:'page_token'].nil?
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
+ query_params[:'limitTotalCount'] = opts[:'limit_total_count'] if !opts[:'limit_total_count'].nil?
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'MessagesList'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"MessagesApi.list_messages",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: MessagesApi#list_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/api/mfa_api.rb b/lib/bandwidth-sdk/api/mfa_api.rb
new file mode 100644
index 00000000..becdf34f
--- /dev/null
+++ b/lib/bandwidth-sdk/api/mfa_api.rb
@@ -0,0 +1,244 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'cgi'
+
+module Bandwidth
+ class MFAApi
+ attr_accessor :api_client
+
+ def initialize(api_client = ApiClient.default)
+ @api_client = api_client
+ end
+ # Messaging Authentication Code
+ # Send an MFA code via text message (SMS).
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param code_request [CodeRequest] MFA code request body.
+ # @param [Hash] opts the optional parameters
+ # @return [MessagingCodeResponse]
+ def generate_messaging_code(account_id, code_request, opts = {})
+ data, _status_code, _headers = generate_messaging_code_with_http_info(account_id, code_request, opts)
+ data
+ end
+
+ # Messaging Authentication Code
+ # Send an MFA code via text message (SMS).
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param code_request [CodeRequest] MFA code request body.
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(MessagingCodeResponse, Integer, Hash)>] MessagingCodeResponse data, response status code and response headers
+ def generate_messaging_code_with_http_info(account_id, code_request, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: MFAApi.generate_messaging_code ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling MFAApi.generate_messaging_code"
+ end
+ # verify the required parameter 'code_request' is set
+ if @api_client.config.client_side_validation && code_request.nil?
+ fail ArgumentError, "Missing the required parameter 'code_request' when calling MFAApi.generate_messaging_code"
+ end
+ # resource path
+ local_var_path = '/accounts/{accountId}/code/messaging'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(code_request)
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'MessagingCodeResponse'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"MFAApi.generate_messaging_code",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: MFAApi#generate_messaging_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Voice Authentication Code
+ # Send an MFA Code via a phone call.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param code_request [CodeRequest] MFA code request body.
+ # @param [Hash] opts the optional parameters
+ # @return [VoiceCodeResponse]
+ def generate_voice_code(account_id, code_request, opts = {})
+ data, _status_code, _headers = generate_voice_code_with_http_info(account_id, code_request, opts)
+ data
+ end
+
+ # Voice Authentication Code
+ # Send an MFA Code via a phone call.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param code_request [CodeRequest] MFA code request body.
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(VoiceCodeResponse, Integer, Hash)>] VoiceCodeResponse data, response status code and response headers
+ def generate_voice_code_with_http_info(account_id, code_request, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: MFAApi.generate_voice_code ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling MFAApi.generate_voice_code"
+ end
+ # verify the required parameter 'code_request' is set
+ if @api_client.config.client_side_validation && code_request.nil?
+ fail ArgumentError, "Missing the required parameter 'code_request' when calling MFAApi.generate_voice_code"
+ end
+ # resource path
+ local_var_path = '/accounts/{accountId}/code/voice'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(code_request)
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'VoiceCodeResponse'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"MFAApi.generate_voice_code",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: MFAApi#generate_voice_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Verify Authentication Code
+ # Verify a previously sent MFA code.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param verify_code_request [VerifyCodeRequest] MFA code verify request body.
+ # @param [Hash] opts the optional parameters
+ # @return [VerifyCodeResponse]
+ def verify_code(account_id, verify_code_request, opts = {})
+ data, _status_code, _headers = verify_code_with_http_info(account_id, verify_code_request, opts)
+ data
+ end
+
+ # Verify Authentication Code
+ # Verify a previously sent MFA code.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param verify_code_request [VerifyCodeRequest] MFA code verify request body.
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(VerifyCodeResponse, Integer, Hash)>] VerifyCodeResponse data, response status code and response headers
+ def verify_code_with_http_info(account_id, verify_code_request, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: MFAApi.verify_code ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling MFAApi.verify_code"
+ end
+ # verify the required parameter 'verify_code_request' is set
+ if @api_client.config.client_side_validation && verify_code_request.nil?
+ fail ArgumentError, "Missing the required parameter 'verify_code_request' when calling MFAApi.verify_code"
+ end
+ # resource path
+ local_var_path = '/accounts/{accountId}/code/verify'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(verify_code_request)
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'VerifyCodeResponse'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"MFAApi.verify_code",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: MFAApi#verify_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/api/phone_number_lookup_api.rb b/lib/bandwidth-sdk/api/phone_number_lookup_api.rb
new file mode 100644
index 00000000..a5c8e0a8
--- /dev/null
+++ b/lib/bandwidth-sdk/api/phone_number_lookup_api.rb
@@ -0,0 +1,165 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'cgi'
+
+module Bandwidth
+ class PhoneNumberLookupApi
+ attr_accessor :api_client
+
+ def initialize(api_client = ApiClient.default)
+ @api_client = api_client
+ end
+ # Create Lookup
+ # Create a Phone Number Lookup Request.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param lookup_request [LookupRequest] Phone number lookup request.
+ # @param [Hash] opts the optional parameters
+ # @return [CreateLookupResponse]
+ def create_lookup(account_id, lookup_request, opts = {})
+ data, _status_code, _headers = create_lookup_with_http_info(account_id, lookup_request, opts)
+ data
+ end
+
+ # Create Lookup
+ # Create a Phone Number Lookup Request.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param lookup_request [LookupRequest] Phone number lookup request.
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(CreateLookupResponse, Integer, Hash)>] CreateLookupResponse data, response status code and response headers
+ def create_lookup_with_http_info(account_id, lookup_request, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: PhoneNumberLookupApi.create_lookup ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling PhoneNumberLookupApi.create_lookup"
+ end
+ # verify the required parameter 'lookup_request' is set
+ if @api_client.config.client_side_validation && lookup_request.nil?
+ fail ArgumentError, "Missing the required parameter 'lookup_request' when calling PhoneNumberLookupApi.create_lookup"
+ end
+ # resource path
+ local_var_path = '/accounts/{accountId}/tnlookup'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(lookup_request)
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'CreateLookupResponse'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"PhoneNumberLookupApi.create_lookup",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: PhoneNumberLookupApi#create_lookup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Get Lookup Request Status
+ # Get an existing Phone Number Lookup Request.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param request_id [String] The phone number lookup request ID from Bandwidth.
+ # @param [Hash] opts the optional parameters
+ # @return [LookupStatus]
+ def get_lookup_status(account_id, request_id, opts = {})
+ data, _status_code, _headers = get_lookup_status_with_http_info(account_id, request_id, opts)
+ data
+ end
+
+ # Get Lookup Request Status
+ # Get an existing Phone Number Lookup Request.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param request_id [String] The phone number lookup request ID from Bandwidth.
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(LookupStatus, Integer, Hash)>] LookupStatus data, response status code and response headers
+ def get_lookup_status_with_http_info(account_id, request_id, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: PhoneNumberLookupApi.get_lookup_status ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling PhoneNumberLookupApi.get_lookup_status"
+ end
+ # verify the required parameter 'request_id' is set
+ if @api_client.config.client_side_validation && request_id.nil?
+ fail ArgumentError, "Missing the required parameter 'request_id' when calling PhoneNumberLookupApi.get_lookup_status"
+ end
+ # resource path
+ local_var_path = '/accounts/{accountId}/tnlookup/{requestId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'requestId' + '}', CGI.escape(request_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'LookupStatus'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"PhoneNumberLookupApi.get_lookup_status",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: PhoneNumberLookupApi#get_lookup_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/api/recordings_api.rb b/lib/bandwidth-sdk/api/recordings_api.rb
new file mode 100644
index 00000000..3adbdbdf
--- /dev/null
+++ b/lib/bandwidth-sdk/api/recordings_api.rb
@@ -0,0 +1,782 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'cgi'
+
+module Bandwidth
+ class RecordingsApi
+ attr_accessor :api_client
+
+ def initialize(api_client = ApiClient.default)
+ @api_client = api_client
+ end
+ # Delete Transcription
+ # Deletes the specified recording's transcription. Note: After the deletion is requested and a `204` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param call_id [String] Programmable Voice API Call ID.
+ # @param recording_id [String] Programmable Voice API Recording ID.
+ # @param [Hash] opts the optional parameters
+ # @return [nil]
+ def delete_call_transcription(account_id, call_id, recording_id, opts = {})
+ delete_call_transcription_with_http_info(account_id, call_id, recording_id, opts)
+ nil
+ end
+
+ # Delete Transcription
+ # Deletes the specified recording's transcription. Note: After the deletion is requested and a `204` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param call_id [String] Programmable Voice API Call ID.
+ # @param recording_id [String] Programmable Voice API Recording ID.
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def delete_call_transcription_with_http_info(account_id, call_id, recording_id, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: RecordingsApi.delete_call_transcription ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling RecordingsApi.delete_call_transcription"
+ end
+ # verify the required parameter 'call_id' is set
+ if @api_client.config.client_side_validation && call_id.nil?
+ fail ArgumentError, "Missing the required parameter 'call_id' when calling RecordingsApi.delete_call_transcription"
+ end
+ # verify the required parameter 'recording_id' is set
+ if @api_client.config.client_side_validation && recording_id.nil?
+ fail ArgumentError, "Missing the required parameter 'recording_id' when calling RecordingsApi.delete_call_transcription"
+ end
+ # resource path
+ local_var_path = '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s)).sub('{' + 'recordingId' + '}', CGI.escape(recording_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"RecordingsApi.delete_call_transcription",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: RecordingsApi#delete_call_transcription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Delete Recording
+ # Delete the recording information, media and transcription. Note: After the deletion is requested and a `204` is returned, neither the recording metadata nor the actual media nor its transcription will be accessible anymore. However, the media of the specified recording is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param call_id [String] Programmable Voice API Call ID.
+ # @param recording_id [String] Programmable Voice API Recording ID.
+ # @param [Hash] opts the optional parameters
+ # @return [nil]
+ def delete_recording(account_id, call_id, recording_id, opts = {})
+ delete_recording_with_http_info(account_id, call_id, recording_id, opts)
+ nil
+ end
+
+ # Delete Recording
+ # Delete the recording information, media and transcription. Note: After the deletion is requested and a `204` is returned, neither the recording metadata nor the actual media nor its transcription will be accessible anymore. However, the media of the specified recording is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param call_id [String] Programmable Voice API Call ID.
+ # @param recording_id [String] Programmable Voice API Recording ID.
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def delete_recording_with_http_info(account_id, call_id, recording_id, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: RecordingsApi.delete_recording ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling RecordingsApi.delete_recording"
+ end
+ # verify the required parameter 'call_id' is set
+ if @api_client.config.client_side_validation && call_id.nil?
+ fail ArgumentError, "Missing the required parameter 'call_id' when calling RecordingsApi.delete_recording"
+ end
+ # verify the required parameter 'recording_id' is set
+ if @api_client.config.client_side_validation && recording_id.nil?
+ fail ArgumentError, "Missing the required parameter 'recording_id' when calling RecordingsApi.delete_recording"
+ end
+ # resource path
+ local_var_path = '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s)).sub('{' + 'recordingId' + '}', CGI.escape(recording_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"RecordingsApi.delete_recording",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: RecordingsApi#delete_recording\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Delete Recording Media
+ # Deletes the specified recording's media.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param call_id [String] Programmable Voice API Call ID.
+ # @param recording_id [String] Programmable Voice API Recording ID.
+ # @param [Hash] opts the optional parameters
+ # @return [nil]
+ def delete_recording_media(account_id, call_id, recording_id, opts = {})
+ delete_recording_media_with_http_info(account_id, call_id, recording_id, opts)
+ nil
+ end
+
+ # Delete Recording Media
+ # Deletes the specified recording's media.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param call_id [String] Programmable Voice API Call ID.
+ # @param recording_id [String] Programmable Voice API Recording ID.
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def delete_recording_media_with_http_info(account_id, call_id, recording_id, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: RecordingsApi.delete_recording_media ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling RecordingsApi.delete_recording_media"
+ end
+ # verify the required parameter 'call_id' is set
+ if @api_client.config.client_side_validation && call_id.nil?
+ fail ArgumentError, "Missing the required parameter 'call_id' when calling RecordingsApi.delete_recording_media"
+ end
+ # verify the required parameter 'recording_id' is set
+ if @api_client.config.client_side_validation && recording_id.nil?
+ fail ArgumentError, "Missing the required parameter 'recording_id' when calling RecordingsApi.delete_recording_media"
+ end
+ # resource path
+ local_var_path = '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s)).sub('{' + 'recordingId' + '}', CGI.escape(recording_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"RecordingsApi.delete_recording_media",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: RecordingsApi#delete_recording_media\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Download Recording
+ # Downloads the specified recording.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param call_id [String] Programmable Voice API Call ID.
+ # @param recording_id [String] Programmable Voice API Recording ID.
+ # @param [Hash] opts the optional parameters
+ # @return [File]
+ def download_call_recording(account_id, call_id, recording_id, opts = {})
+ data, _status_code, _headers = download_call_recording_with_http_info(account_id, call_id, recording_id, opts)
+ data
+ end
+
+ # Download Recording
+ # Downloads the specified recording.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param call_id [String] Programmable Voice API Call ID.
+ # @param recording_id [String] Programmable Voice API Recording ID.
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
+ def download_call_recording_with_http_info(account_id, call_id, recording_id, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: RecordingsApi.download_call_recording ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling RecordingsApi.download_call_recording"
+ end
+ # verify the required parameter 'call_id' is set
+ if @api_client.config.client_side_validation && call_id.nil?
+ fail ArgumentError, "Missing the required parameter 'call_id' when calling RecordingsApi.download_call_recording"
+ end
+ # verify the required parameter 'recording_id' is set
+ if @api_client.config.client_side_validation && recording_id.nil?
+ fail ArgumentError, "Missing the required parameter 'recording_id' when calling RecordingsApi.download_call_recording"
+ end
+ # resource path
+ local_var_path = '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s)).sub('{' + 'recordingId' + '}', CGI.escape(recording_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['audio/vnd.wave', 'audio/mpeg', 'application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'File'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"RecordingsApi.download_call_recording",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: RecordingsApi#download_call_recording\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Get Call Recording
+ # Returns metadata for the specified recording.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param call_id [String] Programmable Voice API Call ID.
+ # @param recording_id [String] Programmable Voice API Recording ID.
+ # @param [Hash] opts the optional parameters
+ # @return [CallRecordingMetadata]
+ def get_call_recording(account_id, call_id, recording_id, opts = {})
+ data, _status_code, _headers = get_call_recording_with_http_info(account_id, call_id, recording_id, opts)
+ data
+ end
+
+ # Get Call Recording
+ # Returns metadata for the specified recording.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param call_id [String] Programmable Voice API Call ID.
+ # @param recording_id [String] Programmable Voice API Recording ID.
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(CallRecordingMetadata, Integer, Hash)>] CallRecordingMetadata data, response status code and response headers
+ def get_call_recording_with_http_info(account_id, call_id, recording_id, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: RecordingsApi.get_call_recording ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling RecordingsApi.get_call_recording"
+ end
+ # verify the required parameter 'call_id' is set
+ if @api_client.config.client_side_validation && call_id.nil?
+ fail ArgumentError, "Missing the required parameter 'call_id' when calling RecordingsApi.get_call_recording"
+ end
+ # verify the required parameter 'recording_id' is set
+ if @api_client.config.client_side_validation && recording_id.nil?
+ fail ArgumentError, "Missing the required parameter 'recording_id' when calling RecordingsApi.get_call_recording"
+ end
+ # resource path
+ local_var_path = '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s)).sub('{' + 'recordingId' + '}', CGI.escape(recording_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'CallRecordingMetadata'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"RecordingsApi.get_call_recording",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: RecordingsApi#get_call_recording\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Get Transcription
+ # Downloads the specified transcription. If the transcribed recording was multi-channel, then there will be 2 transcripts. The caller/called party transcript will be the first item while [``](/docs/voice/bxml/playAudio) and [``](/docs/voice/bxml/speakSentence) transcript will be the second item. During a [``](/docs/voice/bxml/transfer) the A-leg transcript will be the first item while the B-leg transcript will be the second item.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param call_id [String] Programmable Voice API Call ID.
+ # @param recording_id [String] Programmable Voice API Recording ID.
+ # @param [Hash] opts the optional parameters
+ # @return [TranscriptionList]
+ def get_call_transcription(account_id, call_id, recording_id, opts = {})
+ data, _status_code, _headers = get_call_transcription_with_http_info(account_id, call_id, recording_id, opts)
+ data
+ end
+
+ # Get Transcription
+ # Downloads the specified transcription. If the transcribed recording was multi-channel, then there will be 2 transcripts. The caller/called party transcript will be the first item while [`<PlayAudio>`](/docs/voice/bxml/playAudio) and [`<SpeakSentence>`](/docs/voice/bxml/speakSentence) transcript will be the second item. During a [`<Transfer>`](/docs/voice/bxml/transfer) the A-leg transcript will be the first item while the B-leg transcript will be the second item.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param call_id [String] Programmable Voice API Call ID.
+ # @param recording_id [String] Programmable Voice API Recording ID.
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(TranscriptionList, Integer, Hash)>] TranscriptionList data, response status code and response headers
+ def get_call_transcription_with_http_info(account_id, call_id, recording_id, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: RecordingsApi.get_call_transcription ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling RecordingsApi.get_call_transcription"
+ end
+ # verify the required parameter 'call_id' is set
+ if @api_client.config.client_side_validation && call_id.nil?
+ fail ArgumentError, "Missing the required parameter 'call_id' when calling RecordingsApi.get_call_transcription"
+ end
+ # verify the required parameter 'recording_id' is set
+ if @api_client.config.client_side_validation && recording_id.nil?
+ fail ArgumentError, "Missing the required parameter 'recording_id' when calling RecordingsApi.get_call_transcription"
+ end
+ # resource path
+ local_var_path = '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s)).sub('{' + 'recordingId' + '}', CGI.escape(recording_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'TranscriptionList'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"RecordingsApi.get_call_transcription",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: RecordingsApi#get_call_transcription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Get Call Recordings
+ # Returns a list of metadata for the recordings associated with the specified account. The list can be filtered by the optional from, to, minStartTime, and maxStartTime arguments. The list is capped at 1000 entries and may be empty if no recordings match the specified criteria.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param [Hash] opts the optional parameters
+ # @option opts [String] :to Filter results by the `to` field.
+ # @option opts [String] :from Filter results by the `from` field.
+ # @option opts [String] :min_start_time Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format).
+ # @option opts [String] :max_start_time Filter results to recordings which have a `startTime` before `maxStartTime` (in ISO8601 format).
+ # @return [Array]
+ def list_account_call_recordings(account_id, opts = {})
+ data, _status_code, _headers = list_account_call_recordings_with_http_info(account_id, opts)
+ data
+ end
+
+ # Get Call Recordings
+ # Returns a list of metadata for the recordings associated with the specified account. The list can be filtered by the optional from, to, minStartTime, and maxStartTime arguments. The list is capped at 1000 entries and may be empty if no recordings match the specified criteria.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param [Hash] opts the optional parameters
+ # @option opts [String] :to Filter results by the `to` field.
+ # @option opts [String] :from Filter results by the `from` field.
+ # @option opts [String] :min_start_time Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format).
+ # @option opts [String] :max_start_time Filter results to recordings which have a `startTime` before `maxStartTime` (in ISO8601 format).
+ # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers
+ def list_account_call_recordings_with_http_info(account_id, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: RecordingsApi.list_account_call_recordings ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling RecordingsApi.list_account_call_recordings"
+ end
+ # resource path
+ local_var_path = '/accounts/{accountId}/recordings'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+ query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
+ query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
+ query_params[:'minStartTime'] = opts[:'min_start_time'] if !opts[:'min_start_time'].nil?
+ query_params[:'maxStartTime'] = opts[:'max_start_time'] if !opts[:'max_start_time'].nil?
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'Array'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"RecordingsApi.list_account_call_recordings",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: RecordingsApi#list_account_call_recordings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # List Call Recordings
+ # Returns a (potentially empty) list of metadata for the recordings that took place during the specified call.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param call_id [String] Programmable Voice API Call ID.
+ # @param [Hash] opts the optional parameters
+ # @return [Array]
+ def list_call_recordings(account_id, call_id, opts = {})
+ data, _status_code, _headers = list_call_recordings_with_http_info(account_id, call_id, opts)
+ data
+ end
+
+ # List Call Recordings
+ # Returns a (potentially empty) list of metadata for the recordings that took place during the specified call.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param call_id [String] Programmable Voice API Call ID.
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers
+ def list_call_recordings_with_http_info(account_id, call_id, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: RecordingsApi.list_call_recordings ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling RecordingsApi.list_call_recordings"
+ end
+ # verify the required parameter 'call_id' is set
+ if @api_client.config.client_side_validation && call_id.nil?
+ fail ArgumentError, "Missing the required parameter 'call_id' when calling RecordingsApi.list_call_recordings"
+ end
+ # resource path
+ local_var_path = '/accounts/{accountId}/calls/{callId}/recordings'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'Array'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"RecordingsApi.list_call_recordings",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: RecordingsApi#list_call_recordings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Create Transcription Request
+ # Generate the transcription for a specific recording. Transcription can succeed only for recordings of length greater than 500 milliseconds and less than 4 hours.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param call_id [String] Programmable Voice API Call ID.
+ # @param recording_id [String] Programmable Voice API Recording ID.
+ # @param transcribe_recording [TranscribeRecording]
+ # @param [Hash] opts the optional parameters
+ # @return [nil]
+ def transcribe_call_recording(account_id, call_id, recording_id, transcribe_recording, opts = {})
+ transcribe_call_recording_with_http_info(account_id, call_id, recording_id, transcribe_recording, opts)
+ nil
+ end
+
+ # Create Transcription Request
+ # Generate the transcription for a specific recording. Transcription can succeed only for recordings of length greater than 500 milliseconds and less than 4 hours.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param call_id [String] Programmable Voice API Call ID.
+ # @param recording_id [String] Programmable Voice API Recording ID.
+ # @param transcribe_recording [TranscribeRecording]
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def transcribe_call_recording_with_http_info(account_id, call_id, recording_id, transcribe_recording, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: RecordingsApi.transcribe_call_recording ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling RecordingsApi.transcribe_call_recording"
+ end
+ # verify the required parameter 'call_id' is set
+ if @api_client.config.client_side_validation && call_id.nil?
+ fail ArgumentError, "Missing the required parameter 'call_id' when calling RecordingsApi.transcribe_call_recording"
+ end
+ # verify the required parameter 'recording_id' is set
+ if @api_client.config.client_side_validation && recording_id.nil?
+ fail ArgumentError, "Missing the required parameter 'recording_id' when calling RecordingsApi.transcribe_call_recording"
+ end
+ # verify the required parameter 'transcribe_recording' is set
+ if @api_client.config.client_side_validation && transcribe_recording.nil?
+ fail ArgumentError, "Missing the required parameter 'transcribe_recording' when calling RecordingsApi.transcribe_call_recording"
+ end
+ # resource path
+ local_var_path = '/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s)).sub('{' + 'recordingId' + '}', CGI.escape(recording_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(transcribe_recording)
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"RecordingsApi.transcribe_call_recording",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: RecordingsApi#transcribe_call_recording\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Update Recording
+ # Pause or resume a recording on an active phone call.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param call_id [String] Programmable Voice API Call ID.
+ # @param update_call_recording [UpdateCallRecording]
+ # @param [Hash] opts the optional parameters
+ # @return [nil]
+ def update_call_recording_state(account_id, call_id, update_call_recording, opts = {})
+ update_call_recording_state_with_http_info(account_id, call_id, update_call_recording, opts)
+ nil
+ end
+
+ # Update Recording
+ # Pause or resume a recording on an active phone call.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param call_id [String] Programmable Voice API Call ID.
+ # @param update_call_recording [UpdateCallRecording]
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def update_call_recording_state_with_http_info(account_id, call_id, update_call_recording, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: RecordingsApi.update_call_recording_state ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling RecordingsApi.update_call_recording_state"
+ end
+ # verify the required parameter 'call_id' is set
+ if @api_client.config.client_side_validation && call_id.nil?
+ fail ArgumentError, "Missing the required parameter 'call_id' when calling RecordingsApi.update_call_recording_state"
+ end
+ # verify the required parameter 'update_call_recording' is set
+ if @api_client.config.client_side_validation && update_call_recording.nil?
+ fail ArgumentError, "Missing the required parameter 'update_call_recording' when calling RecordingsApi.update_call_recording_state"
+ end
+ # resource path
+ local_var_path = '/accounts/{accountId}/calls/{callId}/recording'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'callId' + '}', CGI.escape(call_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_call_recording)
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"RecordingsApi.update_call_recording_state",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: RecordingsApi#update_call_recording_state\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/api/statistics_api.rb b/lib/bandwidth-sdk/api/statistics_api.rb
new file mode 100644
index 00000000..bbb1ebb5
--- /dev/null
+++ b/lib/bandwidth-sdk/api/statistics_api.rb
@@ -0,0 +1,85 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'cgi'
+
+module Bandwidth
+ class StatisticsApi
+ attr_accessor :api_client
+
+ def initialize(api_client = ApiClient.default)
+ @api_client = api_client
+ end
+ # Get Account Statistics
+ # Returns details about the current state of the account.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param [Hash] opts the optional parameters
+ # @return [AccountStatistics]
+ def get_statistics(account_id, opts = {})
+ data, _status_code, _headers = get_statistics_with_http_info(account_id, opts)
+ data
+ end
+
+ # Get Account Statistics
+ # Returns details about the current state of the account.
+ # @param account_id [String] Your Bandwidth Account ID.
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(AccountStatistics, Integer, Hash)>] AccountStatistics data, response status code and response headers
+ def get_statistics_with_http_info(account_id, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: StatisticsApi.get_statistics ...'
+ end
+ # verify the required parameter 'account_id' is set
+ if @api_client.config.client_side_validation && account_id.nil?
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling StatisticsApi.get_statistics"
+ end
+ # resource path
+ local_var_path = '/accounts/{accountId}/statistics'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'AccountStatistics'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['Basic']
+
+ new_options = opts.merge(
+ :operation => :"StatisticsApi.get_statistics",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: StatisticsApi#get_statistics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/api_client.rb b/lib/bandwidth-sdk/api_client.rb
new file mode 100644
index 00000000..2412b9d5
--- /dev/null
+++ b/lib/bandwidth-sdk/api_client.rb
@@ -0,0 +1,428 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'date'
+require 'json'
+require 'logger'
+require 'tempfile'
+require 'time'
+require 'faraday'
+require 'faraday/multipart' if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('2.0')
+
+module Bandwidth
+ class ApiClient
+ # The Configuration object holding settings to be used in the API client.
+ attr_accessor :config
+
+ # Defines the headers to be used in HTTP requests of all API calls by default.
+ #
+ # @return [Hash]
+ attr_accessor :default_headers
+
+ # Initializes the ApiClient
+ # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
+ def initialize(config = Configuration.default)
+ @config = config
+ @user_agent = "OpenAPI-Generator/#{VERSION}/ruby"
+ @default_headers = {
+ 'Content-Type' => 'application/json',
+ 'User-Agent' => @user_agent
+ }
+ end
+
+ def self.default
+ @@default ||= ApiClient.new
+ end
+
+ # Call an API with given options.
+ #
+ # @return [Array<(Object, Integer, Hash)>] an array of 3 elements:
+ # the data deserialized from response body (could be nil), response status code and response headers.
+ def call_api(http_method, path, opts = {})
+ begin
+ response = connection(opts).public_send(http_method.to_sym.downcase) do |req|
+ build_request(http_method, path, req, opts)
+ end
+
+ if config.debugging
+ config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
+ end
+
+ unless response.success?
+ if response.status == 0 && response.respond_to?(:return_message)
+ # Errors from libcurl will be made visible here
+ fail ApiError.new(code: 0,
+ message: response.return_message)
+ else
+ fail ApiError.new(code: response.status,
+ response_headers: response.headers,
+ response_body: response.body),
+ response.reason_phrase
+ end
+ end
+ rescue Faraday::TimeoutError
+ fail ApiError.new('Connection timed out')
+ rescue Faraday::ConnectionFailed
+ fail ApiError.new('Connection failed')
+ end
+
+ if opts[:return_type]
+ data = deserialize(response, opts[:return_type])
+ else
+ data = nil
+ end
+ return data, response.status, response.headers
+ end
+
+ # Builds the HTTP request
+ #
+ # @param [String] http_method HTTP method/verb (e.g. POST)
+ # @param [String] path URL path (e.g. /account/new)
+ # @option opts [Hash] :header_params Header parameters
+ # @option opts [Hash] :query_params Query parameters
+ # @option opts [Hash] :form_params Query parameters
+ # @option opts [Object] :body HTTP body (JSON/XML)
+ # @return [Faraday::Request] A Faraday Request
+ def build_request(http_method, path, request, opts = {})
+ url = build_request_url(path, opts)
+ http_method = http_method.to_sym.downcase
+
+ header_params = @default_headers.merge(opts[:header_params] || {})
+ query_params = opts[:query_params] || {}
+ form_params = opts[:form_params] || {}
+
+ update_params_for_auth! header_params, query_params, opts[:auth_names]
+
+ if [:post, :patch, :put, :delete].include?(http_method)
+ req_body = build_request_body(header_params, form_params, opts[:body])
+ if config.debugging
+ config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
+ end
+ end
+ request.headers = header_params
+ request.body = req_body
+
+ # Overload default options only if provided
+ request.options.params_encoder = config.params_encoder if config.params_encoder
+ request.options.timeout = config.timeout if config.timeout
+
+ request.url url
+ request.params = query_params
+ download_file(request) if opts[:return_type] == 'File' || opts[:return_type] == 'Binary'
+ request
+ end
+
+ # Builds the HTTP request body
+ #
+ # @param [Hash] header_params Header parameters
+ # @param [Hash] form_params Query parameters
+ # @param [Object] body HTTP body (JSON/XML)
+ # @return [String] HTTP body data in the form of string
+ def build_request_body(header_params, form_params, body)
+ # http form
+ if header_params['Content-Type'] == 'application/x-www-form-urlencoded'
+ data = URI.encode_www_form(form_params)
+ elsif header_params['Content-Type'] == 'multipart/form-data'
+ data = {}
+ form_params.each do |key, value|
+ case value
+ when ::File, ::Tempfile
+ # TODO hardcode to application/octet-stream, need better way to detect content type
+ data[key] = Faraday::FilePart.new(value.path, 'application/octet-stream', value.path)
+ when ::Array, nil
+ # let Faraday handle Array and nil parameters
+ data[key] = value
+ else
+ data[key] = value.to_s
+ end
+ end
+ elsif body
+ data = body.is_a?(String) ? body : body.to_json
+ else
+ data = nil
+ end
+ data
+ end
+
+ def download_file(request)
+ @stream = []
+
+ # handle streaming Responses
+ request.options.on_data = Proc.new do |chunk, overall_received_bytes|
+ @stream << chunk
+ end
+ end
+
+ def connection(opts)
+ opts[:header_params]['Content-Type'] == 'multipart/form-data' ? connection_multipart : connection_regular
+ end
+
+ def connection_multipart
+ @connection_multipart ||= build_connection do |conn|
+ conn.request :multipart
+ conn.request :url_encoded
+ end
+ end
+
+ def connection_regular
+ @connection_regular ||= build_connection
+ end
+
+ def build_connection
+ Faraday.new(url: config.base_url, ssl: ssl_options, proxy: config.proxy) do |conn|
+ basic_auth(conn)
+ config.configure_middleware(conn)
+ yield(conn) if block_given?
+ conn.adapter(Faraday.default_adapter)
+ config.configure_connection(conn)
+ end
+ end
+
+ def ssl_options
+ {
+ ca_file: config.ssl_ca_file,
+ verify: config.ssl_verify,
+ verify_mode: config.ssl_verify_mode,
+ client_cert: config.ssl_client_cert,
+ client_key: config.ssl_client_key
+ }
+ end
+
+ def basic_auth(conn)
+ if config.username && config.password
+ if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('2.0')
+ conn.request(:authorization, :basic, config.username, config.password)
+ else
+ conn.request(:basic_auth, config.username, config.password)
+ end
+ end
+ end
+
+ # Check if the given MIME is a JSON MIME.
+ # JSON MIME examples:
+ # application/json
+ # application/json; charset=UTF8
+ # APPLICATION/JSON
+ # */*
+ # @param [String] mime MIME
+ # @return [Boolean] True if the MIME is application/json
+ def json_mime?(mime)
+ (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
+ end
+
+ # Deserialize the response to the given return type.
+ #
+ # @param [Response] response HTTP response
+ # @param [String] return_type some examples: "User", "Array", "Hash"
+ def deserialize(response, return_type)
+ body = response.body
+
+ # handle file downloading - return the File instance processed in request callbacks
+ # note that response body is empty when the file is written in chunks in request on_body callback
+ if return_type == 'File'
+ if @config.return_binary_data == true
+ # return byte stream
+ encoding = body.encoding
+ return @stream.join.force_encoding(encoding)
+ else
+ # return file instead of binary data
+ content_disposition = response.headers['Content-Disposition']
+ if content_disposition && content_disposition =~ /filename=/i
+ filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
+ prefix = sanitize_filename(filename)
+ else
+ prefix = 'download-'
+ end
+ prefix = prefix + '-' unless prefix.end_with?('-')
+ encoding = body.encoding
+ @tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
+ @tempfile.write(@stream.join.force_encoding(encoding))
+ @tempfile.close
+ @config.logger.info "Temp file written to #{@tempfile.path}, please copy the file to a proper folder "\
+ "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
+ "will be deleted automatically with GC. It's also recommended to delete the temp file "\
+ "explicitly with `tempfile.delete`"
+ return @tempfile
+ end
+ end
+
+ return nil if body.nil? || body.empty?
+
+ # return response body directly for String return type
+ return body if return_type == 'String'
+
+ # ensuring a default content type
+ content_type = response.headers['Content-Type'] || 'application/json'
+
+ fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type)
+
+ begin
+ data = JSON.parse("[#{body}]", :symbolize_names => true)[0]
+ rescue JSON::ParserError => e
+ if %w(String Date Time).include?(return_type)
+ data = body
+ else
+ raise e
+ end
+ end
+
+ convert_to_type data, return_type
+ end
+
+ # Convert data to the given return type.
+ # @param [Object] data Data to be converted
+ # @param [String] return_type Return type
+ # @return [Mixed] Data in a particular type
+ def convert_to_type(data, return_type)
+ return nil if data.nil?
+ case return_type
+ when 'String'
+ data.to_s
+ when 'Integer'
+ data.to_i
+ when 'Float'
+ data.to_f
+ when 'Boolean'
+ data == true
+ when 'Time'
+ # parse date time (expecting ISO 8601 format)
+ Time.parse data
+ when 'Date'
+ # parse date time (expecting ISO 8601 format)
+ Date.parse data
+ when 'Object'
+ # generic object (usually a Hash), return directly
+ data
+ when /\AArray<(.+)>\z/
+ # e.g. Array
+ sub_type = $1
+ data.map { |item| convert_to_type(item, sub_type) }
+ when /\AHash\\z/
+ # e.g. Hash
+ sub_type = $1
+ {}.tap do |hash|
+ data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
+ end
+ else
+ # models (e.g. Pet) or oneOf
+ klass = Bandwidth.const_get(return_type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data)
+ end
+ end
+
+ # Sanitize filename by removing path.
+ # e.g. ../../sun.gif becomes sun.gif
+ #
+ # @param [String] filename the filename to be sanitized
+ # @return [String] the sanitized filename
+ def sanitize_filename(filename)
+ filename.gsub(/.*[\/\\]/, '')
+ end
+
+ def build_request_url(path, opts = {})
+ # Add leading and trailing slashes to path
+ path = "/#{path}".gsub(/\/+/, '/')
+ @config.base_url(opts[:operation]) + path
+ end
+
+ # Update header and query params based on authentication settings.
+ #
+ # @param [Hash] header_params Header parameters
+ # @param [Hash] query_params Query parameters
+ # @param [String] auth_names Authentication scheme name
+ def update_params_for_auth!(header_params, query_params, auth_names)
+ Array(auth_names).each do |auth_name|
+ auth_setting = @config.auth_settings[auth_name]
+ next unless auth_setting
+ case auth_setting[:in]
+ when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
+ when 'query' then query_params[auth_setting[:key]] = auth_setting[:value]
+ else fail ArgumentError, 'Authentication token must be in `query` or `header`'
+ end
+ end
+ end
+
+ # Sets user agent in HTTP header
+ #
+ # @param [String] user_agent User agent (e.g. openapi-generator/ruby/1.0.0)
+ def user_agent=(user_agent)
+ @user_agent = user_agent
+ @default_headers['User-Agent'] = @user_agent
+ end
+
+ # Return Accept header based on an array of accepts provided.
+ # @param [Array] accepts array for Accept
+ # @return [String] the Accept header (e.g. application/json)
+ def select_header_accept(accepts)
+ return nil if accepts.nil? || accepts.empty?
+ # use JSON when present, otherwise use all of the provided
+ json_accept = accepts.find { |s| json_mime?(s) }
+ json_accept || accepts.join(',')
+ end
+
+ # Return Content-Type header based on an array of content types provided.
+ # @param [Array] content_types array for Content-Type
+ # @return [String] the Content-Type header (e.g. application/json)
+ def select_header_content_type(content_types)
+ # return nil by default
+ return if content_types.nil? || content_types.empty?
+ # use JSON when present, otherwise use the first one
+ json_content_type = content_types.find { |s| json_mime?(s) }
+ json_content_type || content_types.first
+ end
+
+ # Convert object (array, hash, object, etc) to JSON string.
+ # @param [Object] model object to be converted into JSON string
+ # @return [String] JSON string representation of the object
+ def object_to_http_body(model)
+ return model if model.nil? || model.is_a?(String)
+ local_body = nil
+ if model.is_a?(Array)
+ local_body = model.map { |m| object_to_hash(m) }
+ else
+ local_body = object_to_hash(model)
+ end
+ local_body.to_json
+ end
+
+ # Convert object(non-array) to hash.
+ # @param [Object] obj object to be converted into JSON string
+ # @return [String] JSON string representation of the object
+ def object_to_hash(obj)
+ if obj.respond_to?(:to_hash)
+ obj.to_hash
+ else
+ obj
+ end
+ end
+
+ # Build parameter value according to the given collection format.
+ # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi
+ def build_collection_param(param, collection_format)
+ case collection_format
+ when :csv
+ param.join(',')
+ when :ssv
+ param.join(' ')
+ when :tsv
+ param.join("\t")
+ when :pipes
+ param.join('|')
+ when :multi
+ # return the array directly as typhoeus will handle it as expected
+ param
+ else
+ fail "unknown collection format: #{collection_format.inspect}"
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/api_error.rb b/lib/bandwidth-sdk/api_error.rb
new file mode 100644
index 00000000..901fb837
--- /dev/null
+++ b/lib/bandwidth-sdk/api_error.rb
@@ -0,0 +1,58 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+module Bandwidth
+ class ApiError < StandardError
+ attr_reader :code, :response_headers, :response_body
+
+ # Usage examples:
+ # ApiError.new
+ # ApiError.new("message")
+ # ApiError.new(:code => 500, :response_headers => {}, :response_body => "")
+ # ApiError.new(:code => 404, :message => "Not Found")
+ def initialize(arg = nil)
+ if arg.is_a? Hash
+ if arg.key?(:message) || arg.key?('message')
+ super(arg[:message] || arg['message'])
+ else
+ super arg
+ end
+
+ arg.each do |k, v|
+ instance_variable_set "@#{k}", v
+ end
+ else
+ super arg
+ @message = arg
+ end
+ end
+
+ # Override to_s to display a friendly error message
+ def to_s
+ message
+ end
+
+ def message
+ if @message.nil?
+ msg = 'Error message: the server returns an error'
+ else
+ msg = @message
+ end
+
+ msg += "\nHTTP status code: #{code}" if code
+ msg += "\nResponse headers: #{response_headers}" if response_headers
+ msg += "\nResponse body: #{response_body}" if response_body
+
+ msg
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/configuration.rb b/lib/bandwidth-sdk/configuration.rb
new file mode 100644
index 00000000..d9a0ad5b
--- /dev/null
+++ b/lib/bandwidth-sdk/configuration.rb
@@ -0,0 +1,591 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+module Bandwidth
+ class Configuration
+ # Defines url scheme
+ attr_accessor :scheme
+
+ # Defines url host
+ attr_accessor :host
+
+ # Defines url base path
+ attr_accessor :base_path
+
+ # Define server configuration index
+ attr_accessor :server_index
+
+ # Define server operation configuration index
+ attr_accessor :server_operation_index
+
+ # Default server variables
+ attr_accessor :server_variables
+
+ # Default server operation variables
+ attr_accessor :server_operation_variables
+
+ # Defines API keys used with API Key authentications.
+ #
+ # @return [Hash] key: parameter name, value: parameter value (API key)
+ #
+ # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
+ # config.api_key['api_key'] = 'xxx'
+ attr_accessor :api_key
+
+ # Defines API key prefixes used with API Key authentications.
+ #
+ # @return [Hash] key: parameter name, value: API key prefix
+ #
+ # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
+ # config.api_key_prefix['api_key'] = 'Token'
+ attr_accessor :api_key_prefix
+
+ # Defines the username used with HTTP basic authentication.
+ #
+ # @return [String]
+ attr_accessor :username
+
+ # Defines the password used with HTTP basic authentication.
+ #
+ # @return [String]
+ attr_accessor :password
+
+ # Defines the access token (Bearer) used with OAuth2.
+ attr_accessor :access_token
+
+ # Defines a Proc used to fetch or refresh access tokens (Bearer) used with OAuth2.
+ # Overrides the access_token if set
+ # @return [Proc]
+ attr_accessor :access_token_getter
+
+ # Set this to return data as binary instead of downloading a temp file. When enabled (set to true)
+ # HTTP responses with return type `File` will be returned as a stream of binary data.
+ # Default to false.
+ attr_accessor :return_binary_data
+
+ # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
+ # details will be logged with `logger.debug` (see the `logger` attribute).
+ # Default to false.
+ #
+ # @return [true, false]
+ attr_accessor :debugging
+
+ # Defines the logger used for debugging.
+ # Default to `Rails.logger` (when in Rails) or logging to STDOUT.
+ #
+ # @return [#debug]
+ attr_accessor :logger
+
+ # Defines the temporary folder to store downloaded files
+ # (for API endpoints that have file response).
+ # Default to use `Tempfile`.
+ #
+ # @return [String]
+ attr_accessor :temp_folder_path
+
+ # The time limit for HTTP request in seconds.
+ # Default to 0 (never times out).
+ attr_accessor :timeout
+
+ # Set this to false to skip client side validation in the operation.
+ # Default to true.
+ # @return [true, false]
+ attr_accessor :client_side_validation
+
+ ### TLS/SSL setting
+ # Set this to false to skip verifying SSL certificate when calling API from https server.
+ # Default to true.
+ #
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
+ #
+ # @return [true, false]
+ attr_accessor :ssl_verify
+
+ ### TLS/SSL setting
+ # Any `OpenSSL::SSL::` constant (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL.html)
+ #
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
+ #
+ attr_accessor :ssl_verify_mode
+
+ ### TLS/SSL setting
+ # Set this to customize the certificate file to verify the peer.
+ #
+ # @return [String] the path to the certificate file
+ attr_accessor :ssl_ca_file
+
+ ### TLS/SSL setting
+ # Client certificate file (for client certificate)
+ attr_accessor :ssl_client_cert
+
+ ### TLS/SSL setting
+ # Client private key file (for client certificate)
+ attr_accessor :ssl_client_key
+
+ ### Proxy setting
+ # HTTP Proxy settings
+ attr_accessor :proxy
+
+ # Set this to customize parameters encoder of array parameter.
+ # Default to nil. Faraday uses NestedParamsEncoder when nil.
+ #
+ # @see The params_encoder option of Faraday. Related source code:
+ # https://github.com/lostisland/faraday/tree/main/lib/faraday/encoders
+ attr_accessor :params_encoder
+
+
+ attr_accessor :inject_format
+
+ attr_accessor :force_ending_format
+
+ def initialize
+ @scheme = 'http'
+ @host = 'localhost'
+ @base_path = ''
+ @server_index = nil
+ @server_operation_index = {}
+ @server_variables = {}
+ @server_operation_variables = {}
+ @api_key = {}
+ @api_key_prefix = {}
+ @client_side_validation = true
+ @ssl_verify = true
+ @ssl_verify_mode = nil
+ @ssl_ca_file = nil
+ @ssl_client_cert = nil
+ @ssl_client_key = nil
+ @middlewares = Hash.new { |h, k| h[k] = [] }
+ @configure_connection_blocks = []
+ @timeout = 60
+ # return data as binary instead of file
+ @return_binary_data = false
+ @params_encoder = nil
+ @debugging = false
+ @inject_format = false
+ @force_ending_format = false
+ @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
+
+ yield(self) if block_given?
+ end
+
+ # The default Configuration object.
+ def self.default
+ @@default ||= Configuration.new
+ end
+
+ def configure
+ yield(self) if block_given?
+ end
+
+ def scheme=(scheme)
+ # remove :// from scheme
+ @scheme = scheme.sub(/:\/\//, '')
+ end
+
+ def host=(host)
+ # remove http(s):// and anything after a slash
+ @host = host.sub(/https?:\/\//, '').split('/').first
+ end
+
+ def base_path=(base_path)
+ # Add leading and trailing slashes to base_path
+ @base_path = "/#{base_path}".gsub(/\/+/, '/')
+ @base_path = '' if @base_path == '/'
+ end
+
+ # Returns base URL for specified operation based on server settings
+ def base_url(operation = nil)
+ if operation_server_settings.key?(operation) then
+ index = server_operation_index.fetch(operation, server_index)
+ server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
+ else
+ server_index.nil? ? "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') : server_url(server_index, server_variables, nil)
+ end
+ end
+
+ # Gets API key (with prefix if set).
+ # @param [String] param_name the parameter name of API key auth
+ def api_key_with_prefix(param_name, param_alias = nil)
+ key = @api_key[param_name]
+ key = @api_key.fetch(param_alias, key) unless param_alias.nil?
+ if @api_key_prefix[param_name]
+ "#{@api_key_prefix[param_name]} #{key}"
+ else
+ key
+ end
+ end
+
+ # Gets access_token using access_token_getter or uses the static access_token
+ def access_token_with_refresh
+ return access_token if access_token_getter.nil?
+ access_token_getter.call
+ end
+
+ # Gets Basic Auth token string
+ def basic_auth_token
+ 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
+ end
+
+ # Returns Auth Settings hash for api client.
+ def auth_settings
+ {
+ 'Basic' =>
+ {
+ type: 'basic',
+ in: 'header',
+ key: 'Authorization',
+ value: basic_auth_token
+ },
+ }
+ end
+
+ # Returns an array of Server setting
+ def server_settings
+ [
+ {
+ url: "",
+ description: "No description provided",
+ }
+ ]
+ end
+
+ def operation_server_settings
+ {
+ "CallsApi.create_call": [
+ {
+ url: "https://voice.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "CallsApi.get_call_state": [
+ {
+ url: "https://voice.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "CallsApi.update_call": [
+ {
+ url: "https://voice.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "CallsApi.update_call_bxml": [
+ {
+ url: "https://voice.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "ConferencesApi.download_conference_recording": [
+ {
+ url: "https://voice.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "ConferencesApi.get_conference": [
+ {
+ url: "https://voice.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "ConferencesApi.get_conference_member": [
+ {
+ url: "https://voice.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "ConferencesApi.get_conference_recording": [
+ {
+ url: "https://voice.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "ConferencesApi.list_conference_recordings": [
+ {
+ url: "https://voice.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "ConferencesApi.list_conferences": [
+ {
+ url: "https://voice.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "ConferencesApi.update_conference": [
+ {
+ url: "https://voice.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "ConferencesApi.update_conference_bxml": [
+ {
+ url: "https://voice.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "ConferencesApi.update_conference_member": [
+ {
+ url: "https://voice.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "MFAApi.generate_messaging_code": [
+ {
+ url: "https://mfa.bandwidth.com/api/v1",
+ description: "Production",
+ }
+ ],
+ "MFAApi.generate_voice_code": [
+ {
+ url: "https://mfa.bandwidth.com/api/v1",
+ description: "Production",
+ }
+ ],
+ "MFAApi.verify_code": [
+ {
+ url: "https://mfa.bandwidth.com/api/v1",
+ description: "Production",
+ }
+ ],
+ "MediaApi.delete_media": [
+ {
+ url: "https://messaging.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "MediaApi.get_media": [
+ {
+ url: "https://messaging.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "MediaApi.list_media": [
+ {
+ url: "https://messaging.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "MediaApi.upload_media": [
+ {
+ url: "https://messaging.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "MessagesApi.create_message": [
+ {
+ url: "https://messaging.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "MessagesApi.list_messages": [
+ {
+ url: "https://messaging.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "PhoneNumberLookupApi.create_lookup": [
+ {
+ url: "https://numbers.bandwidth.com/api/v1",
+ description: "Production",
+ }
+ ],
+ "PhoneNumberLookupApi.get_lookup_status": [
+ {
+ url: "https://numbers.bandwidth.com/api/v1",
+ description: "Production",
+ }
+ ],
+ "RecordingsApi.delete_call_transcription": [
+ {
+ url: "https://voice.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "RecordingsApi.delete_recording": [
+ {
+ url: "https://voice.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "RecordingsApi.delete_recording_media": [
+ {
+ url: "https://voice.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "RecordingsApi.download_call_recording": [
+ {
+ url: "https://voice.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "RecordingsApi.get_call_recording": [
+ {
+ url: "https://voice.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "RecordingsApi.get_call_transcription": [
+ {
+ url: "https://voice.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "RecordingsApi.list_account_call_recordings": [
+ {
+ url: "https://voice.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "RecordingsApi.list_call_recordings": [
+ {
+ url: "https://voice.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "RecordingsApi.transcribe_call_recording": [
+ {
+ url: "https://voice.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "RecordingsApi.update_call_recording_state": [
+ {
+ url: "https://voice.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ "StatisticsApi.get_statistics": [
+ {
+ url: "https://voice.bandwidth.com/api/v2",
+ description: "Production",
+ }
+ ],
+ }
+ end
+
+ # Returns URL based on server settings
+ #
+ # @param index array index of the server settings
+ # @param variables hash of variable and the corresponding value
+ def server_url(index, variables = {}, servers = nil)
+ servers = server_settings if servers == nil
+
+ # check array index out of bound
+ if (index.nil? || index < 0 || index >= servers.size)
+ fail ArgumentError, "Invalid index #{index} when selecting the server. Must not be nil and must be less than #{servers.size}"
+ end
+
+ server = servers[index]
+ url = server[:url]
+
+ return url unless server.key? :variables
+
+ # go through variable and assign a value
+ server[:variables].each do |name, variable|
+ if variables.key?(name)
+ if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
+ url.gsub! "{" + name.to_s + "}", variables[name]
+ else
+ fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
+ end
+ else
+ # use default value
+ url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
+ end
+ end
+
+ url
+ end
+
+ # Configure Faraday connection directly.
+ #
+ # ```
+ # c.configure_faraday_connection do |conn|
+ # conn.use Faraday::HttpCache, shared_cache: false, logger: logger
+ # conn.response :logger, nil, headers: true, bodies: true, log_level: :debug do |logger|
+ # logger.filter(/(Authorization: )(.*)/, '\1[REDACTED]')
+ # end
+ # end
+ #
+ # c.configure_faraday_connection do |conn|
+ # conn.adapter :typhoeus
+ # end
+ # ```
+ #
+ # @param block [Proc] `#call`able object that takes one arg, the connection
+ def configure_faraday_connection(&block)
+ @configure_connection_blocks << block
+ end
+
+ def configure_connection(conn)
+ @configure_connection_blocks.each do |block|
+ block.call(conn)
+ end
+ end
+
+ # Adds middleware to the stack
+ def use(*middleware)
+ set_faraday_middleware(:use, *middleware)
+ end
+
+ # Adds request middleware to the stack
+ def request(*middleware)
+ set_faraday_middleware(:request, *middleware)
+ end
+
+ # Adds response middleware to the stack
+ def response(*middleware)
+ set_faraday_middleware(:response, *middleware)
+ end
+
+ # Adds Faraday middleware setting information to the stack
+ #
+ # @example Use the `set_faraday_middleware` method to set middleware information
+ # config.set_faraday_middleware(:request, :retry, max: 3, methods: [:get, :post], retry_statuses: [503])
+ # config.set_faraday_middleware(:response, :logger, nil, { bodies: true, log_level: :debug })
+ # config.set_faraday_middleware(:use, Faraday::HttpCache, store: Rails.cache, shared_cache: false)
+ # config.set_faraday_middleware(:insert, 0, FaradayMiddleware::FollowRedirects, { standards_compliant: true, limit: 1 })
+ # config.set_faraday_middleware(:swap, 0, Faraday::Response::Logger)
+ # config.set_faraday_middleware(:delete, Faraday::Multipart::Middleware)
+ #
+ # @see https://github.com/lostisland/faraday/blob/v2.3.0/lib/faraday/rack_builder.rb#L92-L143
+ def set_faraday_middleware(operation, key, *args, &block)
+ unless [:request, :response, :use, :insert, :insert_before, :insert_after, :swap, :delete].include?(operation)
+ fail ArgumentError, "Invalid faraday middleware operation #{operation}. Must be" \
+ " :request, :response, :use, :insert, :insert_before, :insert_after, :swap or :delete."
+ end
+
+ @middlewares[operation] << [key, args, block]
+ end
+ ruby2_keywords(:set_faraday_middleware) if respond_to?(:ruby2_keywords, true)
+
+ # Set up middleware on the connection
+ def configure_middleware(connection)
+ return if @middlewares.empty?
+
+ [:request, :response, :use, :insert, :insert_before, :insert_after, :swap].each do |operation|
+ next unless @middlewares.key?(operation)
+
+ @middlewares[operation].each do |key, args, block|
+ connection.builder.send(operation, key, *args, &block)
+ end
+ end
+
+ if @middlewares.key?(:delete)
+ @middlewares[:delete].each do |key, _args, _block|
+ connection.builder.delete(key)
+ end
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/account_statistics.rb b/lib/bandwidth-sdk/models/account_statistics.rb
new file mode 100644
index 00000000..592530f4
--- /dev/null
+++ b/lib/bandwidth-sdk/models/account_statistics.rb
@@ -0,0 +1,223 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ class AccountStatistics
+ # The number of calls currently enqueued.
+ attr_accessor :current_call_queue_size
+
+ # The maximum size of the queue before outgoing calls start being rejected.
+ attr_accessor :max_call_queue_size
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'current_call_queue_size' => :'currentCallQueueSize',
+ :'max_call_queue_size' => :'maxCallQueueSize'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'current_call_queue_size' => :'Integer',
+ :'max_call_queue_size' => :'Integer'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::AccountStatistics` initialize method'
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::AccountStatistics`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'current_call_queue_size')
+ self.current_call_queue_size = attributes[:'current_call_queue_size']
+ end
+
+ if attributes.key?(:'max_call_queue_size')
+ self.max_call_queue_size = attributes[:'max_call_queue_size']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ current_call_queue_size == o.current_call_queue_size &&
+ max_call_queue_size == o.max_call_queue_size
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [current_call_queue_size, max_call_queue_size].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Bandwidth.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/answer_callback.rb b/lib/bandwidth-sdk/models/answer_callback.rb
new file mode 100644
index 00000000..a1df3331
--- /dev/null
+++ b/lib/bandwidth-sdk/models/answer_callback.rb
@@ -0,0 +1,368 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ # The Answer event is sent to the answerUrl specified in the createCall request when an outbound call is answered.
+ class AnswerCallback
+ # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.
+ attr_accessor :event_type
+
+ # The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.
+ attr_accessor :event_time
+
+ # The user account associated with the call.
+ attr_accessor :account_id
+
+ # The id of the application associated with the call.
+ attr_accessor :application_id
+
+ # The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.
+ attr_accessor :from
+
+ # The phone number that received the call, in E.164 format (e.g. +15555555555).
+ attr_accessor :to
+
+ attr_accessor :direction
+
+ # The call id associated with the event.
+ attr_accessor :call_id
+
+ # The URL of the call associated with the event.
+ attr_accessor :call_url
+
+ # (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.
+ attr_accessor :enqueued_time
+
+ # Time the call was started, in ISO 8601 format.
+ attr_accessor :start_time
+
+ # Time the call was answered, in ISO 8601 format.
+ attr_accessor :answer_time
+
+ # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.
+ attr_accessor :tag
+
+ attr_accessor :machine_detection_result
+
+ class EnumAttributeValidator
+ attr_reader :datatype
+ attr_reader :allowable_values
+
+ def initialize(datatype, allowable_values)
+ @allowable_values = allowable_values.map do |value|
+ case datatype.to_s
+ when /Integer/i
+ value.to_i
+ when /Float/i
+ value.to_f
+ else
+ value
+ end
+ end
+ end
+
+ def valid?(value)
+ !value || allowable_values.include?(value)
+ end
+ end
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'event_type' => :'eventType',
+ :'event_time' => :'eventTime',
+ :'account_id' => :'accountId',
+ :'application_id' => :'applicationId',
+ :'from' => :'from',
+ :'to' => :'to',
+ :'direction' => :'direction',
+ :'call_id' => :'callId',
+ :'call_url' => :'callUrl',
+ :'enqueued_time' => :'enqueuedTime',
+ :'start_time' => :'startTime',
+ :'answer_time' => :'answerTime',
+ :'tag' => :'tag',
+ :'machine_detection_result' => :'machineDetectionResult'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'event_type' => :'String',
+ :'event_time' => :'Time',
+ :'account_id' => :'String',
+ :'application_id' => :'String',
+ :'from' => :'String',
+ :'to' => :'String',
+ :'direction' => :'CallDirectionEnum',
+ :'call_id' => :'String',
+ :'call_url' => :'String',
+ :'enqueued_time' => :'Time',
+ :'start_time' => :'Time',
+ :'answer_time' => :'Time',
+ :'tag' => :'String',
+ :'machine_detection_result' => :'MachineDetectionResult'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ :'enqueued_time',
+ :'answer_time',
+ :'tag',
+ :'machine_detection_result'
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::AnswerCallback` initialize method'
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::AnswerCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'event_type')
+ self.event_type = attributes[:'event_type']
+ end
+
+ if attributes.key?(:'event_time')
+ self.event_time = attributes[:'event_time']
+ end
+
+ if attributes.key?(:'account_id')
+ self.account_id = attributes[:'account_id']
+ end
+
+ if attributes.key?(:'application_id')
+ self.application_id = attributes[:'application_id']
+ end
+
+ if attributes.key?(:'from')
+ self.from = attributes[:'from']
+ end
+
+ if attributes.key?(:'to')
+ self.to = attributes[:'to']
+ end
+
+ if attributes.key?(:'direction')
+ self.direction = attributes[:'direction']
+ end
+
+ if attributes.key?(:'call_id')
+ self.call_id = attributes[:'call_id']
+ end
+
+ if attributes.key?(:'call_url')
+ self.call_url = attributes[:'call_url']
+ end
+
+ if attributes.key?(:'enqueued_time')
+ self.enqueued_time = attributes[:'enqueued_time']
+ end
+
+ if attributes.key?(:'start_time')
+ self.start_time = attributes[:'start_time']
+ end
+
+ if attributes.key?(:'answer_time')
+ self.answer_time = attributes[:'answer_time']
+ end
+
+ if attributes.key?(:'tag')
+ self.tag = attributes[:'tag']
+ end
+
+ if attributes.key?(:'machine_detection_result')
+ self.machine_detection_result = attributes[:'machine_detection_result']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ event_type == o.event_type &&
+ event_time == o.event_time &&
+ account_id == o.account_id &&
+ application_id == o.application_id &&
+ from == o.from &&
+ to == o.to &&
+ direction == o.direction &&
+ call_id == o.call_id &&
+ call_url == o.call_url &&
+ enqueued_time == o.enqueued_time &&
+ start_time == o.start_time &&
+ answer_time == o.answer_time &&
+ tag == o.tag &&
+ machine_detection_result == o.machine_detection_result
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [event_type, event_time, account_id, application_id, from, to, direction, call_id, call_url, enqueued_time, start_time, answer_time, tag, machine_detection_result].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Bandwidth.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bridge_complete_callback.rb b/lib/bandwidth-sdk/models/bridge_complete_callback.rb
new file mode 100644
index 00000000..8a7cbc79
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bridge_complete_callback.rb
@@ -0,0 +1,390 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ # If the target call leaves the , then this callback is sent to the bridgeCompleteUrl, and the BXML returned in it is executed on the call. If this webhook is sent, the Bridge Target Complete webhook is NOT sent. This callback is also sent if any problem occurs that prevents the calls to be bridged.
+ class BridgeCompleteCallback
+ # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.
+ attr_accessor :event_type
+
+ # The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.
+ attr_accessor :event_time
+
+ # The user account associated with the call.
+ attr_accessor :account_id
+
+ # The id of the application associated with the call.
+ attr_accessor :application_id
+
+ # The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.
+ attr_accessor :from
+
+ # The phone number that received the call, in E.164 format (e.g. +15555555555).
+ attr_accessor :to
+
+ attr_accessor :direction
+
+ # The call id associated with the event.
+ attr_accessor :call_id
+
+ # The URL of the call associated with the event.
+ attr_accessor :call_url
+
+ # (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.
+ attr_accessor :enqueued_time
+
+ # Time the call was started, in ISO 8601 format.
+ attr_accessor :start_time
+
+ # Time the call was answered, in ISO 8601 format.
+ attr_accessor :answer_time
+
+ # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.
+ attr_accessor :tag
+
+ # Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown.
+ attr_accessor :cause
+
+ # Text explaining the reason that caused the call to fail in case of errors.
+ attr_accessor :error_message
+
+ # Bandwidth's internal id that references the error event.
+ attr_accessor :error_id
+
+ class EnumAttributeValidator
+ attr_reader :datatype
+ attr_reader :allowable_values
+
+ def initialize(datatype, allowable_values)
+ @allowable_values = allowable_values.map do |value|
+ case datatype.to_s
+ when /Integer/i
+ value.to_i
+ when /Float/i
+ value.to_f
+ else
+ value
+ end
+ end
+ end
+
+ def valid?(value)
+ !value || allowable_values.include?(value)
+ end
+ end
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'event_type' => :'eventType',
+ :'event_time' => :'eventTime',
+ :'account_id' => :'accountId',
+ :'application_id' => :'applicationId',
+ :'from' => :'from',
+ :'to' => :'to',
+ :'direction' => :'direction',
+ :'call_id' => :'callId',
+ :'call_url' => :'callUrl',
+ :'enqueued_time' => :'enqueuedTime',
+ :'start_time' => :'startTime',
+ :'answer_time' => :'answerTime',
+ :'tag' => :'tag',
+ :'cause' => :'cause',
+ :'error_message' => :'errorMessage',
+ :'error_id' => :'errorId'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'event_type' => :'String',
+ :'event_time' => :'Time',
+ :'account_id' => :'String',
+ :'application_id' => :'String',
+ :'from' => :'String',
+ :'to' => :'String',
+ :'direction' => :'CallDirectionEnum',
+ :'call_id' => :'String',
+ :'call_url' => :'String',
+ :'enqueued_time' => :'Time',
+ :'start_time' => :'Time',
+ :'answer_time' => :'Time',
+ :'tag' => :'String',
+ :'cause' => :'String',
+ :'error_message' => :'String',
+ :'error_id' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ :'enqueued_time',
+ :'answer_time',
+ :'tag',
+ :'error_message',
+ :'error_id'
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::BridgeCompleteCallback` initialize method'
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::BridgeCompleteCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'event_type')
+ self.event_type = attributes[:'event_type']
+ end
+
+ if attributes.key?(:'event_time')
+ self.event_time = attributes[:'event_time']
+ end
+
+ if attributes.key?(:'account_id')
+ self.account_id = attributes[:'account_id']
+ end
+
+ if attributes.key?(:'application_id')
+ self.application_id = attributes[:'application_id']
+ end
+
+ if attributes.key?(:'from')
+ self.from = attributes[:'from']
+ end
+
+ if attributes.key?(:'to')
+ self.to = attributes[:'to']
+ end
+
+ if attributes.key?(:'direction')
+ self.direction = attributes[:'direction']
+ end
+
+ if attributes.key?(:'call_id')
+ self.call_id = attributes[:'call_id']
+ end
+
+ if attributes.key?(:'call_url')
+ self.call_url = attributes[:'call_url']
+ end
+
+ if attributes.key?(:'enqueued_time')
+ self.enqueued_time = attributes[:'enqueued_time']
+ end
+
+ if attributes.key?(:'start_time')
+ self.start_time = attributes[:'start_time']
+ end
+
+ if attributes.key?(:'answer_time')
+ self.answer_time = attributes[:'answer_time']
+ end
+
+ if attributes.key?(:'tag')
+ self.tag = attributes[:'tag']
+ end
+
+ if attributes.key?(:'cause')
+ self.cause = attributes[:'cause']
+ end
+
+ if attributes.key?(:'error_message')
+ self.error_message = attributes[:'error_message']
+ end
+
+ if attributes.key?(:'error_id')
+ self.error_id = attributes[:'error_id']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ event_type == o.event_type &&
+ event_time == o.event_time &&
+ account_id == o.account_id &&
+ application_id == o.application_id &&
+ from == o.from &&
+ to == o.to &&
+ direction == o.direction &&
+ call_id == o.call_id &&
+ call_url == o.call_url &&
+ enqueued_time == o.enqueued_time &&
+ start_time == o.start_time &&
+ answer_time == o.answer_time &&
+ tag == o.tag &&
+ cause == o.cause &&
+ error_message == o.error_message &&
+ error_id == o.error_id
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [event_type, event_time, account_id, application_id, from, to, direction, call_id, call_url, enqueued_time, start_time, answer_time, tag, cause, error_message, error_id].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Bandwidth.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb b/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb
new file mode 100644
index 00000000..8150a36f
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb
@@ -0,0 +1,358 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ # If the originating call leaves the , then this callback is sent to the bridgeTargetCompleteUrl, and the BXML returned in it is executed on the target call. If this webhook is sent, the Bridge Complete webhook is NOT sent.
+ class BridgeTargetCompleteCallback
+ # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.
+ attr_accessor :event_type
+
+ # The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.
+ attr_accessor :event_time
+
+ # The user account associated with the call.
+ attr_accessor :account_id
+
+ # The id of the application associated with the call.
+ attr_accessor :application_id
+
+ # The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.
+ attr_accessor :from
+
+ # The phone number that received the call, in E.164 format (e.g. +15555555555).
+ attr_accessor :to
+
+ attr_accessor :direction
+
+ # The call id associated with the event.
+ attr_accessor :call_id
+
+ # The URL of the call associated with the event.
+ attr_accessor :call_url
+
+ # (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.
+ attr_accessor :enqueued_time
+
+ # Time the call was started, in ISO 8601 format.
+ attr_accessor :start_time
+
+ # Time the call was answered, in ISO 8601 format.
+ attr_accessor :answer_time
+
+ # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.
+ attr_accessor :tag
+
+ class EnumAttributeValidator
+ attr_reader :datatype
+ attr_reader :allowable_values
+
+ def initialize(datatype, allowable_values)
+ @allowable_values = allowable_values.map do |value|
+ case datatype.to_s
+ when /Integer/i
+ value.to_i
+ when /Float/i
+ value.to_f
+ else
+ value
+ end
+ end
+ end
+
+ def valid?(value)
+ !value || allowable_values.include?(value)
+ end
+ end
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'event_type' => :'eventType',
+ :'event_time' => :'eventTime',
+ :'account_id' => :'accountId',
+ :'application_id' => :'applicationId',
+ :'from' => :'from',
+ :'to' => :'to',
+ :'direction' => :'direction',
+ :'call_id' => :'callId',
+ :'call_url' => :'callUrl',
+ :'enqueued_time' => :'enqueuedTime',
+ :'start_time' => :'startTime',
+ :'answer_time' => :'answerTime',
+ :'tag' => :'tag'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'event_type' => :'String',
+ :'event_time' => :'Time',
+ :'account_id' => :'String',
+ :'application_id' => :'String',
+ :'from' => :'String',
+ :'to' => :'String',
+ :'direction' => :'CallDirectionEnum',
+ :'call_id' => :'String',
+ :'call_url' => :'String',
+ :'enqueued_time' => :'Time',
+ :'start_time' => :'Time',
+ :'answer_time' => :'Time',
+ :'tag' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ :'enqueued_time',
+ :'answer_time',
+ :'tag'
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::BridgeTargetCompleteCallback` initialize method'
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::BridgeTargetCompleteCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'event_type')
+ self.event_type = attributes[:'event_type']
+ end
+
+ if attributes.key?(:'event_time')
+ self.event_time = attributes[:'event_time']
+ end
+
+ if attributes.key?(:'account_id')
+ self.account_id = attributes[:'account_id']
+ end
+
+ if attributes.key?(:'application_id')
+ self.application_id = attributes[:'application_id']
+ end
+
+ if attributes.key?(:'from')
+ self.from = attributes[:'from']
+ end
+
+ if attributes.key?(:'to')
+ self.to = attributes[:'to']
+ end
+
+ if attributes.key?(:'direction')
+ self.direction = attributes[:'direction']
+ end
+
+ if attributes.key?(:'call_id')
+ self.call_id = attributes[:'call_id']
+ end
+
+ if attributes.key?(:'call_url')
+ self.call_url = attributes[:'call_url']
+ end
+
+ if attributes.key?(:'enqueued_time')
+ self.enqueued_time = attributes[:'enqueued_time']
+ end
+
+ if attributes.key?(:'start_time')
+ self.start_time = attributes[:'start_time']
+ end
+
+ if attributes.key?(:'answer_time')
+ self.answer_time = attributes[:'answer_time']
+ end
+
+ if attributes.key?(:'tag')
+ self.tag = attributes[:'tag']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ event_type == o.event_type &&
+ event_time == o.event_time &&
+ account_id == o.account_id &&
+ application_id == o.application_id &&
+ from == o.from &&
+ to == o.to &&
+ direction == o.direction &&
+ call_id == o.call_id &&
+ call_url == o.call_url &&
+ enqueued_time == o.enqueued_time &&
+ start_time == o.start_time &&
+ answer_time == o.answer_time &&
+ tag == o.tag
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [event_type, event_time, account_id, application_id, from, to, direction, call_id, call_url, enqueued_time, start_time, answer_time, tag].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Bandwidth.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/bxml.rb b/lib/bandwidth-sdk/models/bxml/bxml.rb
new file mode 100644
index 00000000..cd8c6b10
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/bxml.rb
@@ -0,0 +1,11 @@
+module Bandwidth
+ module Bxml
+ class Bxml < Bandwidth::Bxml::Root
+ # Initializer
+ # @param nested_verbs [Array] XML element children. Defaults to an empty array.
+ def initialize(nested_verbs = [])
+ super(tag = 'Bxml', nested_verbs)
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/nestable_verb.rb b/lib/bandwidth-sdk/models/bxml/nestable_verb.rb
new file mode 100644
index 00000000..bc0793d3
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/nestable_verb.rb
@@ -0,0 +1,46 @@
+require 'ox'
+
+module Bandwidth
+ module Bxml
+ class NestableVerb < Bandwidth::Bxml::Verb
+ # Initializer
+ # @param tag [String] Name of the XML element.
+ # @param content [String] XML element content. Defaults to nil.
+ # @param nested_verbs [Array] XML element children. Defaults to an empty array.
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
+ def initialize(tag, content = nil, nested_verbs = [], attributes = {})
+ @tag = tag
+ @content = content
+ @nested_verbs = nested_verbs
+ @attributes = attributes
+ end
+
+ # Generate an XML element for the verb
+ # @return [Node] The XML element.
+ def generate_xml
+ root = Ox::Element.new(@tag)
+ if @content
+ root << @content
+ end
+
+ if @nested_verbs.length > 0
+ @nested_verbs.each do |verb|
+ root << verb.generate_xml
+ end
+ end
+
+ if !@attributes.empty? && !@attribute_map.nil?
+ @attributes.each do |key, value|
+ if @attribute_map.include? key.to_sym
+ root[@attribute_map[key.to_sym]] = value
+ else
+ raise NoMethodError.new("attribute '#{key}' is not a valid attribute for this verb")
+ end
+ end
+ end
+
+ root
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/response.rb b/lib/bandwidth-sdk/models/bxml/response.rb
new file mode 100644
index 00000000..e0bbb7e4
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/response.rb
@@ -0,0 +1,11 @@
+module Bandwidth
+ module Bxml
+ class Response < Bandwidth::Bxml::Root
+ # Initializer
+ # @param nested_verbs [Array] XML element children. Defaults to an empty array.
+ def initialize(nested_verbs = [])
+ super(tag = 'Response', nested_verbs)
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/root.rb b/lib/bandwidth-sdk/models/bxml/root.rb
new file mode 100644
index 00000000..1b1ee9a5
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/root.rb
@@ -0,0 +1,47 @@
+require 'ox'
+
+module Bandwidth
+ module Bxml
+ SPEAK_SENTENCE_REGEX = /(.*?)<\/SpeakSentence>/
+ SSML_REGEX = /<([a-zA-Z\/\/].*?)>/
+
+ class Root
+ # Initializer
+ # @param tag [String] Name of the XML element.
+ # @param nested_verbs [Array] XML element children. Defaults to an empty array.
+ def initialize(tag, nested_verbs = [])
+ @tag = tag
+ @nested_verbs = nested_verbs
+ end
+
+ # Generate an XML element for the BXML response
+ # @return [Document] The XML element.
+ def generate_xml
+ xml = Ox::Document.new
+ instruct = Ox::Instruct.new(:xml)
+ instruct[:version] = '1.0'
+ instruct[:encoding] = 'UTF-8'
+ xml << instruct
+ root = Ox::Element.new(@tag)
+ @nested_verbs.each do |verb|
+ root << verb.generate_xml
+ end
+ xml << root
+ xml
+ end
+
+ # Add a verb to the nested verbs array
+ # @param *nested_verbs [Verb] or [Array] Verb or verbs to add to the array.
+ def add_verb(nested_verbs)
+ @nested_verbs.push(*nested_verbs)
+ end
+
+ # Return BXML representaion of this response
+ # @return [String] The XML response in string format.
+ def to_bxml
+ bxml = Ox.dump(generate_xml)
+ bxml.gsub(SPEAK_SENTENCE_REGEX) { |text| text.gsub(SSML_REGEX, '<\1>') }
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verb.rb b/lib/bandwidth-sdk/models/bxml/verb.rb
new file mode 100644
index 00000000..f16b9a44
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verb.rb
@@ -0,0 +1,50 @@
+require 'ox'
+
+module Bandwidth
+ module Bxml
+ class Verb
+ # Initializer
+ # @param tag [String] Name of the XML element.
+ # @param content [String] XML element content. Defaults to nil.
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
+ def initialize(tag, content = nil, attributes = {})
+ @tag = tag
+ @content = content
+ @attributes = attributes
+ end
+
+ # Set XML attributes for the verb
+ # @param attributes [Hash] The attributes to add to the element.
+ def set_attributes(attributes)
+ @attributes = attributes
+ end
+
+ # Generate an XML element for the verb
+ # @return [Node] The XML element.
+ def generate_xml
+ root = Ox::Element.new(@tag)
+ if @content
+ root << @content
+ end
+
+ if !@attributes.empty? && !@attribute_map.nil?
+ @attributes.each do |key, value|
+ if @attribute_map.include? key.to_sym
+ root[@attribute_map[key.to_sym]] = value
+ else
+ raise NoMethodError.new("attribute '#{key}' is not a valid attribute for this verb")
+ end
+ end
+ end
+
+ root
+ end
+
+ # Return BXML representaion of this element
+ # @return [String] The XML element in string format.
+ def to_bxml
+ Ox.dump(generate_xml)
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verbs/bridge.rb b/lib/bandwidth-sdk/models/bxml/verbs/bridge.rb
new file mode 100644
index 00000000..e456404e
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verbs/bridge.rb
@@ -0,0 +1,28 @@
+module Bandwidth
+ module Bxml
+ class Bridge < Bandwidth::Bxml::Verb
+ # Initializer
+ # @param target_call [String] The callId of the call to be bridged.
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
+ def initialize(target_call, attributes = {})
+ super('Bridge', target_call, attributes)
+
+ @attribute_map = {
+ bridge_complete_url: 'bridgeCompleteUrl', # Optional [String]: URL to send the Bridge Complete event to and request new BXML. If this attribute is specified, then Verbs following the verb will be ignored and the BXML returned in this webhook is executed on the call. If this attribute is not specified then no webhook will be sent, and execution of the verbs following the verb continues. May be a relative URL. Defaults to None.
+ bridge_complete_method: 'bridgeCompleteMethod', # Optional [String]: The HTTP method to use for the request to bridgeCompleteUrl. GET or POST. Default value is POST.
+ bridge_complete_fallback_url: 'bridgeCompleteFallbackUrl', # Optional [String]: A fallback url which, if provided, will be used to retry the Bridge Complete webhook delivery in case bridgeCompleteUrl fails to respond. Defaults to None.
+ bridge_complete_fallback_method: 'bridgeCompleteFallbackMethod', # Optional [String]: The HTTP method to use to deliver the Bridge Complete webhook to bridgeCompleteFallbackUrl. GET or POST. Default value is POST.
+ bridge_target_complete_url: 'bridgeTargetCompleteUrl', # Optional [String]: URL to send the Bridge Target Complete event to and request new BXML. If this attribute is specified, then the BXML returned in this webhook is executed on the target call. If this attribute is not specified then no webhook will be sent, and the target call will be hung up. May be a relative URL. Defaults to None.
+ bridge_target_complete_method: 'bridgeTargetCompleteMethod', # Optional [String]: The HTTP method to use for the request to bridgeTargetCompleteUrl. GET or POST. Default value is POST.
+ bridge_target_complete_fallback_url: 'bridgeTargetCompleteFallbackUrl', # Optional [String]: A fallback url which, if provided, will be used to retry the Bridge Target Complete webhook delivery in case bridgeTargetCompleteUrl fails to respond. Defaults to None.
+ bridge_target_complete_fallback_method: 'bridgeTargetCompleteFallbackMethod', # Optional [String]: The HTTP method to use to deliver the Bridge Target Complete webhook to bridgeTargetCompleteFallbackUrl. GET or POST. Default value is POST.
+ username: 'username', # Optional [String]: The username to send in the HTTP request to bridgeCompleteUrl and to bridgeTargetCompleteUrl. Defaults to None.
+ password: 'password', # Optional [String]: The password to send in the HTTP request to bridgeCompleteUrl and to bridgeTargetCompleteUrl. Defaults to None.
+ fallback_username: 'fallbackUsername', # Optional [String]: The username to send in the HTTP request to bridgeCompleteFallbackUrl and to bridgeTargetCompleteFallbackUrl. Defaults to None.
+ fallback_password: 'fallbackPassword', # Optional [String]: The password to send in the HTTP request to bridgeCompleteFallbackUrl and to bridgeTargetCompleteFallbackUrl. Defaults to None.
+ tag: 'tag', # Optional [String]: A custom string that will be sent with the bridgeComplete webhook and all future webhooks of the call unless overwritten by a future tag attribute or verb, or cleared. May be cleared by setting tag="". Max length 256 characters. Defaults to None.
+ }
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verbs/conference.rb b/lib/bandwidth-sdk/models/bxml/verbs/conference.rb
new file mode 100644
index 00000000..3f38c91a
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verbs/conference.rb
@@ -0,0 +1,28 @@
+module Bandwidth
+ module Bxml
+ class Conference < Bandwidth::Bxml::Verb
+ # Initializer
+ # @param name [String] The name of the conference. Can contain up to 100 characters of letters, numbers, and the symbols -, _, and .
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
+ def initialize(name, attributes = {})
+ super('Conference', name, attributes)
+
+ @attribute_map = {
+ mute: 'mute', # Optional [Boolean]: A boolean value to indicate whether the member should be on mute in the conference. When muted, a member can hear others speak, but others cannot hear them speak. Defaults to false.
+ hold: 'hold', # Optional [Boolean]: A boolean value to indicate whether the member should be on hold in the conference. When on hold, a member cannot hear others, and they cannot be heard. Defaults to false.
+ call_ids_to_coach: 'callIdsToCoach', # Optional [String]: A comma-separated list of call ids to coach. When a call joins a conference with this attribute set, it will coach the listed calls. Those calls will be able to hear and be heard by the coach, but other calls in the conference will not hear the coach.
+ conference_event_url: 'conferenceEventUrl', # Optional [String]: URL to send Conference events to. The URL, method, username, and password are set by the BXML document that creates the conference, and all events related to that conference will be delivered to that same endpoint. If more calls join afterwards and also have this property (or any other webhook related properties like username and password), they will be ignored and the original webhook information will be used. This URL may be a relative endpoint.
+ conference_event_method: 'conferenceEventMethod', # Optional [String]: The HTTP method to use for the request to conferenceEventUrl. GET or POST. Default value is POST.
+ conference_event_fallback_url: 'conferenceEventFallbackUrl', # Optional [String]: A fallback url which, if provided, will be used to retry the conference webhook deliveries in case conferenceEventUrl fails to respond.
+ conference_event_fallback_method: 'conferenceEventFallbackMethod', # Optional [String]: The HTTP method to use to deliver the conference webhooks to conferenceEventFallbackUrl. GET or POST. Default value is POST.
+ username: 'username', # Optional [String]: The username to send in the HTTP request to conferenceEventUrl.
+ password: 'password', # Optional [String]: The password to send in the HTTP request to conferenceEventUrl.
+ fallback_username: 'fallbackUsername', # Optional [String]: The username to send in the HTTP request to conferenceEventFallbackUrl.
+ fallback_password: 'fallbackPassword', # Optional [String]: The password to send in the HTTP request to conferenceEventFallbackUrl.
+ tag: 'tag', # Optional [String]: A custom string that will be sent with this and all future callbacks unless overwritten by a future tag attribute or verb, or cleared. May be cleared by setting tag="". Max length 256 characters. Defaults to None.
+ callback_timeout: 'callbackTimeout', # Optional [Number]: This is the timeout (in seconds) to use when delivering webhooks for the conference. If not set, it will inherit the webhook timeout from the call that creates the conference. Can be any numeric value (including decimals) between 1 and 25.
+ }
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verbs/custom_param.rb b/lib/bandwidth-sdk/models/bxml/verbs/custom_param.rb
new file mode 100644
index 00000000..caee962f
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verbs/custom_param.rb
@@ -0,0 +1,16 @@
+module Bandwidth
+ module Bxml
+ class CustomParam < Bandwidth::Bxml::Verb
+ # Initializer
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
+ def initialize(attributes = {})
+ super('CustomParam', nil, attributes)
+
+ @attribute_map = {
+ name: 'name', # [String]: The name of this parameter, up to 256 characters.
+ value: 'value', # [String]: The value of this parameter, up to 2048 characters.
+ }
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verbs/forward.rb b/lib/bandwidth-sdk/models/bxml/verbs/forward.rb
new file mode 100644
index 00000000..5f63110f
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verbs/forward.rb
@@ -0,0 +1,20 @@
+module Bandwidth
+ module Bxml
+ class Forward < Bandwidth::Bxml::Verb
+ # Initializer
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
+ def initialize(attributes = {})
+ super('Forward', nil, attributes)
+
+ @attribute_map = {
+ to: 'to', # [String]: The phone number destination of the call.
+ from: 'from', # Optional [String]: The phone number that the recipient will receive the call from.
+ call_timeout: 'callTimeout', # Optional [Number]: The number of seconds to wait before timing out the call.
+ diversion_treatment: 'diversionTreatment', # Optional [String]: Can be any of the following: - none: No diversion headers are sent on the outbound leg of the transferred call. - propagate: Copy the Diversion header from the inbound leg to the outbound leg. Ignored if there is no Diversion header present on the inbound leg. - stack: After propagating any Diversion header from the inbound leg to the outbound leg, stack on top another Diversion header based on the Request-URI of the inbound call. If diversionTreatment is not specified, no diversion header will be included for the transfer even if one came with the inbound call. Defaults to None.
+ diversion_reason: 'diversionReason', # Optional [String]: Can be any of the following values: unknown, user-busy, no-answer, unavailable, unconditional, time-of-day, do-not-disturb, deflection, follow-me, out-of-service, away. This parameter is considered only when diversionTreatment is set to stack. Defaults to None.
+ uui: 'uui', # Optional [String]: The value of the User-To-User header to send within the outbound INVITE when forwarding to a SIP URI. Must include the encoding parameter as specified in RFC 7433. Only base64 and jwt encoding are currently allowed. This value, including the encoding specifier, may not exceed 256 characters.
+ }
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verbs/gather.rb b/lib/bandwidth-sdk/models/bxml/verbs/gather.rb
new file mode 100644
index 00000000..4fc76458
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verbs/gather.rb
@@ -0,0 +1,42 @@
+module Bandwidth
+ module Bxml
+ class Gather < Bandwidth::Bxml::NestableVerb
+ # Initializer
+ # @param audio_verbs [Array] XML element children. Defaults to an empty array. Valid nested audio verbs are: SpeakSentence, PlayAudio.
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
+ def initialize(audio_verbs = [], attributes = {})
+ super('Gather', nil, audio_verbs, attributes)
+
+ @attribute_map = {
+ gather_url: 'gatherUrl', # Optional [String]: URL to send Gather event to and request new BXML. May be a relative URL.
+ gather_method: 'gatherMethod', # Optional [String]: The HTTP method to use for the request to gather_url. GET or POST. Default value is POST.
+ gather_fallback_url: 'gatherFallbackUrl', # Optional [String]: A fallback url which, if provided, will be used to retry the Gather event callback delivery in case gather_url fails to respond.
+ gather_fallback_method: 'gatherFallbackMethod', # Optional [String]: The HTTP method to use to deliver the Gather event callback to gather_fallback_url. GET or POST. Default value is POST.
+ username: 'username', # Optional [String]: The username to send in the HTTP request to gather_url.
+ password: 'password', # Optional [String]: The password to send in the HTTP request to gather_url.
+ fallback_username: 'fallbackUsername', # Optional [String]: The username to send in the HTTP request to gather_fallback_url.
+ fallback_password: 'fallbackPassword', # Optional [String]: The password to send in the HTTP request to gather_fallback_url.
+ tag: 'tag', # Optional [String]: A custom string that will be sent with this and all future callbacks unless overwritten by a future tag attribute or verb, or cleared. May be cleared by setting tag="". Max length 256 characters.
+ terminating_digits: 'terminatingDigits', # Optional [String]: When any of these digits are pressed, it will terminate the Gather. Default value is "", which disables this feature.
+ max_digits: 'maxDigits', # Optional [Number]: Max number of digits to collect. Default value is 50. Range: decimal values between 1 - 50.
+ inter_digit_timeout: 'interDigitTimeout', # Optional [Number]: Time (in seconds) allowed between digit presses before automatically terminating the Gather. Default value is 5. Range: decimal values between 1 - 60.
+ first_digit_timeout: 'firstDigitTimeout', # Optional [Number]: Time (in seconds) to pause after any audio from nested or verb is played (in seconds) before terminating the Gather. Default value is 5. Range: decimal values between 0 - 60.
+ repeat_count: 'repeat_count', # Optional [Number]: The number of times the audio prompt should be played if no digits are pressed. For example, if this value is 3, the nested audio clip will be played a maximum of three times. The delay between repetitions will be equal to first_digit_timeout. Default value is 1. repeat_count * number of verbs must not be greater than 20.
+ }
+ end
+
+ # Return BXML representaion of this response
+ # @return [String] The XML response in string format.
+ def to_bxml
+ bxml = Ox.dump(generate_xml)
+ bxml.gsub(SPEAK_SENTENCE_REGEX) { |text| text.gsub(SSML_REGEX, '<\1>') }
+ end
+
+ # Add audio verb/s to the nested verbs array
+ # @param audio_verbs [SpeakSentence] || [PlayAudio] or [Array] Verb or verbs to add to the array.
+ def add_audio_verb(audio_verbs)
+ @nested_verbs.push(*audio_verbs)
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verbs/hangup.rb b/lib/bandwidth-sdk/models/bxml/verbs/hangup.rb
new file mode 100644
index 00000000..51d50565
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verbs/hangup.rb
@@ -0,0 +1,10 @@
+module Bandwidth
+ module Bxml
+ class Hangup < Bandwidth::Bxml::Verb
+ # Initializer
+ def initialize
+ super('Hangup', nil, {})
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verbs/pause.rb b/lib/bandwidth-sdk/models/bxml/verbs/pause.rb
new file mode 100644
index 00000000..d41a513d
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verbs/pause.rb
@@ -0,0 +1,15 @@
+module Bandwidth
+ module Bxml
+ class Pause < Bandwidth::Bxml::Verb
+ # Initializer
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
+ def initialize(attributes = {})
+ super('Pause', nil, attributes)
+
+ @attribute_map = {
+ duration: 'duration', # Optional [Number]: The time in seconds to pause. Default value is 1.
+ }
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verbs/pause_recording.rb b/lib/bandwidth-sdk/models/bxml/verbs/pause_recording.rb
new file mode 100644
index 00000000..a0e52c2a
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verbs/pause_recording.rb
@@ -0,0 +1,10 @@
+module Bandwidth
+ module Bxml
+ class PauseRecording < Bandwidth::Bxml::Verb
+ # Initializer
+ def initialize
+ super('PauseRecording', nil, {})
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verbs/phone_number.rb b/lib/bandwidth-sdk/models/bxml/verbs/phone_number.rb
new file mode 100644
index 00000000..db47f2c9
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verbs/phone_number.rb
@@ -0,0 +1,26 @@
+module Bandwidth
+ module Bxml
+ class PhoneNumber < Bandwidth::Bxml::Verb
+ # Initializer
+ # @param number [String] A phone number to transfer the call to. Value must be in E.164 format (e.g. +15555555555).
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
+ def initialize(number, attributes = {})
+ super('PhoneNumber', number, attributes)
+
+ @attribute_map = {
+ transfer_answer_url: 'transferAnswerUrl', # Optional [String]: URL, if any, to send the Transfer Answer event to and request BXML to be executed for the called party before the call is bridged. May be a relative URL. Defaults to None.
+ transfer_answer_method: 'transferAnswerMethod', # Optional [String]: The HTTP method to use for the request to transferAnswerUrl. GET or POST. Default value is POST. Defaults to None.
+ transfer_answer_fallback_url: 'transferAnswerFallbackUrl', # Optional [String]: A fallback url which, if provided, will be used to retry the Transfer Answer callback delivery in case transferAnswerUrl fails to respond. Defaults to None.
+ transfer_answer_fallback_method: 'transferAnswerFallbackMethod', # Optional [String]: The HTTP method to use to deliver the Transfer Answer callback to transferAnswerFallbackUrl. GET or POST. Default value is POST. Defaults to None.
+ transfer_disconnect_url: 'transferDisconnectUrl', # Optional [String]: URL, if any, to send the Transfer Disconnect event to. This event will be sent regardless of how the transfer ends and may not be responded to with BXML. May be a relative URL. Defaults to None.
+ transfer_disconnect_method: 'transferDisconnectMethod', # Optional [String]: The HTTP method to use for the request to transferDisconnectUrl. GET or POST. Default value is POST. Defaults to Defaults to Defaults to None.
+ username: 'username', # Optional [String]: The username to send in the HTTP request to transferAnswerUrl and transferDisconnectUrl. Defaults to Defaults to None.
+ password: 'password', # Optional [String]: The password to send in the HTTP request to transferAnswerUrl and transferDisconnectUrl. Defaults to Defaults to None.
+ fallback_username: 'fallbackUsername', # Optional [String]: The username to send in the HTTP request to transferAnswerFallbackUrl. Defaults to None.
+ fallback_password: 'fallbackPassword', # Optional [String]: The password to send in the HTTP request to transferAnswerFallbackUrl. Defaults to None.
+ tag: 'tag', # Optional [String]: A custom string that will be sent with these and all future callbacks unless overwritten by a future tag attribute or cleared. May be cleared by setting tag="" Max length 256 characters. Defaults to None.
+ }
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verbs/play_audio.rb b/lib/bandwidth-sdk/models/bxml/verbs/play_audio.rb
new file mode 100644
index 00000000..d178400b
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verbs/play_audio.rb
@@ -0,0 +1,17 @@
+module Bandwidth
+ module Bxml
+ class PlayAudio < Bandwidth::Bxml::Verb
+ # Initializer
+ # @param audio_uri [String] The URL of the audio file to play. May be a relative URL.
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
+ def initialize(audio_uri, attributes = {})
+ super('PlayAudio', audio_uri, attributes)
+
+ @attribute_map = {
+ username: 'username', # Optional [String]: The username to send in the HTTP request to audio_uri.
+ password: 'password', # Optional [String]: The password to send in the HTTP request to audio_uri.
+ }
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verbs/record.rb b/lib/bandwidth-sdk/models/bxml/verbs/record.rb
new file mode 100644
index 00000000..c3bbb728
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verbs/record.rb
@@ -0,0 +1,32 @@
+module Bandwidth
+ module Bxml
+ class Record < Bandwidth::Bxml::Verb
+ # Initializer
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
+ def initialize(attributes = {})
+ super('Record', nil, attributes)
+
+ @attribute_map = {
+ record_complete_url: 'recordCompleteUrl', # Optional [String]: URL to send the Record Complete event to once the recording has ended. Accepts BXML, and may be a relative URL. This callback will not be sent if the recording ended due to the call hanging up. Defaults to None.
+ record_complete_method: 'recordCompleteMethod', # Optional [String]: The HTTP method to use for the request to recordCompleteUrl. GET or POST. Default value is POST. Defaults to None.
+ record_complete_fallback_url: 'recordCompleteFallbackUrl', # Optional [String]: A fallback url which, if provided, will be used to retry the Record Complete callback delivery in case recordCompleteUrl fails to respond. Defaults to None.
+ record_complete_fallback_method: 'recordCompleteFallbackMethod', # Optional [String]: The HTTP method to use to deliver the Record Complete callback to recordCompleteFallbackUrl. GET or POST. Default value is POST. Defaults to None.
+ recording_available_url: 'recordingAvailableUrl', # Optional [String]: URL to send the Recording Available event to once it has been processed. Does not accept BXML. May be a relative URL. Defaults to None.
+ recording_available_method: 'recordingAvailableMethod', # Optional [String]: The HTTP method to use for the request to recordingAvailableUrl. GET or POST. Default value is POST. Defaults to None.
+ transcribe: 'transcribe', # Optional [Boolean]: A boolean value to indicate that recording should be transcribed. Transcription can succeed only for recordings of length greater than 500 milliseconds and less than 4 hours. Default is false. Defaults to None.
+ transcription_available_url: 'transcriptionAvailableUrl', # Optional [String]: URL to send the Transcription Available event to once it has been processed. Does not accept BXML. May be a relative URL. Defaults to None.
+ transcription_available_method: 'transcriptionAvailableMethod', # Optional [String]: The HTTP method to use for the request to transcriptionAvailableUrl. GET or POST. Default value is POST. Defaults to None.
+ username: 'username', # Optional [String]: The username to send in the HTTP request to recordCompleteUrl, recordingAvailableUrl or transcriptionAvailableUrl. If specified, the URLs must be TLS-encrypted (i.e., https). Defaults to None.
+ password: 'password', # Optional [String]: The password to send in the HTTP request to recordCompleteUrl, recordingAvailableUrl or transcriptionAvailableUrl. If specified, the URLs must be TLS-encrypted (i.e., https). Defaults to None.
+ fallback_username: 'fallbackUsername', # Optional [String]: The username to send in the HTTP request to recordCompleteFallbackUrl. If specified, the URLs must be TLS-encrypted (i.e., https). Defaults to None.
+ fallback_password: 'fallbackPassword', # Optional [String]: The password to send in the HTTP request to recordCompleteFallbackUrl. If specified, the URLs must be TLS-encrypted (i.e., https). Defaults to None.
+ tag: 'tag', # Optional [String]: A custom string that will be sent with this and all future callbacks unless overwritten by a future tag attribute or verb, or cleared. May be cleared by setting tag="". Max length 256 characters. Defaults to None.
+ terminating_digits: 'terminatingDigits', # Optional [String]: When pressed, this digit will terminate the recording. Default value is “#”. This feature can be disabled with "". Defaults to None.
+ max_duration: 'maxDuration', # Optional [Number]: Maximum length of recording (in seconds). Max 10800 (3 hours). Default value is 60. Defaults to None.
+ silence_timeout: 'silenceTimeout', # Optional [Number]: Length of silence after which to end the recording (in seconds). Max is equivalent to the maximum maxDuration value. Default value is 0, which means no timeout. Defaults to None.
+ file_format: 'fileFormat', # Optional [String]: The audio format that the recording will be saved as: mp3 or wav. Default value is wav. Defaults to None.
+ }
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verbs/redirect.rb b/lib/bandwidth-sdk/models/bxml/verbs/redirect.rb
new file mode 100644
index 00000000..5b65fdbc
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verbs/redirect.rb
@@ -0,0 +1,23 @@
+module Bandwidth
+ module Bxml
+ class Redirect < Bandwidth::Bxml::Verb
+ # Initializer
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
+ def initialize(attributes = {})
+ super('Redirect', nil, attributes)
+
+ @attribute_map = {
+ redirect_url: 'redirectUrl', # [String]: URL to request new BXML from. A Redirect event will be sent to this endpoint. May be a relative URL. Defaults to None.
+ redirect_method: 'redirectMethod', # Optional [String]: The HTTP method to use for the request to redirectUrl. GET or POST. Defaults to None.
+ redirect_fallback_url: 'redirectFallbackUrl', # Optional [String]: A fallback url which, if provided, will be used to retry the Redirect callback delivery in case redirectUrl fails to respond. Defaults to None.
+ redirect_fallback_method: 'redirectFallbackMethod', # Optional [String]: The HTTP method to use to deliver the Redirect callback to redirectFallbackUrl. GET or POST. Default value is POST. Defaults to None.
+ username: 'username', # Optional [String]: The username to send in the HTTP request to redirectUrl. Defaults to None.
+ password: 'password', # Optional [String]: The password to send in the HTTP request to redirectUrl. Defaults to None.
+ fallback_username: 'fallbackUsername', # Optional [String]: The username to send in the HTTP request to redirectFallbackUrl. Defaults to None.
+ fallback_password: 'fallbackPassword', # Optional [String]: The password to send in the HTTP request to redirectFallbackUrl. Defaults to None.
+ tag: 'tag', # Optional [String]: A custom string that will be sent with this and all future callbacks unless overwritten by a future tag attribute or verb, or cleared. May be cleared by setting tag="". Max length 256 characters. Defaults to None.
+ }
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verbs/resume_recording.rb b/lib/bandwidth-sdk/models/bxml/verbs/resume_recording.rb
new file mode 100644
index 00000000..05eed0fc
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verbs/resume_recording.rb
@@ -0,0 +1,10 @@
+module Bandwidth
+ module Bxml
+ class ResumeRecording < Bandwidth::Bxml::Verb
+ # Initializer
+ def initialize
+ super('ResumeRecording', nil, {})
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verbs/ring.rb b/lib/bandwidth-sdk/models/bxml/verbs/ring.rb
new file mode 100644
index 00000000..67f91ea3
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verbs/ring.rb
@@ -0,0 +1,16 @@
+module Bandwidth
+ module Bxml
+ class Ring < Bandwidth::Bxml::Verb
+ # Initializer
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
+ def initialize(attributes = {})
+ super('Ring', nil, attributes)
+
+ @attribute_map = {
+ duration: 'duration', # Optional [Number]: How many seconds to play ringing on the call. Default value is 5. Range: decimal values between 0.1 - 86400.
+ answer_call: 'answerCall', # Optional [Boolean]: A boolean indicating whether or not to answer the call when Ring is executed on an unanswered incoming call. Default value is 'true'.
+ }
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verbs/send_dtmf.rb b/lib/bandwidth-sdk/models/bxml/verbs/send_dtmf.rb
new file mode 100644
index 00000000..f0e84390
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verbs/send_dtmf.rb
@@ -0,0 +1,17 @@
+module Bandwidth
+ module Bxml
+ class SendDtmf < Bandwidth::Bxml::Verb
+ # Initializer
+ # @param digits [String] String containing the DTMF characters to be sent in a call. Allows a maximum of 50 characters. The digits will be sent one-by-one with a marginal delay.
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
+ def initialize(digits, attributes = {})
+ super('SendDtmf', digits, attributes)
+
+ @attribute_map = {
+ tone_duration: 'toneDuration', # Optional [Number]: The length (in milliseconds) of each DTMF tone. Default value is 200. Range: decimal values between 50 - 5000.
+ tone_interval: 'toneInterval', # Optional [Number]: The duration of silence (in milliseconds) following each DTMF tone. Default value is 400. Range: decimal values between 50 - 5000.
+ }
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verbs/sip_uri.rb b/lib/bandwidth-sdk/models/bxml/verbs/sip_uri.rb
new file mode 100644
index 00000000..6f123a91
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verbs/sip_uri.rb
@@ -0,0 +1,27 @@
+module Bandwidth
+ module Bxml
+ class SipUri < Bandwidth::Bxml::Verb
+ # Initializer
+ # @param uri [String] A SIP URI to transfer the call to (e.g. sip:user@server.com)
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
+ def initialize(uri, attributes = {})
+ super('SipUri', uri, attributes)
+
+ @attribute_map = {
+ uui: 'uui', # Optional [String]: The value of the User-To-User header to send within the initial INVITE. Must include the encoding parameter as specified in RFC 7433. Only base64 and jwt encoding are currently allowed. This value, including the encoding specifier, may not exceed 256 characters. Defaults to None.
+ transfer_answer_url: 'transferAnswerUrl', # Optional [String]: URL, if any, to send the Transfer Answer event to and request BXML to be executed for the called party before the call is bridged. May be a relative URL. Defaults to None.
+ transfer_answer_method: 'transferAnswerMethod', # Optional [String]: The HTTP method to use for the request to transferAnswerUrl. GET or POST. Default value is POST. Defaults to None.
+ transfer_answer_fallback_url: 'transferAnswerFallbackUrl', # Optional [String]: A fallback url which, if provided, will be used to retry the Transfer Answer callback delivery in case transferAnswerUrl fails to respond. Defaults to None.
+ transfer_answer_fallback_method: 'transferAnswerFallbackMethod', # Optional [String]: The HTTP method to use to deliver the Transfer Answer callback to transferAnswerFallbackUrl. GET or POST. Default value is POST. Defaults to None.
+ transfer_disconnect_url: 'transferDisconnectUrl', # Optional [String]: URL, if any, to send the Transfer Disconnect event to. This event will be sent regardless of how the transfer ends and may not be responded to with BXML. May be a relative URL. Defaults to None.
+ transfer_disconnect_method: 'transferDisconnectMethod', # Optional [String]: The HTTP method to use for the request to transferDisconnectUrl. GET or POST. Default value is POST. Defaults to Defaults to Defaults to None.
+ username: 'username', # Optional [String]: The username to send in the HTTP request to transferAnswerUrl and transferDisconnectUrl. Defaults to Defaults to None.
+ password: 'password', # Optional [String]: The password to send in the HTTP request to transferAnswerUrl and transferDisconnectUrl. Defaults to Defaults to None.
+ fallback_username: 'fallbackUsername', # Optional [String]: The username to send in the HTTP request to transferAnswerFallbackUrl. Defaults to None.
+ fallback_password: 'fallbackPassword', # Optional [String]: The password to send in the HTTP request to transferAnswerFallbackUrl. Defaults to None.
+ tag: 'tag', # Optional [String]: A custom string that will be sent with these and all future callbacks unless overwritten by a future tag attribute or cleared. May be cleared by setting tag="" Max length 256 characters. Defaults to None.
+ }
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb b/lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb
new file mode 100644
index 00000000..ff3982ef
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb
@@ -0,0 +1,25 @@
+module Bandwidth
+ module Bxml
+ class SpeakSentence < Bandwidth::Bxml::Verb
+ # Initializer
+ # @param text [String] The text to speak. Cannot be blank. Can be a mixture of plain text and SSML tags.
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
+ def initialize(text, attributes = {})
+ super('SpeakSentence', text, attributes)
+
+ @attribute_map = {
+ voice: 'voice', # Optional [String]: Selects the voice of the speaker. If the voice attribute is present, gender and locale are ignored. You can find a list of supported voices here: https://dev.bandwidth.com/docs/voice/bxml/speakSentence/#supported-voices
+ gender: 'gender', # Optional [String]: Selects the gender of the speaker. Valid values are "male" or "female". Default "female".
+ locale: 'locale', # Optional [String]: Selects the locale of the speaker. Default "en_US"
+ }
+ end
+
+ # Return BXML representaion of this response
+ # @return [String] The XML response in string format.
+ def to_bxml
+ bxml = Ox.dump(generate_xml)
+ bxml.gsub(SPEAK_SENTENCE_REGEX) { |text| text.gsub(SSML_REGEX, '<\1>') }
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verbs/start_gather.rb b/lib/bandwidth-sdk/models/bxml/verbs/start_gather.rb
new file mode 100644
index 00000000..26644574
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verbs/start_gather.rb
@@ -0,0 +1,19 @@
+module Bandwidth
+ module Bxml
+ class StartGather < Bandwidth::Bxml::Verb
+ # Initializer
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
+ def initialize(attributes = {})
+ super('StartGather', nil, attributes)
+
+ @attribute_map = {
+ dtmf_url: 'dtmfUrl', # [String]: URL to send the DTMF event to. May be a relative URL.
+ dtmf_method: 'dtmfMethod', # Optional [String]: The HTTP method to use for the request to dtmfUrl. GET or POST. Default value is POST.
+ username: 'username', # Optional [String]: The username to send in the HTTP request to dtmfUrl. Defaults to None.
+ password: 'password', # Optional [String]: The password to send in the HTTP request to dtmfUrl. Defaults to None.
+ tag: 'tag', # Optional [String]: A custom string that will be sent with these and all future callbacks unless overwritten by a future tag attribute or cleared. May be cleared by setting tag="" Max length 256 characters. Defaults to None.
+ }
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verbs/start_recording.rb b/lib/bandwidth-sdk/models/bxml/verbs/start_recording.rb
new file mode 100644
index 00000000..0db4f0c0
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verbs/start_recording.rb
@@ -0,0 +1,24 @@
+module Bandwidth
+ module Bxml
+ class StartRecording < Bandwidth::Bxml::Verb
+ # Initializer
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
+ def initialize(attributes = {})
+ super('StartRecording', nil, attributes)
+
+ @attribute_map = {
+ recording_available_url: 'recordingAvailableUrl', # Optional [String]: URL to send the Recording Available event to once it has been processed. Does not accept BXML. May be a relative URL. Defaults to None.
+ recording_available_method: 'recordingAvailableMethod', # Optional [String]: The HTTP method to use for the request to recordingAvailableUrl. GET or POST. Default value is POST.
+ transcribe: 'transcribe', # Optional [Boolean]: A boolean value to indicate that recording should be transcribed. Transcription can succeed only for recordings of length greater than 500 milliseconds and less than 4 hours. Default is false. Defaults to None.
+ transcription_available_url: 'transcriptionAvailableUrl', # Optional [String]: URL to send the Transcription Available event to once it has been processed. Does not accept BXML. May be a relative URL. Defaults to None.
+ transcription_available_method: 'transcriptionAvailableMethod', # Optional [String]: The HTTP method to use for the request to transcriptionAvailableUrl. GET or POST. Default value is POST. Defaults to None.
+ username: 'username', # Optional [String]: The username to send in the HTTP request to recordingAvailableUrl or transcriptionAvailableUrl. If specified, the URLs must be TLS-encrypted (i.e., https). Defaults to None.
+ password: 'password', # Optional [String]: The password to send in the HTTP request to recordingAvailableUrl or transcriptionAvailableUrl. If specified, the URLs must be TLS-encrypted (i.e., https). Defaults to None.
+ tag: 'tag', # Optional [String]: A custom string that will be sent with this and all future callbacks unless overwritten by a future tag attribute or verb, or cleared. May be cleared by setting tag="". Max length 256 characters. Defaults to None.
+ file_format: 'fileFormat', # Optional [String]: The audio format that the recording will be saved as: mp3 or wav. Default value is wav.
+ multi_channel: 'multiChannel', # Optional [Boolean]: A boolean value indicating whether or not the recording file should separate each side of the call into its own audio channel. Default value is false.
+ }
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb b/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb
new file mode 100644
index 00000000..95b444a8
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verbs/start_stream.rb
@@ -0,0 +1,28 @@
+module Bandwidth
+ module Bxml
+ class StartStream < Bandwidth::Bxml::NestableVerb
+ # Initializer
+ # @param stream_params [Array] XML element children. Defaults to an empty array. Valid nested stream params are: StreamParam. You may specify up to 12 elements nested within a tag.
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
+ def initialize(stream_params = [], attributes = {})
+ super('StartStream', nil, stream_params, attributes)
+
+ @attribute_map = {
+ name: 'name', # Optional [String]: A name to refer to this stream by. Used when sending . If not provided, it will default to the generated stream id as sent in the Media Stream Started webhook.
+ tracks: 'tracks', # Optional [String]: The part of the call to send a stream from. inbound, outbound or both. Default is inbound.
+ destination: 'destination', # Optional [String]: A websocket URI to send the stream to. The audio from the specified tracks will be sent via websocket to this URL as base64-encoded PCMU/G711 audio.
+ stream_event_url: 'streamEventUrl', # Optional [String]: URL to send the associated Webhook events to during this stream's lifetime. Does not accept BXML. May be a relative URL.
+ stream_event_method: 'streamEventMethod', # Optional [String]: The HTTP method to use for the request to streamEventUrl. GET or POST. Default value is POST.
+ username: 'username', # Optional [String]: The username to send in the HTTP request to streamEventUrl. If specified, the URLs must be TLS-encrypted (i.e., https).
+ password: 'password', # Optional [String]: The password to send in the HTTP request to streamEventUrl. If specified, the URLs must be TLS-encrypted (i.e., https).
+ }
+ end
+
+ # Add stream param/s to the nested verbs array
+ # @param stream_params [StreamParam] or [Array] Verb or verbs to add to the array.
+ def add_stream_param(stream_params)
+ @nested_verbs.push(*stream_params)
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verbs/start_transcription.rb b/lib/bandwidth-sdk/models/bxml/verbs/start_transcription.rb
new file mode 100644
index 00000000..e7661532
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verbs/start_transcription.rb
@@ -0,0 +1,29 @@
+module Bandwidth
+ module Bxml
+ class StartTranscription < Bandwidth::Bxml::NestableVerb
+ # Initializer
+ # @param custom_params [Array] XML element children. Defaults to an empty array. Valid nested custom params are: CustomParam. You may specify up to 12 elements nested within a tag.
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
+ def initialize(custom_params = [], attributes = {})
+ super('StartTranscription', nil, custom_params, attributes)
+
+ @attribute_map = {
+ name: 'name', # Optional [String]: A name to refer to this transcription by. Used when sending . If not provided, it will default to the generated transcription id as sent in the Real-Time Transcription Started webhook.
+ tracks: 'tracks', # Optional [String]: The part of the call to send a transcription from. inbound, outbound or both. Default is inbound.
+ transcription_event_url: 'transcriptionEventUrl', # Optional [String]: URL to send the associated Webhook events to during this real-time transcription's lifetime. Does not accept BXML. May be a relative URL.
+ transcription_event_method: 'transcriptionEventMethod', # Optional [String]: The HTTP method to use for the request to transcriptionEventUrl. GET or POST. Default value is POST.
+ username: 'username', # Optional [String]: The username to send in the HTTP request to transcriptionEventUrl. If specified, the transcriptionEventUrl must be TLS-encrypted (i.e., https).
+ password: 'password', # Optional [String]: The password to send in the HTTP request to transcriptionEventUrl. If specified, the transcriptionEventUrl must be TLS-encrypted (i.e., https).
+ destination: 'destination', # Optional [String]: A websocket URI to send the transcription to. A transcription of the specified tracks will be sent via websocket to this URL as a series of JSON messages. See below for more details on the websocket packet format.
+ stabilized: 'stabilized', # Optional [Boolean]: Whether to send transcription update events to the specified destination only after they have become stable. Requires destination. Defaults to true.
+ }
+ end
+
+ # Add custom param/s to the nested verbs array
+ # @param custom_params [CustomParam] or [Array] Verb or verbs to add to the array.
+ def add_custom_param(custom_params)
+ @nested_verbs.push(*custom_params)
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verbs/stop_gather.rb b/lib/bandwidth-sdk/models/bxml/verbs/stop_gather.rb
new file mode 100644
index 00000000..1377846a
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verbs/stop_gather.rb
@@ -0,0 +1,10 @@
+module Bandwidth
+ module Bxml
+ class StopGather < Bandwidth::Bxml::Verb
+ # Initializer
+ def initialize
+ super('StopGather', nil, {})
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verbs/stop_recording.rb b/lib/bandwidth-sdk/models/bxml/verbs/stop_recording.rb
new file mode 100644
index 00000000..dfb690ac
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verbs/stop_recording.rb
@@ -0,0 +1,10 @@
+module Bandwidth
+ module Bxml
+ class StopRecording < Bandwidth::Bxml::Verb
+ # Initializer
+ def initialize
+ super('StopRecording', nil, {})
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verbs/stop_stream.rb b/lib/bandwidth-sdk/models/bxml/verbs/stop_stream.rb
new file mode 100644
index 00000000..770420ad
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verbs/stop_stream.rb
@@ -0,0 +1,15 @@
+module Bandwidth
+ module Bxml
+ class StopStream < Bandwidth::Bxml::Verb
+ # Initializer
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
+ def initialize(attributes = {})
+ super('StopStream', nil, attributes)
+
+ @attribute_map = {
+ name: 'name' # [String]: The name of the stream to stop. This is either the user selected name when sending the verb, or the system generated name returned in the Media Stream Started webhook if was sent with no name attribute.
+ }
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verbs/stop_transcription.rb b/lib/bandwidth-sdk/models/bxml/verbs/stop_transcription.rb
new file mode 100644
index 00000000..59bdc4f0
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verbs/stop_transcription.rb
@@ -0,0 +1,15 @@
+module Bandwidth
+ module Bxml
+ class StopTranscription < Bandwidth::Bxml::Verb
+ # Initializer
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
+ def initialize(attributes = {})
+ super('StopTranscription', nil, attributes)
+
+ @attribute_map = {
+ name: 'name' # [String]: The name of the real-time transcription to stop. This is either the user selected name when sending the verb, or the system generated name returned in the Real-Time Transcription Started webhook if was sent with no name attribute. If no name is specified, then all active call transcriptions will be stopped.
+ }
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verbs/stream_param.rb b/lib/bandwidth-sdk/models/bxml/verbs/stream_param.rb
new file mode 100644
index 00000000..5aa0bb0d
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verbs/stream_param.rb
@@ -0,0 +1,16 @@
+module Bandwidth
+ module Bxml
+ class StreamParam < Bandwidth::Bxml::Verb
+ # Initializer
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
+ def initialize(attributes = {})
+ super('StreamParam', nil, attributes)
+
+ @attribute_map = {
+ name: 'name', # [String]: The name of this parameter, up to 256 characters.
+ value: 'value', # [String]: The value of this parameter, up to 2048 characters.
+ }
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verbs/tag.rb b/lib/bandwidth-sdk/models/bxml/verbs/tag.rb
new file mode 100644
index 00000000..ec6ca9d0
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verbs/tag.rb
@@ -0,0 +1,11 @@
+module Bandwidth
+ module Bxml
+ class Tag < Bandwidth::Bxml::Verb
+ # Initializer
+ # @param content [String] Custom tag value. Defaults to nil.
+ def initialize(content = nil)
+ super('Tag', content, {})
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb b/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb
new file mode 100644
index 00000000..ed913dd8
--- /dev/null
+++ b/lib/bandwidth-sdk/models/bxml/verbs/transfer.rb
@@ -0,0 +1,34 @@
+module Bandwidth
+ module Bxml
+ class Transfer < Bandwidth::Bxml::NestableVerb
+ # Initializer
+ # @param transfer_to [Array] XML element children. Defaults to an empty array. Valid nested transfer verbs are: PhoneNumber, SipUri.
+ # @param attributes [Hash] The attributes to add to the element. Defaults to an empty hash.
+ def initialize(transfer_to = [], attributes = {})
+ super('Transfer', nil, transfer_to, attributes)
+
+ @attribute_map = {
+ transfer_caller_id: 'transferCallerId', # Optional [String]: The caller ID to use when the call is transferred, if different. Must be in E.164 format (e.g. +15555555555) or be one of the following strings Restricted, Anonymous, Private, or Unavailable. Leave as default to pass along the number of the remote party. Defaults to None.
+ call_timeout: 'callTimeout', # Optional [Number]:The timeout (in seconds) for the callee to answer the call after it starts ringing. If the call does not start ringing within 30s, the call will be cancelled regardless of this value. Range: decimal values between 1 - 300. Default value is 30 seconds. Defaults to None.
+ transfer_complete_url: 'transferCompleteUrl', # Optional [String]: URL to send the Transfer Complete event to and request new BXML. Optional but recommended. See below for further details. May be a relative URL. Defaults to None.
+ transfer_complete_method: 'transferCompleteMethod', # Optional [String]: The HTTP method to use for the request to transferCompleteUrl. GET or POST. Default value is POST. Defaults to None.
+ transfer_complete_fallback_url: 'transferCompleteFallbackUrl', # Optional [String]: A fallback url which, if provided, will be used to retry the Transfer Complete callback delivery in case transferCompleteUrl fails to respond. Defaults to None.
+ transfer_complete_fallback_method: 'transferCompleteFallbackMethod', # Optional [String]: The HTTP method to use to deliver the Transfer Complete callback to transferCompleteFallbackUrl. GET or POST. Default value is POST. Defaults to None.
+ username: 'username', # Optional [String]: The username to send in the HTTP request to transferCompleteUrl. Defaults to None.
+ password: 'password', # Optional [String]: The password to send in the HTTP request to transferCompleteUrl. Defaults to None.
+ fallback_username: 'fallbackUsername', # Optional [String]: The username to send in the HTTP request to transferCompleteFallbackUrl. Defaults to None.
+ fallback_password: 'fallbackPassword', # Optional [String]: The password to send in the HTTP request to transferCompleteFallbackUrl. Defaults to None.
+ tag: 'tag', # Optional [String]: A custom string that will be sent with this and all future callbacks unless overwritten by a future tag attribute or cleared. May be cleared by setting tag="" Max length 256 characters. Defaults to None.
+ diversion_treatment: 'diversionTreatment', # Optional [String]: Can be any of the following: - none: No diversion headers are sent on the outbound leg of the transferred call. - propagate: Copy the Diversion header from the inbound leg to the outbound leg. Ignored if there is no Diversion header present on the inbound leg. - stack: After propagating any Diversion header from the inbound leg to the outbound leg, stack on top another Diversion header based on the Request-URI of the inbound call. If diversionTreatment is not specified, no diversion header will be included for the transfer even if one came with the inbound call. Defaults to None.
+ diversion_reason: 'diversionReason', # Optional [String]: Can be any of the following values: unknown, user-busy, no-answer, unavailable, unconditional, time-of-day, do-not-disturb, deflection, follow-me, out-of-service, away. This parameter is considered only when diversionTreatment is set to stack. Defaults to None.
+ }
+ end
+
+ # Add transfer recipient/s to the nested verbs array
+ # @param recipients [PhoneNumber] || [SipUri] or [Array] Verb or verbs to add to the array.
+ def add_transfer_recipient(recipients)
+ @nested_verbs.push(*recipients)
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/call_direction_enum.rb b/lib/bandwidth-sdk/models/call_direction_enum.rb
new file mode 100644
index 00000000..3208d340
--- /dev/null
+++ b/lib/bandwidth-sdk/models/call_direction_enum.rb
@@ -0,0 +1,40 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ class CallDirectionEnum
+ INBOUND = 'inbound'.freeze
+ OUTBOUND = 'outbound'.freeze
+
+ def self.all_vars
+ @all_vars ||= [INBOUND, OUTBOUND].freeze
+ end
+
+ # Builds the enum from string
+ # @param [String] The enum value in the form of the string
+ # @return [String] The enum value
+ def self.build_from_hash(value)
+ new.build_from_hash(value)
+ end
+
+ # Builds the enum from string
+ # @param [String] The enum value in the form of the string
+ # @return [String] The enum value
+ def build_from_hash(value)
+ return value if CallDirectionEnum.all_vars.include?(value)
+ raise "Invalid ENUM value #{value} for class #CallDirectionEnum"
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/call_recording_metadata.rb b/lib/bandwidth-sdk/models/call_recording_metadata.rb
new file mode 100644
index 00000000..b475737a
--- /dev/null
+++ b/lib/bandwidth-sdk/models/call_recording_metadata.rb
@@ -0,0 +1,404 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ class CallRecordingMetadata
+ # The id of the application associated with the call.
+ attr_accessor :application_id
+
+ # The user account associated with the call.
+ attr_accessor :account_id
+
+ # The call id associated with the event.
+ attr_accessor :call_id
+
+ # (optional) If the event is related to the B leg of a , the call id of the original call leg that executed the . Otherwise, this field will not be present.
+ attr_accessor :parent_call_id
+
+ # The unique ID of this recording
+ attr_accessor :recording_id
+
+ # The phone number that received the call, in E.164 format (e.g. +15555555555).
+ attr_accessor :to
+
+ # The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.
+ attr_accessor :from
+
+ # The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.
+ attr_accessor :transfer_caller_id
+
+ # The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).
+ attr_accessor :transfer_to
+
+ # The duration of the recording in ISO-8601 format
+ attr_accessor :duration
+
+ attr_accessor :direction
+
+ # Always `1` for conference recordings; multi-channel recordings are not supported on conferences.
+ attr_accessor :channels
+
+ # Time the call was started, in ISO 8601 format.
+ attr_accessor :start_time
+
+ # The time that the recording ended in ISO-8601 format
+ attr_accessor :end_time
+
+ attr_accessor :file_format
+
+ # The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.
+ attr_accessor :status
+
+ # The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.
+ attr_accessor :media_url
+
+ attr_accessor :transcription
+
+ class EnumAttributeValidator
+ attr_reader :datatype
+ attr_reader :allowable_values
+
+ def initialize(datatype, allowable_values)
+ @allowable_values = allowable_values.map do |value|
+ case datatype.to_s
+ when /Integer/i
+ value.to_i
+ when /Float/i
+ value.to_f
+ else
+ value
+ end
+ end
+ end
+
+ def valid?(value)
+ !value || allowable_values.include?(value)
+ end
+ end
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'application_id' => :'applicationId',
+ :'account_id' => :'accountId',
+ :'call_id' => :'callId',
+ :'parent_call_id' => :'parentCallId',
+ :'recording_id' => :'recordingId',
+ :'to' => :'to',
+ :'from' => :'from',
+ :'transfer_caller_id' => :'transferCallerId',
+ :'transfer_to' => :'transferTo',
+ :'duration' => :'duration',
+ :'direction' => :'direction',
+ :'channels' => :'channels',
+ :'start_time' => :'startTime',
+ :'end_time' => :'endTime',
+ :'file_format' => :'fileFormat',
+ :'status' => :'status',
+ :'media_url' => :'mediaUrl',
+ :'transcription' => :'transcription'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'application_id' => :'String',
+ :'account_id' => :'String',
+ :'call_id' => :'String',
+ :'parent_call_id' => :'String',
+ :'recording_id' => :'String',
+ :'to' => :'String',
+ :'from' => :'String',
+ :'transfer_caller_id' => :'String',
+ :'transfer_to' => :'String',
+ :'duration' => :'String',
+ :'direction' => :'CallDirectionEnum',
+ :'channels' => :'Integer',
+ :'start_time' => :'Time',
+ :'end_time' => :'Time',
+ :'file_format' => :'FileFormatEnum',
+ :'status' => :'String',
+ :'media_url' => :'String',
+ :'transcription' => :'TranscriptionMetadata'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ :'media_url',
+ :'transcription'
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CallRecordingMetadata` initialize method'
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CallRecordingMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'application_id')
+ self.application_id = attributes[:'application_id']
+ end
+
+ if attributes.key?(:'account_id')
+ self.account_id = attributes[:'account_id']
+ end
+
+ if attributes.key?(:'call_id')
+ self.call_id = attributes[:'call_id']
+ end
+
+ if attributes.key?(:'parent_call_id')
+ self.parent_call_id = attributes[:'parent_call_id']
+ end
+
+ if attributes.key?(:'recording_id')
+ self.recording_id = attributes[:'recording_id']
+ end
+
+ if attributes.key?(:'to')
+ self.to = attributes[:'to']
+ end
+
+ if attributes.key?(:'from')
+ self.from = attributes[:'from']
+ end
+
+ if attributes.key?(:'transfer_caller_id')
+ self.transfer_caller_id = attributes[:'transfer_caller_id']
+ end
+
+ if attributes.key?(:'transfer_to')
+ self.transfer_to = attributes[:'transfer_to']
+ end
+
+ if attributes.key?(:'duration')
+ self.duration = attributes[:'duration']
+ end
+
+ if attributes.key?(:'direction')
+ self.direction = attributes[:'direction']
+ end
+
+ if attributes.key?(:'channels')
+ self.channels = attributes[:'channels']
+ end
+
+ if attributes.key?(:'start_time')
+ self.start_time = attributes[:'start_time']
+ end
+
+ if attributes.key?(:'end_time')
+ self.end_time = attributes[:'end_time']
+ end
+
+ if attributes.key?(:'file_format')
+ self.file_format = attributes[:'file_format']
+ end
+
+ if attributes.key?(:'status')
+ self.status = attributes[:'status']
+ end
+
+ if attributes.key?(:'media_url')
+ self.media_url = attributes[:'media_url']
+ end
+
+ if attributes.key?(:'transcription')
+ self.transcription = attributes[:'transcription']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ application_id == o.application_id &&
+ account_id == o.account_id &&
+ call_id == o.call_id &&
+ parent_call_id == o.parent_call_id &&
+ recording_id == o.recording_id &&
+ to == o.to &&
+ from == o.from &&
+ transfer_caller_id == o.transfer_caller_id &&
+ transfer_to == o.transfer_to &&
+ duration == o.duration &&
+ direction == o.direction &&
+ channels == o.channels &&
+ start_time == o.start_time &&
+ end_time == o.end_time &&
+ file_format == o.file_format &&
+ status == o.status &&
+ media_url == o.media_url &&
+ transcription == o.transcription
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [application_id, account_id, call_id, parent_call_id, recording_id, to, from, transfer_caller_id, transfer_to, duration, direction, channels, start_time, end_time, file_format, status, media_url, transcription].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Bandwidth.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/call_state.rb b/lib/bandwidth-sdk/models/call_state.rb
new file mode 100644
index 00000000..e5e735cc
--- /dev/null
+++ b/lib/bandwidth-sdk/models/call_state.rb
@@ -0,0 +1,416 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ class CallState
+ # The application id associated with the call.
+ attr_accessor :application_id
+
+ # The account id associated with the call.
+ attr_accessor :account_id
+
+ # The programmable voice API call ID.
+ attr_accessor :call_id
+
+ # The A-leg call id, set only if this call is the B-leg of a [``](/docs/voice/bxml/transfer).
+ attr_accessor :parent_call_id
+
+ # The phone number that received the call, in E.164 format (e.g. +15555555555), or if the call was to a SIP URI, the SIP URI.
+ attr_accessor :to
+
+ # The phone number that made the call, in E.164 format (e.g. +15555555555).
+ attr_accessor :from
+
+ attr_accessor :direction
+
+ # The current state of the call. Current possible values are `queued`, `initiated`, `answered` and `disconnected`. Additional states may be added in the future, so your application must be tolerant of unknown values.
+ attr_accessor :state
+
+ # For inbound calls, the Bandwidth STIR/SHAKEN implementation will verify the information provided in the inbound invite request `Identity` header. The verification status is stored in the call state `stirShaken` property as follows. | Property | Description | |:------------------|:------------| | verstat | (optional) The verification status indicating whether the verification was successful or not. Possible values are `TN-Verification-Passed` or `TN-Verification-Failed`. | | attestationIndicator | (optional) The attestation level verified by Bandwidth. Possible values are `A` (full), `B` (partial) or `C` (gateway). | | originatingId | (optional) A unique origination identifier. | Note that these are common properties but that the `stirShaken` object is free form and can contain other key-value pairs. More information: [Understanding STIR/SHAKEN](https://www.bandwidth.com/regulations/stir-shaken).
+ attr_accessor :stir_shaken
+
+ # The value of the `Identity` header from the inbound invite request. Only present for inbound calls and if the account is configured to forward this header.
+ attr_accessor :identity
+
+ # The time this call was placed in queue.
+ attr_accessor :enqueued_time
+
+ # The time the call was initiated, in ISO 8601 format. `null` if the call is still in your queue.
+ attr_accessor :start_time
+
+ # Populated once the call has been answered, with the time in ISO 8601 format.
+ attr_accessor :answer_time
+
+ # Populated once the call has ended, with the time in ISO 8601 format.
+ attr_accessor :end_time
+
+ # | Cause | Description | |:------|:------------| | `hangup`| One party hung up the call, a [``](../../bxml/verbs/hangup.md) verb was executed, or there was no more BXML to execute; it indicates that the call ended normally. | | `busy` | Callee was busy. | | `timeout` | Call wasn't answered before the `callTimeout` was reached. | | `cancel` | Call was cancelled by its originator while it was ringing. | | `rejected` | Call was rejected by the callee. | | `callback-error` | BXML callback couldn't be delivered to your callback server. | | `invalid-bxml` | Invalid BXML was returned in response to a callback. | | `application-error` | An unsupported action was tried on the call, e.g. trying to play a .ogg audio. | | `account-limit` | Account rate limits were reached. | | `node-capacity-exceeded` | System maximum capacity was reached. | | `error` | Some error not described in any of the other causes happened on the call. | | `unknown` | Unknown error happened on the call. | Note: This list is not exhaustive and other values can appear in the future.
+ attr_accessor :disconnect_cause
+
+ # Populated only if the call ended with an error, with text explaining the reason.
+ attr_accessor :error_message
+
+ # Populated only if the call ended with an error, with a Bandwidth internal id that references the error event.
+ attr_accessor :error_id
+
+ # The last time the call had a state update, in ISO 8601 format.
+ attr_accessor :last_update
+
+ class EnumAttributeValidator
+ attr_reader :datatype
+ attr_reader :allowable_values
+
+ def initialize(datatype, allowable_values)
+ @allowable_values = allowable_values.map do |value|
+ case datatype.to_s
+ when /Integer/i
+ value.to_i
+ when /Float/i
+ value.to_f
+ else
+ value
+ end
+ end
+ end
+
+ def valid?(value)
+ !value || allowable_values.include?(value)
+ end
+ end
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'application_id' => :'applicationId',
+ :'account_id' => :'accountId',
+ :'call_id' => :'callId',
+ :'parent_call_id' => :'parentCallId',
+ :'to' => :'to',
+ :'from' => :'from',
+ :'direction' => :'direction',
+ :'state' => :'state',
+ :'stir_shaken' => :'stirShaken',
+ :'identity' => :'identity',
+ :'enqueued_time' => :'enqueuedTime',
+ :'start_time' => :'startTime',
+ :'answer_time' => :'answerTime',
+ :'end_time' => :'endTime',
+ :'disconnect_cause' => :'disconnectCause',
+ :'error_message' => :'errorMessage',
+ :'error_id' => :'errorId',
+ :'last_update' => :'lastUpdate'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'application_id' => :'String',
+ :'account_id' => :'String',
+ :'call_id' => :'String',
+ :'parent_call_id' => :'String',
+ :'to' => :'String',
+ :'from' => :'String',
+ :'direction' => :'CallDirectionEnum',
+ :'state' => :'String',
+ :'stir_shaken' => :'Hash',
+ :'identity' => :'String',
+ :'enqueued_time' => :'Time',
+ :'start_time' => :'Time',
+ :'answer_time' => :'Time',
+ :'end_time' => :'Time',
+ :'disconnect_cause' => :'String',
+ :'error_message' => :'String',
+ :'error_id' => :'String',
+ :'last_update' => :'Time'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ :'parent_call_id',
+ :'stir_shaken',
+ :'identity',
+ :'enqueued_time',
+ :'start_time',
+ :'answer_time',
+ :'end_time',
+ :'disconnect_cause',
+ :'error_message',
+ :'error_id',
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CallState` initialize method'
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CallState`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'application_id')
+ self.application_id = attributes[:'application_id']
+ end
+
+ if attributes.key?(:'account_id')
+ self.account_id = attributes[:'account_id']
+ end
+
+ if attributes.key?(:'call_id')
+ self.call_id = attributes[:'call_id']
+ end
+
+ if attributes.key?(:'parent_call_id')
+ self.parent_call_id = attributes[:'parent_call_id']
+ end
+
+ if attributes.key?(:'to')
+ self.to = attributes[:'to']
+ end
+
+ if attributes.key?(:'from')
+ self.from = attributes[:'from']
+ end
+
+ if attributes.key?(:'direction')
+ self.direction = attributes[:'direction']
+ end
+
+ if attributes.key?(:'state')
+ self.state = attributes[:'state']
+ end
+
+ if attributes.key?(:'stir_shaken')
+ if (value = attributes[:'stir_shaken']).is_a?(Hash)
+ self.stir_shaken = value
+ end
+ end
+
+ if attributes.key?(:'identity')
+ self.identity = attributes[:'identity']
+ end
+
+ if attributes.key?(:'enqueued_time')
+ self.enqueued_time = attributes[:'enqueued_time']
+ end
+
+ if attributes.key?(:'start_time')
+ self.start_time = attributes[:'start_time']
+ end
+
+ if attributes.key?(:'answer_time')
+ self.answer_time = attributes[:'answer_time']
+ end
+
+ if attributes.key?(:'end_time')
+ self.end_time = attributes[:'end_time']
+ end
+
+ if attributes.key?(:'disconnect_cause')
+ self.disconnect_cause = attributes[:'disconnect_cause']
+ end
+
+ if attributes.key?(:'error_message')
+ self.error_message = attributes[:'error_message']
+ end
+
+ if attributes.key?(:'error_id')
+ self.error_id = attributes[:'error_id']
+ end
+
+ if attributes.key?(:'last_update')
+ self.last_update = attributes[:'last_update']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ application_id == o.application_id &&
+ account_id == o.account_id &&
+ call_id == o.call_id &&
+ parent_call_id == o.parent_call_id &&
+ to == o.to &&
+ from == o.from &&
+ direction == o.direction &&
+ state == o.state &&
+ stir_shaken == o.stir_shaken &&
+ identity == o.identity &&
+ enqueued_time == o.enqueued_time &&
+ start_time == o.start_time &&
+ answer_time == o.answer_time &&
+ end_time == o.end_time &&
+ disconnect_cause == o.disconnect_cause &&
+ error_message == o.error_message &&
+ error_id == o.error_id &&
+ last_update == o.last_update
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [application_id, account_id, call_id, parent_call_id, to, from, direction, state, stir_shaken, identity, enqueued_time, start_time, answer_time, end_time, disconnect_cause, error_message, error_id, last_update].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Bandwidth.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/call_state_enum.rb b/lib/bandwidth-sdk/models/call_state_enum.rb
new file mode 100644
index 00000000..16f757f5
--- /dev/null
+++ b/lib/bandwidth-sdk/models/call_state_enum.rb
@@ -0,0 +1,40 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ class CallStateEnum
+ ACTIVE = 'active'.freeze
+ COMPLETED = 'completed'.freeze
+
+ def self.all_vars
+ @all_vars ||= [ACTIVE, COMPLETED].freeze
+ end
+
+ # Builds the enum from string
+ # @param [String] The enum value in the form of the string
+ # @return [String] The enum value
+ def self.build_from_hash(value)
+ new.build_from_hash(value)
+ end
+
+ # Builds the enum from string
+ # @param [String] The enum value in the form of the string
+ # @return [String] The enum value
+ def build_from_hash(value)
+ return value if CallStateEnum.all_vars.include?(value)
+ raise "Invalid ENUM value #{value} for class #CallStateEnum"
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/callback_method_enum.rb b/lib/bandwidth-sdk/models/callback_method_enum.rb
new file mode 100644
index 00000000..9face145
--- /dev/null
+++ b/lib/bandwidth-sdk/models/callback_method_enum.rb
@@ -0,0 +1,40 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ class CallbackMethodEnum
+ GET = 'GET'.freeze
+ POST = 'POST'.freeze
+
+ def self.all_vars
+ @all_vars ||= [GET, POST].freeze
+ end
+
+ # Builds the enum from string
+ # @param [String] The enum value in the form of the string
+ # @return [String] The enum value
+ def self.build_from_hash(value)
+ new.build_from_hash(value)
+ end
+
+ # Builds the enum from string
+ # @param [String] The enum value in the form of the string
+ # @return [String] The enum value
+ def build_from_hash(value)
+ return value if CallbackMethodEnum.all_vars.include?(value)
+ raise "Invalid ENUM value #{value} for class #CallbackMethodEnum"
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/code_request.rb b/lib/bandwidth-sdk/models/code_request.rb
new file mode 100644
index 00000000..c6501549
--- /dev/null
+++ b/lib/bandwidth-sdk/models/code_request.rb
@@ -0,0 +1,434 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ class CodeRequest
+ # The phone number to send the mfa code to.
+ attr_accessor :to
+
+ # The application phone number, the sender of the mfa code.
+ attr_accessor :from
+
+ # The application unique ID, obtained from Bandwidth.
+ attr_accessor :application_id
+
+ # An optional field to denote what scope or action the mfa code is addressing. If not supplied, defaults to \"2FA\".
+ attr_accessor :scope
+
+ # The message format of the mfa code. There are three values that the system will replace \"{CODE}\", \"{NAME}\", \"{SCOPE}\". The \"{SCOPE}\" and \"{NAME} value template are optional, while \"{CODE}\" must be supplied. As the name would suggest, code will be replace with the actual mfa code. Name is replaced with the application name, configured during provisioning of mfa. The scope value is the same value sent during the call and partitioned by the server.
+ attr_accessor :message
+
+ # The number of digits for your mfa code. The valid number ranges from 2 to 8, inclusively.
+ attr_accessor :digits
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'to' => :'to',
+ :'from' => :'from',
+ :'application_id' => :'applicationId',
+ :'scope' => :'scope',
+ :'message' => :'message',
+ :'digits' => :'digits'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'to' => :'String',
+ :'from' => :'String',
+ :'application_id' => :'String',
+ :'scope' => :'String',
+ :'message' => :'String',
+ :'digits' => :'Integer'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CodeRequest` initialize method'
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CodeRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'to')
+ self.to = attributes[:'to']
+ else
+ self.to = nil
+ end
+
+ if attributes.key?(:'from')
+ self.from = attributes[:'from']
+ else
+ self.from = nil
+ end
+
+ if attributes.key?(:'application_id')
+ self.application_id = attributes[:'application_id']
+ else
+ self.application_id = nil
+ end
+
+ if attributes.key?(:'scope')
+ self.scope = attributes[:'scope']
+ end
+
+ if attributes.key?(:'message')
+ self.message = attributes[:'message']
+ else
+ self.message = nil
+ end
+
+ if attributes.key?(:'digits')
+ self.digits = attributes[:'digits']
+ else
+ self.digits = nil
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ if @to.nil?
+ invalid_properties.push('invalid value for "to", to cannot be nil.')
+ end
+
+ pattern = Regexp.new(/^\+[1-9]\d{1,14}$/)
+ if @to !~ pattern
+ invalid_properties.push("invalid value for \"to\", must conform to the pattern #{pattern}.")
+ end
+
+ if @from.nil?
+ invalid_properties.push('invalid value for "from", from cannot be nil.')
+ end
+
+ if @from.to_s.length > 32
+ invalid_properties.push('invalid value for "from", the character length must be smaller than or equal to 32.')
+ end
+
+ pattern = Regexp.new(/^\+[1-9]\d{1,14}$/)
+ if @from !~ pattern
+ invalid_properties.push("invalid value for \"from\", must conform to the pattern #{pattern}.")
+ end
+
+ if @application_id.nil?
+ invalid_properties.push('invalid value for "application_id", application_id cannot be nil.')
+ end
+
+ if @application_id.to_s.length > 50
+ invalid_properties.push('invalid value for "application_id", the character length must be smaller than or equal to 50.')
+ end
+
+ if !@scope.nil? && @scope.to_s.length > 25
+ invalid_properties.push('invalid value for "scope", the character length must be smaller than or equal to 25.')
+ end
+
+ if @message.nil?
+ invalid_properties.push('invalid value for "message", message cannot be nil.')
+ end
+
+ if @message.to_s.length > 2048
+ invalid_properties.push('invalid value for "message", the character length must be smaller than or equal to 2048.')
+ end
+
+ if @digits.nil?
+ invalid_properties.push('invalid value for "digits", digits cannot be nil.')
+ end
+
+ if @digits > 8
+ invalid_properties.push('invalid value for "digits", must be smaller than or equal to 8.')
+ end
+
+ if @digits < 4
+ invalid_properties.push('invalid value for "digits", must be greater than or equal to 4.')
+ end
+
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ return false if @to.nil?
+ return false if @to !~ Regexp.new(/^\+[1-9]\d{1,14}$/)
+ return false if @from.nil?
+ return false if @from.to_s.length > 32
+ return false if @from !~ Regexp.new(/^\+[1-9]\d{1,14}$/)
+ return false if @application_id.nil?
+ return false if @application_id.to_s.length > 50
+ return false if !@scope.nil? && @scope.to_s.length > 25
+ return false if @message.nil?
+ return false if @message.to_s.length > 2048
+ return false if @digits.nil?
+ return false if @digits > 8
+ return false if @digits < 4
+ true
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] to Value to be assigned
+ def to=(to)
+ if to.nil?
+ fail ArgumentError, 'to cannot be nil'
+ end
+
+ pattern = Regexp.new(/^\+[1-9]\d{1,14}$/)
+ if to !~ pattern
+ fail ArgumentError, "invalid value for \"to\", must conform to the pattern #{pattern}."
+ end
+
+ @to = to
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] from Value to be assigned
+ def from=(from)
+ if from.nil?
+ fail ArgumentError, 'from cannot be nil'
+ end
+
+ if from.to_s.length > 32
+ fail ArgumentError, 'invalid value for "from", the character length must be smaller than or equal to 32.'
+ end
+
+ pattern = Regexp.new(/^\+[1-9]\d{1,14}$/)
+ if from !~ pattern
+ fail ArgumentError, "invalid value for \"from\", must conform to the pattern #{pattern}."
+ end
+
+ @from = from
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] application_id Value to be assigned
+ def application_id=(application_id)
+ if application_id.nil?
+ fail ArgumentError, 'application_id cannot be nil'
+ end
+
+ if application_id.to_s.length > 50
+ fail ArgumentError, 'invalid value for "application_id", the character length must be smaller than or equal to 50.'
+ end
+
+ @application_id = application_id
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] scope Value to be assigned
+ def scope=(scope)
+ if scope.nil?
+ fail ArgumentError, 'scope cannot be nil'
+ end
+
+ if scope.to_s.length > 25
+ fail ArgumentError, 'invalid value for "scope", the character length must be smaller than or equal to 25.'
+ end
+
+ @scope = scope
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] message Value to be assigned
+ def message=(message)
+ if message.nil?
+ fail ArgumentError, 'message cannot be nil'
+ end
+
+ if message.to_s.length > 2048
+ fail ArgumentError, 'invalid value for "message", the character length must be smaller than or equal to 2048.'
+ end
+
+ @message = message
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] digits Value to be assigned
+ def digits=(digits)
+ if digits.nil?
+ fail ArgumentError, 'digits cannot be nil'
+ end
+
+ if digits > 8
+ fail ArgumentError, 'invalid value for "digits", must be smaller than or equal to 8.'
+ end
+
+ if digits < 4
+ fail ArgumentError, 'invalid value for "digits", must be greater than or equal to 4.'
+ end
+
+ @digits = digits
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ to == o.to &&
+ from == o.from &&
+ application_id == o.application_id &&
+ scope == o.scope &&
+ message == o.message &&
+ digits == o.digits
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [to, from, application_id, scope, message, digits].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Bandwidth.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/conference.rb b/lib/bandwidth-sdk/models/conference.rb
new file mode 100644
index 00000000..1f239ef6
--- /dev/null
+++ b/lib/bandwidth-sdk/models/conference.rb
@@ -0,0 +1,313 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ class Conference
+ # The Bandwidth-generated conference ID.
+ attr_accessor :id
+
+ # The name of the conference, as specified by your application.
+ attr_accessor :name
+
+ # The time the conference was initiated, in ISO 8601 format.
+ attr_accessor :created_time
+
+ # The time the conference was terminated, in ISO 8601 format.
+ attr_accessor :completed_time
+
+ # The URL to send the conference-related events.
+ attr_accessor :conference_event_url
+
+ attr_accessor :conference_event_method
+
+ # The custom string attached to the conference that will be sent with callbacks.
+ attr_accessor :tag
+
+ # A list of active members of the conference. Omitted if this is a response to the [Get Conferences endpoint](/apis/voice#tag/Conferences/operation/listConferences).
+ attr_accessor :active_members
+
+ class EnumAttributeValidator
+ attr_reader :datatype
+ attr_reader :allowable_values
+
+ def initialize(datatype, allowable_values)
+ @allowable_values = allowable_values.map do |value|
+ case datatype.to_s
+ when /Integer/i
+ value.to_i
+ when /Float/i
+ value.to_f
+ else
+ value
+ end
+ end
+ end
+
+ def valid?(value)
+ !value || allowable_values.include?(value)
+ end
+ end
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'id' => :'id',
+ :'name' => :'name',
+ :'created_time' => :'createdTime',
+ :'completed_time' => :'completedTime',
+ :'conference_event_url' => :'conferenceEventUrl',
+ :'conference_event_method' => :'conferenceEventMethod',
+ :'tag' => :'tag',
+ :'active_members' => :'activeMembers'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'id' => :'String',
+ :'name' => :'String',
+ :'created_time' => :'Time',
+ :'completed_time' => :'Time',
+ :'conference_event_url' => :'String',
+ :'conference_event_method' => :'CallbackMethodEnum',
+ :'tag' => :'String',
+ :'active_members' => :'Array'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ :'completed_time',
+ :'conference_event_url',
+ :'conference_event_method',
+ :'tag',
+ :'active_members'
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::Conference` initialize method'
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Conference`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'id')
+ self.id = attributes[:'id']
+ end
+
+ if attributes.key?(:'name')
+ self.name = attributes[:'name']
+ end
+
+ if attributes.key?(:'created_time')
+ self.created_time = attributes[:'created_time']
+ end
+
+ if attributes.key?(:'completed_time')
+ self.completed_time = attributes[:'completed_time']
+ end
+
+ if attributes.key?(:'conference_event_url')
+ self.conference_event_url = attributes[:'conference_event_url']
+ end
+
+ if attributes.key?(:'conference_event_method')
+ self.conference_event_method = attributes[:'conference_event_method']
+ else
+ self.conference_event_method = 'POST'
+ end
+
+ if attributes.key?(:'tag')
+ self.tag = attributes[:'tag']
+ end
+
+ if attributes.key?(:'active_members')
+ if (value = attributes[:'active_members']).is_a?(Array)
+ self.active_members = value
+ end
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ id == o.id &&
+ name == o.name &&
+ created_time == o.created_time &&
+ completed_time == o.completed_time &&
+ conference_event_url == o.conference_event_url &&
+ conference_event_method == o.conference_event_method &&
+ tag == o.tag &&
+ active_members == o.active_members
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [id, name, created_time, completed_time, conference_event_url, conference_event_method, tag, active_members].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Bandwidth.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/conference_completed_callback.rb b/lib/bandwidth-sdk/models/conference_completed_callback.rb
new file mode 100644
index 00000000..8074fc50
--- /dev/null
+++ b/lib/bandwidth-sdk/models/conference_completed_callback.rb
@@ -0,0 +1,255 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ # The Conference Completed event is fired when the last member leaves the conference. The response to this event may not contain BXML.
+ class ConferenceCompletedCallback
+ # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.
+ attr_accessor :event_type
+
+ # The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.
+ attr_accessor :event_time
+
+ # The unique, Bandwidth-generated ID of the conference that was recorded
+ attr_accessor :conference_id
+
+ # The user-specified name of the conference that was recorded
+ attr_accessor :name
+
+ # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.
+ attr_accessor :tag
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'event_type' => :'eventType',
+ :'event_time' => :'eventTime',
+ :'conference_id' => :'conferenceId',
+ :'name' => :'name',
+ :'tag' => :'tag'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'event_type' => :'String',
+ :'event_time' => :'Time',
+ :'conference_id' => :'String',
+ :'name' => :'String',
+ :'tag' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ :'tag'
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::ConferenceCompletedCallback` initialize method'
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ConferenceCompletedCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'event_type')
+ self.event_type = attributes[:'event_type']
+ end
+
+ if attributes.key?(:'event_time')
+ self.event_time = attributes[:'event_time']
+ end
+
+ if attributes.key?(:'conference_id')
+ self.conference_id = attributes[:'conference_id']
+ end
+
+ if attributes.key?(:'name')
+ self.name = attributes[:'name']
+ end
+
+ if attributes.key?(:'tag')
+ self.tag = attributes[:'tag']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ event_type == o.event_type &&
+ event_time == o.event_time &&
+ conference_id == o.conference_id &&
+ name == o.name &&
+ tag == o.tag
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [event_type, event_time, conference_id, name, tag].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Bandwidth.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/conference_created_callback.rb b/lib/bandwidth-sdk/models/conference_created_callback.rb
new file mode 100644
index 00000000..7142732a
--- /dev/null
+++ b/lib/bandwidth-sdk/models/conference_created_callback.rb
@@ -0,0 +1,255 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ # The Conference Created event is fired whenever a new conference that specified a callbackUrl is created. The response may be either empty or a BXML document. Only the following verbs are valid for conferences: PlayAudio, SpeakSentence, StartRecording, StopRecording, PauseRecording, ResumeRecording. Audio verbs will be heard by all members of the conference. Recordings capture audio from all members who are not muted or on hold, as well as any audio verbs that are played into the conference.
+ class ConferenceCreatedCallback
+ # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.
+ attr_accessor :event_type
+
+ # The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.
+ attr_accessor :event_time
+
+ # The unique, Bandwidth-generated ID of the conference that was recorded
+ attr_accessor :conference_id
+
+ # The user-specified name of the conference that was recorded
+ attr_accessor :name
+
+ # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.
+ attr_accessor :tag
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'event_type' => :'eventType',
+ :'event_time' => :'eventTime',
+ :'conference_id' => :'conferenceId',
+ :'name' => :'name',
+ :'tag' => :'tag'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'event_type' => :'String',
+ :'event_time' => :'Time',
+ :'conference_id' => :'String',
+ :'name' => :'String',
+ :'tag' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ :'tag'
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::ConferenceCreatedCallback` initialize method'
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ConferenceCreatedCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'event_type')
+ self.event_type = attributes[:'event_type']
+ end
+
+ if attributes.key?(:'event_time')
+ self.event_time = attributes[:'event_time']
+ end
+
+ if attributes.key?(:'conference_id')
+ self.conference_id = attributes[:'conference_id']
+ end
+
+ if attributes.key?(:'name')
+ self.name = attributes[:'name']
+ end
+
+ if attributes.key?(:'tag')
+ self.tag = attributes[:'tag']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ event_type == o.event_type &&
+ event_time == o.event_time &&
+ conference_id == o.conference_id &&
+ name == o.name &&
+ tag == o.tag
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [event_type, event_time, conference_id, name, tag].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Bandwidth.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/conference_member.rb b/lib/bandwidth-sdk/models/conference_member.rb
new file mode 100644
index 00000000..ed5fe582
--- /dev/null
+++ b/lib/bandwidth-sdk/models/conference_member.rb
@@ -0,0 +1,266 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ class ConferenceMember
+ # The call id associated with the event.
+ attr_accessor :call_id
+
+ # The unique, Bandwidth-generated ID of the conference that was recorded
+ attr_accessor :conference_id
+
+ # A URL that may be used to retrieve information about or update the state of this conference member. This is the URL of this member's [Get Conference Member](/apis/voice/#operation/getConferenceMember) endpoint and [Modify Conference Member](/apis/voice/#operation/updateConferenceMember) endpoint.
+ attr_accessor :member_url
+
+ # Whether or not this member is currently muted. Members who are muted are still able to hear other participants. If used in a PUT request, updates this member's mute status. Has no effect if omitted.
+ attr_accessor :mute
+
+ # Whether or not this member is currently on hold. Members who are on hold are not able to hear or speak in the conference. If used in a PUT request, updates this member's hold status. Has no effect if omitted.
+ attr_accessor :hold
+
+ # If this member had a value set for `callIdsToCoach` in its [Conference](/docs/voice/bxml/conference) verb or this list was added with a previous PUT request to modify the member, this is that list of calls. If present in a PUT request, modifies the calls that this member is coaching. Has no effect if omitted. See the documentation for the [Conference](/docs/voice/bxml/conference) verb for more details about coaching. Note that this will not add the matching calls to the conference; each call must individually execute a Conference verb to join.
+ attr_accessor :call_ids_to_coach
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'call_id' => :'callId',
+ :'conference_id' => :'conferenceId',
+ :'member_url' => :'memberUrl',
+ :'mute' => :'mute',
+ :'hold' => :'hold',
+ :'call_ids_to_coach' => :'callIdsToCoach'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'call_id' => :'String',
+ :'conference_id' => :'String',
+ :'member_url' => :'String',
+ :'mute' => :'Boolean',
+ :'hold' => :'Boolean',
+ :'call_ids_to_coach' => :'Array'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ :'call_ids_to_coach'
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::ConferenceMember` initialize method'
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ConferenceMember`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'call_id')
+ self.call_id = attributes[:'call_id']
+ end
+
+ if attributes.key?(:'conference_id')
+ self.conference_id = attributes[:'conference_id']
+ end
+
+ if attributes.key?(:'member_url')
+ self.member_url = attributes[:'member_url']
+ end
+
+ if attributes.key?(:'mute')
+ self.mute = attributes[:'mute']
+ end
+
+ if attributes.key?(:'hold')
+ self.hold = attributes[:'hold']
+ end
+
+ if attributes.key?(:'call_ids_to_coach')
+ if (value = attributes[:'call_ids_to_coach']).is_a?(Array)
+ self.call_ids_to_coach = value
+ end
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ call_id == o.call_id &&
+ conference_id == o.conference_id &&
+ member_url == o.member_url &&
+ mute == o.mute &&
+ hold == o.hold &&
+ call_ids_to_coach == o.call_ids_to_coach
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [call_id, conference_id, member_url, mute, hold, call_ids_to_coach].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Bandwidth.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/conference_member_exit_callback.rb b/lib/bandwidth-sdk/models/conference_member_exit_callback.rb
new file mode 100644
index 00000000..a3e4a5d7
--- /dev/null
+++ b/lib/bandwidth-sdk/models/conference_member_exit_callback.rb
@@ -0,0 +1,285 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ # The Conference Member Exit event is fired whenever a caller exits a conference that specified a callbackUrl. The response may be either empty or a BXML document. Only the following verbs are valid for conferences: PlayAudio, SpeakSentence, StartRecording, StopRecording, PauseRecording, ResumeRecording. Audio verbs will be heard by all members of the conference. Recordings capture audio from all members who are not muted or on hold, as well as any audio verbs that are played into the conference.
+ class ConferenceMemberExitCallback
+ # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.
+ attr_accessor :event_type
+
+ # The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.
+ attr_accessor :event_time
+
+ # The unique, Bandwidth-generated ID of the conference that was recorded
+ attr_accessor :conference_id
+
+ # The user-specified name of the conference that was recorded
+ attr_accessor :name
+
+ # The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.
+ attr_accessor :from
+
+ # The phone number that received the call, in E.164 format (e.g. +15555555555).
+ attr_accessor :to
+
+ # The call id associated with the event.
+ attr_accessor :call_id
+
+ # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.
+ attr_accessor :tag
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'event_type' => :'eventType',
+ :'event_time' => :'eventTime',
+ :'conference_id' => :'conferenceId',
+ :'name' => :'name',
+ :'from' => :'from',
+ :'to' => :'to',
+ :'call_id' => :'callId',
+ :'tag' => :'tag'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'event_type' => :'String',
+ :'event_time' => :'Time',
+ :'conference_id' => :'String',
+ :'name' => :'String',
+ :'from' => :'String',
+ :'to' => :'String',
+ :'call_id' => :'String',
+ :'tag' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ :'tag'
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::ConferenceMemberExitCallback` initialize method'
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ConferenceMemberExitCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'event_type')
+ self.event_type = attributes[:'event_type']
+ end
+
+ if attributes.key?(:'event_time')
+ self.event_time = attributes[:'event_time']
+ end
+
+ if attributes.key?(:'conference_id')
+ self.conference_id = attributes[:'conference_id']
+ end
+
+ if attributes.key?(:'name')
+ self.name = attributes[:'name']
+ end
+
+ if attributes.key?(:'from')
+ self.from = attributes[:'from']
+ end
+
+ if attributes.key?(:'to')
+ self.to = attributes[:'to']
+ end
+
+ if attributes.key?(:'call_id')
+ self.call_id = attributes[:'call_id']
+ end
+
+ if attributes.key?(:'tag')
+ self.tag = attributes[:'tag']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ event_type == o.event_type &&
+ event_time == o.event_time &&
+ conference_id == o.conference_id &&
+ name == o.name &&
+ from == o.from &&
+ to == o.to &&
+ call_id == o.call_id &&
+ tag == o.tag
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [event_type, event_time, conference_id, name, from, to, call_id, tag].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Bandwidth.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/conference_member_join_callback.rb b/lib/bandwidth-sdk/models/conference_member_join_callback.rb
new file mode 100644
index 00000000..f8352171
--- /dev/null
+++ b/lib/bandwidth-sdk/models/conference_member_join_callback.rb
@@ -0,0 +1,285 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ # The Conference Member Join event is fired whenever a caller joins a conference that specified a callbackUrl. The response may be either empty or a BXML document. Only the following verbs are valid for conferences: PlayAudio, SpeakSentence, StartRecording, StopRecording, PauseRecording, ResumeRecording. Audio verbs will be heard by all members of the conference. Recordings capture audio from all members who are not muted or on hold, as well as any audio verbs that are played into the conference.
+ class ConferenceMemberJoinCallback
+ # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.
+ attr_accessor :event_type
+
+ # The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.
+ attr_accessor :event_time
+
+ # The unique, Bandwidth-generated ID of the conference that was recorded
+ attr_accessor :conference_id
+
+ # The user-specified name of the conference that was recorded
+ attr_accessor :name
+
+ # The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.
+ attr_accessor :from
+
+ # The phone number that received the call, in E.164 format (e.g. +15555555555).
+ attr_accessor :to
+
+ # The call id associated with the event.
+ attr_accessor :call_id
+
+ # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.
+ attr_accessor :tag
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'event_type' => :'eventType',
+ :'event_time' => :'eventTime',
+ :'conference_id' => :'conferenceId',
+ :'name' => :'name',
+ :'from' => :'from',
+ :'to' => :'to',
+ :'call_id' => :'callId',
+ :'tag' => :'tag'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'event_type' => :'String',
+ :'event_time' => :'Time',
+ :'conference_id' => :'String',
+ :'name' => :'String',
+ :'from' => :'String',
+ :'to' => :'String',
+ :'call_id' => :'String',
+ :'tag' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ :'tag'
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::ConferenceMemberJoinCallback` initialize method'
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ConferenceMemberJoinCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'event_type')
+ self.event_type = attributes[:'event_type']
+ end
+
+ if attributes.key?(:'event_time')
+ self.event_time = attributes[:'event_time']
+ end
+
+ if attributes.key?(:'conference_id')
+ self.conference_id = attributes[:'conference_id']
+ end
+
+ if attributes.key?(:'name')
+ self.name = attributes[:'name']
+ end
+
+ if attributes.key?(:'from')
+ self.from = attributes[:'from']
+ end
+
+ if attributes.key?(:'to')
+ self.to = attributes[:'to']
+ end
+
+ if attributes.key?(:'call_id')
+ self.call_id = attributes[:'call_id']
+ end
+
+ if attributes.key?(:'tag')
+ self.tag = attributes[:'tag']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ event_type == o.event_type &&
+ event_time == o.event_time &&
+ conference_id == o.conference_id &&
+ name == o.name &&
+ from == o.from &&
+ to == o.to &&
+ call_id == o.call_id &&
+ tag == o.tag
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [event_type, event_time, conference_id, name, from, to, call_id, tag].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Bandwidth.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/conference_recording_available_callback.rb b/lib/bandwidth-sdk/models/conference_recording_available_callback.rb
new file mode 100644
index 00000000..695007d1
--- /dev/null
+++ b/lib/bandwidth-sdk/models/conference_recording_available_callback.rb
@@ -0,0 +1,367 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ # The Conference Recording Available event is sent after a conference recording has been processed. It indicates that the recording is available for download.
+ class ConferenceRecordingAvailableCallback
+ # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.
+ attr_accessor :event_type
+
+ # The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.
+ attr_accessor :event_time
+
+ # The unique, Bandwidth-generated ID of the conference that was recorded
+ attr_accessor :conference_id
+
+ # The user-specified name of the conference that was recorded
+ attr_accessor :name
+
+ # The user account associated with the call.
+ attr_accessor :account_id
+
+ # The unique ID of this recording
+ attr_accessor :recording_id
+
+ # Always `1` for conference recordings; multi-channel recordings are not supported on conferences.
+ attr_accessor :channels
+
+ # Time the call was started, in ISO 8601 format.
+ attr_accessor :start_time
+
+ # The time that the recording ended in ISO-8601 format
+ attr_accessor :end_time
+
+ # The duration of the recording in ISO-8601 format
+ attr_accessor :duration
+
+ attr_accessor :file_format
+
+ # The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.
+ attr_accessor :media_url
+
+ # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.
+ attr_accessor :tag
+
+ # The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.
+ attr_accessor :status
+
+ class EnumAttributeValidator
+ attr_reader :datatype
+ attr_reader :allowable_values
+
+ def initialize(datatype, allowable_values)
+ @allowable_values = allowable_values.map do |value|
+ case datatype.to_s
+ when /Integer/i
+ value.to_i
+ when /Float/i
+ value.to_f
+ else
+ value
+ end
+ end
+ end
+
+ def valid?(value)
+ !value || allowable_values.include?(value)
+ end
+ end
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'event_type' => :'eventType',
+ :'event_time' => :'eventTime',
+ :'conference_id' => :'conferenceId',
+ :'name' => :'name',
+ :'account_id' => :'accountId',
+ :'recording_id' => :'recordingId',
+ :'channels' => :'channels',
+ :'start_time' => :'startTime',
+ :'end_time' => :'endTime',
+ :'duration' => :'duration',
+ :'file_format' => :'fileFormat',
+ :'media_url' => :'mediaUrl',
+ :'tag' => :'tag',
+ :'status' => :'status'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'event_type' => :'String',
+ :'event_time' => :'Time',
+ :'conference_id' => :'String',
+ :'name' => :'String',
+ :'account_id' => :'String',
+ :'recording_id' => :'String',
+ :'channels' => :'Integer',
+ :'start_time' => :'Time',
+ :'end_time' => :'Time',
+ :'duration' => :'String',
+ :'file_format' => :'FileFormatEnum',
+ :'media_url' => :'String',
+ :'tag' => :'String',
+ :'status' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ :'media_url',
+ :'tag',
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::ConferenceRecordingAvailableCallback` initialize method'
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ConferenceRecordingAvailableCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'event_type')
+ self.event_type = attributes[:'event_type']
+ end
+
+ if attributes.key?(:'event_time')
+ self.event_time = attributes[:'event_time']
+ end
+
+ if attributes.key?(:'conference_id')
+ self.conference_id = attributes[:'conference_id']
+ end
+
+ if attributes.key?(:'name')
+ self.name = attributes[:'name']
+ end
+
+ if attributes.key?(:'account_id')
+ self.account_id = attributes[:'account_id']
+ end
+
+ if attributes.key?(:'recording_id')
+ self.recording_id = attributes[:'recording_id']
+ end
+
+ if attributes.key?(:'channels')
+ self.channels = attributes[:'channels']
+ end
+
+ if attributes.key?(:'start_time')
+ self.start_time = attributes[:'start_time']
+ end
+
+ if attributes.key?(:'end_time')
+ self.end_time = attributes[:'end_time']
+ end
+
+ if attributes.key?(:'duration')
+ self.duration = attributes[:'duration']
+ end
+
+ if attributes.key?(:'file_format')
+ self.file_format = attributes[:'file_format']
+ end
+
+ if attributes.key?(:'media_url')
+ self.media_url = attributes[:'media_url']
+ end
+
+ if attributes.key?(:'tag')
+ self.tag = attributes[:'tag']
+ end
+
+ if attributes.key?(:'status')
+ self.status = attributes[:'status']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ event_type == o.event_type &&
+ event_time == o.event_time &&
+ conference_id == o.conference_id &&
+ name == o.name &&
+ account_id == o.account_id &&
+ recording_id == o.recording_id &&
+ channels == o.channels &&
+ start_time == o.start_time &&
+ end_time == o.end_time &&
+ duration == o.duration &&
+ file_format == o.file_format &&
+ media_url == o.media_url &&
+ tag == o.tag &&
+ status == o.status
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [event_type, event_time, conference_id, name, account_id, recording_id, channels, start_time, end_time, duration, file_format, media_url, tag, status].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Bandwidth.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/conference_recording_metadata.rb b/lib/bandwidth-sdk/models/conference_recording_metadata.rb
new file mode 100644
index 00000000..365d04b3
--- /dev/null
+++ b/lib/bandwidth-sdk/models/conference_recording_metadata.rb
@@ -0,0 +1,335 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ class ConferenceRecordingMetadata
+ # The user account associated with the call.
+ attr_accessor :account_id
+
+ # The unique, Bandwidth-generated ID of the conference that was recorded
+ attr_accessor :conference_id
+
+ # The user-specified name of the conference that was recorded
+ attr_accessor :name
+
+ # The unique ID of this recording
+ attr_accessor :recording_id
+
+ # The duration of the recording in ISO-8601 format
+ attr_accessor :duration
+
+ # Always `1` for conference recordings; multi-channel recordings are not supported on conferences.
+ attr_accessor :channels
+
+ # Time the call was started, in ISO 8601 format.
+ attr_accessor :start_time
+
+ # The time that the recording ended in ISO-8601 format
+ attr_accessor :end_time
+
+ attr_accessor :file_format
+
+ # The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.
+ attr_accessor :status
+
+ # The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.
+ attr_accessor :media_url
+
+ class EnumAttributeValidator
+ attr_reader :datatype
+ attr_reader :allowable_values
+
+ def initialize(datatype, allowable_values)
+ @allowable_values = allowable_values.map do |value|
+ case datatype.to_s
+ when /Integer/i
+ value.to_i
+ when /Float/i
+ value.to_f
+ else
+ value
+ end
+ end
+ end
+
+ def valid?(value)
+ !value || allowable_values.include?(value)
+ end
+ end
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'account_id' => :'accountId',
+ :'conference_id' => :'conferenceId',
+ :'name' => :'name',
+ :'recording_id' => :'recordingId',
+ :'duration' => :'duration',
+ :'channels' => :'channels',
+ :'start_time' => :'startTime',
+ :'end_time' => :'endTime',
+ :'file_format' => :'fileFormat',
+ :'status' => :'status',
+ :'media_url' => :'mediaUrl'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'account_id' => :'String',
+ :'conference_id' => :'String',
+ :'name' => :'String',
+ :'recording_id' => :'String',
+ :'duration' => :'String',
+ :'channels' => :'Integer',
+ :'start_time' => :'Time',
+ :'end_time' => :'Time',
+ :'file_format' => :'FileFormatEnum',
+ :'status' => :'String',
+ :'media_url' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ :'media_url'
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::ConferenceRecordingMetadata` initialize method'
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ConferenceRecordingMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'account_id')
+ self.account_id = attributes[:'account_id']
+ end
+
+ if attributes.key?(:'conference_id')
+ self.conference_id = attributes[:'conference_id']
+ end
+
+ if attributes.key?(:'name')
+ self.name = attributes[:'name']
+ end
+
+ if attributes.key?(:'recording_id')
+ self.recording_id = attributes[:'recording_id']
+ end
+
+ if attributes.key?(:'duration')
+ self.duration = attributes[:'duration']
+ end
+
+ if attributes.key?(:'channels')
+ self.channels = attributes[:'channels']
+ end
+
+ if attributes.key?(:'start_time')
+ self.start_time = attributes[:'start_time']
+ end
+
+ if attributes.key?(:'end_time')
+ self.end_time = attributes[:'end_time']
+ end
+
+ if attributes.key?(:'file_format')
+ self.file_format = attributes[:'file_format']
+ end
+
+ if attributes.key?(:'status')
+ self.status = attributes[:'status']
+ end
+
+ if attributes.key?(:'media_url')
+ self.media_url = attributes[:'media_url']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ account_id == o.account_id &&
+ conference_id == o.conference_id &&
+ name == o.name &&
+ recording_id == o.recording_id &&
+ duration == o.duration &&
+ channels == o.channels &&
+ start_time == o.start_time &&
+ end_time == o.end_time &&
+ file_format == o.file_format &&
+ status == o.status &&
+ media_url == o.media_url
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [account_id, conference_id, name, recording_id, duration, channels, start_time, end_time, file_format, status, media_url].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Bandwidth.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/conference_redirect_callback.rb b/lib/bandwidth-sdk/models/conference_redirect_callback.rb
new file mode 100644
index 00000000..a0252fc3
--- /dev/null
+++ b/lib/bandwidth-sdk/models/conference_redirect_callback.rb
@@ -0,0 +1,255 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ # The Conference Redirect event is fired whenever an existing conference is modified via a POST request made to the /conferences/{conferenceId} endpoint. The response may be either empty or a BXML document. Only the following verbs are valid for conferences: PlayAudio, SpeakSentence, StartRecording, StopRecording, PauseRecording, ResumeRecording. Audio verbs will be heard by all members of the conference. Recordings capture audio from all members who are not muted or on hold, as well as any audio verbs that are played into the conference.
+ class ConferenceRedirectCallback
+ # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.
+ attr_accessor :event_type
+
+ # The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.
+ attr_accessor :event_time
+
+ # The unique, Bandwidth-generated ID of the conference that was recorded
+ attr_accessor :conference_id
+
+ # The user-specified name of the conference that was recorded
+ attr_accessor :name
+
+ # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.
+ attr_accessor :tag
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'event_type' => :'eventType',
+ :'event_time' => :'eventTime',
+ :'conference_id' => :'conferenceId',
+ :'name' => :'name',
+ :'tag' => :'tag'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'event_type' => :'String',
+ :'event_time' => :'Time',
+ :'conference_id' => :'String',
+ :'name' => :'String',
+ :'tag' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ :'tag'
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::ConferenceRedirectCallback` initialize method'
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::ConferenceRedirectCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'event_type')
+ self.event_type = attributes[:'event_type']
+ end
+
+ if attributes.key?(:'event_time')
+ self.event_time = attributes[:'event_time']
+ end
+
+ if attributes.key?(:'conference_id')
+ self.conference_id = attributes[:'conference_id']
+ end
+
+ if attributes.key?(:'name')
+ self.name = attributes[:'name']
+ end
+
+ if attributes.key?(:'tag')
+ self.tag = attributes[:'tag']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ event_type == o.event_type &&
+ event_time == o.event_time &&
+ conference_id == o.conference_id &&
+ name == o.name &&
+ tag == o.tag
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [event_type, event_time, conference_id, name, tag].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Bandwidth.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/conference_state_enum.rb b/lib/bandwidth-sdk/models/conference_state_enum.rb
new file mode 100644
index 00000000..19b83f0f
--- /dev/null
+++ b/lib/bandwidth-sdk/models/conference_state_enum.rb
@@ -0,0 +1,40 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ class ConferenceStateEnum
+ ACTIVE = 'active'.freeze
+ COMPLETED = 'completed'.freeze
+
+ def self.all_vars
+ @all_vars ||= [ACTIVE, COMPLETED].freeze
+ end
+
+ # Builds the enum from string
+ # @param [String] The enum value in the form of the string
+ # @return [String] The enum value
+ def self.build_from_hash(value)
+ new.build_from_hash(value)
+ end
+
+ # Builds the enum from string
+ # @param [String] The enum value in the form of the string
+ # @return [String] The enum value
+ def build_from_hash(value)
+ return value if ConferenceStateEnum.all_vars.include?(value)
+ raise "Invalid ENUM value #{value} for class #ConferenceStateEnum"
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/create_call.rb b/lib/bandwidth-sdk/models/create_call.rb
new file mode 100644
index 00000000..70853754
--- /dev/null
+++ b/lib/bandwidth-sdk/models/create_call.rb
@@ -0,0 +1,687 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ class CreateCall
+ # The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.example`)).
+ attr_accessor :to
+
+ # A Bandwidth phone number on your account the call should come from (must be in E.164 format, like `+15555551212`, or be one of the following strings: `Restricted`, `Anonymous`, `Private`, or `Unavailable`).
+ attr_accessor :from
+
+ # The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines.
+ attr_accessor :display_name
+
+ # A comma-separated list of 'User-To-User' headers to be sent in the INVITE when calling a SIP URI. Each value must end with an 'encoding' parameter as described in RFC 7433. Only 'jwt' and 'base64' encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators.
+ attr_accessor :uui
+
+ # The id of the application associated with the `from` number.
+ attr_accessor :application_id
+
+ # The full URL to send the Answer event to when the called party answers. This endpoint should return the first BXML document to be executed in the call. Must use `https` if specifying `username` and `password`.
+ attr_accessor :answer_url
+
+ attr_accessor :answer_method
+
+ # Basic auth username.
+ attr_accessor :username
+
+ # Basic auth password.
+ attr_accessor :password
+
+ # A fallback url which, if provided, will be used to retry the `answer` webhook delivery in case `answerUrl` fails to respond Must use `https` if specifying `fallbackUsername` and `fallbackPassword`.
+ attr_accessor :answer_fallback_url
+
+ attr_accessor :answer_fallback_method
+
+ # Basic auth username.
+ attr_accessor :fallback_username
+
+ # Basic auth password.
+ attr_accessor :fallback_password
+
+ # The URL to send the Disconnect event to when the call ends. This event does not expect a BXML response.
+ attr_accessor :disconnect_url
+
+ attr_accessor :disconnect_method
+
+ # The timeout (in seconds) for the callee to answer the call after it starts ringing. If the call does not start ringing within 30s, the call will be cancelled regardless of this value. Can be any numeric value (including decimals) between 1 and 300.
+ attr_accessor :call_timeout
+
+ # This is the timeout (in seconds) to use when delivering webhooks for the call. Can be any numeric value (including decimals) between 1 and 25.
+ attr_accessor :callback_timeout
+
+ attr_accessor :machine_detection
+
+ # The priority of this call over other calls from your account. For example, if during a call your application needs to place a new call and bridge it with the current call, you might want to create the call with priority 1 so that it will be the next call picked off your queue, ahead of other less time sensitive calls. A lower value means higher priority, so a priority 1 call takes precedence over a priority 2 call.
+ attr_accessor :priority
+
+ # A custom string that will be sent with all webhooks for this call unless overwritten by a future `` verb or `tag` attribute on another verb, or cleared. May be cleared by setting `tag=\"\"` Max length 256 characters.
+ attr_accessor :tag
+
+ class EnumAttributeValidator
+ attr_reader :datatype
+ attr_reader :allowable_values
+
+ def initialize(datatype, allowable_values)
+ @allowable_values = allowable_values.map do |value|
+ case datatype.to_s
+ when /Integer/i
+ value.to_i
+ when /Float/i
+ value.to_f
+ else
+ value
+ end
+ end
+ end
+
+ def valid?(value)
+ !value || allowable_values.include?(value)
+ end
+ end
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'to' => :'to',
+ :'from' => :'from',
+ :'display_name' => :'displayName',
+ :'uui' => :'uui',
+ :'application_id' => :'applicationId',
+ :'answer_url' => :'answerUrl',
+ :'answer_method' => :'answerMethod',
+ :'username' => :'username',
+ :'password' => :'password',
+ :'answer_fallback_url' => :'answerFallbackUrl',
+ :'answer_fallback_method' => :'answerFallbackMethod',
+ :'fallback_username' => :'fallbackUsername',
+ :'fallback_password' => :'fallbackPassword',
+ :'disconnect_url' => :'disconnectUrl',
+ :'disconnect_method' => :'disconnectMethod',
+ :'call_timeout' => :'callTimeout',
+ :'callback_timeout' => :'callbackTimeout',
+ :'machine_detection' => :'machineDetection',
+ :'priority' => :'priority',
+ :'tag' => :'tag'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'to' => :'String',
+ :'from' => :'String',
+ :'display_name' => :'String',
+ :'uui' => :'String',
+ :'application_id' => :'String',
+ :'answer_url' => :'String',
+ :'answer_method' => :'CallbackMethodEnum',
+ :'username' => :'String',
+ :'password' => :'String',
+ :'answer_fallback_url' => :'String',
+ :'answer_fallback_method' => :'CallbackMethodEnum',
+ :'fallback_username' => :'String',
+ :'fallback_password' => :'String',
+ :'disconnect_url' => :'String',
+ :'disconnect_method' => :'CallbackMethodEnum',
+ :'call_timeout' => :'Float',
+ :'callback_timeout' => :'Float',
+ :'machine_detection' => :'MachineDetectionConfiguration',
+ :'priority' => :'Integer',
+ :'tag' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ :'display_name',
+ :'uui',
+ :'answer_method',
+ :'username',
+ :'password',
+ :'answer_fallback_url',
+ :'answer_fallback_method',
+ :'fallback_username',
+ :'fallback_password',
+ :'disconnect_url',
+ :'disconnect_method',
+ :'call_timeout',
+ :'callback_timeout',
+ :'priority',
+ :'tag'
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CreateCall` initialize method'
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateCall`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'to')
+ self.to = attributes[:'to']
+ else
+ self.to = nil
+ end
+
+ if attributes.key?(:'from')
+ self.from = attributes[:'from']
+ else
+ self.from = nil
+ end
+
+ if attributes.key?(:'display_name')
+ self.display_name = attributes[:'display_name']
+ end
+
+ if attributes.key?(:'uui')
+ self.uui = attributes[:'uui']
+ end
+
+ if attributes.key?(:'application_id')
+ self.application_id = attributes[:'application_id']
+ else
+ self.application_id = nil
+ end
+
+ if attributes.key?(:'answer_url')
+ self.answer_url = attributes[:'answer_url']
+ else
+ self.answer_url = nil
+ end
+
+ if attributes.key?(:'answer_method')
+ self.answer_method = attributes[:'answer_method']
+ else
+ self.answer_method = 'POST'
+ end
+
+ if attributes.key?(:'username')
+ self.username = attributes[:'username']
+ end
+
+ if attributes.key?(:'password')
+ self.password = attributes[:'password']
+ end
+
+ if attributes.key?(:'answer_fallback_url')
+ self.answer_fallback_url = attributes[:'answer_fallback_url']
+ end
+
+ if attributes.key?(:'answer_fallback_method')
+ self.answer_fallback_method = attributes[:'answer_fallback_method']
+ else
+ self.answer_fallback_method = 'POST'
+ end
+
+ if attributes.key?(:'fallback_username')
+ self.fallback_username = attributes[:'fallback_username']
+ end
+
+ if attributes.key?(:'fallback_password')
+ self.fallback_password = attributes[:'fallback_password']
+ end
+
+ if attributes.key?(:'disconnect_url')
+ self.disconnect_url = attributes[:'disconnect_url']
+ end
+
+ if attributes.key?(:'disconnect_method')
+ self.disconnect_method = attributes[:'disconnect_method']
+ else
+ self.disconnect_method = 'POST'
+ end
+
+ if attributes.key?(:'call_timeout')
+ self.call_timeout = attributes[:'call_timeout']
+ else
+ self.call_timeout = 30
+ end
+
+ if attributes.key?(:'callback_timeout')
+ self.callback_timeout = attributes[:'callback_timeout']
+ else
+ self.callback_timeout = 15
+ end
+
+ if attributes.key?(:'machine_detection')
+ self.machine_detection = attributes[:'machine_detection']
+ end
+
+ if attributes.key?(:'priority')
+ self.priority = attributes[:'priority']
+ else
+ self.priority = 5
+ end
+
+ if attributes.key?(:'tag')
+ self.tag = attributes[:'tag']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ if @to.nil?
+ invalid_properties.push('invalid value for "to", to cannot be nil.')
+ end
+
+ if @from.nil?
+ invalid_properties.push('invalid value for "from", from cannot be nil.')
+ end
+
+ if !@display_name.nil? && @display_name.to_s.length > 256
+ invalid_properties.push('invalid value for "display_name", the character length must be smaller than or equal to 256.')
+ end
+
+ if @application_id.nil?
+ invalid_properties.push('invalid value for "application_id", application_id cannot be nil.')
+ end
+
+ if @answer_url.nil?
+ invalid_properties.push('invalid value for "answer_url", answer_url cannot be nil.')
+ end
+
+ if @answer_url.to_s.length > 2048
+ invalid_properties.push('invalid value for "answer_url", the character length must be smaller than or equal to 2048.')
+ end
+
+ if !@username.nil? && @username.to_s.length > 1024
+ invalid_properties.push('invalid value for "username", the character length must be smaller than or equal to 1024.')
+ end
+
+ if !@password.nil? && @password.to_s.length > 1024
+ invalid_properties.push('invalid value for "password", the character length must be smaller than or equal to 1024.')
+ end
+
+ if !@answer_fallback_url.nil? && @answer_fallback_url.to_s.length > 2048
+ invalid_properties.push('invalid value for "answer_fallback_url", the character length must be smaller than or equal to 2048.')
+ end
+
+ if !@fallback_username.nil? && @fallback_username.to_s.length > 1024
+ invalid_properties.push('invalid value for "fallback_username", the character length must be smaller than or equal to 1024.')
+ end
+
+ if !@fallback_password.nil? && @fallback_password.to_s.length > 1024
+ invalid_properties.push('invalid value for "fallback_password", the character length must be smaller than or equal to 1024.')
+ end
+
+ if !@disconnect_url.nil? && @disconnect_url.to_s.length > 2048
+ invalid_properties.push('invalid value for "disconnect_url", the character length must be smaller than or equal to 2048.')
+ end
+
+ if !@call_timeout.nil? && @call_timeout > 300
+ invalid_properties.push('invalid value for "call_timeout", must be smaller than or equal to 300.')
+ end
+
+ if !@call_timeout.nil? && @call_timeout < 1
+ invalid_properties.push('invalid value for "call_timeout", must be greater than or equal to 1.')
+ end
+
+ if !@callback_timeout.nil? && @callback_timeout > 25
+ invalid_properties.push('invalid value for "callback_timeout", must be smaller than or equal to 25.')
+ end
+
+ if !@callback_timeout.nil? && @callback_timeout < 1
+ invalid_properties.push('invalid value for "callback_timeout", must be greater than or equal to 1.')
+ end
+
+ if !@priority.nil? && @priority > 5
+ invalid_properties.push('invalid value for "priority", must be smaller than or equal to 5.')
+ end
+
+ if !@priority.nil? && @priority < 1
+ invalid_properties.push('invalid value for "priority", must be greater than or equal to 1.')
+ end
+
+ if !@tag.nil? && @tag.to_s.length > 256
+ invalid_properties.push('invalid value for "tag", the character length must be smaller than or equal to 256.')
+ end
+
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ return false if @to.nil?
+ return false if @from.nil?
+ return false if !@display_name.nil? && @display_name.to_s.length > 256
+ return false if @application_id.nil?
+ return false if @answer_url.nil?
+ return false if @answer_url.to_s.length > 2048
+ return false if !@username.nil? && @username.to_s.length > 1024
+ return false if !@password.nil? && @password.to_s.length > 1024
+ return false if !@answer_fallback_url.nil? && @answer_fallback_url.to_s.length > 2048
+ return false if !@fallback_username.nil? && @fallback_username.to_s.length > 1024
+ return false if !@fallback_password.nil? && @fallback_password.to_s.length > 1024
+ return false if !@disconnect_url.nil? && @disconnect_url.to_s.length > 2048
+ return false if !@call_timeout.nil? && @call_timeout > 300
+ return false if !@call_timeout.nil? && @call_timeout < 1
+ return false if !@callback_timeout.nil? && @callback_timeout > 25
+ return false if !@callback_timeout.nil? && @callback_timeout < 1
+ return false if !@priority.nil? && @priority > 5
+ return false if !@priority.nil? && @priority < 1
+ return false if !@tag.nil? && @tag.to_s.length > 256
+ true
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] display_name Value to be assigned
+ def display_name=(display_name)
+ if !display_name.nil? && display_name.to_s.length > 256
+ fail ArgumentError, 'invalid value for "display_name", the character length must be smaller than or equal to 256.'
+ end
+
+ @display_name = display_name
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] answer_url Value to be assigned
+ def answer_url=(answer_url)
+ if answer_url.nil?
+ fail ArgumentError, 'answer_url cannot be nil'
+ end
+
+ if answer_url.to_s.length > 2048
+ fail ArgumentError, 'invalid value for "answer_url", the character length must be smaller than or equal to 2048.'
+ end
+
+ @answer_url = answer_url
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] username Value to be assigned
+ def username=(username)
+ if !username.nil? && username.to_s.length > 1024
+ fail ArgumentError, 'invalid value for "username", the character length must be smaller than or equal to 1024.'
+ end
+
+ @username = username
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] password Value to be assigned
+ def password=(password)
+ if !password.nil? && password.to_s.length > 1024
+ fail ArgumentError, 'invalid value for "password", the character length must be smaller than or equal to 1024.'
+ end
+
+ @password = password
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] answer_fallback_url Value to be assigned
+ def answer_fallback_url=(answer_fallback_url)
+ if !answer_fallback_url.nil? && answer_fallback_url.to_s.length > 2048
+ fail ArgumentError, 'invalid value for "answer_fallback_url", the character length must be smaller than or equal to 2048.'
+ end
+
+ @answer_fallback_url = answer_fallback_url
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] fallback_username Value to be assigned
+ def fallback_username=(fallback_username)
+ if !fallback_username.nil? && fallback_username.to_s.length > 1024
+ fail ArgumentError, 'invalid value for "fallback_username", the character length must be smaller than or equal to 1024.'
+ end
+
+ @fallback_username = fallback_username
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] fallback_password Value to be assigned
+ def fallback_password=(fallback_password)
+ if !fallback_password.nil? && fallback_password.to_s.length > 1024
+ fail ArgumentError, 'invalid value for "fallback_password", the character length must be smaller than or equal to 1024.'
+ end
+
+ @fallback_password = fallback_password
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] disconnect_url Value to be assigned
+ def disconnect_url=(disconnect_url)
+ if !disconnect_url.nil? && disconnect_url.to_s.length > 2048
+ fail ArgumentError, 'invalid value for "disconnect_url", the character length must be smaller than or equal to 2048.'
+ end
+
+ @disconnect_url = disconnect_url
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] call_timeout Value to be assigned
+ def call_timeout=(call_timeout)
+ if !call_timeout.nil? && call_timeout > 300
+ fail ArgumentError, 'invalid value for "call_timeout", must be smaller than or equal to 300.'
+ end
+
+ if !call_timeout.nil? && call_timeout < 1
+ fail ArgumentError, 'invalid value for "call_timeout", must be greater than or equal to 1.'
+ end
+
+ @call_timeout = call_timeout
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] callback_timeout Value to be assigned
+ def callback_timeout=(callback_timeout)
+ if !callback_timeout.nil? && callback_timeout > 25
+ fail ArgumentError, 'invalid value for "callback_timeout", must be smaller than or equal to 25.'
+ end
+
+ if !callback_timeout.nil? && callback_timeout < 1
+ fail ArgumentError, 'invalid value for "callback_timeout", must be greater than or equal to 1.'
+ end
+
+ @callback_timeout = callback_timeout
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] priority Value to be assigned
+ def priority=(priority)
+ if !priority.nil? && priority > 5
+ fail ArgumentError, 'invalid value for "priority", must be smaller than or equal to 5.'
+ end
+
+ if !priority.nil? && priority < 1
+ fail ArgumentError, 'invalid value for "priority", must be greater than or equal to 1.'
+ end
+
+ @priority = priority
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] tag Value to be assigned
+ def tag=(tag)
+ if !tag.nil? && tag.to_s.length > 256
+ fail ArgumentError, 'invalid value for "tag", the character length must be smaller than or equal to 256.'
+ end
+
+ @tag = tag
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ to == o.to &&
+ from == o.from &&
+ display_name == o.display_name &&
+ uui == o.uui &&
+ application_id == o.application_id &&
+ answer_url == o.answer_url &&
+ answer_method == o.answer_method &&
+ username == o.username &&
+ password == o.password &&
+ answer_fallback_url == o.answer_fallback_url &&
+ answer_fallback_method == o.answer_fallback_method &&
+ fallback_username == o.fallback_username &&
+ fallback_password == o.fallback_password &&
+ disconnect_url == o.disconnect_url &&
+ disconnect_method == o.disconnect_method &&
+ call_timeout == o.call_timeout &&
+ callback_timeout == o.callback_timeout &&
+ machine_detection == o.machine_detection &&
+ priority == o.priority &&
+ tag == o.tag
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [to, from, display_name, uui, application_id, answer_url, answer_method, username, password, answer_fallback_url, answer_fallback_method, fallback_username, fallback_password, disconnect_url, disconnect_method, call_timeout, callback_timeout, machine_detection, priority, tag].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Bandwidth.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/create_call_response.rb b/lib/bandwidth-sdk/models/create_call_response.rb
new file mode 100644
index 00000000..a93608fa
--- /dev/null
+++ b/lib/bandwidth-sdk/models/create_call_response.rb
@@ -0,0 +1,559 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ class CreateCallResponse
+ # The id of the application associated with the `from` number.
+ attr_accessor :application_id
+
+ # The bandwidth account ID associated with the call.
+ attr_accessor :account_id
+
+ # Programmable Voice API Call ID.
+ attr_accessor :call_id
+
+ # Recipient of the outgoing call.
+ attr_accessor :to
+
+ # Phone number that created the outbound call.
+ attr_accessor :from
+
+ # The time at which the call was accepted into the queue.
+ attr_accessor :enqueued_time
+
+ # The URL to update this call's state.
+ attr_accessor :call_url
+
+ # The timeout (in seconds) for the callee to answer the call after it starts ringing.
+ attr_accessor :call_timeout
+
+ # This is the timeout (in seconds) to use when delivering webhooks for the call.
+ attr_accessor :callback_timeout
+
+ # Custom tag value.
+ attr_accessor :tag
+
+ attr_accessor :answer_method
+
+ # URL to deliver the `answer` event webhook.
+ attr_accessor :answer_url
+
+ attr_accessor :answer_fallback_method
+
+ # Fallback URL to deliver the `answer` event webhook.
+ attr_accessor :answer_fallback_url
+
+ attr_accessor :disconnect_method
+
+ # URL to deliver the `disconnect` event webhook.
+ attr_accessor :disconnect_url
+
+ # Basic auth username.
+ attr_accessor :username
+
+ # Basic auth password.
+ attr_accessor :password
+
+ # Basic auth username.
+ attr_accessor :fallback_username
+
+ # Basic auth password.
+ attr_accessor :fallback_password
+
+ # The priority of this call over other calls from your account.
+ attr_accessor :priority
+
+ class EnumAttributeValidator
+ attr_reader :datatype
+ attr_reader :allowable_values
+
+ def initialize(datatype, allowable_values)
+ @allowable_values = allowable_values.map do |value|
+ case datatype.to_s
+ when /Integer/i
+ value.to_i
+ when /Float/i
+ value.to_f
+ else
+ value
+ end
+ end
+ end
+
+ def valid?(value)
+ !value || allowable_values.include?(value)
+ end
+ end
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'application_id' => :'applicationId',
+ :'account_id' => :'accountId',
+ :'call_id' => :'callId',
+ :'to' => :'to',
+ :'from' => :'from',
+ :'enqueued_time' => :'enqueuedTime',
+ :'call_url' => :'callUrl',
+ :'call_timeout' => :'callTimeout',
+ :'callback_timeout' => :'callbackTimeout',
+ :'tag' => :'tag',
+ :'answer_method' => :'answerMethod',
+ :'answer_url' => :'answerUrl',
+ :'answer_fallback_method' => :'answerFallbackMethod',
+ :'answer_fallback_url' => :'answerFallbackUrl',
+ :'disconnect_method' => :'disconnectMethod',
+ :'disconnect_url' => :'disconnectUrl',
+ :'username' => :'username',
+ :'password' => :'password',
+ :'fallback_username' => :'fallbackUsername',
+ :'fallback_password' => :'fallbackPassword',
+ :'priority' => :'priority'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'application_id' => :'String',
+ :'account_id' => :'String',
+ :'call_id' => :'String',
+ :'to' => :'String',
+ :'from' => :'String',
+ :'enqueued_time' => :'Time',
+ :'call_url' => :'String',
+ :'call_timeout' => :'Float',
+ :'callback_timeout' => :'Float',
+ :'tag' => :'String',
+ :'answer_method' => :'CallbackMethodEnum',
+ :'answer_url' => :'String',
+ :'answer_fallback_method' => :'CallbackMethodEnum',
+ :'answer_fallback_url' => :'String',
+ :'disconnect_method' => :'CallbackMethodEnum',
+ :'disconnect_url' => :'String',
+ :'username' => :'String',
+ :'password' => :'String',
+ :'fallback_username' => :'String',
+ :'fallback_password' => :'String',
+ :'priority' => :'Integer'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ :'enqueued_time',
+ :'tag',
+ :'answer_method',
+ :'answer_fallback_method',
+ :'answer_fallback_url',
+ :'disconnect_method',
+ :'disconnect_url',
+ :'username',
+ :'password',
+ :'fallback_username',
+ :'fallback_password',
+ :'priority'
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CreateCallResponse` initialize method'
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateCallResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'application_id')
+ self.application_id = attributes[:'application_id']
+ else
+ self.application_id = nil
+ end
+
+ if attributes.key?(:'account_id')
+ self.account_id = attributes[:'account_id']
+ else
+ self.account_id = nil
+ end
+
+ if attributes.key?(:'call_id')
+ self.call_id = attributes[:'call_id']
+ else
+ self.call_id = nil
+ end
+
+ if attributes.key?(:'to')
+ self.to = attributes[:'to']
+ else
+ self.to = nil
+ end
+
+ if attributes.key?(:'from')
+ self.from = attributes[:'from']
+ else
+ self.from = nil
+ end
+
+ if attributes.key?(:'enqueued_time')
+ self.enqueued_time = attributes[:'enqueued_time']
+ end
+
+ if attributes.key?(:'call_url')
+ self.call_url = attributes[:'call_url']
+ else
+ self.call_url = nil
+ end
+
+ if attributes.key?(:'call_timeout')
+ self.call_timeout = attributes[:'call_timeout']
+ end
+
+ if attributes.key?(:'callback_timeout')
+ self.callback_timeout = attributes[:'callback_timeout']
+ end
+
+ if attributes.key?(:'tag')
+ self.tag = attributes[:'tag']
+ end
+
+ if attributes.key?(:'answer_method')
+ self.answer_method = attributes[:'answer_method']
+ else
+ self.answer_method = 'POST'
+ end
+
+ if attributes.key?(:'answer_url')
+ self.answer_url = attributes[:'answer_url']
+ else
+ self.answer_url = nil
+ end
+
+ if attributes.key?(:'answer_fallback_method')
+ self.answer_fallback_method = attributes[:'answer_fallback_method']
+ else
+ self.answer_fallback_method = 'POST'
+ end
+
+ if attributes.key?(:'answer_fallback_url')
+ self.answer_fallback_url = attributes[:'answer_fallback_url']
+ end
+
+ if attributes.key?(:'disconnect_method')
+ self.disconnect_method = attributes[:'disconnect_method']
+ else
+ self.disconnect_method = 'POST'
+ end
+
+ if attributes.key?(:'disconnect_url')
+ self.disconnect_url = attributes[:'disconnect_url']
+ end
+
+ if attributes.key?(:'username')
+ self.username = attributes[:'username']
+ end
+
+ if attributes.key?(:'password')
+ self.password = attributes[:'password']
+ end
+
+ if attributes.key?(:'fallback_username')
+ self.fallback_username = attributes[:'fallback_username']
+ end
+
+ if attributes.key?(:'fallback_password')
+ self.fallback_password = attributes[:'fallback_password']
+ end
+
+ if attributes.key?(:'priority')
+ self.priority = attributes[:'priority']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ if @application_id.nil?
+ invalid_properties.push('invalid value for "application_id", application_id cannot be nil.')
+ end
+
+ if @account_id.nil?
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
+ end
+
+ if @call_id.nil?
+ invalid_properties.push('invalid value for "call_id", call_id cannot be nil.')
+ end
+
+ if @to.nil?
+ invalid_properties.push('invalid value for "to", to cannot be nil.')
+ end
+
+ if @from.nil?
+ invalid_properties.push('invalid value for "from", from cannot be nil.')
+ end
+
+ if @call_url.nil?
+ invalid_properties.push('invalid value for "call_url", call_url cannot be nil.')
+ end
+
+ if @answer_url.nil?
+ invalid_properties.push('invalid value for "answer_url", answer_url cannot be nil.')
+ end
+
+ if !@username.nil? && @username.to_s.length > 1024
+ invalid_properties.push('invalid value for "username", the character length must be smaller than or equal to 1024.')
+ end
+
+ if !@password.nil? && @password.to_s.length > 1024
+ invalid_properties.push('invalid value for "password", the character length must be smaller than or equal to 1024.')
+ end
+
+ if !@fallback_username.nil? && @fallback_username.to_s.length > 1024
+ invalid_properties.push('invalid value for "fallback_username", the character length must be smaller than or equal to 1024.')
+ end
+
+ if !@fallback_password.nil? && @fallback_password.to_s.length > 1024
+ invalid_properties.push('invalid value for "fallback_password", the character length must be smaller than or equal to 1024.')
+ end
+
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ return false if @application_id.nil?
+ return false if @account_id.nil?
+ return false if @call_id.nil?
+ return false if @to.nil?
+ return false if @from.nil?
+ return false if @call_url.nil?
+ return false if @answer_url.nil?
+ return false if !@username.nil? && @username.to_s.length > 1024
+ return false if !@password.nil? && @password.to_s.length > 1024
+ return false if !@fallback_username.nil? && @fallback_username.to_s.length > 1024
+ return false if !@fallback_password.nil? && @fallback_password.to_s.length > 1024
+ true
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] username Value to be assigned
+ def username=(username)
+ if !username.nil? && username.to_s.length > 1024
+ fail ArgumentError, 'invalid value for "username", the character length must be smaller than or equal to 1024.'
+ end
+
+ @username = username
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] password Value to be assigned
+ def password=(password)
+ if !password.nil? && password.to_s.length > 1024
+ fail ArgumentError, 'invalid value for "password", the character length must be smaller than or equal to 1024.'
+ end
+
+ @password = password
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] fallback_username Value to be assigned
+ def fallback_username=(fallback_username)
+ if !fallback_username.nil? && fallback_username.to_s.length > 1024
+ fail ArgumentError, 'invalid value for "fallback_username", the character length must be smaller than or equal to 1024.'
+ end
+
+ @fallback_username = fallback_username
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] fallback_password Value to be assigned
+ def fallback_password=(fallback_password)
+ if !fallback_password.nil? && fallback_password.to_s.length > 1024
+ fail ArgumentError, 'invalid value for "fallback_password", the character length must be smaller than or equal to 1024.'
+ end
+
+ @fallback_password = fallback_password
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ application_id == o.application_id &&
+ account_id == o.account_id &&
+ call_id == o.call_id &&
+ to == o.to &&
+ from == o.from &&
+ enqueued_time == o.enqueued_time &&
+ call_url == o.call_url &&
+ call_timeout == o.call_timeout &&
+ callback_timeout == o.callback_timeout &&
+ tag == o.tag &&
+ answer_method == o.answer_method &&
+ answer_url == o.answer_url &&
+ answer_fallback_method == o.answer_fallback_method &&
+ answer_fallback_url == o.answer_fallback_url &&
+ disconnect_method == o.disconnect_method &&
+ disconnect_url == o.disconnect_url &&
+ username == o.username &&
+ password == o.password &&
+ fallback_username == o.fallback_username &&
+ fallback_password == o.fallback_password &&
+ priority == o.priority
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [application_id, account_id, call_id, to, from, enqueued_time, call_url, call_timeout, callback_timeout, tag, answer_method, answer_url, answer_fallback_method, answer_fallback_url, disconnect_method, disconnect_url, username, password, fallback_username, fallback_password, priority].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Bandwidth.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/create_lookup_response.rb b/lib/bandwidth-sdk/models/create_lookup_response.rb
new file mode 100644
index 00000000..ce6f0892
--- /dev/null
+++ b/lib/bandwidth-sdk/models/create_lookup_response.rb
@@ -0,0 +1,245 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ # The request has been accepted for processing but not yet finished and in a terminal state (COMPLETE, PARTIAL_COMPLETE, or FAILED).
+ class CreateLookupResponse
+ # The phone number lookup request ID from Bandwidth.
+ attr_accessor :request_id
+
+ attr_accessor :status
+
+ class EnumAttributeValidator
+ attr_reader :datatype
+ attr_reader :allowable_values
+
+ def initialize(datatype, allowable_values)
+ @allowable_values = allowable_values.map do |value|
+ case datatype.to_s
+ when /Integer/i
+ value.to_i
+ when /Float/i
+ value.to_f
+ else
+ value
+ end
+ end
+ end
+
+ def valid?(value)
+ !value || allowable_values.include?(value)
+ end
+ end
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'request_id' => :'requestId',
+ :'status' => :'status'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'request_id' => :'String',
+ :'status' => :'LookupStatusEnum'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CreateLookupResponse` initialize method'
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateLookupResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'request_id')
+ self.request_id = attributes[:'request_id']
+ end
+
+ if attributes.key?(:'status')
+ self.status = attributes[:'status']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ request_id == o.request_id &&
+ status == o.status
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [request_id, status].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Bandwidth.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/create_message_request_error.rb b/lib/bandwidth-sdk/models/create_message_request_error.rb
new file mode 100644
index 00000000..10dd2032
--- /dev/null
+++ b/lib/bandwidth-sdk/models/create_message_request_error.rb
@@ -0,0 +1,246 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ class CreateMessageRequestError
+ attr_accessor :type
+
+ attr_accessor :description
+
+ attr_accessor :field_errors
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'type' => :'type',
+ :'description' => :'description',
+ :'field_errors' => :'fieldErrors'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'type' => :'String',
+ :'description' => :'String',
+ :'field_errors' => :'Array'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CreateMessageRequestError` initialize method'
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CreateMessageRequestError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'type')
+ self.type = attributes[:'type']
+ else
+ self.type = nil
+ end
+
+ if attributes.key?(:'description')
+ self.description = attributes[:'description']
+ else
+ self.description = nil
+ end
+
+ if attributes.key?(:'field_errors')
+ if (value = attributes[:'field_errors']).is_a?(Array)
+ self.field_errors = value
+ end
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ if @type.nil?
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
+ end
+
+ if @description.nil?
+ invalid_properties.push('invalid value for "description", description cannot be nil.')
+ end
+
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ return false if @type.nil?
+ return false if @description.nil?
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ type == o.type &&
+ description == o.description &&
+ field_errors == o.field_errors
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [type, description, field_errors].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Bandwidth.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/deferred_result.rb b/lib/bandwidth-sdk/models/deferred_result.rb
new file mode 100644
index 00000000..9aa5a732
--- /dev/null
+++ b/lib/bandwidth-sdk/models/deferred_result.rb
@@ -0,0 +1,221 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ class DeferredResult
+ attr_accessor :result
+
+ attr_accessor :set_or_expired
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'result' => :'result',
+ :'set_or_expired' => :'setOrExpired'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'result' => :'Object',
+ :'set_or_expired' => :'Boolean'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::DeferredResult` initialize method'
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::DeferredResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'result')
+ self.result = attributes[:'result']
+ end
+
+ if attributes.key?(:'set_or_expired')
+ self.set_or_expired = attributes[:'set_or_expired']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ result == o.result &&
+ set_or_expired == o.set_or_expired
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [result, set_or_expired].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Bandwidth.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/disconenct_callback.rb b/lib/bandwidth-sdk/models/disconenct_callback.rb
new file mode 100644
index 00000000..b6b16e44
--- /dev/null
+++ b/lib/bandwidth-sdk/models/disconenct_callback.rb
@@ -0,0 +1,405 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 6.3.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ # The Disconnect event is fired when a call ends, for any reason.
+ class DisconenctCallback
+ # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.
+ attr_accessor :event_type
+
+ # The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.
+ attr_accessor :event_time
+
+ # The user account associated with the call.
+ attr_accessor :account_id
+
+ # The id of the application associated with the call.
+ attr_accessor :application_id
+
+ # The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.
+ attr_accessor :from
+
+ # The phone number that received the call, in E.164 format (e.g. +15555555555).
+ attr_accessor :to
+
+ # The call id associated with the event.
+ attr_accessor :call_id
+
+ attr_accessor :direction
+
+ # The URL of the call associated with the event.
+ attr_accessor :call_url
+
+ # (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.
+ attr_accessor :enqueued_time
+
+ # Time the call was started, in ISO 8601 format.
+ attr_accessor :start_time
+
+ # Time the call was answered, in ISO 8601 format.
+ attr_accessor :answer_time
+
+ # The time that the recording ended in ISO-8601 format
+ attr_accessor :end_time
+
+ # Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown.
+ attr_accessor :cause
+
+ # Text explaining the reason that caused the call to fail in case of errors.
+ attr_accessor :error_message
+
+ # Bandwidth's internal id that references the error event.
+ attr_accessor :error_id
+
+ # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.
+ attr_accessor :tag
+
+ class EnumAttributeValidator
+ attr_reader :datatype
+ attr_reader :allowable_values
+
+ def initialize(datatype, allowable_values)
+ @allowable_values = allowable_values.map do |value|
+ case datatype.to_s
+ when /Integer/i
+ value.to_i
+ when /Float/i
+ value.to_f
+ else
+ value
+ end
+ end
+ end
+
+ def valid?(value)
+ !value || allowable_values.include?(value)
+ end
+ end
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'event_type' => :'eventType',
+ :'event_time' => :'eventTime',
+ :'account_id' => :'accountId',
+ :'application_id' => :'applicationId',
+ :'from' => :'from',
+ :'to' => :'to',
+ :'call_id' => :'callId',
+ :'direction' => :'direction',
+ :'call_url' => :'callUrl',
+ :'enqueued_time' => :'enqueuedTime',
+ :'start_time' => :'startTime',
+ :'answer_time' => :'answerTime',
+ :'end_time' => :'endTime',
+ :'cause' => :'cause',
+ :'error_message' => :'errorMessage',
+ :'error_id' => :'errorId',
+ :'tag' => :'tag'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'event_type' => :'String',
+ :'event_time' => :'String',
+ :'account_id' => :'String',
+ :'application_id' => :'String',
+ :'from' => :'String',
+ :'to' => :'String',
+ :'call_id' => :'String',
+ :'direction' => :'CallDirectionEnum',
+ :'call_url' => :'String',
+ :'enqueued_time' => :'Time',
+ :'start_time' => :'Time',
+ :'answer_time' => :'Time',
+ :'end_time' => :'Time',
+ :'cause' => :'String',
+ :'error_message' => :'String',
+ :'error_id' => :'String',
+ :'tag' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ :'enqueued_time',
+ :'answer_time',
+ :'error_message',
+ :'error_id',
+ :'tag'
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::DisconenctCallback` initialize method'
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::DisconenctCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'event_type')
+ self.event_type = attributes[:'event_type']
+ end
+
+ if attributes.key?(:'event_time')
+ self.event_time = attributes[:'event_time']
+ end
+
+ if attributes.key?(:'account_id')
+ self.account_id = attributes[:'account_id']
+ end
+
+ if attributes.key?(:'application_id')
+ self.application_id = attributes[:'application_id']
+ end
+
+ if attributes.key?(:'from')
+ self.from = attributes[:'from']
+ end
+
+ if attributes.key?(:'to')
+ self.to = attributes[:'to']
+ end
+
+ if attributes.key?(:'call_id')
+ self.call_id = attributes[:'call_id']
+ end
+
+ if attributes.key?(:'direction')
+ self.direction = attributes[:'direction']
+ end
+
+ if attributes.key?(:'call_url')
+ self.call_url = attributes[:'call_url']
+ end
+
+ if attributes.key?(:'enqueued_time')
+ self.enqueued_time = attributes[:'enqueued_time']
+ end
+
+ if attributes.key?(:'start_time')
+ self.start_time = attributes[:'start_time']
+ end
+
+ if attributes.key?(:'answer_time')
+ self.answer_time = attributes[:'answer_time']
+ end
+
+ if attributes.key?(:'end_time')
+ self.end_time = attributes[:'end_time']
+ end
+
+ if attributes.key?(:'cause')
+ self.cause = attributes[:'cause']
+ end
+
+ if attributes.key?(:'error_message')
+ self.error_message = attributes[:'error_message']
+ end
+
+ if attributes.key?(:'error_id')
+ self.error_id = attributes[:'error_id']
+ end
+
+ if attributes.key?(:'tag')
+ self.tag = attributes[:'tag']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ event_type == o.event_type &&
+ event_time == o.event_time &&
+ account_id == o.account_id &&
+ application_id == o.application_id &&
+ from == o.from &&
+ to == o.to &&
+ call_id == o.call_id &&
+ direction == o.direction &&
+ call_url == o.call_url &&
+ enqueued_time == o.enqueued_time &&
+ start_time == o.start_time &&
+ answer_time == o.answer_time &&
+ end_time == o.end_time &&
+ cause == o.cause &&
+ error_message == o.error_message &&
+ error_id == o.error_id &&
+ tag == o.tag
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [event_type, event_time, account_id, application_id, from, to, call_id, direction, call_url, enqueued_time, start_time, answer_time, end_time, cause, error_message, error_id, tag].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ new.build_from_hash(attributes)
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ self.class.openapi_types.each_pair do |key, type|
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
+ self.send("#{key}=", nil)
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
+ end
+ elsif !attributes[self.class.attribute_map[key]].nil?
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
+ end
+ end
+
+ self
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def _deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Bandwidth.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/disconnect_callback.rb b/lib/bandwidth-sdk/models/disconnect_callback.rb
new file mode 100644
index 00000000..9363c0f9
--- /dev/null
+++ b/lib/bandwidth-sdk/models/disconnect_callback.rb
@@ -0,0 +1,400 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ # The Disconnect event is fired when a call ends, for any reason.
+ class DisconnectCallback
+ # The event type, value can be one of the following: answer, bridgeComplete, bridgeTargetComplete, conferenceCreated, conferenceRedirect, conferenceMemberJoin, conferenceMemberExit, conferenceCompleted, conferenceRecordingAvailable, disconnect, dtmf, gather, initiate, machineDetectionComplete, recordingComplete, recordingAvailable, redirect, transcriptionAvailable, transferAnswer, transferComplete, transferDisconnect.
+ attr_accessor :event_type
+
+ # The approximate UTC date and time when the event was generated by the Bandwidth server, in ISO 8601 format. This may not be exactly the time of event execution.
+ attr_accessor :event_time
+
+ # The user account associated with the call.
+ attr_accessor :account_id
+
+ # The id of the application associated with the call.
+ attr_accessor :application_id
+
+ # The provided identifier of the caller: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.
+ attr_accessor :from
+
+ # The phone number that received the call, in E.164 format (e.g. +15555555555).
+ attr_accessor :to
+
+ # The call id associated with the event.
+ attr_accessor :call_id
+
+ attr_accessor :direction
+
+ # The URL of the call associated with the event.
+ attr_accessor :call_url
+
+ # (optional) If call queueing is enabled and this is an outbound call, time the call was queued, in ISO 8601 format.
+ attr_accessor :enqueued_time
+
+ # Time the call was started, in ISO 8601 format.
+ attr_accessor :start_time
+
+ # Time the call was answered, in ISO 8601 format.
+ attr_accessor :answer_time
+
+ # The time that the recording ended in ISO-8601 format
+ attr_accessor :end_time
+
+ # Reason the call failed - hangup, busy, timeout, cancel, rejected, callback-error, invalid-bxml, application-error, account-limit, node-capacity-exceeded, error, or unknown.
+ attr_accessor :cause
+
+ # Text explaining the reason that caused the call to fail in case of errors.
+ attr_accessor :error_message
+
+ # Bandwidth's internal id that references the error event.
+ attr_accessor :error_id
+
+ # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.
+ attr_accessor :tag
+
+ class EnumAttributeValidator
+ attr_reader :datatype
+ attr_reader :allowable_values
+
+ def initialize(datatype, allowable_values)
+ @allowable_values = allowable_values.map do |value|
+ case datatype.to_s
+ when /Integer/i
+ value.to_i
+ when /Float/i
+ value.to_f
+ else
+ value
+ end
+ end
+ end
+
+ def valid?(value)
+ !value || allowable_values.include?(value)
+ end
+ end
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'event_type' => :'eventType',
+ :'event_time' => :'eventTime',
+ :'account_id' => :'accountId',
+ :'application_id' => :'applicationId',
+ :'from' => :'from',
+ :'to' => :'to',
+ :'call_id' => :'callId',
+ :'direction' => :'direction',
+ :'call_url' => :'callUrl',
+ :'enqueued_time' => :'enqueuedTime',
+ :'start_time' => :'startTime',
+ :'answer_time' => :'answerTime',
+ :'end_time' => :'endTime',
+ :'cause' => :'cause',
+ :'error_message' => :'errorMessage',
+ :'error_id' => :'errorId',
+ :'tag' => :'tag'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'event_type' => :'String',
+ :'event_time' => :'Time',
+ :'account_id' => :'String',
+ :'application_id' => :'String',
+ :'from' => :'String',
+ :'to' => :'String',
+ :'call_id' => :'String',
+ :'direction' => :'CallDirectionEnum',
+ :'call_url' => :'String',
+ :'enqueued_time' => :'Time',
+ :'start_time' => :'Time',
+ :'answer_time' => :'Time',
+ :'end_time' => :'Time',
+ :'cause' => :'String',
+ :'error_message' => :'String',
+ :'error_id' => :'String',
+ :'tag' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ :'enqueued_time',
+ :'answer_time',
+ :'error_message',
+ :'error_id',
+ :'tag'
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::DisconnectCallback` initialize method'
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::DisconnectCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'event_type')
+ self.event_type = attributes[:'event_type']
+ end
+
+ if attributes.key?(:'event_time')
+ self.event_time = attributes[:'event_time']
+ end
+
+ if attributes.key?(:'account_id')
+ self.account_id = attributes[:'account_id']
+ end
+
+ if attributes.key?(:'application_id')
+ self.application_id = attributes[:'application_id']
+ end
+
+ if attributes.key?(:'from')
+ self.from = attributes[:'from']
+ end
+
+ if attributes.key?(:'to')
+ self.to = attributes[:'to']
+ end
+
+ if attributes.key?(:'call_id')
+ self.call_id = attributes[:'call_id']
+ end
+
+ if attributes.key?(:'direction')
+ self.direction = attributes[:'direction']
+ end
+
+ if attributes.key?(:'call_url')
+ self.call_url = attributes[:'call_url']
+ end
+
+ if attributes.key?(:'enqueued_time')
+ self.enqueued_time = attributes[:'enqueued_time']
+ end
+
+ if attributes.key?(:'start_time')
+ self.start_time = attributes[:'start_time']
+ end
+
+ if attributes.key?(:'answer_time')
+ self.answer_time = attributes[:'answer_time']
+ end
+
+ if attributes.key?(:'end_time')
+ self.end_time = attributes[:'end_time']
+ end
+
+ if attributes.key?(:'cause')
+ self.cause = attributes[:'cause']
+ end
+
+ if attributes.key?(:'error_message')
+ self.error_message = attributes[:'error_message']
+ end
+
+ if attributes.key?(:'error_id')
+ self.error_id = attributes[:'error_id']
+ end
+
+ if attributes.key?(:'tag')
+ self.tag = attributes[:'tag']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ event_type == o.event_type &&
+ event_time == o.event_time &&
+ account_id == o.account_id &&
+ application_id == o.application_id &&
+ from == o.from &&
+ to == o.to &&
+ call_id == o.call_id &&
+ direction == o.direction &&
+ call_url == o.call_url &&
+ enqueued_time == o.enqueued_time &&
+ start_time == o.start_time &&
+ answer_time == o.answer_time &&
+ end_time == o.end_time &&
+ cause == o.cause &&
+ error_message == o.error_message &&
+ error_id == o.error_id &&
+ tag == o.tag
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [event_type, event_time, account_id, application_id, from, to, call_id, direction, call_url, enqueued_time, start_time, answer_time, end_time, cause, error_message, error_id, tag].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Bandwidth.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+ end
+end
diff --git a/lib/bandwidth-sdk/models/diversion.rb b/lib/bandwidth-sdk/models/diversion.rb
new file mode 100644
index 00000000..cc055774
--- /dev/null
+++ b/lib/bandwidth-sdk/models/diversion.rb
@@ -0,0 +1,273 @@
+=begin
+#Bandwidth
+
+#Bandwidth's Communication APIs
+
+The version of the OpenAPI document: 1.0.0
+Contact: letstalk@bandwidth.com
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.0.0
+
+=end
+
+require 'date'
+require 'time'
+
+module Bandwidth
+ class Diversion
+ # The reason for the diversion. Common values: unknown, user-busy, no-answer, unavailable, unconditional, time-of-day, do-not-disturb, deflection, follow-me, out-of-service, away.
+ attr_accessor :reason
+
+ # off or full
+ attr_accessor :privacy
+
+ # No if the number was provided by the user, yes if the number was provided by the network
+ attr_accessor :screen
+
+ # The number of diversions that have occurred
+ attr_accessor :counter
+
+ # The maximum number of diversions allowed for this session
+ attr_accessor :limit
+
+ # The normal list of values is not exhaustive. Your application must be tolerant of unlisted keys and unlisted values of those keys.
+ attr_accessor :unknown
+
+ # Always present. Indicates the last telephone number that the call was diverted from.
+ attr_accessor :orig_to
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'reason' => :'reason',
+ :'privacy' => :'privacy',
+ :'screen' => :'screen',
+ :'counter' => :'counter',
+ :'limit' => :'limit',
+ :'unknown' => :'unknown',
+ :'orig_to' => :'origTo'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'reason' => :'String',
+ :'privacy' => :'String',
+ :'screen' => :'String',
+ :'counter' => :'String',
+ :'limit' => :'String',
+ :'unknown' => :'String',
+ :'orig_to' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::Diversion` initialize method'
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::Diversion`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'reason')
+ self.reason = attributes[:'reason']
+ end
+
+ if attributes.key?(:'privacy')
+ self.privacy = attributes[:'privacy']
+ end
+
+ if attributes.key?(:'screen')
+ self.screen = attributes[:'screen']
+ end
+
+ if attributes.key?(:'counter')
+ self.counter = attributes[:'counter']
+ end
+
+ if attributes.key?(:'limit')
+ self.limit = attributes[:'limit']
+ end
+
+ if attributes.key?(:'unknown')
+ self.unknown = attributes[:'unknown']
+ end
+
+ if attributes.key?(:'orig_to')
+ self.orig_to = attributes[:'orig_to']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ reason == o.reason &&
+ privacy == o.privacy &&
+ screen == o.screen &&
+ counter == o.counter &&
+ limit == o.limit &&
+ unknown == o.unknown &&
+ orig_to == o.orig_to
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [reason, privacy, screen, counter, limit, unknown, orig_to].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?