NAME
Twilio::Jwt::Client::ScopeURI - One permission inside a capability token
SYNOPSIS
my $scope = Twilio::Jwt::Client::ScopeURI->new('client', 'incoming', { clientName => 'me' });
print $scope->to_string; # scope:client:incoming?clientName=me
my $same = Twilio::Jwt::Client::ScopeURI->parse($scope->to_string);
DESCRIPTION
Used by Twilio::Jwt::ClientToken.
METHODS
new
my $scope = Twilio::Jwt::Client::ScopeURI->new($service, $privilege, $params);
$params is a hash reference, written with its names sorted, or an array reference of pairs, written in the order given.
parse
my $scope = Twilio::Jwt::Client::ScopeURI->parse($uri);
Reads a scope back. It throws Twilio::Exceptions::TwilioException when the text is not a scope.
to_string
Returns the text of the scope.
add_param
$scope->add_param($name, $value);
Sets a parameter, and returns the scope.
build_query
my $query = Twilio::Jwt::Client::ScopeURI->build_query($params);
Returns parameters as a URL query, encoded as PHP's http_build_query does.
get_service
get_privilege
get_params
Return each part of the scope. get_params returns a hash reference.
LICENSE
Copyright (c) 2026 Francisco Zarabozo. Released under the MIT License.