Class: ShellDataReportingApIs::CardGroupRequest

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

Overview

CardGroupRequest Model.

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(col_co_id = SKIP, col_co_code = SKIP, payer_id = SKIP, payer_number = SKIP, account = SKIP, card_group_name = SKIP, status = SKIP) ⇒ CardGroupRequest

Returns a new instance of CardGroupRequest.



104
105
106
107
108
109
110
111
112
113
114
# File 'lib/shell_data_reporting_ap_is/models/card_group_request.rb', line 104

def initialize(col_co_id = SKIP, col_co_code = SKIP, payer_id = SKIP,
               payer_number = SKIP,  = SKIP, card_group_name = SKIP,
               status = SKIP)
  @col_co_id = col_co_id unless col_co_id == SKIP
  @col_co_code = col_co_code unless col_co_code == SKIP
  @payer_id = payer_id unless payer_id == SKIP
  @payer_number = payer_number unless payer_number == SKIP
  @account =  unless  == SKIP
  @card_group_name = card_group_name unless card_group_name == SKIP
  @status = status unless status == SKIP
end

Instance Attribute Details

#accountArray[Accounts]

PayerNumber of the customer. Optional if PayerId is passed, else Mandatory. This input is a search criterion. Example: GB00123456

Returns:



48
49
50
# File 'lib/shell_data_reporting_ap_is/models/card_group_request.rb', line 48

def 
  @account
end

#card_group_nameString

Card Group Name Optional. Minimum of 2 characters should be provided else not considered. CardGroups those have the entered value at any part

Returns:

  • (String)


55
56
57
# File 'lib/shell_data_reporting_ap_is/models/card_group_request.rb', line 55

def card_group_name
  @card_group_name
end

#col_co_codeInteger

Collecting Company Code (Shell Code) of the selected payer. Mandatory for serviced OUs such as Romania, Latvia, Lithuania, Estonia, Ukraine etc. It is optional for other countries if ColCoID is provided. Example: 86 for Philippines 5 for UK

Returns:

  • (Integer)


27
28
29
# File 'lib/shell_data_reporting_ap_is/models/card_group_request.rb', line 27

def col_co_code
  @col_co_code
end

#col_co_idInteger

Collecting Company Id of the selected payer. Optional if ColCoCode is passed else Mandatory. Example: 1 for Philippines 5 for UK

Returns:

  • (Integer)


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

def col_co_id
  @col_co_id
end

#payer_idInteger

Payer id of the customer. Optional if PayerNumber is passed, else Mandatory. This input is a search criterion. Example: 123456

Returns:

  • (Integer)


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

def payer_id
  @payer_id
end

#payer_numberString

PayerNumber of the customer. Optional if PayerId is passed, else Mandatory. This input is a search criterion. Example: GB00123456

Returns:

  • (String)


41
42
43
# File 'lib/shell_data_reporting_ap_is/models/card_group_request.rb', line 41

def payer_number
  @payer_number
end

#statusString

Card Group Status Mandatory Allowed values: • ALL • TERMINATED • ACTIVE

Returns:

  • (String)


64
65
66
# File 'lib/shell_data_reporting_ap_is/models/card_group_request.rb', line 64

def status
  @status
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/shell_data_reporting_ap_is/models/card_group_request.rb', line 117

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  col_co_id = hash.key?('ColCoId') ? hash['ColCoId'] : SKIP
  col_co_code = hash.key?('ColCoCode') ? hash['ColCoCode'] : SKIP
  payer_id = hash.key?('PayerId') ? hash['PayerId'] : SKIP
  payer_number = hash.key?('PayerNumber') ? hash['PayerNumber'] : SKIP
  # Parameter is an array, so we need to iterate through it
   = nil
  unless hash['Account'].nil?
     = []
    hash['Account'].each do |structure|
       << (Accounts.from_hash(structure) if structure)
    end
  end

   = SKIP unless hash.key?('Account')
  card_group_name =
    hash.key?('CardGroupName') ? hash['CardGroupName'] : SKIP
  status = hash.key?('Status') ? hash['Status'] : SKIP

  # Create object from extracted values.
  CardGroupRequest.new(col_co_id,
                       col_co_code,
                       payer_id,
                       payer_number,
                       ,
                       card_group_name,
                       status)
end

.namesObject

A mapping from model property names to API property names.



67
68
69
70
71
72
73
74
75
76
77
# File 'lib/shell_data_reporting_ap_is/models/card_group_request.rb', line 67

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['col_co_id'] = 'ColCoId'
  @_hash['col_co_code'] = 'ColCoCode'
  @_hash['payer_id'] = 'PayerId'
  @_hash['payer_number'] = 'PayerNumber'
  @_hash['account'] = 'Account'
  @_hash['card_group_name'] = 'CardGroupName'
  @_hash['status'] = 'Status'
  @_hash
end

.nullablesObject

An array for nullable fields



93
94
95
96
97
98
99
100
101
102
# File 'lib/shell_data_reporting_ap_is/models/card_group_request.rb', line 93

def self.nullables
  %w[
    col_co_id
    col_co_code
    payer_id
    payer_number
    card_group_name
    status
  ]
end

.optionalsObject

An array for optional fields



80
81
82
83
84
85
86
87
88
89
90
# File 'lib/shell_data_reporting_ap_is/models/card_group_request.rb', line 80

def self.optionals
  %w[
    col_co_id
    col_co_code
    payer_id
    payer_number
    account
    card_group_name
    status
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



158
159
160
161
162
163
164
# File 'lib/shell_data_reporting_ap_is/models/card_group_request.rb', line 158

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} col_co_id: #{@col_co_id.inspect}, col_co_code: #{@col_co_code.inspect},"\
  " payer_id: #{@payer_id.inspect}, payer_number: #{@payer_number.inspect}, account:"\
  " #{@account.inspect}, card_group_name: #{@card_group_name.inspect}, status:"\
  " #{@status.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



150
151
152
153
154
155
# File 'lib/shell_data_reporting_ap_is/models/card_group_request.rb', line 150

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} col_co_id: #{@col_co_id}, col_co_code: #{@col_co_code}, payer_id:"\
  " #{@payer_id}, payer_number: #{@payer_number}, account: #{@account}, card_group_name:"\
  " #{@card_group_name}, status: #{@status}>"
end