Skip to content

Commit 87806b1

Browse files
committed
prepare for application api release
1 parent 7e1186a commit 87806b1

File tree

11 files changed

+63
-35
lines changed

11 files changed

+63
-35
lines changed

application/README.md

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,47 +19,59 @@ applications, next_page = vonage_client.application.list_applications()
1919

2020
# With options
2121
options = ListApplicationsFilter(page_size=3, page=2)
22-
applications, next_page = vonage_client.applications.list_applications(options)
22+
applications, next_page = vonage_client.application.list_applications(options)
2323
```
2424

25-
26-
--------
27-
28-
29-
### Create a New User
25+
### Create a New Application
3026

3127
```python
32-
from vonage_users import User, Channels, SmsChannel
33-
user_options = User(
34-
name='my_user_name',
35-
display_name='My User Name',
36-
properties={'custom_key': 'custom_value'},
37-
channels=Channels(sms=[SmsChannel(number='1234567890')]),
28+
from vonage_application import ApplicationConfig
29+
30+
app_data = vonage_client.application.create_application()
31+
32+
# Create with custom options (can also be done with a dict)
33+
from vonage_application import ApplicationConfig, Keys, Voice, VoiceWebhooks
34+
voice = Voice(
35+
webhooks=VoiceWebhooks(
36+
event_url=VoiceUrl(
37+
address='https://example.com/event',
38+
http_method='POST',
39+
connect_timeout=500,
40+
socket_timeout=3000,
41+
),
42+
),
43+
signed_callbacks=True,
44+
)
45+
capabilities = Capabilities(voice=voice)
46+
keys = Keys(public_key='MY_PUBLIC_KEY')
47+
config = ApplicationConfig(
48+
name='My Customised Application',
49+
capabilities=capabilities,
50+
keys=keys,
3851
)
39-
user = vonage_client.users.create_user(user_options)
52+
app_data = vonage_client.application.create_application(config)
4053
```
4154

42-
### Get a User
55+
### Get an Application
4356

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

49-
### Update a User
62+
### Update an Application
63+
64+
To update an application, pass config for the updated field(s) in an ApplicationConfig object
65+
5066
```python
51-
from vonage_users import User, Channels, SmsChannel, WhatsappChannel
52-
user_options = User(
53-
name='my_user_name',
54-
display_name='My User Name',
55-
properties={'custom_key': 'custom_value'},
56-
channels=Channels(sms=[SmsChannel(number='1234567890')], whatsapp=[WhatsappChannel(number='9876543210')]),
57-
)
58-
user = vonage_client.users.update_user(id, user_options)
67+
from vonage_application import ApplicationConfig, Keys, Voice, VoiceWebhooks
68+
69+
config = ApplicationConfig(name='My Updated Application')
70+
app_data = vonage_client.application.update_application('MY_APP_ID', config)
5971
```
6072

61-
### Delete a User
73+
### Delete an Application
6274

6375
```python
64-
vonage_client.users.delete_user(id)
76+
vonage_client.applications.delete_application('MY_APP_ID')
6577
```

application/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ authors = [{ name = "Vonage", email = "devrel@vonage.com" }]
77
requires-python = ">=3.8"
88
dependencies = [
99
"vonage-http-client>=1.3.1",
10-
"vonage-utils>=1.1.1",
10+
"vonage-utils>=1.1.2",
1111
"pydantic>=2.7.1",
1212
]
1313
classifiers = [

users/CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 1.1.2
2+
- Internal refactoring
3+
14
# 1.1.1
25
- Update minimum dependency version
36

users/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[project]
22
name = 'vonage-users'
3-
version = '1.1.1'
3+
version = '1.1.2'
44
description = 'Vonage Users package'
55
readme = "README.md"
66
authors = [{ name = "Vonage", email = "devrel@vonage.com" }]
77
requires-python = ">=3.8"
88
dependencies = [
99
"vonage-http-client>=1.3.1",
10-
"vonage-utils>=1.1.1",
10+
"vonage-utils>=1.1.2",
1111
"pydantic>=2.7.1",
1212
]
1313
classifiers = [

voice/CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 1.0.3
2+
- Internal refactoring
3+
14
# 1.0.2
25
- Update minimum dependency version
36

voice/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[project]
22
name = 'vonage-voice'
3-
version = '1.0.2'
3+
version = '1.0.3'
44
description = 'Vonage voice package'
55
readme = "README.md"
66
authors = [{ name = "Vonage", email = "devrel@vonage.com" }]
77
requires-python = ">=3.8"
88
dependencies = [
99
"vonage-http-client>=1.3.1",
10-
"vonage-utils>=1.1.1",
10+
"vonage-utils>=1.1.2",
1111
"pydantic>=2.7.1",
1212
]
1313
classifiers = [

vonage/CHANGES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 3.99.0a10
2+
- Add support for the [Vonage Application API](https://developer.vonage.com/en/application/overview).
3+
4+
# 3.99.0a9
5+
- Internal refactoring
6+
17
# 3.99.0a8
28
- Add support for the [Vonage Number Insight API](https://developer.vonage.com/en/number-insight/overview).
39
- Update minimum dependency version

vonage/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ requires-python = ">=3.8"
88
dependencies = [
99
"vonage-utils>=1.1.1",
1010
"vonage-http-client>=1.3.1",
11+
"vonage-application>=1.0.0",
1112
"vonage-messages>=1.1.1",
1213
"vonage-number-insight>=1.0.0",
1314
"vonage-number-insight-v2>=0.1.1b0",

vonage/src/vonage/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '3.99.0a8'
1+
__version__ = '3.99.0a10'

vonage_utils/CHANGES.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
# 1.1.0
1+
# 1.1.2
2+
- Refactoring common pydantic models across the monorepo into this package
3+
4+
# 1.1.1
25
- Update minimum dependency version
36

47
# 1.1.0

0 commit comments

Comments
 (0)