Class: ShellCardManagementApIs::CreateCardGroupRequestCardsItems

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

Overview

CreateCardGroupRequestCardsItems Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(account_id = SKIP, account_number = SKIP, card_id = SKIP, pan = SKIP) ⇒ CreateCardGroupRequestCardsItems

Returns a new instance of CreateCardGroupRequestCardsItems.



57
58
59
60
61
62
63
# File 'lib/shell_card_management_ap_is/models/create_card_group_request_cards_items.rb', line 57

def initialize( = SKIP,  = SKIP, card_id = SKIP,
               pan = SKIP)
  @account_id =  unless  == SKIP
  @account_number =  unless  == SKIP
  @card_id = card_id unless card_id == SKIP
  @pan = pan unless pan == SKIP
end

Instance Attribute Details

#account_idInteger

Account Id of the account of the card. Optional if AccountNumber is passed, else Mandatory.

Returns:

  • (Integer)


15
16
17
# File 'lib/shell_card_management_ap_is/models/create_card_group_request_cards_items.rb', line 15

def 
  @account_id
end

#account_numberString

Account Number of the account of the card. Optional if AccountId is passed, else Mandatory.

Returns:

  • (String)


20
21
22
# File 'lib/shell_card_management_ap_is/models/create_card_group_request_cards_items.rb', line 20

def 
  @account_number
end

#card_idInteger

Card Id of the card. Optional if PAN is passed, else Mandatory.

Returns:

  • (Integer)


25
26
27
# File 'lib/shell_card_management_ap_is/models/create_card_group_request_cards_items.rb', line 25

def card_id
  @card_id
end

#panString

PAN of the card. Optional if CardId is passed, else Mandatory.

Returns:

  • (String)


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

def pan
  @pan
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/shell_card_management_ap_is/models/create_card_group_request_cards_items.rb', line 66

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('AccountId') ? hash['AccountId'] : SKIP
   = hash.key?('AccountNumber') ? hash['AccountNumber'] : SKIP
  card_id = hash.key?('CardId') ? hash['CardId'] : SKIP
  pan = hash.key?('PAN') ? hash['PAN'] : SKIP

  # Create object from extracted values.
  CreateCardGroupRequestCardsItems.new(,
                                       ,
                                       card_id,
                                       pan)
end

.namesObject

A mapping from model property names to API property names.



33
34
35
36
37
38
39
40
# File 'lib/shell_card_management_ap_is/models/create_card_group_request_cards_items.rb', line 33

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_id'] = 'AccountId'
  @_hash['account_number'] = 'AccountNumber'
  @_hash['card_id'] = 'CardId'
  @_hash['pan'] = 'PAN'
  @_hash
end

.nullablesObject

An array for nullable fields



53
54
55
# File 'lib/shell_card_management_ap_is/models/create_card_group_request_cards_items.rb', line 53

def self.nullables
  []
end

.optionalsObject

An array for optional fields



43
44
45
46
47
48
49
50
# File 'lib/shell_card_management_ap_is/models/create_card_group_request_cards_items.rb', line 43

def self.optionals
  %w[
    account_id
    account_number
    card_id
    pan
  ]
end