Module: Auth0::Api::V2::UserBlocks

Included in:
Auth0::Api::V2
Defined in:
lib/auth0/api/v2/user_blocks.rb

Overview

Methods to use the User Blocks endpoints

Instance Method Summary collapse

Instance Method Details

#delete_user_blocks(identifier) ⇒ Object

Deletes the user blocks

Parameters:

  • identifier (string)

    Should be any of: username, phone_number, email.

Raises:

See Also:



24
25
26
27
28
29
30
31
# File 'lib/auth0/api/v2/user_blocks.rb', line 24

def delete_user_blocks(identifier)
  raise Auth0::InvalidParameter, 'Must specify a valid identifier' if identifier.to_s.empty?
  # path = "#{user_blocks_path}?identifier=#{identifier}"
  request_params = {
    identifier: identifier
  }
  delete(user_blocks_path, request_params)
end

#delete_user_blocks_by_id(user_id) ⇒ Object

Deletes a user’s blocks

Parameters:

  • user_id (string)

    The user_id of the user to retrieve

Raises:

See Also:



47
48
49
50
51
# File 'lib/auth0/api/v2/user_blocks.rb', line 47

def delete_user_blocks_by_id(user_id)
  raise Auth0::InvalidParameter, 'Must specify a valid identifier' if user_id.to_s.empty?
  path = "#{user_blocks_path}/#{user_id}"
  delete(path)
end

#user_blocks(identifier) ⇒ json

Retrieves the user blocks

Parameters:

  • identifier (string)

    Should be any of: username, phone_number, email.

Returns:

  • (json)

    the user blocks

Raises:

See Also:



13
14
15
16
17
18
19
# File 'lib/auth0/api/v2/user_blocks.rb', line 13

def user_blocks(identifier)
  raise Auth0::InvalidParameter, 'Must specify a valid identifier' if identifier.to_s.empty?
  request_params = {
    identifier: identifier
  }
  get(user_blocks_path, request_params)
end

#user_blocks_by_id(user_id) ⇒ json

Retrieves a user’s blocks

Parameters:

  • user_id (string)

    The user_id of the user to retrieve

Returns:

  • (json)

    the user blocks

Raises:

See Also:



38
39
40
41
42
# File 'lib/auth0/api/v2/user_blocks.rb', line 38

def user_blocks_by_id(user_id)
  raise Auth0::InvalidParameter, 'Must specify a valid identifier' if user_id.to_s.empty?
  path = "#{user_blocks_path}/#{user_id}"
  get(path)
end