TwilioMagicValues.NumberPurchasing (Twilio Magic Values v1.0.7) View Source
Wrapper for Twilio magic phone numbers used in tests buying phone numbers.
See: https://www.twilio.com/docs/iam/test-credentials#test-incoming-phone-numbers
Link to this section Summary
Functions
Returns the magic area code which has numbers available for purchase.
Returns the magic area code which has NO numbers available for purchase.
Returns the magic phone number which is INVALID for purchase.
Returns the magic phone number which is UNAVAILABLE for purchase.
Returns the magic phone number which is VALID for purchase.
Link to this section Functions
Returns the magic area code which has numbers available for purchase.
Expect no error, and the purchased phone number to be: +15005550006
Example
iex> map = buy_number(area_code: TwilioMagicValues.NumberPurchasing.available_area_code())
iex> Map.get(map, :code, "There was no error code")
"There was no error code"
iex> Map.get(map, :friendly_name)
"(500) 555-0006"
Returns the magic area code which has NO numbers available for purchase.
Expect the 21452 API error from Twilio.
Example
iex> map = buy_number(area_code: TwilioMagicValues.NumberPurchasing.empty_area_code())
iex> Map.get(map, :code)
21452
Returns the magic phone number which is INVALID for purchase.
Expect the 21421 API error from Twilio.
Example
iex> map = buy_number(exactly: TwilioMagicValues.NumberPurchasing.invalid_phone_number())
iex> Map.get(map, :code)
21421
Returns the magic phone number which is VALID for purchase.
Expect no error.
Example
iex> map = buy_number(exactly: TwilioMagicValues.NumberPurchasing.valid_phone_number())
iex> Map.get(map, :code, "There was no error code")
"There was no error code"
iex> Map.get(map, :friendly_name)
"(500) 555-0006"