slackline/api/admin/roles

This module is generated by gleam run -m slackline_codegen/generate. Do not edit it by hand.

Admin API methods for assigning admin roles to users.

Types

Identifies admin.roles.addAssignments in the slackline.Call that add_assignments returns.

pub type AddAssignments

Identifies admin.roles.listAssignments in the slackline.Call that list_assignments returns.

pub type ListAssignments

A successful response from admin.roles.listAssignments.

pub type ListAssignmentsResponse {
  ListAssignmentsResponse(
    role_assignments: option.Option(List(RoleAssignment)),
    response_metadata: option.Option(slackline.ResponseMetadata),
  )
}

Constructors

Identifies admin.roles.removeAssignments in the slackline.Call that remove_assignments returns.

pub type RemoveAssignments

A role granted to a user for an org, workspace or channel.

pub type RoleAssignment {
  RoleAssignment(
    role_id: option.Option(String),
    entity_id: option.Option(String),
    user_id: option.Option(String),
    date_create: option.Option(Int),
  )
}

Constructors

  • RoleAssignment(
      role_id: option.Option(String),
      entity_id: option.Option(String),
      user_id: option.Option(String),
      date_create: option.Option(Int),
    )

    Arguments

    role_id

    The role ID, such as Rl0A.

    entity_id

    The org, workspace or channel the role applies to.

    user_id

    The user holding the role.

    date_create

    When the role was assigned, in Unix seconds.

Values

pub fn add_assignments(
  role_id role_id: String,
  entity_ids entity_ids: List(String),
  user_ids user_ids: List(String),
) -> slackline.Call(AddAssignments, Nil)

admin.roles.addAssignments: Adds members to the specified role with the specified scopes

roles.AddAssignments identifies this method in slackline.Call.

User token scopes: admin.roles:write.

Rate limit tier: t2.

Documented errors: cannot_modify_role_admin, failed_for_some_entities, failed_for_some_users, failed_for_some_users_and_entities, feature_not_enabled, invalid_actor, invalid_role_id, no_valid_entities, no_valid_users, too_many_entities, too_many_users.

pub fn list_assignments() -> slackline.Call(
  ListAssignments,
  ListAssignmentsResponse,
)

admin.roles.listAssignments: Lists assignments for all roles across entities. Options to scope results by any combination of roles or entities

roles.ListAssignments identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/admin/roles/list_assignments.

User token scopes: admin.roles:read.

Rate limit tier: t3.

Documented errors: feature_not_enabled, invalid_actor, invalid_cursor, invalid_role_id, invalid_sort.

pub fn list_assignments_response_decoder() -> decode.Decoder(
  ListAssignmentsResponse,
)

Decodes the response from admin.roles.listAssignments.

pub fn remove_assignments(
  role_id role_id: String,
  entity_ids entity_ids: List(String),
  user_ids user_ids: List(String),
) -> slackline.Call(RemoveAssignments, Nil)

admin.roles.removeAssignments: Removes a set of users from a role for the given scopes and entities

roles.RemoveAssignments identifies this method in slackline.Call.

User token scopes: admin.roles:write.

Rate limit tier: t2.

Documented errors: cannot_modify_role_admin, failed_for_some_entities, failed_for_some_users, failed_for_some_users_and_entities, feature_not_enabled, invalid_actor, invalid_role_id, no_valid_entities, no_valid_users, too_many_entities, too_many_users.

pub fn role_assignment_decoder() -> decode.Decoder(RoleAssignment)

Decodes RoleAssignment from json.

pub fn role_assignment_to_json(it: RoleAssignment) -> json.Json

Encodes RoleAssignment as json.

✨ Search Document