NAME
Twilio::Rest::Serverless::V1::Service::Environment::Variable - The Variable resource
SYNOPSIS
my $client = Twilio::Rest::Client->new($account_sid, $auth_token);
my $variable = $client->serverless->v1->services($service_sid)->environments($environment_sid)->variables->create($key, $value);
for my $variable ($client->serverless->v1->services($service_sid)->environments($environment_sid)->variables->read({}, 20)) {
...
}
my $variable = $client->serverless->v1->services($service_sid)->environments($environment_sid)->variables($sid)->fetch;
$client->serverless->v1->services($service_sid)->environments($environment_sid)->variables($sid)->update(\%options);
$client->serverless->v1->services($service_sid)->environments($environment_sid)->variables($sid)->delete;
DESCRIPTION
A key and value pair that is specific to an Environment.
This file holds VariableList, VariablePage, VariableContext and VariableInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.
VariableList
Returned by $client->serverless->v1->services($service_sid)->environments($environment_sid)->variables. See also Twilio::ListResource.
create
my $variable = $client->serverless->v1->services($service_sid)->environments($environment_sid)->variables->create($key, $value);
Create a new Variable. Returns a VariableInstance.
The required values are:
$key-
A string by which the Variable resource can be referenced. It can be a maximum of 128 characters.
$value-
A string that contains the actual value of the Variable. It can be a maximum of 450 bytes in size.
read
my @records = $client->serverless->v1->services($service_sid)->environments($environment_sid)->variables->read(\%options, $limit, $page_size);
Retrieve a list of all Variables. Returns the records as a list, fetching as many pages as it needs.
stream
my $stream = $client->serverless->v1->services($service_sid)->environments($environment_sid)->variables->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)->environments($environment_sid)->variables->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)->environments($environment_sid)->variables->get_page($url);
Fetches the page at a URL given by Twilio.
get_context
my $context = $client->serverless->v1->services($service_sid)->environments($environment_sid)->variables->get_context($sid);
Returns a VariableContext, and makes no request.
VariablePage
A Twilio::Page of VariableInstance objects.
records_key
build_instance
Used by Twilio::Page.
VariableContext
Returned by $client->serverless->v1->services($service_sid)->environments($environment_sid)->variables($sid). It makes no request until one of these methods is called.
fetch
my $variable = $client->serverless->v1->services($service_sid)->environments($environment_sid)->variables($sid)->fetch;
Retrieve a specific Variable. Returns a VariableInstance.
update
my $variable = $client->serverless->v1->services($service_sid)->environments($environment_sid)->variables($sid)->update(\%options);
Update a specific Variable. Returns a VariableInstance.
The options are:
key-
A string by which the Variable resource can be referenced. It can be a maximum of 128 characters.
value-
A string that contains the actual value of the Variable. It can be a maximum of 450 bytes in size.
delete
$client->serverless->v1->services($service_sid)->environments($environment_sid)->variables($sid)->delete;
Delete a specific Variable. Returns true.
VariableInstance
See also Twilio::InstanceResource.
It has fetch, update and delete, which work as they do on the context.
Its fields are:
- account_sid
-
The SID of the Account that created the Variable resource.
- date_created
-
The date and time in GMT when the Variable 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 Variable resource was last updated specified in ISO 8601 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.
- environment_sid
-
The SID of the Environment in which the Variable exists.
- key
-
A string by which the Variable resource can be referenced.
- service_sid
-
The SID of the Service that the Variable resource is associated with.
- sid
-
The unique string that we created to identify the Variable resource.
- url
-
The absolute URL of the Variable resource.
- value
-
A string that contains the actual value of the Variable.
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.