Adding classes for more APIs, Client class now instantiates API classes so methods can be called consistently
- Moved some client methods into their own classes:
account.py, application.py, message_search.py, number_insight.py, numbers.py, short_codes.py, ussd.py
- Deprecated the corresponding client methods. These will be removed in a major release that's coming soon.
- Client now instantiates a class object for each API when it is created, e.g.
vonage.Client(key="mykey", secret="mysecret")
instantiates instances ofAccount
,Sms
,NumberInsight
etc. These instances can now be called directly fromClient
, e.g.
client = vonage.Client(key="mykey", secret="mysecret")
print(f"Account balance is: {client.account.get_balance()}")
print("Sending an SMS")
client.sms.send_message(
"from": "Vonage",
"to": "SOME_PHONE_NUMBER",
"text": "Hello from Vonage's SMS API"
)