NAME

Twilio::Rest::Voice::V1::ConnectionPolicy::ConnectionPolicyTarget - The ConnectionPolicyTarget resource

SYNOPSIS

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

my $connection_policy_target = $client->voice->v1->connection_policies($connection_policy_sid)->targets->create($target, \%options);
for my $connection_policy_target ($client->voice->v1->connection_policies($connection_policy_sid)->targets->read({}, 20)) {
  ...
}
my $connection_policy_target = $client->voice->v1->connection_policies($connection_policy_sid)->targets($sid)->fetch;
$client->voice->v1->connection_policies($connection_policy_sid)->targets($sid)->update(\%options);
$client->voice->v1->connection_policies($connection_policy_sid)->targets($sid)->delete;

DESCRIPTION

Network element entry points into your communications infrastructure

This file holds ConnectionPolicyTargetList, ConnectionPolicyTargetPage, ConnectionPolicyTargetContext and ConnectionPolicyTargetInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.

ConnectionPolicyTargetList

Returned by $client->voice->v1->connection_policies($connection_policy_sid)->targets. See also Twilio::ListResource.

create

my $connection_policy_target = $client->voice->v1->connection_policies($connection_policy_sid)->targets->create($target, \%options);

Returns a ConnectionPolicyTargetInstance.

The required values are:

$target

The SIP address you want Twilio to route your calls to. This must be a sip: schema. sips is NOT supported.

The options are:

enabled

Whether the Target is enabled. The default is true.

friendly_name

A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long.

priority

The relative importance of the target. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important target.

weight

The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. Targets with higher values receive more load than those with lower ones with the same priority.

read

my @records = $client->voice->v1->connection_policies($connection_policy_sid)->targets->read(\%options, $limit, $page_size);

Returns the records as a list, fetching as many pages as it needs.

stream

my $stream = $client->voice->v1->connection_policies($connection_policy_sid)->targets->stream(\%options, $limit, $page_size);

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

page

my $page = $client->voice->v1->connection_policies($connection_policy_sid)->targets->page(\%options, $page_size, $page_token, $page_number);

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

get_page

my $page = $client->voice->v1->connection_policies($connection_policy_sid)->targets->get_page($url);

Fetches the page at a URL given by Twilio.

get_context

my $context = $client->voice->v1->connection_policies($connection_policy_sid)->targets->get_context($sid);

Returns a ConnectionPolicyTargetContext, and makes no request.

ConnectionPolicyTargetPage

A Twilio::Page of ConnectionPolicyTargetInstance objects.

records_key

build_instance

Used by Twilio::Page.

ConnectionPolicyTargetContext

Returned by $client->voice->v1->connection_policies($connection_policy_sid)->targets($sid). It makes no request until one of these methods is called.

fetch

my $connection_policy_target = $client->voice->v1->connection_policies($connection_policy_sid)->targets($sid)->fetch;

Returns a ConnectionPolicyTargetInstance.

update

my $connection_policy_target = $client->voice->v1->connection_policies($connection_policy_sid)->targets($sid)->update(\%options);

Returns a ConnectionPolicyTargetInstance.

The options are:

enabled

Whether the Target is enabled.

friendly_name

A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long.

priority

The relative importance of the target. Can be an integer from 0 to 65535, inclusive. The lowest number represents the most important target.

target

The SIP address you want Twilio to route your calls to. This must be a sip: schema. sips is NOT supported.

weight

The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive. Targets with higher values receive more load than those with lower ones with the same priority.

delete

$client->voice->v1->connection_policies($connection_policy_sid)->targets($sid)->delete;

Returns true.

ConnectionPolicyTargetInstance

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 Target resource.

connection_policy_sid

The SID of the Connection Policy that owns the Target.

date_created

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

date_updated

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

enabled

Whether the target is enabled. The default is true.

friendly_name

The string that you assigned to describe the resource.

priority

The relative importance of the target. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important target.

sid

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

target

The SIP address you want Twilio to route your calls to. This must be a sip: schema. sips is NOT supported.

url

The absolute URL of the resource.

weight

The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. Targets with higher values receive more load than those with lower ones with the same priority.

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.