Module: Slack::Web::Api::Endpoints::AdminBarriers

Included in:
Slack::Web::Api::Endpoints
Defined in:
lib/slack/web/api/endpoints/admin_barriers.rb

Instance Method Summary collapse

Instance Method Details

#admin_barriers_create(options = {}) ⇒ Object

Create an Information Barrier

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :barriered_from_usergroup_ids (Object)

    A list of IDP Groups ids that the primary usergroup is to be barriered from.

  • :primary_usergroup_id (Object)

    The id of the primary IDP Group.

  • :restricted_subjects (Object)

    What kind of interactions are blocked by this barrier? For v1, we only support a list of all 3, eg im, mpim, call.

See Also:



20
21
22
23
24
25
# File 'lib/slack/web/api/endpoints/admin_barriers.rb', line 20

def admin_barriers_create(options = {})
  throw ArgumentError.new('Required arguments :barriered_from_usergroup_ids missing') if options[:barriered_from_usergroup_ids].nil?
  throw ArgumentError.new('Required arguments :primary_usergroup_id missing') if options[:primary_usergroup_id].nil?
  throw ArgumentError.new('Required arguments :restricted_subjects missing') if options[:restricted_subjects].nil?
  post('admin.barriers.create', options)
end

#admin_barriers_delete(options = {}) ⇒ Object

Delete an existing Information Barrier

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :barrier_id (Object)

    The ID of the barrier you’re trying to delete.

See Also:



34
35
36
37
# File 'lib/slack/web/api/endpoints/admin_barriers.rb', line 34

def admin_barriers_delete(options = {})
  throw ArgumentError.new('Required arguments :barrier_id missing') if options[:barrier_id].nil?
  post('admin.barriers.delete', options)
end

#admin_barriers_list(options = {}) ⇒ Object

Get all Information Barriers for your organization

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :cursor (Object)

    Set cursor to next_cursor returned by the previous call to list items in the next page.

  • :limit (Object)

    The maximum number of items to return. Must be between 1 - 1000 both inclusive.

See Also:



48
49
50
51
52
53
54
55
56
# File 'lib/slack/web/api/endpoints/admin_barriers.rb', line 48

def admin_barriers_list(options = {})
  if block_given?
    Pagination::Cursor.new(self, :admin_barriers_list, options).each do |page|
      yield page
    end
  else
    post('admin.barriers.list', options)
  end
end

#admin_barriers_update(options = {}) ⇒ Object

Update an existing Information Barrier

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :barrier_id (Object)

    The ID of the barrier you’re trying to modify.

  • :barriered_from_usergroup_ids (Object)

    A list of IDP Groups ids that the primary usergroup is to be barriered from.

  • :primary_usergroup_id (Object)

    The id of the primary IDP Group.

  • :restricted_subjects (Object)

    What kind of interactions are blocked by this barrier? For v1, we only support a list of all 3, eg im, mpim, call.

See Also:



71
72
73
74
75
76
77
# File 'lib/slack/web/api/endpoints/admin_barriers.rb', line 71

def admin_barriers_update(options = {})
  throw ArgumentError.new('Required arguments :barrier_id missing') if options[:barrier_id].nil?
  throw ArgumentError.new('Required arguments :barriered_from_usergroup_ids missing') if options[:barriered_from_usergroup_ids].nil?
  throw ArgumentError.new('Required arguments :primary_usergroup_id missing') if options[:primary_usergroup_id].nil?
  throw ArgumentError.new('Required arguments :restricted_subjects missing') if options[:restricted_subjects].nil?
  post('admin.barriers.update', options)
end