Class: LockstepSdk::UserGroupModel

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

Overview

A UserGroup represents the groups that the user is a member of. A user may have varying permissions/access within a Group.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ UserGroupModel

Initialize the UserGroupModel using the provided prototype



26
27
28
29
30
31
# File 'lib/lockstep_sdk/models/user_group_model.rb', line 26

def initialize(params = {})
    @group_key = params.dig(:group_key)
    @user_role = params.dig(:user_role)
    @group_name = params.dig(:group_name)
    @status = params.dig(:status)
end

Instance Attribute Details

#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. For more information, see [Accounts and GroupKeys](developer.lockstep.io/docs/accounts-and-groupkeys).

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. For more information, see [Accounts and GroupKeys](developer.lockstep.io/docs/accounts-and-groupkeys).



35
36
37
# File 'lib/lockstep_sdk/models/user_group_model.rb', line 35

def group_key
  @group_key
end

#group_nameString

Returns The name of the group.

Returns:

  • (String)

    The name of the group



43
44
45
# File 'lib/lockstep_sdk/models/user_group_model.rb', line 43

def group_name
  @group_name
end

#statusString

Returns The user’s status in the group.

Returns:

  • (String)

    The user’s status in the group



47
48
49
# File 'lib/lockstep_sdk/models/user_group_model.rb', line 47

def status
  @status
end

#user_roleString

Returns The name of the Permission Level for the group.

Returns:

  • (String)

    The name of the Permission Level for the group.



39
40
41
# File 'lib/lockstep_sdk/models/user_group_model.rb', line 39

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



51
52
53
54
55
56
57
58
# File 'lib/lockstep_sdk/models/user_group_model.rb', line 51

def as_json(options={})
    {
        'groupKey' => @group_key,
        'userRole' => @user_role,
        'groupName' => @group_name,
        'status' => @status,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



62
63
64
# File 'lib/lockstep_sdk/models/user_group_model.rb', line 62

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