NAME
Twilio::ListResource - Base class for a collection of records
DESCRIPTION
A list is the collection endpoint of a resource, such as the messages of an account. Each resource has a subclass that sets uri and solution in its constructor, and only the operations Twilio offers for it. This is why read and stream are not defined here: a list without them must not respond to them.
METHODS
new
my $list = Twilio::ListResource->new($version);
read_records
my @records = $list->read_records(\%options, $limit, $page_size);
Returns the records as a list, fetching as many pages as it needs. The read method of a subclass calls this.
stream_records
my $stream = $list->stream_records(\%options, $limit, $page_size);
Fetches the first page and returns a Twilio::Stream that starts there. It calls the page method of the subclass, with the options and page size. The stream method of a subclass calls this.
with_metadata
my $answer = $client->messages->with_metadata(create => $to, { body => 'Hi' });
my $listed = $client->messages->with_metadata(read => {}, 20);
Runs one of the list's operations, such as create, read, stream or page, with the arguments that follow its name. Returns a Twilio::Metadata with what the operation returns, and the status code and headers of Twilio's answer. It dies when the list has no such operation.
LICENSE
Copyright (c) 2026 Francisco Zarabozo. Released under the MIT License.