NAME
Twilio::Rest::Serverless::V1::Service::Function - The Function resource
SYNOPSIS
my $client = Twilio::Rest::Client->new($account_sid, $auth_token);
my $function = $client->serverless->v1->services($service_sid)->functions->create($friendly_name);
for my $function ($client->serverless->v1->services($service_sid)->functions->read({}, 20)) {
...
}
my $function = $client->serverless->v1->services($service_sid)->functions($sid)->fetch;
$client->serverless->v1->services($service_sid)->functions($sid)->update($friendly_name);
$client->serverless->v1->services($service_sid)->functions($sid)->delete;
DESCRIPTION
A wrapper that represents a Serverless JavaScript function and groups the different and groups the different Versions of this code.
This file holds FunctionList, FunctionPage, FunctionContext and FunctionInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.
FunctionList
Returned by $client->serverless->v1->services($service_sid)->functions. See also Twilio::ListResource.
create
my $function = $client->serverless->v1->services($service_sid)->functions->create($friendly_name);
Create a new Function resource. Returns a FunctionInstance.
The required values are:
$friendly_name-
A descriptive string that you create to describe the Function resource. It can be a maximum of 255 characters.
read
my @records = $client->serverless->v1->services($service_sid)->functions->read(\%options, $limit, $page_size);
Retrieve a list of all Functions. Returns the records as a list, fetching as many pages as it needs.
stream
my $stream = $client->serverless->v1->services($service_sid)->functions->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)->functions->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)->functions->get_page($url);
Fetches the page at a URL given by Twilio.
get_context
my $context = $client->serverless->v1->services($service_sid)->functions->get_context($sid);
Returns a FunctionContext, and makes no request.
FunctionPage
A Twilio::Page of FunctionInstance objects.
records_key
build_instance
Used by Twilio::Page.
FunctionContext
Returned by $client->serverless->v1->services($service_sid)->functions($sid). It makes no request until one of these methods is called.
fetch
my $function = $client->serverless->v1->services($service_sid)->functions($sid)->fetch;
Retrieve a specific Function resource. Returns a FunctionInstance.
update
my $function = $client->serverless->v1->services($service_sid)->functions($sid)->update($friendly_name);
Update a specific Function resource. Returns a FunctionInstance.
The required values are:
$friendly_name-
A descriptive string that you create to describe the Function resource. It can be a maximum of 255 characters.
delete
$client->serverless->v1->services($service_sid)->functions($sid)->delete;
Delete a Function resource. Returns true.
function_versions
my $list = $object->function_versions;
my $context = $object->function_versions($sid);
See Twilio::Rest::Serverless::V1::Service::Function::FunctionVersion.
FunctionInstance
See also Twilio::InstanceResource.
It has fetch, update, delete and function_versions, which work as they do on the context.
Its fields are:
- account_sid
-
The SID of the Account that created the Function resource.
- date_created
-
The date and time in GMT when the Function 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 Function 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 Function resource. It can be a maximum of 255 characters.
- links
-
The URLs of nested resources of the Function resource.
- service_sid
-
The SID of the Service that the Function resource is associated with.
- sid
-
The unique string that we created to identify the Function resource.
- url
-
The absolute URL of the Function 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.