This PR introduces a bunch of changes to support multi-account usage:
creates a Config struct with everything required to do requests to Twilio API.
move the old behavior to ExTwilio.Config.Env, so all changes can be backward compatible and doesn't require any code changing for people moving from older versions.
Reasoning for all the changes:
stop using application configuration(recommended in the Library Guidelines.)
allows multi-account usage
allows testing with bypass or other means once you can provide the desired url for the subdomains(either by setting it with application configuration or by using the actual config struct).
I've done just a small change in ExTwilio.UrlGenerator just as an example on how it can be used throughout the codebase. Most probably it's better to inject the Config.new() default config earlier as possible, to avoid it being called multiple times for a single request.
@danielberkompas can you please take a look to make sure that I'm in the right direction, I'd like to finish adjusting the code to use the config struct.
This PR introduces a bunch of changes to support multi-account usage:
Reasoning for all the changes:
I've done just a small change in
ExTwilio.UrlGenerator
just as an example on how it can be used throughout the codebase. Most probably it's better to inject theConfig.new()
default config earlier as possible, to avoid it being called multiple times for a single request.