slack-ruby/slack-ruby-client

View on GitHub
lib/slack/web/api/endpoints/usergroups.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 Usergroups
          #
          # Create a User Group.
          #
          # @option options [string] :name
          #   A name for the User Group. Must be unique among User Groups.
          # @option options [array] :channels
          #   A comma separated string of encoded channel IDs for which the User Group uses as a default.
          # @option options [string] :description
          #   A short description of the User Group.
          # @option options [string] :handle
          #   A mention handle. Must be unique among channels, users and User Groups.
          # @option options [boolean] :include_count
          #   Include the number of users in each User Group.
          # @option options [string] :team_id
          #   Encoded team id where the user group has to be created, required if org token is used.
          # @see https://api.slack.com/methods/usergroups.create
          # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.create.json
          def usergroups_create(options = {})
            raise ArgumentError, 'Required arguments :name missing' if options[:name].nil?
            post('usergroups.create', options)
          end

          #
          # Disable an existing User Group.
          #
          # @option options [Object] :usergroup
          #   The encoded ID of the User Group to disable.
          # @option options [boolean] :include_count
          #   Include the number of users in the User Group.
          # @option options [Object] :team_id
          #   Encoded target team id where the user group is, required if org token is used.
          # @see https://api.slack.com/methods/usergroups.disable
          # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.disable.json
          def usergroups_disable(options = {})
            raise ArgumentError, 'Required arguments :usergroup missing' if options[:usergroup].nil?
            post('usergroups.disable', options)
          end

          #
          # Enable a User Group.
          #
          # @option options [string] :usergroup
          #   The encoded ID of the User Group to enable.
          # @option options [boolean] :include_count
          #   Include the number of users in the User Group.
          # @option options [string] :team_id
          #   Encoded team id where the user group is, required if org token is used.
          # @see https://api.slack.com/methods/usergroups.enable
          # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.enable.json
          def usergroups_enable(options = {})
            raise ArgumentError, 'Required arguments :usergroup missing' if options[:usergroup].nil?
            post('usergroups.enable', options)
          end

          #
          # List all User Groups for a team.
          #
          # @option options [boolean] :include_count
          #   Include the number of users in each User Group.
          # @option options [boolean] :include_disabled
          #   Include disabled User Groups.
          # @option options [boolean] :include_users
          #   Include the list of users for each User Group.
          # @option options [string] :team_id
          #   encoded team id to list user groups in, required if org token is used.
          # @see https://api.slack.com/methods/usergroups.list
          # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.list.json
          def usergroups_list(options = {})
            post('usergroups.list', options)
          end

          #
          # Update an existing User Group.
          #
          # @option options [Object] :usergroup
          #   The encoded ID of the User Group to update.
          # @option options [array] :channels
          #   A comma separated string of encoded channel IDs for which the User Group uses as a default.
          # @option options [string] :description
          #   A short description of the User Group.
          # @option options [string] :handle
          #   A mention handle. Must be unique among channels, users and User Groups.
          # @option options [boolean] :include_count
          #   Include the number of users in the User Group.
          # @option options [string] :name
          #   A name for the User Group. Must be unique among User Groups.
          # @option options [Object] :team_id
          #   encoded team id where the user group exists, required if org token is used.
          # @see https://api.slack.com/methods/usergroups.update
          # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/usergroups/usergroups.update.json
          def usergroups_update(options = {})
            raise ArgumentError, 'Required arguments :usergroup missing' if options[:usergroup].nil?
            post('usergroups.update', options)
          end
        end
      end
    end
  end
end