slack-ruby/slack-ruby-client

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

Summary

Maintainability
A
55 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 ConversationsExternalinvitepermissions
          #
          # Upgrade or downgrade Slack Connect channel permissions between 'can post only' and 'can post and invite'.
          #
          # @option options [enum] :action
          #   Type of action to be taken: upgrade or downgrade.
          # @option options [channel] :channel
          #   The channel ID to change external invite permissions for.
          # @option options [Object] :target_team
          #   The encoded team ID of the target team.  Must be in the specified channel.
          # @see https://api.slack.com/methods/conversations.externalInvitePermissions.set
          # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations.externalInvitePermissions/conversations.externalInvitePermissions.set.json
          def conversations_externalInvitePermissions_set(options = {})
            raise ArgumentError, 'Required arguments :action missing' if options[:action].nil?
            raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
            raise ArgumentError, 'Required arguments :target_team missing' if options[:target_team].nil?
            options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
            post('conversations.externalInvitePermissions.set', options)
          end
        end
      end
    end
  end
end