Class: ShellCardManagementApIs::SearchCardRestriction

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

Overview

SearchCardRestriction Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(card_id = SKIP, pan = SKIP) ⇒ SearchCardRestriction

Returns a new instance of SearchCardRestriction.



48
49
50
51
# File 'lib/shell_card_management_ap_is/models/search_card_restriction.rb', line 48

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

Instance Attribute Details

#card_idInteger

Unique Card Id Optional if PAN is given, else mandatory.

Returns:

  • (Integer)


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

def card_id
  @card_id
end

#panString

Card PAN. Optional if CardId is given, else mandatory. Note: PAN is ignored if CardId is given. Example: 7002051006629890645

Returns:

  • (String)


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

def pan
  @pan
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

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

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

.namesObject

A mapping from model property names to API property names.



25
26
27
28
29
30
# File 'lib/shell_card_management_ap_is/models/search_card_restriction.rb', line 25

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

.nullablesObject

An array for nullable fields



41
42
43
44
45
46
# File 'lib/shell_card_management_ap_is/models/search_card_restriction.rb', line 41

def self.nullables
  %w[
    card_id
    pan
  ]
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    card_id
    pan
  ]
end