slack-ruby/slack-ruby-client

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

Summary

Maintainability
A
20 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 AppsManifest
          #
          # Create an app from an app manifest.
          #
          # @option options [manifest object as string] :manifest
          #   A JSON app manifest encoded as a string. This manifest must use a valid app manifest schema - read our guide to creating one.
          # @see https://api.slack.com/methods/apps.manifest.create
          # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.manifest/apps.manifest.create.json
          def apps_manifest_create(options = {})
            raise ArgumentError, 'Required arguments :manifest missing' if options[:manifest].nil?
            options = encode_options_as_json(options, %i[manifest])
            post('apps.manifest.create', options)
          end

          #
          # Permanently deletes an app created through app manifests
          #
          # @option options [Object] :app_id
          #   The ID of the app you want to delete.
          # @see https://api.slack.com/methods/apps.manifest.delete
          # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.manifest/apps.manifest.delete.json
          def apps_manifest_delete(options = {})
            raise ArgumentError, 'Required arguments :app_id missing' if options[:app_id].nil?
            post('apps.manifest.delete', options)
          end

          #
          # Export an app manifest from an existing app
          #
          # @option options [Object] :app_id
          #   The ID of the app whose configuration you want to export as a manifest.
          # @see https://api.slack.com/methods/apps.manifest.export
          # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.manifest/apps.manifest.export.json
          def apps_manifest_export(options = {})
            raise ArgumentError, 'Required arguments :app_id missing' if options[:app_id].nil?
            post('apps.manifest.export', options)
          end

          #
          # Update an app from an app manifest
          #
          # @option options [Object] :app_id
          #   The ID of the app whose configuration you want to update.
          # @option options [manifest object as string] :manifest
          #   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.
          # @see https://api.slack.com/methods/apps.manifest.update
          # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.manifest/apps.manifest.update.json
          def apps_manifest_update(options = {})
            raise ArgumentError, 'Required arguments :app_id missing' if options[:app_id].nil?
            raise ArgumentError, 'Required arguments :manifest missing' if options[:manifest].nil?
            options = encode_options_as_json(options, %i[manifest])
            post('apps.manifest.update', options)
          end

          #
          # Validate an app manifest
          #
          # @option options [manifest object as string] :manifest
          #   The manifest to be validated. Will be validated against the app manifest schema - read our guide.
          # @option options [Object] :app_id
          #   The ID of the app whose configuration you want to validate.
          # @see https://api.slack.com/methods/apps.manifest.validate
          # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.manifest/apps.manifest.validate.json
          def apps_manifest_validate(options = {})
            raise ArgumentError, 'Required arguments :manifest missing' if options[:manifest].nil?
            post('apps.manifest.validate', options)
          end
        end
      end
    end
  end
end