slack-ruby/slack-ruby-client

View on GitHub
bin/commands/apps_manifest.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 Cli
    class App
      desc 'AppsManifest methods.'
      command 'apps_manifest' do |g|
        g.desc 'Create an app from an app manifest.'
        g.long_desc %( Create an app from an app manifest. )
        g.command 'create' do |c|
          c.flag 'manifest', desc: 'A JSON app manifest encoded as a string. This manifest must use a valid app manifest schema - read our guide to creating one.'
          c.action do |_global_options, options, _args|
            puts JSON.dump(@client.apps_manifest_create(options))
          end
        end

        g.desc 'Permanently deletes an app created through app manifests'
        g.long_desc %( Permanently deletes an app created through app manifests )
        g.command 'delete' do |c|
          c.flag 'app_id', desc: 'The ID of the app you want to delete.'
          c.action do |_global_options, options, _args|
            puts JSON.dump(@client.apps_manifest_delete(options))
          end
        end

        g.desc 'Export an app manifest from an existing app'
        g.long_desc %( Export an app manifest from an existing app )
        g.command 'export' do |c|
          c.flag 'app_id', desc: 'The ID of the app whose configuration you want to export as a manifest.'
          c.action do |_global_options, options, _args|
            puts JSON.dump(@client.apps_manifest_export(options))
          end
        end

        g.desc 'Update an app from an app manifest'
        g.long_desc %( Update an app from an app manifest )
        g.command 'update' do |c|
          c.flag 'app_id', desc: 'The ID of the app whose configuration you want to update.'
          c.flag 'manifest', desc: 'A JSON app manifest encoded as a string. This manifest must use a valid app manifest schema - read our guide to creating one. As this method entirely replaces any previous configuration, manifest must contain both unmodified and modified fields.'
          c.action do |_global_options, options, _args|
            puts JSON.dump(@client.apps_manifest_update(options))
          end
        end

        g.desc 'Validate an app manifest'
        g.long_desc %( Validate an app manifest )
        g.command 'validate' do |c|
          c.flag 'manifest', desc: 'The manifest to be validated. Will be validated against the app manifest schema - read our guide.'
          c.flag 'app_id', desc: 'The ID of the app whose configuration you want to validate.'
          c.action do |_global_options, options, _args|
            puts JSON.dump(@client.apps_manifest_validate(options))
          end
        end
      end
    end
  end
end