slack-ruby/slack-ruby-client

View on GitHub
bin/commands/canvases.rb

Summary

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

module Slack
  module Cli
    class App
      desc 'Canvases methods.'
      command 'canvases' do |g|
        g.desc 'Create Canvas for a user.'
        g.long_desc %( Create Canvas for a user. )
        g.command 'create' do |c|
          c.flag 'document_content', desc: 'Structure describing the type and value of the content to create.'
          c.flag 'title', desc: 'Title of the newly created canvas.'
          c.action do |_global_options, options, _args|
            puts JSON.dump(@client.canvases_create(options))
          end
        end

        g.desc 'Deletes a canvas.'
        g.long_desc %( Deletes a canvas. )
        g.command 'delete' do |c|
          c.flag 'canvas_id', desc: 'Encoded ID of the canvas.'
          c.action do |_global_options, options, _args|
            puts JSON.dump(@client.canvases_delete(options))
          end
        end

        g.desc 'Update an existing canvas'
        g.long_desc %( Update an existing canvas )
        g.command 'edit' do |c|
          c.flag 'canvas_id', desc: 'Encoded ID of the canvas.'
          c.flag 'changes', desc: 'List of changes to apply on the specified canvas.'
          c.action do |_global_options, options, _args|
            puts JSON.dump(@client.canvases_edit(options))
          end
        end
      end
    end
  end
end