slackline/audit_logs
This module is generated by gleam run -m slackline_codegen/generate. Do not edit it by hand.
The Audit Logs API at
api.slack.com/audit/v1, for Enterprise organizations. logs() needs an
organization owner’s token with auditlogs:read; schemas() and
actions() need no token.
Types
Who did something. Always a user.
pub type AuditActor {
AuditActor(
actor_type: option.Option(String),
user: option.Option(AuditUser),
)
}
Constructors
-
AuditActor( actor_type: option.Option(String), user: option.Option(AuditUser), )
Where an event came from.
pub type AuditContext {
AuditContext(
location: option.Option(AuditLocation),
ua: option.Option(String),
ip_address: option.Option(String),
session_id: option.Option(String),
)
}
Constructors
-
AuditContext( location: option.Option(AuditLocation), ua: option.Option(String), ip_address: option.Option(String), session_id: option.Option(String), )Arguments
- ua
-
The user agent.
One audit event.
pub type AuditEntry {
AuditEntry(
id: String,
date_create: option.Option(Int),
action: String,
actor: option.Option(AuditActor),
entity: option.Option(value.Value),
context: option.Option(AuditContext),
details: option.Option(value.Value),
)
}
Constructors
-
AuditEntry( id: String, date_create: option.Option(Int), action: String, actor: option.Option(AuditActor), entity: option.Option(value.Value), context: option.Option(AuditContext), details: option.Option(value.Value), )Arguments
- date_create
-
Unix time.
- action
-
Such as
user_loginorfile_downloaded.actions()lists them. - entity
-
What the action was done to:
typenames a key that holds the object. - details
-
Extra details for some actions.
The workspace or organization an event happened in.
pub type AuditLocation {
AuditLocation(
location_type: option.Option(String),
id: option.Option(String),
name: option.Option(String),
domain: option.Option(String),
)
}
Constructors
-
AuditLocation( location_type: option.Option(String), id: option.Option(String), name: option.Option(String), domain: option.Option(String), )Arguments
- location_type
-
workspaceorenterprise.
A page of audit events, newest first.
pub type AuditLogs {
AuditLogs(
entries: List(AuditEntry),
response_metadata: option.Option(slackline.ResponseMetadata),
)
}
Constructors
-
AuditLogs( entries: List(AuditEntry), response_metadata: option.Option(slackline.ResponseMetadata), )
A user in an audit event.
pub type AuditUser {
AuditUser(
id: String,
name: option.Option(String),
email: option.Option(String),
team: option.Option(String),
)
}
Constructors
-
AuditUser( id: String, name: option.Option(String), email: option.Option(String), team: option.Option(String), )Arguments
- id
-
USLACKSECURITYwhen Slack Security reset credentials,USLACKUSERwhen an event fired without an actor.
Values
pub fn action(
call: slackline.Call(Logs, r),
actions: List(String),
) -> slackline.Call(Logs, r)
Only these actions (at most 30), such as user_login.
pub fn actions() -> slackline.Call(
Reference,
dict.Dict(String, List(String)),
)
Every action name, keyed by the kind of entity it applies to.
pub fn actor(
call: slackline.Call(Logs, r),
user: String,
) -> slackline.Call(Logs, r)
Only events by this user.
pub fn audit_actor_decoder() -> decode.Decoder(AuditActor)
Decodes AuditActor from json.
pub fn audit_actor_to_json(it: AuditActor) -> json.Json
Encodes AuditActor as json.
pub fn audit_context_decoder() -> decode.Decoder(AuditContext)
Decodes AuditContext from json.
pub fn audit_context_to_json(it: AuditContext) -> json.Json
Encodes AuditContext as json.
pub fn audit_entry_decoder() -> decode.Decoder(AuditEntry)
Decodes AuditEntry from json.
pub fn audit_entry_to_json(it: AuditEntry) -> json.Json
Encodes AuditEntry as json.
pub fn audit_location_decoder() -> decode.Decoder(AuditLocation)
Decodes AuditLocation from json.
pub fn audit_location_to_json(it: AuditLocation) -> json.Json
Encodes AuditLocation as json.
pub fn audit_logs_decoder() -> decode.Decoder(AuditLogs)
Decodes AuditLogs from json.
pub fn audit_user_decoder() -> decode.Decoder(AuditUser)
Decodes AuditUser from json.
pub fn entity(
call: slackline.Call(Logs, r),
id: String,
) -> slackline.Call(Logs, r)
Only events on this channel, workspace, organization, file or other ID.
pub fn latest(
call: slackline.Call(Logs, r),
latest: Int,
) -> slackline.Call(Logs, r)
Only events at or before this Unix time.
pub fn limit(
call: slackline.Call(Logs, r),
limit: Int,
) -> slackline.Call(Logs, r)
How many events to return, at most 9999. Slack may return more when several share a timestamp.
pub fn logs() -> slackline.Call(Logs, AuditLogs)
Audit events, newest first. Narrow them with the setters below, and page
with httpc.fold_pages and response_metadata.
pub fn oldest(
call: slackline.Call(Logs, r),
oldest: Int,
) -> slackline.Call(Logs, r)
Only events at or after this Unix time. There is no data before March 2018.
pub fn schemas() -> slackline.Call(Reference, List(value.Value))
The shape of each kind of entity, as json.