NAME
Twilio::Deserialize - Convert API values to Perl values
SYNOPSIS
my $date = Twilio::Deserialize::date_time('Thu, 30 Jul 2015 20:12:31 +0000');
say $date->ymd;
DESCRIPTION
Functions that generated resources use to read their responses. None of them are exported.
FUNCTIONS
date_time
Returns a Time::Piece object in UTC for a date in any format Twilio uses: RFC 2822, as in Thu, 30 Jul 2015 20:12:31 +0000, ISO 8601, as in 2015-07-30T20:12:31Z, or 2015-07-30.
A value that cannot be read is returned as it is, so that an unexpected format never breaks a response. This is why the result should be checked with ref before relying on it, if the value does not come from a documented field.
To work with a DateTime object instead:
my $date_time = DateTime->from_epoch(epoch => $date->epoch);
phone_number_capabilities
Returns a Twilio::Base::PhoneNumberCapabilities object. A value that is not a hash reference holding at least one capability is returned as it is.
LICENSE
Copyright (c) 2026 Francisco Zarabozo. Released under the MIT License.