Class: ThePlaidApi::UserAccountIdentityEditCounts

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/the_plaid_api/models/user_account_identity_edit_counts.rb

Overview

Edit counts over various time periods.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(edits_current: SKIP, edits_1d: SKIP, edits_30d: SKIP, edits_365d: SKIP, edits_all_time: SKIP, additional_properties: nil) ⇒ UserAccountIdentityEditCounts

Returns a new instance of UserAccountIdentityEditCounts.



59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/the_plaid_api/models/user_account_identity_edit_counts.rb', line 59

def initialize(edits_current: SKIP, edits_1d: SKIP, edits_30d: SKIP,
               edits_365d: SKIP, edits_all_time: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @edits_current = edits_current unless edits_current == SKIP
  @edits_1d = edits_1d unless edits_1d == SKIP
  @edits_30d = edits_30d unless edits_30d == SKIP
  @edits_365d = edits_365d unless edits_365d == SKIP
  @edits_all_time = edits_all_time unless edits_all_time == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#edits_1dInteger

Number of edits in the last 1 day

Returns:

  • (Integer)


18
19
20
# File 'lib/the_plaid_api/models/user_account_identity_edit_counts.rb', line 18

def edits_1d
  @edits_1d
end

#edits_30dInteger

Number of edits in the last 30 days

Returns:

  • (Integer)


22
23
24
# File 'lib/the_plaid_api/models/user_account_identity_edit_counts.rb', line 22

def edits_30d
  @edits_30d
end

#edits_365dInteger

Number of edits in the last 365 days

Returns:

  • (Integer)


26
27
28
# File 'lib/the_plaid_api/models/user_account_identity_edit_counts.rb', line 26

def edits_365d
  @edits_365d
end

#edits_all_timeInteger

Total number of edits

Returns:

  • (Integer)


30
31
32
# File 'lib/the_plaid_api/models/user_account_identity_edit_counts.rb', line 30

def edits_all_time
  @edits_all_time
end

#edits_currentInteger

Number of edits in the current session

Returns:

  • (Integer)


14
15
16
# File 'lib/the_plaid_api/models/user_account_identity_edit_counts.rb', line 14

def edits_current
  @edits_current
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/the_plaid_api/models/user_account_identity_edit_counts.rb', line 74

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  edits_current = hash.key?('edits_current') ? hash['edits_current'] : SKIP
  edits_1d = hash.key?('edits_1d') ? hash['edits_1d'] : SKIP
  edits_30d = hash.key?('edits_30d') ? hash['edits_30d'] : SKIP
  edits_365d = hash.key?('edits_365d') ? hash['edits_365d'] : SKIP
  edits_all_time =
    hash.key?('edits_all_time') ? hash['edits_all_time'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  UserAccountIdentityEditCounts.new(edits_current: edits_current,
                                    edits_1d: edits_1d,
                                    edits_30d: edits_30d,
                                    edits_365d: edits_365d,
                                    edits_all_time: edits_all_time,
                                    additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



33
34
35
36
37
38
39
40
41
# File 'lib/the_plaid_api/models/user_account_identity_edit_counts.rb', line 33

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['edits_current'] = 'edits_current'
  @_hash['edits_1d'] = 'edits_1d'
  @_hash['edits_30d'] = 'edits_30d'
  @_hash['edits_365d'] = 'edits_365d'
  @_hash['edits_all_time'] = 'edits_all_time'
  @_hash
end

.nullablesObject

An array for nullable fields



55
56
57
# File 'lib/the_plaid_api/models/user_account_identity_edit_counts.rb', line 55

def self.nullables
  []
end

.optionalsObject

An array for optional fields



44
45
46
47
48
49
50
51
52
# File 'lib/the_plaid_api/models/user_account_identity_edit_counts.rb', line 44

def self.optionals
  %w[
    edits_current
    edits_1d
    edits_30d
    edits_365d
    edits_all_time
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



110
111
112
113
114
115
# File 'lib/the_plaid_api/models/user_account_identity_edit_counts.rb', line 110

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} edits_current: #{@edits_current.inspect}, edits_1d: #{@edits_1d.inspect},"\
  " edits_30d: #{@edits_30d.inspect}, edits_365d: #{@edits_365d.inspect}, edits_all_time:"\
  " #{@edits_all_time.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



102
103
104
105
106
107
# File 'lib/the_plaid_api/models/user_account_identity_edit_counts.rb', line 102

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} edits_current: #{@edits_current}, edits_1d: #{@edits_1d}, edits_30d:"\
  " #{@edits_30d}, edits_365d: #{@edits_365d}, edits_all_time: #{@edits_all_time},"\
  " additional_properties: #{@additional_properties}>"
end