Class: Isaca::Model::GetUserDetailsByToken

Inherits:
Object
  • Object
show all
Defined in:
lib/isaca/models/get_user_details_by_token.rb

Overview

Class is used as an object representation of the response from Request::GetUserDetailsByToken.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ GetUserDetailsByToken

Returns a new instance of GetUserDetailsByToken.

Parameters:

  • params (Hash)

    The parameters used to create the object

Options Hash (params):

  • :ID (String)

    Required

  • :Ent_ID (String)
  • :First_Name (String)
  • :Last_Name (String)
  • :Email (String)
  • :UserName (String)
  • :Country (String)
  • :PRIVACY (String)
  • :MARKETING (String)

Raises:



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/isaca/models/get_user_details_by_token.rb', line 54

def initialize(params)
  if params[:ID].to_s.strip.empty?
    raise ServiceError.new('User with given IMIS ID not found')
  else
    @imis_id = params[:ID]
  end

  @enterprise_id = params[:Ent_ID]
  @first_name = params[:First_Name]
  @last_name = params[:Last_Name]
  @email = params[:Email]
  @username = params[:UserName]
  @country = params[:Country]

  if params[:PRIVACY] == '1'
    @privacy = true
  elsif params[:PRIVACY] == '0'
    @privacy = false
  else
    @privacy = nil
  end

  if params[:MARKETING] == '1'
    @marketing = true
  elsif params[:MARKETING] == '0'
    @marketing = false
  else
    @marketing = nil
  end
end

Instance Attribute Details

#countryString

Returns The country of the requested user.

Returns:

  • (String)

    The country of the requested user



30
31
32
# File 'lib/isaca/models/get_user_details_by_token.rb', line 30

def country
  @country
end

#emailString

Returns The email of the requested user.

Returns:

  • (String)

    The email of the requested user



22
23
24
# File 'lib/isaca/models/get_user_details_by_token.rb', line 22

def email
  @email
end

#enterprise_idString

Returns The Enterprise ID of the requested user.

Returns:

  • (String)

    The Enterprise ID of the requested user



10
11
12
# File 'lib/isaca/models/get_user_details_by_token.rb', line 10

def enterprise_id
  @enterprise_id
end

#first_nameString

Returns The first name of the requested user.

Returns:

  • (String)

    The first name of the requested user



14
15
16
# File 'lib/isaca/models/get_user_details_by_token.rb', line 14

def first_name
  @first_name
end

#imis_idString

Returns The IMIS ID of the requested user.

Returns:

  • (String)

    The IMIS ID of the requested user



10
11
12
# File 'lib/isaca/models/get_user_details_by_token.rb', line 10

def imis_id
  @imis_id
end

#last_nameString

Returns The last name of the requested user.

Returns:

  • (String)

    The last name of the requested user



18
19
20
# File 'lib/isaca/models/get_user_details_by_token.rb', line 18

def last_name
  @last_name
end

#marketingBoolean|nil

Returns The marketing acceptance status of the requested user.

Returns:

  • (Boolean|nil)

    The marketing acceptance status of the requested user



38
39
40
# File 'lib/isaca/models/get_user_details_by_token.rb', line 38

def marketing
  @marketing
end

#privacyBoolean|nil

Returns The privacy acceptance status of the requested user.

Returns:

  • (Boolean|nil)

    The privacy acceptance status of the requested user



34
35
36
# File 'lib/isaca/models/get_user_details_by_token.rb', line 34

def privacy
  @privacy
end

#usernameString

Returns The username of the requested user.

Returns:

  • (String)

    The username of the requested user



26
27
28
# File 'lib/isaca/models/get_user_details_by_token.rb', line 26

def username
  @username
end