pub struct PermissionsClient { /* private fields */ }Expand description
Client for permissions operations.
Implementations§
Source§impl PermissionsClient
impl PermissionsClient
pub fn new(client: Client) -> Self
Sourcepub async fn archive_permission(
&self,
permission_id: String,
body: ArchivePermissionRequest,
) -> Result<ArchivePermissionResponse, Error>
pub async fn archive_permission( &self, permission_id: String, body: ArchivePermissionRequest, ) -> Result<ArchivePermissionResponse, Error>
Archives or unarchives a permission (role). Archived permissions are effectively soft-deleted.
Sourcepub async fn list_permission_assignments(
&self,
permission_id: String,
query: Option<ListPermissionAssignmentsQuery>,
) -> Result<ListPermissionAssignmentsResponse, Error>
pub async fn list_permission_assignments( &self, permission_id: String, query: Option<ListPermissionAssignmentsQuery>, ) -> Result<ListPermissionAssignmentsResponse, Error>
Lists all permission (role) assignments for a given permission.
Sourcepub async fn assign_permission(
&self,
permission_id: String,
body: AssignPermissionRequest,
) -> Result<AssignPermissionResponse, Error>
pub async fn assign_permission( &self, permission_id: String, body: AssignPermissionRequest, ) -> Result<AssignPermissionResponse, Error>
Assigns a permission (role) to an identity (user, PAT or service account), granting it access to the operations defined in the permission. Returns the assignment on success (200), or a pending change request if approval is required (202).
Sourcepub async fn list_permissions(
&self,
query: Option<ListPermissionsQuery>,
) -> Result<ListPermissionsResponse, Error>
pub async fn list_permissions( &self, query: Option<ListPermissionsQuery>, ) -> Result<ListPermissionsResponse, Error>
Lists all permissions (roles) in the organization.
Sourcepub async fn create_permission(
&self,
body: CreatePermissionRequest,
) -> Result<CreatePermissionResponse, Error>
pub async fn create_permission( &self, body: CreatePermissionRequest, ) -> Result<CreatePermissionResponse, Error>
Creates a new permission (also referred to as “role” in the dashboard) that grants access to the specified API operations.
Sourcepub async fn revoke_permission(
&self,
permission_id: String,
assignment_id: String,
query: Option<RevokePermissionQuery>,
) -> Result<(), Error>
pub async fn revoke_permission( &self, permission_id: String, assignment_id: String, query: Option<RevokePermissionQuery>, ) -> Result<(), Error>
Revokes a permission (role) assignment, removing the identity’s access to the operations granted by the permission.
Sourcepub async fn get_permission(
&self,
permission_id: String,
) -> Result<GetPermissionResponse, Error>
pub async fn get_permission( &self, permission_id: String, ) -> Result<GetPermissionResponse, Error>
Retrieves a permission (role) by ID, including any pending change request.
Sourcepub async fn update_permission(
&self,
permission_id: String,
body: UpdatePermissionRequest,
) -> Result<UpdatePermissionResponse, Error>
pub async fn update_permission( &self, permission_id: String, body: UpdatePermissionRequest, ) -> Result<UpdatePermissionResponse, Error>
Updates the name or operations of an existing permission (role).
Trait Implementations§
Source§impl Clone for PermissionsClient
impl Clone for PermissionsClient
Source§fn clone(&self) -> PermissionsClient
fn clone(&self) -> PermissionsClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more