Class: ShellDataReportingApIs::AccountAccess

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/shell_data_reporting_ap_is/models/account_access.rb

Overview

AccountAccess Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(colco_id = SKIP, colco_code = SKIP, payer_id = SKIP, payer_number = SKIP, payer_name = SKIP, account_id = SKIP, account_number = SKIP, account_name = SKIP) ⇒ AccountAccess

Returns a new instance of AccountAccess.



85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/shell_data_reporting_ap_is/models/account_access.rb', line 85

def initialize(colco_id = SKIP, colco_code = SKIP, payer_id = SKIP,
               payer_number = SKIP, payer_name = SKIP,  = SKIP,
                = SKIP,  = SKIP)
  @colco_id = colco_id unless colco_id == SKIP
  @colco_code = colco_code unless colco_code == SKIP
  @payer_id = payer_id unless payer_id == SKIP
  @payer_number = payer_number unless payer_number == SKIP
  @payer_name = payer_name unless payer_name == SKIP
  @account_id =  unless  == SKIP
  @account_number =  unless  == SKIP
  @account_name =  unless  == SKIP
end

Instance Attribute Details

#account_idInteger

Account Id to which the user has access

Returns:

  • (Integer)


34
35
36
# File 'lib/shell_data_reporting_ap_is/models/account_access.rb', line 34

def 
  @account_id
end

#account_nameString

Name of the Account to which the user has access

Returns:

  • (String)


42
43
44
# File 'lib/shell_data_reporting_ap_is/models/account_access.rb', line 42

def 
  @account_name
end

#account_numberString

Account Number to which the user has access

Returns:

  • (String)


38
39
40
# File 'lib/shell_data_reporting_ap_is/models/account_access.rb', line 38

def 
  @account_number
end

#colco_codeInteger

Collecting company code.

Returns:

  • (Integer)


18
19
20
# File 'lib/shell_data_reporting_ap_is/models/account_access.rb', line 18

def colco_code
  @colco_code
end

#colco_idInteger

Collecting company id.

Returns:

  • (Integer)


14
15
16
# File 'lib/shell_data_reporting_ap_is/models/account_access.rb', line 14

def colco_id
  @colco_id
end

#payer_idInteger

Payer Id to which the user has access

Returns:

  • (Integer)


22
23
24
# File 'lib/shell_data_reporting_ap_is/models/account_access.rb', line 22

def payer_id
  @payer_id
end

#payer_nameString

Name of the Payer to which the user has access

Returns:

  • (String)


30
31
32
# File 'lib/shell_data_reporting_ap_is/models/account_access.rb', line 30

def payer_name
  @payer_name
end

#payer_numberString

Payer Number to which the user has access

Returns:

  • (String)


26
27
28
# File 'lib/shell_data_reporting_ap_is/models/account_access.rb', line 26

def payer_number
  @payer_number
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/shell_data_reporting_ap_is/models/account_access.rb', line 99

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  colco_id = hash.key?('ColcoId') ? hash['ColcoId'] : SKIP
  colco_code = hash.key?('ColcoCode') ? hash['ColcoCode'] : SKIP
  payer_id = hash.key?('PayerId') ? hash['PayerId'] : SKIP
  payer_number = hash.key?('PayerNumber') ? hash['PayerNumber'] : SKIP
  payer_name = hash.key?('PayerName') ? hash['PayerName'] : SKIP
   = hash.key?('AccountId') ? hash['AccountId'] : SKIP
   = hash.key?('AccountNumber') ? hash['AccountNumber'] : SKIP
   = hash.key?('AccountName') ? hash['AccountName'] : SKIP

  # Create object from extracted values.
  AccountAccess.new(colco_id,
                    colco_code,
                    payer_id,
                    payer_number,
                    payer_name,
                    ,
                    ,
                    )
end

.namesObject

A mapping from model property names to API property names.



45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/shell_data_reporting_ap_is/models/account_access.rb', line 45

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['colco_id'] = 'ColcoId'
  @_hash['colco_code'] = 'ColcoCode'
  @_hash['payer_id'] = 'PayerId'
  @_hash['payer_number'] = 'PayerNumber'
  @_hash['payer_name'] = 'PayerName'
  @_hash['account_id'] = 'AccountId'
  @_hash['account_number'] = 'AccountNumber'
  @_hash['account_name'] = 'AccountName'
  @_hash
end

.nullablesObject

An array for nullable fields



73
74
75
76
77
78
79
80
81
82
83
# File 'lib/shell_data_reporting_ap_is/models/account_access.rb', line 73

def self.nullables
  %w[
    colco_id
    colco_code
    payer_id
    payer_number
    payer_name
    account_id
    account_name
  ]
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    colco_id
    colco_code
    payer_id
    payer_number
    payer_name
    account_id
    account_number
    account_name
  ]
end