sfreiberg / gotwilio

Twilio library for Go (golang).
BSD 2-Clause "Simplified" License
342 stars 136 forks source link

update usage type in `UsageRecord` to match Twilio definition #105

Open sshapir opened 2 years ago

sshapir commented 2 years ago

Twilio returns usage as a string, which can be parsed to an integer or decimal type depending on the usage_unit. Using Twilio's Python client to fetch usage records, it was clear that the string value sometimes mapped to an int and a double in others for different corresponding usage_unit values. It is safer to just return the string and let the caller convert it to the expected value.

sfreiberg commented 2 years ago

Unfortunately this is a breaking change and I need to move to versioning before I can make breaking changes.