slack-ruby/slack-ruby-client

View on GitHub
lib/slack/web/api/endpoints/canvases.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake

module Slack
  module Web
    module Api
      module Endpoints
        module Canvases
          #
          # Create Canvas for a user.
          #
          # @option options [Object] :document_content
          #   Structure describing the type and value of the content to create.
          # @option options [string] :title
          #   Title of the newly created canvas.
          # @see https://api.slack.com/methods/canvases.create
          # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/canvases/canvases.create.json
          def canvases_create(options = {})
            post('canvases.create', options)
          end

          #
          # Deletes a canvas.
          #
          # @option options [Object] :canvas_id
          #   Encoded ID of the canvas.
          # @see https://api.slack.com/methods/canvases.delete
          # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/canvases/canvases.delete.json
          def canvases_delete(options = {})
            raise ArgumentError, 'Required arguments :canvas_id missing' if options[:canvas_id].nil?
            post('canvases.delete', options)
          end

          #
          # Update an existing canvas
          #
          # @option options [Object] :canvas_id
          #   Encoded ID of the canvas.
          # @option options [array] :changes
          #   List of changes to apply on the specified canvas.
          # @see https://api.slack.com/methods/canvases.edit
          # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/canvases/canvases.edit.json
          def canvases_edit(options = {})
            raise ArgumentError, 'Required arguments :canvas_id missing' if options[:canvas_id].nil?
            raise ArgumentError, 'Required arguments :changes missing' if options[:changes].nil?
            post('canvases.edit', options)
          end
        end
      end
    end
  end
end