Skip to content

Commit

Permalink
update application parameter name and make users models more easily a…
Browse files Browse the repository at this point in the history
…ccessible
  • Loading branch information
maxkahan committed Oct 25, 2024
1 parent 4616cb6 commit 06ddaa6
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 12 deletions.
3 changes: 3 additions & 0 deletions application/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 2.0.0
- Rename `params` -> `config` in method arguments

# 1.0.3
- Support for Python 3.13, drop support for 3.8

Expand Down
2 changes: 1 addition & 1 deletion application/src/vonage_application/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.0.3'
__version__ = '2.0.0'
16 changes: 8 additions & 8 deletions application/src/vonage_application/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,21 @@ def list_applications(

@validate_call
def create_application(
self, params: Optional[ApplicationConfig] = None
self, config: Optional[ApplicationConfig] = None
) -> ApplicationData:
"""Create a new application.
Args:
params (Optional[ApplicationConfig]): Parameters describing the
application options to set.
config (Optional[ApplicationConfig]): Configuration options describing the
application to create.
Returns:
ApplicationData: The created application object.
"""
response = self._http_client.post(
self._http_client.api_host,
'/v2/applications',
params.model_dump(exclude_none=True) if params is not None else None,
config.model_dump(exclude_none=True) if config is not None else None,
self._auth_type,
)
return ApplicationData(**response)
Expand All @@ -91,21 +91,21 @@ def get_application(self, id: str) -> ApplicationData:
return ApplicationData(**response)

@validate_call
def update_application(self, id: str, params: ApplicationConfig) -> ApplicationData:
def update_application(self, id: str, config: ApplicationConfig) -> ApplicationData:
"""Update an application.
Args:
id (str): The ID of the application to update.
params (ApplicationConfig): Parameters describing the
application options to update.
config (ApplicationConfig): Configuration options describing the application
to update.
Returns:
ApplicationData: The updated application object.
"""
response = self._http_client.put(
self._http_client.api_host,
f'/v2/applications/{id}',
params.model_dump(exclude_none=True),
config.model_dump(exclude_none=True),
self._auth_type,
)
return ApplicationData(**response)
Expand Down
3 changes: 3 additions & 0 deletions users/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.2.0
- Expose more properties in the top-level `vonage_users` scope

# 1.1.4
- Support for Python 3.13, drop support for 3.8

Expand Down
28 changes: 26 additions & 2 deletions users/src/vonage_users/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,35 @@
from .common import User
from .common import (
Channels,
MessengerChannel,
MmsChannel,
Properties,
PstnChannel,
SipChannel,
SmsChannel,
User,
VbcChannel,
ViberChannel,
WebsocketChannel,
WhatsappChannel,
)
from .requests import ListUsersFilter
from .responses import UserSummary
from .users import Users

__all__ = [
'Users',
'User',
'PstnChannel',
'SipChannel',
'WebsocketChannel',
'VbcChannel',
'SmsChannel',
'MmsChannel',
'WhatsappChannel',
'ViberChannel',
'MessengerChannel',
'Channels',
'Properties',
'ListUsersFilter',
'UserSummary',
'Users',
]
2 changes: 1 addition & 1 deletion users/src/vonage_users/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.1.4'
__version__ = '1.2.0'

0 comments on commit 06ddaa6

Please sign in to comment.