Class: LockstepSdk::CustomFieldDefinitionModel

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

Overview

A Custom Field represents metadata added to an object within the Lockstep Platform. Lockstep provides a core definition for each object. The core definition is intended to represent a level of compatibility that provides support across most accounting systems and products. When a user or developer requires information beyond this core definition, you can use Custom Fields to represent this information.

See [Extensibility](developer.lockstep.io/docs/extensibility) for more information.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ CustomFieldDefinitionModel

Initialize the CustomFieldDefinitionModel using the provided prototype



33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/lockstep_sdk/models/custom_field_definition_model.rb', line 33

def initialize(params = {})
    @group_key = params.dig(:group_key)
    @custom_field_definition_id = params.dig(:custom_field_definition_id)
    @table_key = params.dig(:table_key)
    @app_id = params.dig(:app_id)
    @custom_field_label = params.dig(:custom_field_label)
    @data_type = params.dig(:data_type)
    @sort_order = params.dig(:sort_order)
    @created = params.dig(:created)
    @created_user_id = params.dig(:created_user_id)
    @modified = params.dig(:modified)
    @modified_user_id = params.dig(:modified_user_id)
    @app_enrollment_id = params.dig(:app_enrollment_id)
end

Instance Attribute Details

#app_enrollment_idUuid

Returns AppEnrollmentId for this record; used for mapping purposes.

Returns:

  • (Uuid)

    AppEnrollmentId for this record; used for mapping purposes.



94
95
96
# File 'lib/lockstep_sdk/models/custom_field_definition_model.rb', line 94

def app_enrollment_id
  @app_enrollment_id
end

#app_idUuid

Returns Id of app this definition belongs to.

Returns:

  • (Uuid)

    Id of app this definition belongs to



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

def app_id
  @app_id
end

#createdDate-time

Returns Date created.

Returns:

  • (Date-time)

    Date created



78
79
80
# File 'lib/lockstep_sdk/models/custom_field_definition_model.rb', line 78

def created
  @created
end

#created_user_idUuid

Returns Id of user who created this definition.

Returns:

  • (Uuid)

    Id of user who created this definition



82
83
84
# File 'lib/lockstep_sdk/models/custom_field_definition_model.rb', line 82

def created_user_id
  @created_user_id
end

#custom_field_definition_idUuid

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.



54
55
56
# File 'lib/lockstep_sdk/models/custom_field_definition_model.rb', line 54

def custom_field_definition_id
  @custom_field_definition_id
end

#custom_field_labelString

Returns Text to display in-application for custom field.

Returns:

  • (String)

    Text to display in-application for custom field



66
67
68
# File 'lib/lockstep_sdk/models/custom_field_definition_model.rb', line 66

def custom_field_label
  @custom_field_label
end

#data_typeString

Returns Data type of this definition.

Returns:

  • (String)

    Data type of this definition



70
71
72
# File 'lib/lockstep_sdk/models/custom_field_definition_model.rb', line 70

def data_type
  @data_type
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. 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).



50
51
52
# File 'lib/lockstep_sdk/models/custom_field_definition_model.rb', line 50

def group_key
  @group_key
end

#modifiedDate-time

Returns Date modified.

Returns:

  • (Date-time)

    Date modified



86
87
88
# File 'lib/lockstep_sdk/models/custom_field_definition_model.rb', line 86

def modified
  @modified
end

#modified_user_idUuid

Returns Id of user who modified this definition.

Returns:

  • (Uuid)

    Id of user who modified this definition



90
91
92
# File 'lib/lockstep_sdk/models/custom_field_definition_model.rb', line 90

def modified_user_id
  @modified_user_id
end

#sort_orderInt32

Returns Used for display logic when multiple custom fields exist.

Returns:

  • (Int32)

    Used for display logic when multiple custom fields exist



74
75
76
# File 'lib/lockstep_sdk/models/custom_field_definition_model.rb', line 74

def sort_order
  @sort_order
end

#table_keyString

Returns Table to which this definition belongs.

Returns:

  • (String)

    Table to which this definition belongs



58
59
60
# File 'lib/lockstep_sdk/models/custom_field_definition_model.rb', line 58

def table_key
  @table_key
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



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/lockstep_sdk/models/custom_field_definition_model.rb', line 98

def as_json(options={})
    {
        'groupKey' => @group_key,
        'customFieldDefinitionId' => @custom_field_definition_id,
        'tableKey' => @table_key,
        'appId' => @app_id,
        'customFieldLabel' => @custom_field_label,
        'dataType' => @data_type,
        'sortOrder' => @sort_order,
        'created' => @created,
        'createdUserId' => @created_user_id,
        'modified' => @modified,
        'modifiedUserId' => @modified_user_id,
        'appEnrollmentId' => @app_enrollment_id,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



117
118
119
# File 'lib/lockstep_sdk/models/custom_field_definition_model.rb', line 117

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