slackline/api/canvases

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

Slack Web API methods for creating, editing and sharing canvases.

Types

Identifies canvases.access.delete in the slackline.Call that access_delete returns.

pub type AccessDelete

Identifies canvases.access.set in the slackline.Call that access_set returns.

pub type AccessSet

The access level granted to a canvas.

pub type CanvasAccessLevel {
  ReadAccess
  WriteAccess
  OwnerAccess
}

Constructors

  • ReadAccess

    read

  • WriteAccess

    write

  • OwnerAccess

    owner

One edit to apply to a canvas, chosen by operation.

pub type CanvasChange {
  InsertAfterChange(
    section_id: String,
    document_content: common.CanvasDocumentContent,
  )
  InsertBeforeChange(
    section_id: String,
    document_content: common.CanvasDocumentContent,
  )
  InsertAtStartChange(
    document_content: common.CanvasDocumentContent,
  )
  InsertAtEndChange(
    document_content: common.CanvasDocumentContent,
  )
  ReplaceChange(
    section_id: option.Option(String),
    document_content: common.CanvasDocumentContent,
  )
  DeleteChange(section_id: String)
  RenameChange(title_content: common.CanvasDocumentContent)
  UnknownCanvasChange(operation: String, raw: value.Value)
}

Constructors

  • InsertAfterChange(
      section_id: String,
      document_content: common.CanvasDocumentContent,
    )

    Insert content after the section section_id.

  • InsertBeforeChange(
      section_id: String,
      document_content: common.CanvasDocumentContent,
    )

    Insert content before the section section_id.

  • InsertAtStartChange(
      document_content: common.CanvasDocumentContent,
    )

    Insert content at the beginning of the canvas.

  • InsertAtEndChange(document_content: common.CanvasDocumentContent)

    Insert content at the end of the canvas.

  • ReplaceChange(
      section_id: option.Option(String),
      document_content: common.CanvasDocumentContent,
    )

    Replace the section section_id, or the whole canvas when it is omitted.

  • DeleteChange(section_id: String)

    Delete the section section_id.

  • RenameChange(title_content: common.CanvasDocumentContent)

    Rename the canvas. Markdown, including emoji, is supported.

  • UnknownCanvasChange(operation: String, raw: value.Value)

    A operation that this version of slackline does not know. raw holds the full json.

The format of returned canvas content.

pub type CanvasContentType {
  Html
  Markdown
}

Constructors

  • Html

    html

  • Markdown

    markdown

A canvas section returned by canvases.sections.lookup.

pub type CanvasSection {
  CanvasSection(id: String)
}

Constructors

  • CanvasSection(id: String)

    Arguments

    id

    The section ID, for use with canvases.edit.

Criteria for finding sections in a canvas. Criteria combine to narrow the result.

pub type CanvasSectionCriteria {
  CanvasSectionCriteria(
    section_types: option.Option(List(CanvasSectionType)),
    contains_text: option.Option(String),
  )
}

Constructors

  • CanvasSectionCriteria(
      section_types: option.Option(List(CanvasSectionType)),
      contains_text: option.Option(String),
    )

    Arguments

    section_types

    Match sections of these types.

    contains_text

    Match sections containing this text.

Section types that can be used to filter canvases.sections.lookup.

pub type CanvasSectionType {
  AnyHeader
  Blockquote
  Callout
  CanvasUnfurl
  Chart
  Citation
  FileUnfurl
  Flexbox
  H1
  H2
  H3
  HorizontalLine
  ListSection
  MessageUnfurl
  SfdcRecordMention
  SfdcRecordUnfurl
  Table
  UserMention
  UserUnfurl
}

Constructors

  • AnyHeader

    any_header

  • Blockquote

    blockquote

  • Callout

    callout

  • CanvasUnfurl

    canvas_unfurl

  • Chart

    chart

  • Citation

    citation

  • FileUnfurl

    file_unfurl

  • Flexbox

    flexbox

  • H1

    h1

  • H2

    h2

  • H3

    h3

  • HorizontalLine

    horizontal_line

  • ListSection

    list

  • MessageUnfurl

    message_unfurl

  • SfdcRecordMention

    sfdc_record_mention

  • SfdcRecordUnfurl

    sfdc_record_unfurl

  • Table

    table

  • UserMention

    user_mention

  • UserUnfurl

    user_unfurl

Identifies canvases.create in the slackline.Call that create returns.

pub type Create

A successful response from canvases.create.

pub type CreateResponse {
  CreateResponse(canvas_id: String)
}

Constructors

  • CreateResponse(canvas_id: String)

    Arguments

    canvas_id

    The ID of the new canvas.

Identifies canvases.delete in the slackline.Call that delete returns.

pub type Delete

Identifies canvases.edit in the slackline.Call that edit returns.

pub type Edit

Identifies canvases.getContent in the slackline.Call that get_content returns.

pub type GetContent

A successful response from canvases.getContent.

pub type GetContentResponse {
  GetContentResponse(content: option.Option(String))
}

Constructors

  • GetContentResponse(content: option.Option(String))

    Arguments

    content

    The entire canvas content, in the requested format.

Identifies canvases.sections.lookup in the slackline.Call that sections_lookup returns.

pub type SectionsLookup

A successful response from canvases.sections.lookup.

pub type SectionsLookupResponse {
  SectionsLookupResponse(
    sections: option.Option(List(CanvasSection)),
  )
}

Constructors

Values

pub fn access_delete(
  canvas_id canvas_id: String,
) -> slackline.Call(AccessDelete, Nil)

canvases.access.delete: Remove access to a canvas for specified entities

canvases.AccessDelete identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/canvases/access_delete.

Bot token scopes: canvases:write. User token scopes: canvases:write.

Rate limit tier: t3.

Documented errors: canvas_disabled_user_team, canvas_not_found, channel_not_found, invalid_parameters, restricted_action, user_not_found.

pub fn access_set(
  canvas_id canvas_id: String,
  access_level access_level: CanvasAccessLevel,
) -> slackline.Call(AccessSet, Nil)

canvases.access.set: Sets the access level to a canvas for specified entities

canvases.AccessSet identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/canvases/access_set.

Bot token scopes: canvases:write. User token scopes: canvases:write.

Rate limit tier: t3.

Documented errors: canvas_disabled_user_team, canvas_not_found, channel_not_found, failed_to_update_user_ids, invalid_parameters, restricted_action, user_not_found.

pub fn canvas_access_level_decoder() -> decode.Decoder(
  CanvasAccessLevel,
)

Decodes CanvasAccessLevel from a json string.

pub fn canvas_access_level_from_string(
  string: String,
) -> Result(CanvasAccessLevel, Nil)

Parses CanvasAccessLevel from its json string.

pub fn canvas_access_level_to_json(
  it: CanvasAccessLevel,
) -> json.Json

Encodes CanvasAccessLevel as a json string.

pub fn canvas_access_level_to_string(
  it: CanvasAccessLevel,
) -> String

The json string of CanvasAccessLevel.

pub fn canvas_change_decoder() -> decode.Decoder(CanvasChange)

Decodes CanvasChange from json. The operation field selects the variant.

pub fn canvas_change_to_json(it: CanvasChange) -> json.Json

Encodes CanvasChange as json.

pub fn canvas_content_type_decoder() -> decode.Decoder(
  CanvasContentType,
)

Decodes CanvasContentType from a json string.

pub fn canvas_content_type_from_string(
  string: String,
) -> Result(CanvasContentType, Nil)

Parses CanvasContentType from its json string.

pub fn canvas_content_type_to_json(
  it: CanvasContentType,
) -> json.Json

Encodes CanvasContentType as a json string.

pub fn canvas_content_type_to_string(
  it: CanvasContentType,
) -> String

The json string of CanvasContentType.

pub fn canvas_section_criteria_decoder() -> decode.Decoder(
  CanvasSectionCriteria,
)

Decodes CanvasSectionCriteria from json.

pub fn canvas_section_criteria_to_json(
  it: CanvasSectionCriteria,
) -> json.Json

Encodes CanvasSectionCriteria as json.

pub fn canvas_section_decoder() -> decode.Decoder(CanvasSection)

Decodes CanvasSection from json.

pub fn canvas_section_to_json(it: CanvasSection) -> json.Json

Encodes CanvasSection as json.

pub fn canvas_section_type_decoder() -> decode.Decoder(
  CanvasSectionType,
)

Decodes CanvasSectionType from a json string.

pub fn canvas_section_type_from_string(
  string: String,
) -> Result(CanvasSectionType, Nil)

Parses CanvasSectionType from its json string.

pub fn canvas_section_type_to_json(
  it: CanvasSectionType,
) -> json.Json

Encodes CanvasSectionType as a json string.

pub fn canvas_section_type_to_string(
  it: CanvasSectionType,
) -> String

The json string of CanvasSectionType.

pub fn create() -> slackline.Call(Create, CreateResponse)

canvases.create: Create canvas for a user

canvases.Create identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/canvases/create.

Bot token scopes: canvases:write. User token scopes: canvases:write.

Rate limit tier: t2.

Documented errors: canvas_creation_failed, canvas_disabled_user_team, free_team_canvas_tab_already_exists, free_teams_cannot_create_standalone_canvases, restricted_action.

pub fn create_response_decoder() -> decode.Decoder(CreateResponse)

Decodes the response from canvases.create.

pub fn delete(
  canvas_id canvas_id: String,
) -> slackline.Call(Delete, Nil)

canvases.delete: Deletes a canvas

canvases.Delete identifies this method in slackline.Call.

Bot token scopes: canvases:write. User token scopes: canvases:write.

Rate limit tier: t3.

Documented errors: canvas_deleting_disabled, canvas_not_found, restricted_action, use_skills_api.

pub fn edit(
  canvas_id canvas_id: String,
  changes changes: List(CanvasChange),
) -> slackline.Call(Edit, Nil)

canvases.edit: Update an existing canvas

canvases.Edit identifies this method in slackline.Call.

Bot token scopes: canvases:write. User token scopes: canvases:write.

Rate limit tier: t3.

Documented errors: canvas_disabled_user_team, canvas_editing_failed, canvas_editing_locked, canvas_not_found, canvas_too_large, free_teams_cannot_edit_standalone_canvases, restricted_action, use_skills_api.

pub fn get_content(
  canvas_id canvas_id: String,
) -> slackline.Call(GetContent, GetContentResponse)

canvases.getContent: Get the content of a canvas as markdown (default) or HTML.

canvases.GetContent identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/canvases/get_content.

Bot token scopes: canvases:read. User token scopes: canvases:read.

Rate limit tier: t3.

Documented errors: canvas_disabled_user_team, canvas_not_found.

pub fn get_content_response_decoder() -> decode.Decoder(
  GetContentResponse,
)

Decodes the response from canvases.getContent.

pub fn sections_lookup(
  canvas_id canvas_id: String,
  criteria criteria: CanvasSectionCriteria,
) -> slackline.Call(SectionsLookup, SectionsLookupResponse)

canvases.sections.lookup: Find sections matching the provided criteria

canvases.SectionsLookup identifies this method in slackline.Call.

Bot token scopes: canvases:read. User token scopes: canvases:read.

Rate limit tier: t3.

Documented errors: canvas_deleted, canvas_disabled_user_team, canvas_not_found.

pub fn sections_lookup_response_decoder() -> decode.Decoder(
  SectionsLookupResponse,
)

Decodes the response from canvases.sections.lookup.

✨ Search Document