Class: ShellDataReportingApIs::PayerAccess

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

Overview

PayerAccess Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(is_default = false, colco_id = SKIP, colco_code = SKIP, col_co_country_code = SKIP, payer_group_id = SKIP, payer_group = SKIP, payer_id = SKIP, payer_number = SKIP, payer_name = SKIP) ⇒ PayerAccess

Returns a new instance of PayerAccess.



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

def initialize(is_default = false, colco_id = SKIP, colco_code = SKIP,
               col_co_country_code = SKIP, payer_group_id = SKIP,
               payer_group = SKIP, payer_id = SKIP, payer_number = SKIP,
               payer_name = SKIP)
  @is_default = is_default unless is_default == SKIP
  @colco_id = colco_id unless colco_id == SKIP
  @colco_code = colco_code unless colco_code == SKIP
  @col_co_country_code = col_co_country_code unless col_co_country_code == SKIP
  @payer_group_id = payer_group_id unless payer_group_id == SKIP
  @payer_group = payer_group unless payer_group == 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
end

Instance Attribute Details

#col_co_country_codeString

The 2-character ISO Code for the customer and card owning country

Returns:

  • (String)


29
30
31
# File 'lib/shell_data_reporting_ap_is/models/payer_access.rb', line 29

def col_co_country_code
  @col_co_country_code
end

#colco_codeInteger

Collecting company code. Example: 86-Philippines 5-UK

Returns:

  • (Integer)


25
26
27
# File 'lib/shell_data_reporting_ap_is/models/payer_access.rb', line 25

def colco_code
  @colco_code
end

#colco_idInteger

Collecting company id.

Returns:

  • (Integer)


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

def colco_id
  @colco_id
end

#is_defaultTrueClass | FalseClass

Whether this payer is the default payer of the user.

Returns:

  • (TrueClass | FalseClass)


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

def is_default
  @is_default
end

#payer_groupString

Payer group of the payer. The value of this parameter will always be null when the input parameter “IncludePayerGroup” is false.

Returns:

  • (String)


39
40
41
# File 'lib/shell_data_reporting_ap_is/models/payer_access.rb', line 39

def payer_group
  @payer_group
end

#payer_group_idInteger

Payer Group Id of the payer.

Returns:

  • (Integer)


33
34
35
# File 'lib/shell_data_reporting_ap_is/models/payer_access.rb', line 33

def payer_group_id
  @payer_group_id
end

#payer_idInteger

Payer Id to which the user has access Example: 123456

Returns:

  • (Integer)


44
45
46
# File 'lib/shell_data_reporting_ap_is/models/payer_access.rb', line 44

def payer_id
  @payer_id
end

#payer_nameString

Name of the Payer to which the user has access

Returns:

  • (String)


53
54
55
# File 'lib/shell_data_reporting_ap_is/models/payer_access.rb', line 53

def payer_name
  @payer_name
end

#payer_numberString

Payer Number to which the user has access Example: GB000000123

Returns:

  • (String)


49
50
51
# File 'lib/shell_data_reporting_ap_is/models/payer_access.rb', line 49

def payer_number
  @payer_number
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/shell_data_reporting_ap_is/models/payer_access.rb', line 115

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  is_default = hash['IsDefault'] ||= false
  colco_id = hash.key?('ColcoId') ? hash['ColcoId'] : SKIP
  colco_code = hash.key?('ColcoCode') ? hash['ColcoCode'] : SKIP
  col_co_country_code =
    hash.key?('ColCoCountryCode') ? hash['ColCoCountryCode'] : SKIP
  payer_group_id = hash.key?('PayerGroupId') ? hash['PayerGroupId'] : SKIP
  payer_group = hash.key?('PayerGroup') ? hash['PayerGroup'] : 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

  # Create object from extracted values.
  PayerAccess.new(is_default,
                  colco_id,
                  colco_code,
                  col_co_country_code,
                  payer_group_id,
                  payer_group,
                  payer_id,
                  payer_number,
                  payer_name)
end

.namesObject

A mapping from model property names to API property names.



56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/shell_data_reporting_ap_is/models/payer_access.rb', line 56

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['is_default'] = 'IsDefault'
  @_hash['colco_id'] = 'ColcoId'
  @_hash['colco_code'] = 'ColcoCode'
  @_hash['col_co_country_code'] = 'ColCoCountryCode'
  @_hash['payer_group_id'] = 'PayerGroupId'
  @_hash['payer_group'] = 'PayerGroup'
  @_hash['payer_id'] = 'PayerId'
  @_hash['payer_number'] = 'PayerNumber'
  @_hash['payer_name'] = 'PayerName'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  %w[
    colco_id
    colco_code
    col_co_country_code
    payer_group_id
    payer_group
    payer_id
    payer_number
    payer_name
  ]
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    is_default
    colco_id
    colco_code
    col_co_country_code
    payer_group_id
    payer_group
    payer_id
    payer_number
    payer_name
  ]
end