Class: ShellCardManagementApIs::CardMoveRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/shell_card_management_ap_is/models/card_move_request.rb

Overview

CardMoveRequest Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(col_co_code = SKIP, col_co_id = SKIP, col_co_country_code = SKIP, payer_number = SKIP, payer_id = SKIP, cards = SKIP, target_account_id = SKIP, target_account_number = SKIP, target_card_group_id = SKIP, target_new_card_group_name = SKIP) ⇒ CardMoveRequest

Returns a new instance of CardMoveRequest.



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/shell_card_management_ap_is/models/card_move_request.rb', line 95

def initialize(col_co_code = SKIP, col_co_id = SKIP,
               col_co_country_code = SKIP, payer_number = SKIP,
               payer_id = SKIP, cards = SKIP,  = SKIP,
                = SKIP, target_card_group_id = SKIP,
               target_new_card_group_name = SKIP)
  @col_co_code = col_co_code unless col_co_code == SKIP
  @col_co_id = col_co_id unless col_co_id == SKIP
  @col_co_country_code = col_co_country_code unless col_co_country_code == SKIP
  @payer_number = payer_number unless payer_number == SKIP
  @payer_id = payer_id unless payer_id == SKIP
  @cards = cards unless cards == SKIP
  @target_account_id =  unless  == SKIP
  @target_account_number =  unless  == SKIP
  @target_card_group_id = target_card_group_id unless target_card_group_id == SKIP
  unless target_new_card_group_name == SKIP
    @target_new_card_group_name =
      target_new_card_group_name
  end
end

Instance Attribute Details

#cardsArray[CardMoveRequestCardsItems]

TODO: Write general description for this method

Returns:



34
35
36
# File 'lib/shell_card_management_ap_is/models/card_move_request.rb', line 34

def cards
  @cards
end

#col_co_codeInteger

TODO: Write general description for this method

Returns:

  • (Integer)


14
15
16
# File 'lib/shell_card_management_ap_is/models/card_move_request.rb', line 14

def col_co_code
  @col_co_code
end

#col_co_country_codeString

TODO: Write general description for this method

Returns:

  • (String)


22
23
24
# File 'lib/shell_card_management_ap_is/models/card_move_request.rb', line 22

def col_co_country_code
  @col_co_country_code
end

#col_co_idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


18
19
20
# File 'lib/shell_card_management_ap_is/models/card_move_request.rb', line 18

def col_co_id
  @col_co_id
end

#payer_idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


30
31
32
# File 'lib/shell_card_management_ap_is/models/card_move_request.rb', line 30

def payer_id
  @payer_id
end

#payer_numberString

TODO: Write general description for this method

Returns:

  • (String)


26
27
28
# File 'lib/shell_card_management_ap_is/models/card_move_request.rb', line 26

def payer_number
  @payer_number
end

#target_account_idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


38
39
40
# File 'lib/shell_card_management_ap_is/models/card_move_request.rb', line 38

def 
  @target_account_id
end

#target_account_numberString

TODO: Write general description for this method

Returns:

  • (String)


42
43
44
# File 'lib/shell_card_management_ap_is/models/card_move_request.rb', line 42

def 
  @target_account_number
end

#target_card_group_idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


46
47
48
# File 'lib/shell_card_management_ap_is/models/card_move_request.rb', line 46

def target_card_group_id
  @target_card_group_id
end

#target_new_card_group_nameString

TODO: Write general description for this method

Returns:

  • (String)


50
51
52
# File 'lib/shell_card_management_ap_is/models/card_move_request.rb', line 50

def target_new_card_group_name
  @target_new_card_group_name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/shell_card_management_ap_is/models/card_move_request.rb', line 116

def self.from_hash(hash)
  return nil unless hash

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

  cards = SKIP unless hash.key?('Cards')
   =
    hash.key?('TargetAccountId') ? hash['TargetAccountId'] : SKIP
   =
    hash.key?('TargetAccountNumber') ? hash['TargetAccountNumber'] : SKIP
  target_card_group_id =
    hash.key?('TargetCardGroupId') ? hash['TargetCardGroupId'] : SKIP
  target_new_card_group_name =
    hash.key?('TargetNewCardGroupName') ? hash['TargetNewCardGroupName'] : SKIP

  # Create object from extracted values.
  CardMoveRequest.new(col_co_code,
                      col_co_id,
                      col_co_country_code,
                      payer_number,
                      payer_id,
                      cards,
                      ,
                      ,
                      target_card_group_id,
                      target_new_card_group_name)
end

.namesObject

A mapping from model property names to API property names.



53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/shell_card_management_ap_is/models/card_move_request.rb', line 53

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['col_co_code'] = 'ColCoCode'
  @_hash['col_co_id'] = 'ColCoId'
  @_hash['col_co_country_code'] = 'ColCoCountryCode'
  @_hash['payer_number'] = 'PayerNumber'
  @_hash['payer_id'] = 'PayerId'
  @_hash['cards'] = 'Cards'
  @_hash['target_account_id'] = 'TargetAccountId'
  @_hash['target_account_number'] = 'TargetAccountNumber'
  @_hash['target_card_group_id'] = 'TargetCardGroupId'
  @_hash['target_new_card_group_name'] = 'TargetNewCardGroupName'
  @_hash
end

.nullablesObject

An array for nullable fields



85
86
87
88
89
90
91
92
93
# File 'lib/shell_card_management_ap_is/models/card_move_request.rb', line 85

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

.optionalsObject

An array for optional fields



69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/shell_card_management_ap_is/models/card_move_request.rb', line 69

def self.optionals
  %w[
    col_co_code
    col_co_id
    col_co_country_code
    payer_number
    payer_id
    cards
    target_account_id
    target_account_number
    target_card_group_id
    target_new_card_group_name
  ]
end