Module: Slack::Web::Api::Endpoints::AdminAuthPolicy

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

Instance Method Summary collapse

Instance Method Details

#admin_auth_policy_assignEntities(options = {}) ⇒ Object

Assign entities to a particular authentication policy.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :entity_ids (array)

    Array of IDs to assign to the policy.

  • :entity_type (Object)

    The type of entity to assign to the policy. Currently, USER is supported.

  • :policy_name (string)

    The name of the authentication policy to assign the entities to. Currently, email_password is the only policy that may be used with this method.

Raises:

  • (ArgumentError)

See Also:



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

def admin_auth_policy_assignEntities(options = {})
  raise ArgumentError, 'Required arguments :entity_ids missing' if options[:entity_ids].nil?
  raise ArgumentError, 'Required arguments :entity_type missing' if options[:entity_type].nil?
  raise ArgumentError, 'Required arguments :policy_name missing' if options[:policy_name].nil?
  post('admin.auth.policy.assignEntities', options)
end

#admin_auth_policy_getEntities(options = {}) ⇒ Object

Fetch all the entities assigned to a particular authentication policy by name.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :policy_name (string)

    The name of the policy to fetch entities for. Currently, email_password is the only policy that may be used with this method.

  • :cursor (string)

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

  • :entity_type (Object)

    The type of entity to assign to the policy. Currently, USER is supported.

  • :limit (integer)

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

Raises:

  • (ArgumentError)

See Also:



40
41
42
43
44
45
46
47
48
49
# File 'lib/slack/web/api/endpoints/admin_auth_policy.rb', line 40

def admin_auth_policy_getEntities(options = {})
  raise ArgumentError, 'Required arguments :policy_name missing' if options[:policy_name].nil?
  if block_given?
    Pagination::Cursor.new(self, :admin_auth_policy_getEntities, options).each do |page|
      yield page
    end
  else
    post('admin.auth.policy.getEntities', options)
  end
end

#admin_auth_policy_removeEntities(options = {}) ⇒ Object

Remove specified entities from a specified authentication policy.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :entity_ids (array)

    Encoded IDs of the entities you’d like to remove from the policy.

  • :entity_type (Object)

    The type of entity to assign to the policy. Currently, USER is supported.

  • :policy_name (string)

    The name of the policy to remove entities from. Currently, email_password is the only policy that may be used with this method.

Raises:

  • (ArgumentError)

See Also:



62
63
64
65
66
67
# File 'lib/slack/web/api/endpoints/admin_auth_policy.rb', line 62

def admin_auth_policy_removeEntities(options = {})
  raise ArgumentError, 'Required arguments :entity_ids missing' if options[:entity_ids].nil?
  raise ArgumentError, 'Required arguments :entity_type missing' if options[:entity_type].nil?
  raise ArgumentError, 'Required arguments :policy_name missing' if options[:policy_name].nil?
  post('admin.auth.policy.removeEntities', options)
end