Class: LockstepSdk::MagicLinkModel

Inherits:
Object
  • Object
show all
Defined in:
lib/lockstep_sdk/models/magic_link_model.rb

Overview

Represents a magic link that can be used to log in to a Lockstep application.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ MagicLinkModel

Initialize the MagicLinkModel using the provided prototype



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/lockstep_sdk/models/magic_link_model.rb', line 25

def initialize(params = {})
    @magic_link_id = params.dig(:magic_link_id)
    @group_key = params.dig(:group_key)
    @user_id = params.dig(:user_id)
    @user_role = params.dig(:user_role)
    @application_id = params.dig(:application_id)
    @expires = params.dig(:expires)
    @revoked = params.dig(:revoked)
    @created = params.dig(:created)
    @created_user_id = params.dig(:created_user_id)
    @modified = params.dig(:modified)
    @modified_user_id = params.dig(:modified_user_id)
    @company_id = params.dig(:company_id)
    @accounting_profile_id = params.dig(:accounting_profile_id)
    @magic_link_url = params.dig(:magic_link_url)
    @user = params.dig(:user)
end

Instance Attribute Details

#accounting_profile_idUuid

Returns The ID of the accounting profile associated to this magic link.

Returns:

  • (Uuid)

    The ID of the accounting profile associated to this magic link



93
94
95
# File 'lib/lockstep_sdk/models/magic_link_model.rb', line 93

def accounting_profile_id
  @accounting_profile_id
end

#application_idUuid

Returns The ID of the application for this magic link.

Returns:

  • (Uuid)

    The ID of the application for this magic link.



61
62
63
# File 'lib/lockstep_sdk/models/magic_link_model.rb', line 61

def application_id
  @application_id
end

#company_idUuid

Returns The ID of the company associated to this magic link.

Returns:

  • (Uuid)

    The ID of the company associated to this magic link



89
90
91
# File 'lib/lockstep_sdk/models/magic_link_model.rb', line 89

def company_id
  @company_id
end

#createdDate-time

Returns The date that the magic link was created.

Returns:

  • (Date-time)

    The date that the magic link was created



73
74
75
# File 'lib/lockstep_sdk/models/magic_link_model.rb', line 73

def created
  @created
end

#created_user_idUuid

Returns The ID of the user who created the magic link.

Returns:

  • (Uuid)

    The ID of the user who created the magic link



77
78
79
# File 'lib/lockstep_sdk/models/magic_link_model.rb', line 77

def created_user_id
  @created_user_id
end

#expiresDate-time

Returns The UTC date and time when this magic link expires.

Returns:

  • (Date-time)

    The UTC date and time when this magic link expires.



65
66
67
# File 'lib/lockstep_sdk/models/magic_link_model.rb', line 65

def expires
  @expires
end

#group_keyUuid

Returns The GroupKey uniquely identifies a single Lockstep Platform account. All records for this account will share the same GroupKey value. GroupKey values cannot be changed once created.

Returns:

  • (Uuid)

    The GroupKey uniquely identifies a single Lockstep Platform account. All records for this account will share the same GroupKey value. GroupKey values cannot be changed once created.



49
50
51
# File 'lib/lockstep_sdk/models/magic_link_model.rb', line 49

def group_key
  @group_key
end

Returns The unique ID of this record, automatically assigned by Lockstep when this record is added to the Lockstep platform.

Returns:

  • (Uuid)

    The unique ID of this record, automatically assigned by Lockstep when this record is added to the Lockstep platform.



45
46
47
# File 'lib/lockstep_sdk/models/magic_link_model.rb', line 45

def magic_link_id
  @magic_link_id
end

Returns The created magic link URL. This will only be returned upon creation of the magic link. All other times, this value will be ‘null`.

Returns:

  • (String)

    The created magic link URL. This will only be returned upon creation of the magic link. All other times, this value will be ‘null`.



97
98
99
# File 'lib/lockstep_sdk/models/magic_link_model.rb', line 97

def magic_link_url
  @magic_link_url
end

#modifiedDate-time

Returns The date that the magic link was last modified.

Returns:

  • (Date-time)

    The date that the magic link was last modified



81
82
83
# File 'lib/lockstep_sdk/models/magic_link_model.rb', line 81

def modified
  @modified
end

#modified_user_idUuid

Returns The ID of the user who last modified the magic link.

Returns:

  • (Uuid)

    The ID of the user who last modified the magic link



85
86
87
# File 'lib/lockstep_sdk/models/magic_link_model.rb', line 85

def modified_user_id
  @modified_user_id
end

#revokedDate-time

Returns The UTC date and time when this magic link was revoked.

Returns:

  • (Date-time)

    The UTC date and time when this magic link was revoked.



69
70
71
# File 'lib/lockstep_sdk/models/magic_link_model.rb', line 69

def revoked
  @revoked
end

#userUserAccountModel

Returns The user associated with this magic link. To retrieve this item, specify ‘User` in the “Include” parameter for your query.

Returns:

  • (UserAccountModel)

    The user associated with this magic link. To retrieve this item, specify ‘User` in the “Include” parameter for your query.



101
102
103
# File 'lib/lockstep_sdk/models/magic_link_model.rb', line 101

def user
  @user
end

#user_idUuid

Returns The unique ID of the user that this magic link is associated with.

Returns:

  • (Uuid)

    The unique ID of the user that this magic link is associated with.



53
54
55
# File 'lib/lockstep_sdk/models/magic_link_model.rb', line 53

def user_id
  @user_id
end

#user_roleUuid

Returns The ID of the user role for the magic link.

Returns:

  • (Uuid)

    The ID of the user role for the magic link.



57
58
59
# File 'lib/lockstep_sdk/models/magic_link_model.rb', line 57

def user_role
  @user_role
end

Instance Method Details

#as_json(options = {}) ⇒ object

Returns This object as a JSON key-value structure.

Returns:

  • (object)

    This object as a JSON key-value structure



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/lockstep_sdk/models/magic_link_model.rb', line 105

def as_json(options={})
    {
        'magicLinkId' => @magic_link_id,
        'groupKey' => @group_key,
        'userId' => @user_id,
        'userRole' => @user_role,
        'applicationId' => @application_id,
        'expires' => @expires,
        'revoked' => @revoked,
        'created' => @created,
        'createdUserId' => @created_user_id,
        'modified' => @modified,
        'modifiedUserId' => @modified_user_id,
        'companyId' => @company_id,
        'accountingProfileId' => @accounting_profile_id,
        'magicLinkUrl' => @magic_link_url,
        'user' => @user,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



127
128
129
# File 'lib/lockstep_sdk/models/magic_link_model.rb', line 127

def to_json(*options)
    "[#{as_json(*options).to_json(*options)}]"
end