twilio / twilio-go

A Go package for communicating with the Twilio API.
MIT License
272 stars 40 forks source link

feat: add context.Context support #197

Closed natebrennand closed 1 year ago

natebrennand commented 1 year ago

Fixes #98

(to be rebased after landing https://github.com/twilio/twilio-go/pull/196)

This PR uses the new alternative base client interfaces, BaseClientWithCtx and RequestHandlerWithCtx, that allow context.Context objects to be provided to every API request. This will allow the Twilio SDK to support context cancellations, and for custom HTTP clients to access the context while executing the request.

The final commit regenerates the SDK with oai-generator changes in this PR: https://github.com/twilio/twilio-oai-generator/pull/301

The contributions are split by commit, but I can make this 2 separate PR's if you'd like me to separate the SDK regeneration from the client changes.

Checklist

natebrennand commented 1 year ago

Need to regenerate for new API's added, will update