diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8fe82a53..698497d5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: strategy: fail-fast: false matrix: - python: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python: ["3.9", "3.10", "3.11", "3.12"] os: ["ubuntu-latest"] steps: - name: Clone repo diff --git a/README.md b/README.md index be28ad61..75fe21c5 100644 --- a/README.md +++ b/README.md @@ -405,13 +405,12 @@ verify_signature(TOKEN, SIGNATURE_SECRET) # Returns a boolean ## Messages API - ### How to Construct a Message -In order to send a message, you must construct a message object of the correct type. These are all found under `vonage_messages.models`. +In order to send a message, you must construct a message object of the correct type. ```python -from vonage_messages.models import Sms +from vonage_messages import Sms message = Sms( from_='Vonage APIs', @@ -435,7 +434,7 @@ Some message types have submodels with additional fields. In this case, import t e.g. ```python -from vonage_messages.models import MessengerImage, MessengerOptions, MessengerResource +from vonage_messages import MessengerImage, MessengerOptions, MessengerResource messenger = MessengerImage( to='1234567890', @@ -451,7 +450,7 @@ To send a message, access the `Messages.send` method via the main Vonage object, ```python from vonage import Auth, Vonage -from vonage_messages.models import Sms +from vonage_messages import Sms vonage_client = Vonage(Auth(application_id='my-application-id', private_key='my-private-key')) @@ -970,12 +969,10 @@ response = vonage_client.verify_legacy.request_network_unblock('23410') ## Video API -You will use the custom Pydantic data models to make most of the API calls in this package. They are accessed from the `vonage_video.models` package. - ### Generate a Client Token ```python -from vonage_video.models import TokenOptions +from vonage_video import TokenOptions token_options = TokenOptions(session_id='your_session_id', role='publisher') client_token = vonage_client.video.generate_client_token(token_options) @@ -984,7 +981,7 @@ client_token = vonage_client.video.generate_client_token(token_options) ### Create a Session ```python -from vonage_video.models import SessionOptions +from vonage_video import SessionOptions session_options = SessionOptions(media_mode='routed') video_session = vonage_client.video.create_session(session_options) @@ -1005,7 +1002,7 @@ stream_info = vonage_client.video.get_stream(session_id='your_session_id', strea ### Change Stream Layout ```python -from vonage_video.models import StreamLayoutOptions +from vonage_video import StreamLayoutOptions layout_options = StreamLayoutOptions(type='bestFit') updated_streams = vonage_client.video.change_stream_layout(session_id='your_session_id', stream_layout_options=layout_options) @@ -1014,7 +1011,7 @@ updated_streams = vonage_client.video.change_stream_layout(session_id='your_sess ### Send a Signal ```python -from vonage_video.models import SignalData +from vonage_video import SignalData signal_data = SignalData(type='chat', data='Hello, World!') vonage_client.video.send_signal(session_id='your_session_id', data=signal_data) @@ -1047,7 +1044,7 @@ vonage_client.video.disable_mute_all_streams(session_id='your_session_id') ### Start Captions ```python -from vonage_video.models import CaptionsOptions +from vonage_video import CaptionsOptions captions_options = CaptionsOptions(language='en-US') captions_data = vonage_client.video.start_captions(captions_options) @@ -1056,7 +1053,7 @@ captions_data = vonage_client.video.start_captions(captions_options) ### Stop Captions ```python -from vonage_video.models import CaptionsData +from vonage_video import CaptionsData captions_data = CaptionsData(captions_id='your_captions_id') vonage_client.video.stop_captions(captions_data) @@ -1065,7 +1062,7 @@ vonage_client.video.stop_captions(captions_data) ### Start Audio Connector ```python -from vonage_video.models import AudioConnectorOptions +from vonage_video import AudioConnectorOptions audio_connector_options = AudioConnectorOptions(session_id='your_session_id', token='your_token', url='https://example.com') audio_connector_data = vonage_client.video.start_audio_connector(audio_connector_options) @@ -1074,7 +1071,7 @@ audio_connector_data = vonage_client.video.start_audio_connector(audio_connector ### Start Experience Composer ```python -from vonage_video.models import ExperienceComposerOptions +from vonage_video import ExperienceComposerOptions experience_composer_options = ExperienceComposerOptions(session_id='your_session_id', token='your_token', url='https://example.com') experience_composer = vonage_client.video.start_experience_composer(experience_composer_options) @@ -1083,7 +1080,7 @@ experience_composer = vonage_client.video.start_experience_composer(experience_c ### List Experience Composers ```python -from vonage_video.models import ListExperienceComposersFilter +from vonage_video import ListExperienceComposersFilter filter = ListExperienceComposersFilter(page_size=10) experience_composers, count, next_page_offset = vonage_client.video.list_experience_composers(filter) @@ -1105,7 +1102,7 @@ vonage_client.video.stop_experience_composer(experience_composer_id='experience_ ### List Archives ```python -from vonage_video.models import ListArchivesFilter +from vonage_video import ListArchivesFilter filter = ListArchivesFilter(offset=2) archives, count, next_page_offset = vonage_client.video.list_archives(filter) @@ -1115,7 +1112,7 @@ print(archives) ### Start Archive ```python -from vonage_video.models import CreateArchiveRequest +from vonage_video import CreateArchiveRequest archive_options = CreateArchiveRequest(session_id='your_session_id', name='My Archive') archive = vonage_client.video.start_archive(archive_options) @@ -1137,7 +1134,7 @@ vonage_client.video.delete_archive(archive_id='your_archive_id') ### Add Stream to Archive ```python -from vonage_video.models import AddStreamRequest +from vonage_video import AddStreamRequest add_stream_request = AddStreamRequest(stream_id='your_stream_id') vonage_client.video.add_stream_to_archive(archive_id='your_archive_id', params=add_stream_request) @@ -1159,7 +1156,7 @@ print(archive) ### Change Archive Layout ```python -from vonage_video.models import ComposedLayout +from vonage_video import ComposedLayout layout = ComposedLayout(type='bestFit') archive = vonage_client.video.change_archive_layout(archive_id='your_archive_id', layout=layout) @@ -1169,7 +1166,7 @@ print(archive) ### List Broadcasts ```python -from vonage_video.models import ListBroadcastsFilter +from vonage_video import ListBroadcastsFilter filter = ListBroadcastsFilter(page_size=10) broadcasts, count, next_page_offset = vonage_client.video.list_broadcasts(filter) @@ -1179,7 +1176,7 @@ print(broadcasts) ### Start Broadcast ```python -from vonage_video.models import CreateBroadcastRequest, BroadcastOutputSettings, BroadcastHls, BroadcastRtmp +from vonage_video import CreateBroadcastRequest, BroadcastOutputSettings, BroadcastHls, BroadcastRtmp broadcast_options = CreateBroadcastRequest(session_id='your_session_id', outputs=BroadcastOutputSettings( hls=BroadcastHls(dvr=True, low_latency=False), @@ -1213,7 +1210,7 @@ print(broadcast) ### Change Broadcast Layout ```python -from vonage_video.models import ComposedLayout +from vonage_video import ComposedLayout layout = ComposedLayout(type='bestFit') broadcast = vonage_client.video.change_broadcast_layout(broadcast_id='your_broadcast_id', layout=layout) @@ -1223,7 +1220,7 @@ print(broadcast) ### Add Stream to Broadcast ```python -from vonage_video.models import AddStreamRequest +from vonage_video import AddStreamRequest add_stream_request = AddStreamRequest(stream_id='your_stream_id') vonage_client.video.add_stream_to_broadcast(broadcast_id='your_broadcast_id', params=add_stream_request) @@ -1238,7 +1235,7 @@ vonage_client.video.remove_stream_from_broadcast(broadcast_id='your_broadcast_id ### Initiate SIP Call ```python -from vonage_video.models import InitiateSipRequest, SipOptions, SipAuth +from vonage_video import InitiateSipRequest, SipOptions, SipAuth sip_request_params = InitiateSipRequest( session_id='your_session_id', @@ -1281,7 +1278,7 @@ vonage_client.video.play_dtmf(session_id=session_id, digits=digits, connection_i To create a call, you must pass an instance of the `CreateCallRequest` model to the `create_call` method. If supplying an NCCO, import the NCCO actions you want to use and pass them in as a list to the `ncco` model field. ```python -from vonage_voice.models import CreateCallRequest, Talk +from vonage_voice import CreateCallRequest, Talk ncco = [Talk(text='Hello world', loop=3, language='en-GB')] @@ -1303,7 +1300,7 @@ print(response.model_dump()) calls, next_record_index = vonage_client.voice.list_calls() # Specify filtering options -from vonage_voice.models import ListCallsFilter +from vonage_voice import ListCallsFilter call_filter = ListCallsFilter( status='completed', @@ -1364,7 +1361,7 @@ vonage_client.voice.unearmuff('UUID') ### Play Audio Into a Call ```python -from vonage_voice.models import AudioStreamOptions +from vonage_voice import AudioStreamOptions # Only the `stream_url` option is required options = AudioStreamOptions( @@ -1382,7 +1379,7 @@ vonage_client.voice.stop_audio_stream('UUID') ### Play TTS Into a Call ```python -from vonage_voice.models import TtsStreamOptions +from vonage_voice import TtsStreamOptions # Only the `text` field is required options = TtsStreamOptions( diff --git a/messages/CHANGES.md b/messages/CHANGES.md index ed2fabf3..7183d872 100644 --- a/messages/CHANGES.md +++ b/messages/CHANGES.md @@ -1,3 +1,6 @@ +# 1.4.0 +- Make all models originally accessed by `vonage_messages.models.***` available at the top level of the package, i.e. `vonage_messages.***` + # 1.3.0 - Add support for API key/secret header authentication - Updated dependency versions diff --git a/messages/README.md b/messages/README.md index 37f7f957..206d174c 100644 --- a/messages/README.md +++ b/messages/README.md @@ -8,10 +8,10 @@ It is recommended to use this as part of the main `vonage` package. The examples ### How to Construct a Message -In order to send a message, you must construct a message object of the correct type. These are all found under `vonage_messages.models`. +In order to send a message, you must construct a message object of the correct type. ```python -from vonage_messages.models import Sms +from vonage_messages import Sms message = Sms( from_='Vonage APIs', @@ -35,7 +35,7 @@ Some message types have submodels with additional fields. In this case, import t e.g. ```python -from vonage_messages.models import MessengerImage, MessengerOptions, MessengerResource +from vonage_messages import MessengerImage, MessengerOptions, MessengerResource messenger = MessengerImage( to='1234567890', @@ -51,7 +51,7 @@ To send a message, access the `Messages.send` method via the main Vonage object, ```python from vonage import Auth, Vonage -from vonage_messages.models import Sms +from vonage_messages import Sms vonage_client = Vonage(Auth(application_id='my-application-id', private_key='my-private-key')) diff --git a/messages/src/vonage_messages/__init__.py b/messages/src/vonage_messages/__init__.py index 11000717..b4ac8969 100644 --- a/messages/src/vonage_messages/__init__.py +++ b/messages/src/vonage_messages/__init__.py @@ -1,5 +1,6 @@ -from . import models +from . import models # Import models to access the module directly from .messages import Messages +from .models import * # Need this to directly expose data models from .responses import SendMessageResponse __all__ = ['models', 'Messages', 'SendMessageResponse'] diff --git a/messages/src/vonage_messages/_version.py b/messages/src/vonage_messages/_version.py index 19b4f1d6..96e3ce8d 100644 --- a/messages/src/vonage_messages/_version.py +++ b/messages/src/vonage_messages/_version.py @@ -1 +1 @@ -__version__ = '1.3.0' +__version__ = '1.4.0' diff --git a/messages/tests/test_messages.py b/messages/tests/test_messages.py index 9bcf3c64..51c8767b 100644 --- a/messages/tests/test_messages.py +++ b/messages/tests/test_messages.py @@ -2,17 +2,15 @@ import responses from pytest import raises -from vonage_http_client.auth import Auth -from vonage_http_client.errors import HttpRequestError -from vonage_http_client.http_client import HttpClient, HttpClientOptions -from vonage_messages.messages import Messages -from vonage_messages.models import Sms -from vonage_messages.models.messenger import ( +from vonage_http_client import Auth, HttpClient, HttpClientOptions, HttpRequestError +from vonage_messages import ( + Messages, MessengerImage, MessengerOptions, MessengerResource, + SendMessageResponse, + Sms, ) -from vonage_messages.responses import SendMessageResponse from testutils import build_response, get_mock_api_key_auth, get_mock_jwt_auth diff --git a/pants.ci.toml b/pants.ci.toml index a0749d00..299dd51f 100644 --- a/pants.ci.toml +++ b/pants.ci.toml @@ -2,4 +2,4 @@ colors = true [python] -interpreter_constraints = ['>=3.8'] +interpreter_constraints = ['>=3.9'] diff --git a/pants.toml b/pants.toml index 3b13e505..27ab0803 100644 --- a/pants.toml +++ b/pants.toml @@ -27,20 +27,20 @@ interpreter_constraints = ['==3.12.*'] args = ['-vv', '--no-header'] [coverage-py] -interpreter_constraints = ['>=3.8'] +interpreter_constraints = ['>=3.9'] report = ['html', 'console'] [black] args = ['--line-length=90', '--skip-string-normalization'] -interpreter_constraints = ['>=3.8'] +interpreter_constraints = ['>=3.9'] [isort] args = ['--profile=black', '--line-length=90'] -interpreter_constraints = ['>=3.8'] +interpreter_constraints = ['>=3.9'] [docformatter] args = ['--wrap-summaries=90', '--wrap-descriptions=90'] -interpreter_constraints = ['>=3.8'] +interpreter_constraints = ['>=3.9'] [autoflake] -interpreter_constraints = ['>=3.8'] +interpreter_constraints = ['>=3.9'] diff --git a/video/CHANGES.md b/video/CHANGES.md index b30e01a7..bfad17f4 100644 --- a/video/CHANGES.md +++ b/video/CHANGES.md @@ -1,3 +1,6 @@ +# 1.2.0 +- Make all models originally accessed by `vonage_video.models.***` available at the top level of the package, i.e. `vonage_video.***` + # 1.1.0 - Add new `max_bitrate` field for archives diff --git a/video/OPENTOK_TO_VONAGE_MIGRATION.md b/video/OPENTOK_TO_VONAGE_MIGRATION.md index acf5c74a..f7a2b2d9 100644 --- a/video/OPENTOK_TO_VONAGE_MIGRATION.md +++ b/video/OPENTOK_TO_VONAGE_MIGRATION.md @@ -60,10 +60,10 @@ vonage_client.video.video_api_method... ## Accessing Video API Data Models -You can access data models for the Video API, e.g. as arguments to video methods, by importing them from the `vonage_video.models` package, e.g. +You can access data models for the Video API, e.g. as arguments to video methods, by importing them from the `vonage_video` package, e.g. ```python -from vonage_video.models import SessionOptions +from vonage_video import SessionOptions session_options = SessionOptions(...) @@ -78,7 +78,7 @@ vonage_client.video.create_session(session_options) There are some changes to methods between the `opentok` SDK and the Video API implementation in the `vonage-video` SDK. -- Any positional parameters in method signatures have been replaced with data models in the `vonage-video` package, stored at `vonage_video.models`. +- Any positional parameters in method signatures have been replaced with data models in the `vonage-video` package. - Methods now return responses as Pydantic data models. - Some methods have been renamed, for clarity and/or to better reflect what the method does. These are listed below: diff --git a/video/README.md b/video/README.md index d26ac46b..1330f615 100644 --- a/video/README.md +++ b/video/README.md @@ -6,12 +6,12 @@ This package contains the code to use [Vonage's Video API](https://developer.von It is recommended to use this as part of the main `vonage` package. The examples below assume you've created an instance of the `vonage.Vonage` class called `vonage_client`. -You will use the custom Pydantic data models to make most of the API calls in this package. They are accessed from the `vonage_video.models` package. +You will use the custom Pydantic data models to make most of the API calls in this package. ### Generate a Client Token ```python -from vonage_video.models import TokenOptions +from vonage_video import TokenOptions token_options = TokenOptions(session_id='your_session_id', role='publisher') client_token = vonage_client.video.generate_client_token(token_options) @@ -20,7 +20,7 @@ client_token = vonage_client.video.generate_client_token(token_options) ### Create a Session ```python -from vonage_video.models import SessionOptions +from vonage_video import SessionOptions session_options = SessionOptions(media_mode='routed') video_session = vonage_client.video.create_session(session_options) @@ -41,7 +41,7 @@ stream_info = vonage_client.video.get_stream(session_id='your_session_id', strea ### Change Stream Layout ```python -from vonage_video.models import StreamLayoutOptions +from vonage_video import StreamLayoutOptions layout_options = StreamLayoutOptions(type='bestFit') updated_streams = vonage_client.video.change_stream_layout(session_id='your_session_id', stream_layout_options=layout_options) @@ -50,7 +50,7 @@ updated_streams = vonage_client.video.change_stream_layout(session_id='your_sess ### Send a Signal ```python -from vonage_video.models import SignalData +from vonage_video import SignalData signal_data = SignalData(type='chat', data='Hello, World!') vonage_client.video.send_signal(session_id='your_session_id', data=signal_data) @@ -83,7 +83,7 @@ vonage_client.video.disable_mute_all_streams(session_id='your_session_id') ### Start Captions ```python -from vonage_video.models import CaptionsOptions +from vonage_video import CaptionsOptions captions_options = CaptionsOptions(language='en-US') captions_data = vonage_client.video.start_captions(captions_options) @@ -92,7 +92,7 @@ captions_data = vonage_client.video.start_captions(captions_options) ### Stop Captions ```python -from vonage_video.models import CaptionsData +from vonage_video import CaptionsData captions_data = CaptionsData(captions_id='your_captions_id') vonage_client.video.stop_captions(captions_data) @@ -101,7 +101,7 @@ vonage_client.video.stop_captions(captions_data) ### Start Audio Connector ```python -from vonage_video.models import AudioConnectorOptions +from vonage_video import AudioConnectorOptions audio_connector_options = AudioConnectorOptions(session_id='your_session_id', token='your_token', url='https://example.com') audio_connector_data = vonage_client.video.start_audio_connector(audio_connector_options) @@ -110,7 +110,7 @@ audio_connector_data = vonage_client.video.start_audio_connector(audio_connector ### Start Experience Composer ```python -from vonage_video.models import ExperienceComposerOptions +from vonage_video import ExperienceComposerOptions experience_composer_options = ExperienceComposerOptions(session_id='your_session_id', token='your_token', url='https://example.com') experience_composer = vonage_client.video.start_experience_composer(experience_composer_options) @@ -119,7 +119,7 @@ experience_composer = vonage_client.video.start_experience_composer(experience_c ### List Experience Composers ```python -from vonage_video.models import ListExperienceComposersFilter +from vonage_video import ListExperienceComposersFilter filter = ListExperienceComposersFilter(page_size=10) experience_composers, count, next_page_offset = vonage_client.video.list_experience_composers(filter) @@ -141,7 +141,7 @@ vonage_client.video.stop_experience_composer(experience_composer_id='experience_ ### List Archives ```python -from vonage_video.models import ListArchivesFilter +from vonage_video import ListArchivesFilter filter = ListArchivesFilter(offset=2) archives, count, next_page_offset = vonage_client.video.list_archives(filter) @@ -151,7 +151,7 @@ print(archives) ### Start Archive ```python -from vonage_video.models import CreateArchiveRequest +from vonage_video import CreateArchiveRequest archive_options = CreateArchiveRequest(session_id='your_session_id', name='My Archive') archive = vonage_client.video.start_archive(archive_options) @@ -173,7 +173,7 @@ vonage_client.video.delete_archive(archive_id='your_archive_id') ### Add Stream to Archive ```python -from vonage_video.models import AddStreamRequest +from vonage_video import AddStreamRequest add_stream_request = AddStreamRequest(stream_id='your_stream_id') vonage_client.video.add_stream_to_archive(archive_id='your_archive_id', params=add_stream_request) @@ -195,7 +195,7 @@ print(archive) ### Change Archive Layout ```python -from vonage_video.models import ComposedLayout +from vonage_video import ComposedLayout layout = ComposedLayout(type='bestFit') archive = vonage_client.video.change_archive_layout(archive_id='your_archive_id', layout=layout) @@ -205,7 +205,7 @@ print(archive) ### List Broadcasts ```python -from vonage_video.models import ListBroadcastsFilter +from vonage_video import ListBroadcastsFilter filter = ListBroadcastsFilter(page_size=10) broadcasts, count, next_page_offset = vonage_client.video.list_broadcasts(filter) @@ -215,7 +215,7 @@ print(broadcasts) ### Start Broadcast ```python -from vonage_video.models import CreateBroadcastRequest, BroadcastOutputSettings, BroadcastHls, BroadcastRtmp +from vonage_video import CreateBroadcastRequest, BroadcastOutputSettings, BroadcastHls, BroadcastRtmp broadcast_options = CreateBroadcastRequest(session_id='your_session_id', outputs=BroadcastOutputSettings( hls=BroadcastHls(dvr=True, low_latency=False), @@ -249,7 +249,7 @@ print(broadcast) ### Change Broadcast Layout ```python -from vonage_video.models import ComposedLayout +from vonage_video import ComposedLayout layout = ComposedLayout(type='bestFit') broadcast = vonage_client.video.change_broadcast_layout(broadcast_id='your_broadcast_id', layout=layout) @@ -259,7 +259,7 @@ print(broadcast) ### Add Stream to Broadcast ```python -from vonage_video.models import AddStreamRequest +from vonage_video import AddStreamRequest add_stream_request = AddStreamRequest(stream_id='your_stream_id') vonage_client.video.add_stream_to_broadcast(broadcast_id='your_broadcast_id', params=add_stream_request) @@ -274,7 +274,7 @@ vonage_client.video.remove_stream_from_broadcast(broadcast_id='your_broadcast_id ### Initiate SIP Call ```python -from vonage_video.models import InitiateSipRequest, SipOptions, SipAuth +from vonage_video import InitiateSipRequest, SipOptions, SipAuth sip_request_params = InitiateSipRequest( session_id='your_session_id', diff --git a/video/src/vonage_video/__init__.py b/video/src/vonage_video/__init__.py index 16da3cf3..a91ef7a5 100644 --- a/video/src/vonage_video/__init__.py +++ b/video/src/vonage_video/__init__.py @@ -1,4 +1,5 @@ -from . import errors, models +from . import errors, models # Import models to access the module directly +from .models import * # Need this to directly expose data models from .video import Video __all__ = ['Video', 'errors', 'models'] diff --git a/video/src/vonage_video/_version.py b/video/src/vonage_video/_version.py index 1a72d32e..58d478ab 100644 --- a/video/src/vonage_video/_version.py +++ b/video/src/vonage_video/_version.py @@ -1 +1 @@ -__version__ = '1.1.0' +__version__ = '1.2.0' diff --git a/video/tests/test_archive.py b/video/tests/test_archive.py index d0e58a69..4ef03d88 100644 --- a/video/tests/test_archive.py +++ b/video/tests/test_archive.py @@ -2,7 +2,18 @@ import responses from pytest import raises -from vonage_http_client.http_client import HttpClient +from vonage_http_client import HttpClient +from vonage_video import ( + AddStreamRequest, + ComposedLayout, + CreateArchiveRequest, + LayoutType, + ListArchivesFilter, + OutputMode, + StreamMode, + Video, + VideoResolution, +) from vonage_video.errors import ( IndividualArchivePropertyError, InvalidArchiveStateError, @@ -10,14 +21,6 @@ LayoutStylesheetError, NoAudioOrVideoError, ) -from vonage_video.models.archive import ( - ComposedLayout, - CreateArchiveRequest, - ListArchivesFilter, -) -from vonage_video.models.common import AddStreamRequest -from vonage_video.models.enums import LayoutType, OutputMode, StreamMode, VideoResolution -from vonage_video.video import Video from testutils import build_response, get_mock_jwt_auth diff --git a/video/tests/test_audio_connector.py b/video/tests/test_audio_connector.py index 0c9cce6b..48d52311 100644 --- a/video/tests/test_audio_connector.py +++ b/video/tests/test_audio_connector.py @@ -2,13 +2,14 @@ import responses from vonage_http_client import HttpClient -from vonage_video.models.audio_connector import ( +from vonage_video import ( AudioConnectorOptions, AudioConnectorWebSocket, + AudioSampleRate, + TokenOptions, + TokenRole, + Video, ) -from vonage_video.models.enums import AudioSampleRate, TokenRole -from vonage_video.models.token import TokenOptions -from vonage_video.video import Video from testutils import build_response, get_mock_jwt_auth diff --git a/voice/CHANGES.md b/voice/CHANGES.md index f563df38..d7bdb746 100644 --- a/voice/CHANGES.md +++ b/voice/CHANGES.md @@ -1,3 +1,6 @@ +# 1.2.0 +- Make all models originally accessed by `vonage_voice.models.***` available at the top level of the package, i.e. `vonage_voice.***` + # 1.1.2 - Update incorrect return type annotation for `Voice.download_recording` diff --git a/voice/README.md b/voice/README.md index d68e96d8..1c8a3338 100644 --- a/voice/README.md +++ b/voice/README.md @@ -4,7 +4,7 @@ This package contains the code to use [Vonage's Voice API](https://developer.von ## Structure -There is a `Voice` class which contains the methods used to call Vonage APIs. To call many of the APIs, you need to pass a Pydantic model with the required options. These can be accessed from the `vonage_voice.models` subpackage. Errors can be accessed from the `vonage_voice.errors` module. +There is a `Voice` class which contains the methods used to call Vonage APIs. To call many of the APIs, you need to pass a Pydantic model with the required options. Errors can be accessed from the `vonage_voice.errors` module. ## Usage @@ -21,7 +21,7 @@ vonage_client = Vonage(Auth('MY_AUTH_INFO')) To create a call, you must pass an instance of the `CreateCallRequest` model to the `create_call` method. If supplying an NCCO, import the NCCO actions you want to use and pass them in as a list to the `ncco` model field. ```python -from vonage_voice.models import CreateCallRequest, Talk +from vonage_voice import CreateCallRequest, Talk ncco = [Talk(text='Hello world', loop=3, language='en-GB')] @@ -43,7 +43,7 @@ print(response.model_dump()) calls, next_record_index = vonage_client.voice.list_calls() # Specify filtering options -from vonage_voice.models import ListCallsFilter +from vonage_voice import ListCallsFilter call_filter = ListCallsFilter( status='completed', @@ -104,7 +104,7 @@ vonage_client.voice.unearmuff('UUID') ### Play Audio Into a Call ```python -from vonage_voice.models import AudioStreamOptions +from vonage_voice import AudioStreamOptions # Only the `stream_url` option is required options = AudioStreamOptions( @@ -122,7 +122,7 @@ vonage_client.voice.stop_audio_stream('UUID') ### Play TTS Into a Call ```python -from vonage_voice.models import TtsStreamOptions +from vonage_voice import TtsStreamOptions # Only the `text` field is required options = TtsStreamOptions( diff --git a/voice/src/vonage_voice/__init__.py b/voice/src/vonage_voice/__init__.py index b73b81f1..5f500f22 100644 --- a/voice/src/vonage_voice/__init__.py +++ b/voice/src/vonage_voice/__init__.py @@ -1,4 +1,5 @@ -from . import errors, models +from . import errors, models # Import models to access the module directly +from .models import * # Need this to directly expose data models from .voice import Voice __all__ = ['Voice', 'errors', 'models'] diff --git a/voice/src/vonage_voice/_version.py b/voice/src/vonage_voice/_version.py index 7b344eca..58d478ab 100644 --- a/voice/src/vonage_voice/_version.py +++ b/voice/src/vonage_voice/_version.py @@ -1 +1 @@ -__version__ = '1.1.2' +__version__ = '1.2.0' diff --git a/voice/tests/test_voice.py b/voice/tests/test_voice.py index 5046cd21..d0b8c39c 100644 --- a/voice/tests/test_voice.py +++ b/voice/tests/test_voice.py @@ -4,14 +4,14 @@ from pytest import raises from responses.matchers import json_params_matcher from vonage_http_client.http_client import HttpClient -from vonage_voice.errors import VoiceError -from vonage_voice.models.ncco import Talk -from vonage_voice.models.requests import ( +from vonage_voice import ( AudioStreamOptions, CreateCallRequest, ListCallsFilter, TtsStreamOptions, ) +from vonage_voice.errors import VoiceError +from vonage_voice.models.ncco import Talk from vonage_voice.models.responses import CreateCallResponse from vonage_voice.voice import Voice diff --git a/vonage/CHANGES.md b/vonage/CHANGES.md index 9aad0258..af16e675 100644 --- a/vonage/CHANGES.md +++ b/vonage/CHANGES.md @@ -1,3 +1,8 @@ +# 4.3.0 +- Make all models originally accessed by `vonage_voice.models.***` available at the top level of the package, i.e. `vonage_voice.***` +- Make all models originally accessed by `vonage_video.models.***` available at the top level of the package, i.e. `vonage_video.***` +- Make all models originally accessed by `vonage_messages.models.***` available at the top level of the package, i.e. `vonage_messages.***` + # 4.2.0 - Add new `max_bitrate` field for Video API archives - Fix a bug with error types diff --git a/vonage/pyproject.toml b/vonage/pyproject.toml index 52397140..30d79323 100644 --- a/vonage/pyproject.toml +++ b/vonage/pyproject.toml @@ -9,7 +9,7 @@ dependencies = [ "vonage-http-client>=1.5.1", "vonage-account>=1.1.1", "vonage-application>=2.0.1", - "vonage-messages>=1.3.0", + "vonage-messages>=1.4.0", "vonage-network-auth>=1.0.2", "vonage-network-sim-swap>=1.1.2", "vonage-network-number-verification>=1.0.2", @@ -20,8 +20,8 @@ dependencies = [ "vonage-users>=1.2.1", "vonage-verify>=2.1.0", "vonage-verify-legacy>=1.0.1", - "vonage-video>=1.1.0", - "vonage-voice>=1.1.2", + "vonage-video>=1.2.0", + "vonage-voice>=1.2.0", ] classifiers = [ "Programming Language :: Python", diff --git a/vonage/src/vonage/_version.py b/vonage/src/vonage/_version.py index ea5d65fc..5ee6158c 100644 --- a/vonage/src/vonage/_version.py +++ b/vonage/src/vonage/_version.py @@ -1 +1 @@ -__version__ = '4.2.0' +__version__ = '4.3.0'