NAME

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

SYNOPSIS

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

my $environment = $client->serverless->v1->services($service_sid)->environments->create($unique_name, \%options);
for my $environment ($client->serverless->v1->services($service_sid)->environments->read({}, 20)) {
  ...
}
my $environment = $client->serverless->v1->services($service_sid)->environments($sid)->fetch;
$client->serverless->v1->services($service_sid)->environments($sid)->delete;

DESCRIPTION

Represents a deployed build of a given set of Functions and/or Assets at a specific URL.

This file holds EnvironmentList, EnvironmentPage, EnvironmentContext and EnvironmentInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.

EnvironmentList

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

create

my $environment = $client->serverless->v1->services($service_sid)->environments->create($unique_name, \%options);

Create a new environment. Returns a EnvironmentInstance.

The required values are:

$unique_name

A user-defined string that uniquely identifies the Environment resource. It can be a maximum of 100 characters.

The options are:

domain_suffix

A URL-friendly name that represents the environment and forms part of the domain name. It can be a maximum of 16 characters.

read

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

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

stream

my $stream = $client->serverless->v1->services($service_sid)->environments->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->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->get_page($url);

Fetches the page at a URL given by Twilio.

get_context

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

Returns a EnvironmentContext, and makes no request.

EnvironmentPage

A Twilio::Page of EnvironmentInstance objects.

records_key

build_instance

Used by Twilio::Page.

EnvironmentContext

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

fetch

my $environment = $client->serverless->v1->services($service_sid)->environments($sid)->fetch;

Retrieve a specific environment. Returns a EnvironmentInstance.

delete

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

Delete a specific environment. Returns true.

deployments

my $list = $object->deployments;

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

See Twilio::Rest::Serverless::V1::Service::Environment::Deployment.

logs

my $list = $object->logs;

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

See Twilio::Rest::Serverless::V1::Service::Environment::Log.

variables

my $list = $object->variables;

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

See Twilio::Rest::Serverless::V1::Service::Environment::Variable.

EnvironmentInstance

See also Twilio::InstanceResource.

It has fetch, delete, deployments, logs and variables, which work as they do on the context.

Its fields are:

account_sid

The SID of the Account that created the Environment resource.

build_sid

The SID of the build deployed in the environment.

date_created

The date and time in GMT when the Environment 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 Environment resource was last updated specified in ISO 8601 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.

domain_name

The domain name for all Functions and Assets deployed in the Environment, using the Service unique name, a randomly-generated Service suffix, and an optional Environment domain suffix.

domain_suffix

A URL-friendly name that represents the environment and forms part of the domain name.

The URLs of the Environment resource's nested resources.

service_sid

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

sid

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

unique_name

A user-defined string that uniquely identifies the Environment resource.

url

The absolute URL of the Environment 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.