=encoding utf8

=head1 NAME

OpenAPI::Client::OpenAI::Path::organization-users-user_id-roles - Documentation for the /organization/users/{user_id}/roles path.

=head1 OPERATIONS

=head2 GET /organization/users/{user_id}/roles

=head3 list-user-role-assignments

  $client->list_user_role_assignments({
      body => { ... },
  });

Lists the organization roles assigned to a user within the organization.

=head4 Path/query parameters

=over

=item * C<user_id> (in path, required, string) - The ID of the user to inspect.

=item * C<limit> (in query, optional, integer) - A limit on the number of organization role assignments to return.

=item * C<after> (in query, optional, string) - Cursor for pagination. Provide the value from the previous response's C<next>
field to continue listing organization roles.

=item * C<order> (in query, optional, string) - Sort order for the returned organization roles.

Allowed values: asc, desc

=back

=head4 Responses

B<200 - User organization role assignments listed successfully.>

Content-Type: application/json

Example:

    {
       "data" : [
          {
             "assignment_sources" : null,
             "created_at" : 1711471533,
             "created_by" : "user_abc123",
             "created_by_user_obj" : {
                "email" : "ada@example.com",
                "id" : "user_abc123",
                "name" : "Ada Lovelace"
             },
             "description" : "Allows managing organization groups",
             "id" : "role_01J1F8ROLE01",
             "metadata" : {},
             "name" : "API Group Manager",
             "permissions" : [
                "api.groups.read",
                "api.groups.write"
             ],
             "predefined_role" : false,
             "resource_type" : "api.organization",
             "updated_at" : 1711472599
          }
       ],
       "has_more" : false,
       "next" : null,
       "object" : "list"
    }

=head2 POST /organization/users/{user_id}/roles

=head3 assign-user-role

  $client->assign_user_role({
      body => { ... },
  });

Assigns an organization role to a user within the organization.

=head4 Path/query parameters

=over

=item * C<user_id> (in path, required, string) - The ID of the user that should receive the organization role.

=back

=head4 Responses

B<200 - Organization role assigned to the user successfully.>

Content-Type: application/json

Example:

    {
       "object" : "user.role",
       "role" : {
          "description" : "Allows managing organization groups",
          "id" : "role_01J1F8ROLE01",
          "name" : "API Group Manager",
          "object" : "role",
          "permissions" : [
             "api.groups.read",
             "api.groups.write"
          ],
          "predefined_role" : false,
          "resource_type" : "api.organization"
       },
       "user" : {
          "added_at" : 1711470000,
          "email" : "ada@example.com",
          "id" : "user_abc123",
          "name" : "Ada Lovelace",
          "object" : "organization.user",
          "role" : "owner"
       }
    }

=head1 SCHEMAS

=head2 AssignedRoleDetails

Properties:

=over

=item * C<assignment_sources> (anyOf, required) - Principals from which the role assignment is inherited, when available.

=item * C<created_at> (anyOf, required) - When the role was created.

=item * C<created_by> (anyOf, required) - Identifier of the actor who created the role.

=item * C<created_by_user_obj> (anyOf, required) - User details for the actor that created the role, when available.

=item * C<description> (anyOf, required) - Description of the role.

=item * C<id> (string, required) - Identifier for the role.

=item * C<metadata> (anyOf, required) - Arbitrary metadata stored on the role.

=item * C<name> (string, required) - Name of the role.

=item * C<permissions> (array of string, required) - Permissions associated with the role.

=item * C<predefined_role> (boolean, required) - Whether the role is predefined by OpenAI.

=item * C<resource_type> (string, required) - Resource type the role applies to.

=item * C<updated_at> (anyOf, required) - When the role was last updated.

=back

=head2 PublicAssignOrganizationGroupRoleBody

Properties:

=over

=item * C<role_id> (string, required) - Identifier of the role to assign.

=back

=head2 Role

Properties:

=over

=item * C<description> (anyOf, required) - Optional description of the role.

=item * C<id> (string, required) - Identifier for the role.

=item * C<name> (string, required) - Unique name for the role.

=item * C<object> (string, required) - Always C<role> .

Allowed values: role

=item * C<permissions> (array of string, required) - Permissions granted by the role.

=item * C<predefined_role> (boolean, required) - Whether the role is predefined and managed by OpenAI.

=item * C<resource_type> (string, required) - Resource type the role is bound to (for example C<api.organization> or
C<api.project> ).

=back

=head2 RoleListResource

Properties:

=over

=item * C<data> (array of AssignedRoleDetails, required) - Role assignments returned in the current page.

=item * C<has_more> (boolean, required) - Whether additional assignments are available when paginating.

=item * C<next> (anyOf, required) - Cursor to fetch the next page of results, or C<null> when there are no more
assignments.

=item * C<object> (string, required) - Always C<list> .

Allowed values: list

=back

=head2 User

Properties:

=over

=item * C<added_at> (integer, required) - The Unix timestamp (in seconds) of when the user was added.

=item * C<api_key_last_used_at> (anyOf) - The Unix timestamp (in seconds) of the user's last API key usage.

=item * C<created> (integer) - The Unix timestamp (in seconds) of when the user was created.

=item * C<developer_persona> (anyOf) - The developer persona metadata for the user.

=item * C<email> (anyOf) - The email address of the user

=item * C<id> (string, required) - The identifier, which can be referenced in API endpoints

=item * C<is_default> (boolean) - Whether this is the organization's default user.

=item * C<is_scale_tier_authorized_purchaser> (anyOf) - Whether the user is an authorized purchaser for Scale Tier.

=item * C<is_scim_managed> (boolean) - Whether the user is managed through SCIM.

=item * C<is_service_account> (boolean) - Whether the user is a service account.

=item * C<name> (anyOf) - The name of the user

=item * C<object> (string, required) - The object type, which is always C<organization.user>

Allowed values: organization.user

=item * C<projects> (anyOf) - Projects associated with the user, if included.

=item * C<role> (anyOf) - C<owner> or C<reader>

=item * C<technical_level> (anyOf) - The technical level metadata for the user.

=item * C<user> (object) - Nested user details.

=back

=head2 UserRoleAssignment

Properties:

=over

=item * C<object> (string, required) - Always C<user.role> .

Allowed values: user.role

=item * C<role> (Role, required)

See L</Role> below for shape.

=item * C<user> (User, required)

See L</User> below for shape.

=back

=head1 SEE ALSO

L<OpenAPI::Client::OpenAI::Path>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2023-2026 by Nelson Ferraz

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.14.0 or,
at your option, any later version of Perl 5 you may have available.

=cut
