Skip to content

Commit

Permalink
prepare for application api release
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkahan committed May 9, 2024
1 parent 7e1186a commit 87806b1
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 35 deletions.
66 changes: 39 additions & 27 deletions application/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,47 +19,59 @@ applications, next_page = vonage_client.application.list_applications()

# With options
options = ListApplicationsFilter(page_size=3, page=2)
applications, next_page = vonage_client.applications.list_applications(options)
applications, next_page = vonage_client.application.list_applications(options)
```


--------


### Create a New User
### Create a New Application

```python
from vonage_users import User, Channels, SmsChannel
user_options = User(
name='my_user_name',
display_name='My User Name',
properties={'custom_key': 'custom_value'},
channels=Channels(sms=[SmsChannel(number='1234567890')]),
from vonage_application import ApplicationConfig

app_data = vonage_client.application.create_application()

# Create with custom options (can also be done with a dict)
from vonage_application import ApplicationConfig, Keys, Voice, VoiceWebhooks
voice = Voice(
webhooks=VoiceWebhooks(
event_url=VoiceUrl(
address='https://example.com/event',
http_method='POST',
connect_timeout=500,
socket_timeout=3000,
),
),
signed_callbacks=True,
)
capabilities = Capabilities(voice=voice)
keys = Keys(public_key='MY_PUBLIC_KEY')
config = ApplicationConfig(
name='My Customised Application',
capabilities=capabilities,
keys=keys,
)
user = vonage_client.users.create_user(user_options)
app_data = vonage_client.application.create_application(config)
```

### Get a User
### Get an Application

```python
user = client.users.get_user('USR-87e3e6b0-cd7b-45ef-a0a7-bcd5566a672b')
user_as_dict = user.model_dump(exclude_none=True)
app_data = client.application.get_application('MY_APP_ID')
app_data_as_dict = app.model_dump(exclude_none=True)
```

### Update a User
### Update an Application

To update an application, pass config for the updated field(s) in an ApplicationConfig object

```python
from vonage_users import User, Channels, SmsChannel, WhatsappChannel
user_options = User(
name='my_user_name',
display_name='My User Name',
properties={'custom_key': 'custom_value'},
channels=Channels(sms=[SmsChannel(number='1234567890')], whatsapp=[WhatsappChannel(number='9876543210')]),
)
user = vonage_client.users.update_user(id, user_options)
from vonage_application import ApplicationConfig, Keys, Voice, VoiceWebhooks

config = ApplicationConfig(name='My Updated Application')
app_data = vonage_client.application.update_application('MY_APP_ID', config)
```

### Delete a User
### Delete an Application

```python
vonage_client.users.delete_user(id)
vonage_client.applications.delete_application('MY_APP_ID')
```
2 changes: 1 addition & 1 deletion application/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ authors = [{ name = "Vonage", email = "devrel@vonage.com" }]
requires-python = ">=3.8"
dependencies = [
"vonage-http-client>=1.3.1",
"vonage-utils>=1.1.1",
"vonage-utils>=1.1.2",
"pydantic>=2.7.1",
]
classifiers = [
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.1.2
- Internal refactoring

# 1.1.1
- Update minimum dependency version

Expand Down
4 changes: 2 additions & 2 deletions users/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[project]
name = 'vonage-users'
version = '1.1.1'
version = '1.1.2'
description = 'Vonage Users package'
readme = "README.md"
authors = [{ name = "Vonage", email = "devrel@vonage.com" }]
requires-python = ">=3.8"
dependencies = [
"vonage-http-client>=1.3.1",
"vonage-utils>=1.1.1",
"vonage-utils>=1.1.2",
"pydantic>=2.7.1",
]
classifiers = [
Expand Down
3 changes: 3 additions & 0 deletions voice/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.0.3
- Internal refactoring

# 1.0.2
- Update minimum dependency version

Expand Down
4 changes: 2 additions & 2 deletions voice/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[project]
name = 'vonage-voice'
version = '1.0.2'
version = '1.0.3'
description = 'Vonage voice package'
readme = "README.md"
authors = [{ name = "Vonage", email = "devrel@vonage.com" }]
requires-python = ">=3.8"
dependencies = [
"vonage-http-client>=1.3.1",
"vonage-utils>=1.1.1",
"vonage-utils>=1.1.2",
"pydantic>=2.7.1",
]
classifiers = [
Expand Down
6 changes: 6 additions & 0 deletions vonage/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 3.99.0a10
- Add support for the [Vonage Application API](https://developer.vonage.com/en/application/overview).

# 3.99.0a9
- Internal refactoring

# 3.99.0a8
- Add support for the [Vonage Number Insight API](https://developer.vonage.com/en/number-insight/overview).
- Update minimum dependency version
Expand Down
1 change: 1 addition & 0 deletions vonage/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ requires-python = ">=3.8"
dependencies = [
"vonage-utils>=1.1.1",
"vonage-http-client>=1.3.1",
"vonage-application>=1.0.0",
"vonage-messages>=1.1.1",
"vonage-number-insight>=1.0.0",
"vonage-number-insight-v2>=0.1.1b0",
Expand Down
2 changes: 1 addition & 1 deletion vonage/src/vonage/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '3.99.0a8'
__version__ = '3.99.0a10'
5 changes: 4 additions & 1 deletion vonage_utils/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# 1.1.0
# 1.1.2
- Refactoring common pydantic models across the monorepo into this package

# 1.1.1
- Update minimum dependency version

# 1.1.0
Expand Down
2 changes: 1 addition & 1 deletion vonage_utils/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = 'vonage-utils'
version = '1.1.1'
version = '1.1.2'
description = 'Utils package containing objects for use with Vonage APIs'
readme = "README.md"
authors = [{ name = "Vonage", email = "devrel@vonage.com" }]
Expand Down

0 comments on commit 87806b1

Please sign in to comment.