NAME

Twilio::Rest::Serverless::V1::Service::Asset - The Asset resource

SYNOPSIS

my $client = Twilio::Rest::Client->new($account_sid, $auth_token);

my $asset = $client->serverless->v1->services($service_sid)->assets->create($friendly_name);
for my $asset ($client->serverless->v1->services($service_sid)->assets->read({}, 20)) {
  ...
}
my $asset = $client->serverless->v1->services($service_sid)->assets($sid)->fetch;
$client->serverless->v1->services($service_sid)->assets($sid)->update($friendly_name);
$client->serverless->v1->services($service_sid)->assets($sid)->delete;

DESCRIPTION

A wrapper that represents a static file and groups the different Versions of the static file.

This file holds AssetList, AssetPage, AssetContext and AssetInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.

AssetList

Returned by $client->serverless->v1->services($service_sid)->assets. See also Twilio::ListResource.

create

my $asset = $client->serverless->v1->services($service_sid)->assets->create($friendly_name);

Create a new Asset resource. Returns a AssetInstance.

The required values are:

$friendly_name

A descriptive string that you create to describe the Asset resource. It can be a maximum of 255 characters.

read

my @records = $client->serverless->v1->services($service_sid)->assets->read(\%options, $limit, $page_size);

Retrieve a list of all Assets. Returns the records as a list, fetching as many pages as it needs.

stream

my $stream = $client->serverless->v1->services($service_sid)->assets->stream(\%options, $limit, $page_size);

Takes the same arguments as "read", and returns a Twilio::Stream.

page

my $page = $client->serverless->v1->services($service_sid)->assets->page(\%options, $page_size, $page_token, $page_number);

Fetches one page, and returns a Twilio::Page.

get_page

my $page = $client->serverless->v1->services($service_sid)->assets->get_page($url);

Fetches the page at a URL given by Twilio.

get_context

my $context = $client->serverless->v1->services($service_sid)->assets->get_context($sid);

Returns a AssetContext, and makes no request.

AssetPage

A Twilio::Page of AssetInstance objects.

records_key

build_instance

Used by Twilio::Page.

AssetContext

Returned by $client->serverless->v1->services($service_sid)->assets($sid). It makes no request until one of these methods is called.

fetch

my $asset = $client->serverless->v1->services($service_sid)->assets($sid)->fetch;

Retrieve a specific Asset resource. Returns a AssetInstance.

update

my $asset = $client->serverless->v1->services($service_sid)->assets($sid)->update($friendly_name);

Update a specific Asset resource. Returns a AssetInstance.

The required values are:

$friendly_name

A descriptive string that you create to describe the Asset resource. It can be a maximum of 255 characters.

delete

$client->serverless->v1->services($service_sid)->assets($sid)->delete;

Delete an Asset resource. Returns true.

asset_versions

my $list = $object->asset_versions;

my $context = $object->asset_versions($sid);

See Twilio::Rest::Serverless::V1::Service::Asset::AssetVersion.

AssetInstance

See also Twilio::InstanceResource.

It has fetch, update, delete and asset_versions, which work as they do on the context.

Its fields are:

account_sid

The SID of the Account that created the Asset resource.

date_created

The date and time in GMT when the Asset resource was created specified in ISO 8601 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.

date_updated

The date and time in GMT when the Asset resource was last updated specified in ISO 8601 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.

friendly_name

The string that you assigned to describe the Asset resource. It can be a maximum of 255 characters.

The URLs of the Asset resource's nested resources.

service_sid

The SID of the Service that the Asset resource is associated with.

sid

The unique string that we created to identify the Asset resource.

url

The absolute URL of the Asset resource.

CONSTRUCTORS

new

Objects here come from the methods above, so there is no need to call new directly.

LICENSE

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