-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
25 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,8 +46,11 @@ It's recommended to create a new virtual environment to install the SDK. You can | |
# Create the virtual environment | ||
python3 -m venv venv | ||
|
||
# Activate the virtual environment | ||
# Activate the virtual environment in Mac/Linux | ||
. ./venv/bin/activate | ||
|
||
# Or on Windows Command Prompt | ||
venv\Scripts\activate | ||
``` | ||
|
||
To install the Python SDK package using pip: | ||
|
@@ -62,13 +65,7 @@ To upgrade your installed client library using pip: | |
pip install vonage --upgrade | ||
``` | ||
|
||
Alternatively, you can clone the repository via the command line: | ||
|
||
```bash | ||
git clone [email protected]:Vonage/vonage-python-sdk.git | ||
``` | ||
|
||
or by opening it on GitHub desktop. | ||
Alternatively, you can clone the repository via the command line, or by opening it on GitHub desktop. | ||
|
||
## Migration Guides | ||
|
||
|
@@ -99,6 +96,8 @@ print(response.model_dump(exclude_unset=True)) | |
|
||
## Usage | ||
|
||
Many of the use cases require you to buy a Vonage Number, which you can [do in the Vonage Developer Dashboard](https://dashboard.nexmo.com/). | ||
|
||
```python | ||
from vonage import Vonage, Auth, HttpClientOptions | ||
|
||
|
@@ -129,6 +128,17 @@ You can also access the underlying `HttpClient` instance through the `http_clien | |
user_agent = vonage.http_client.user_agent | ||
``` | ||
|
||
### Convert a Pydantic Model to Dict or Json | ||
|
||
Most responses to API calls in the SDK are Pydantic models. To convert a Pydantic model to a dict, use `model.model_dump`. To convert to a JSON string, use `model.model_dump_json` | ||
|
||
```python | ||
response = vonage.api_package.api_call(...) | ||
|
||
response_dict = response.model_dump() | ||
response_json = response.model_dump_json() | ||
``` | ||
|
||
## Account API | ||
|
||
### Get Account Balance | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,2 @@ | ||
# 2.0.0 | ||
- Rename to "Verify Legacy", rename `vonage-verify` -> `vonage-verify-legacy`, `Verify` -> `VerifyLegacy`, etc. | ||
- Update dependency versions | ||
|
||
# 1.1.3 | ||
- Support for Python 3.13, drop support for 3.8 | ||
|
||
# 1.1.2 | ||
- Add docstrings to data models | ||
|
||
# 1.1.1 | ||
- Update minimum dependency version | ||
|
||
# 1.1.0 | ||
- Add `http_client` property | ||
|
||
# 1.0.1 | ||
- Internal refactoring | ||
|
||
# 1.0.0 | ||
- Initial upload | ||
- Initial upload as `legacy` package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '2.0.0' | ||
__version__ = '1.0.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters