NAME

Twilio::InstanceResource - Base class for one record

SYNOPSIS

my $message = $client->messages->create($to, { from => $from, body => $body });

say $message->sid;

my $fields = $message->to_hash;

DESCRIPTION

An instance holds a record as Twilio returned it. Each resource has a subclass with one accessor per documented field. Every field is kept, including those newer than this library, which have no accessor but are returned by "to_hash".

METHODS

new

my $instance = Twilio::InstanceResource->new($version, $payload, \%solution);

$payload is the record, and %solution holds the identifiers needed to reach it, such as the account SID.

to_hash

my $fields = $instance->to_hash;

Returns a hash reference with the record's fields, as Twilio named them. This is toArray in PHP.

LICENSE

Copyright (c) 2026 Francisco Zarabozo. Released under the MIT License.