NAME

Twilio::Rest::PreviewIam::Versionless::Organization::RoleAssignment - The RoleAssignment resource

SYNOPSIS

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

my $role_assignment = $client->preview_iam->versionless->organization($organization_sid)->role_assignments->create(\%body);
for my $role_assignment ($client->preview_iam->versionless->organization($organization_sid)->role_assignments->read({}, 20)) {
  ...
}
$client->preview_iam->versionless->organization($organization_sid)->role_assignments($role_assignment_sid)->delete;

DESCRIPTION

This file holds RoleAssignmentList, RoleAssignmentPage, RoleAssignmentContext and RoleAssignmentInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.

RoleAssignmentList

Returned by $client->preview_iam->versionless->organization($organization_sid)->role_assignments. See also Twilio::ListResource.

create

my $role_assignment = $client->preview_iam->versionless->organization($organization_sid)->role_assignments->create(\%body);

Create a role assignment for the given organization. Returns a RoleAssignmentInstance.

%body is sent as JSON. It takes the names Twilio's API documentation uses.

Its fields are:

identity

Required. Twilio Sid representing identity of this assignment

resource_id

The resource id for resource-level role assignments

resource_type

The resource type for resource-level role assignments

role_sid

Required. Twilio Role Sid representing assigned role

scope

Required. Twilio Sid representing scope of this assignment

read

my @records = $client->preview_iam->versionless->organization($organization_sid)->role_assignments->read(\%options, $limit, $page_size);

List role assignments for the given organization. Returns the records as a list, fetching as many pages as it needs.

The options are:

identity

No description in the specification.

resource_id

Filter by resource id for resource-level role assignments

resource_type

Filter by resource type for resource-level role assignments

scope

No description in the specification.

stream

my $stream = $client->preview_iam->versionless->organization($organization_sid)->role_assignments->stream(\%options, $limit, $page_size);

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

page

my $page = $client->preview_iam->versionless->organization($organization_sid)->role_assignments->page(\%options, $page_size, $page_token, $page_number);

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

get_page

my $page = $client->preview_iam->versionless->organization($organization_sid)->role_assignments->get_page($url);

Fetches the page at a URL given by Twilio.

get_context

my $context = $client->preview_iam->versionless->organization($organization_sid)->role_assignments->get_context($role_assignment_sid);

Returns a RoleAssignmentContext, and makes no request.

RoleAssignmentPage

A Twilio::Page of RoleAssignmentInstance objects.

records_key

build_instance

Used by Twilio::Page.

RoleAssignmentContext

Returned by $client->preview_iam->versionless->organization($organization_sid)->role_assignments($role_assignment_sid). It makes no request until one of these methods is called.

delete

$client->preview_iam->versionless->organization($organization_sid)->role_assignments($role_assignment_sid)->delete;

Delete a role assignment for the given organization. Returns true.

RoleAssignmentInstance

See also Twilio::InstanceResource.

It has delete, which work as they do on the context.

Its fields are:

identity

Twilio Sid representing scope of this assignment

resource_id

The resource id for resource-level role assignments

resource_type

The resource type for resource-level role assignments

role_sid

Twilio Role Sid representing assigned role

scope

Twilio Sid representing identity of this assignment

sid

Twilio Role Assignment Sid representing this role assignment

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.