Class: ShellCardManagementApIs::CreateCardGroupResponseErrorCardsItems

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

Overview

CreateCardGroupResponseErrorCardsItems 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, error_code = SKIP, error_description = SKIP) ⇒ CreateCardGroupResponseErrorCardsItems

Returns a new instance of CreateCardGroupResponseErrorCardsItems.



53
54
55
56
57
58
59
# File 'lib/shell_card_management_ap_is/models/create_card_group_response_error_cards_items.rb', line 53

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

Instance Attribute Details

#card_idInteger

Card Id of the card.

Returns:

  • (Integer)


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

def card_id
  @card_id
end

#error_codeString

Error code for validation failure.

Returns:

  • (String)


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

def error_code
  @error_code
end

#error_descriptionString

Description of validation failure.

Returns:

  • (String)


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

def error_description
  @error_description
end

#panString

PAN of the card.

Returns:

  • (String)


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

def pan
  @pan
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/shell_card_management_ap_is/models/create_card_group_response_error_cards_items.rb', line 62

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
  error_code = hash.key?('ErrorCode') ? hash['ErrorCode'] : SKIP
  error_description =
    hash.key?('ErrorDescription') ? hash['ErrorDescription'] : SKIP

  # Create object from extracted values.
  CreateCardGroupResponseErrorCardsItems.new(card_id,
                                             pan,
                                             error_code,
                                             error_description)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
36
# File 'lib/shell_card_management_ap_is/models/create_card_group_response_error_cards_items.rb', line 29

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

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    card_id
    pan
    error_code
    error_description
  ]
end