Class: ShellCardManagementApIs::CardTypeRequest

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

Overview

CardTypeRequest 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_id = SKIP, col_co_code = SKIP, payer_id = SKIP, payer_number = SKIP, account_id = SKIP, account_number = SKIP, include_usage_restrictions = SKIP, include_purchase_categories = SKIP) ⇒ CardTypeRequest

Returns a new instance of CardTypeRequest.



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

def initialize(col_co_id = SKIP, col_co_code = SKIP, payer_id = SKIP,
               payer_number = SKIP,  = SKIP,
                = SKIP, include_usage_restrictions = SKIP,
               include_purchase_categories = 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_id =  unless  == SKIP
  @account_number =  unless  == SKIP
  unless include_usage_restrictions == SKIP
    @include_usage_restrictions =
      include_usage_restrictions
  end
  unless include_purchase_categories == SKIP
    @include_purchase_categories =
      include_purchase_categories
  end
end

Instance Attribute Details

#account_idInteger

Account Id of the customer. Optional if AccountNumber is passed else Mandatory.

Returns:

  • (Integer)


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

def 
  @account_id
end

#account_numberString

Account Number of the customer. Optional if AccountId is passed else Mandatory Example: GB000000124

Returns:

  • (String)


40
41
42
# File 'lib/shell_card_management_ap_is/models/card_type_request.rb', line 40

def 
  @account_number
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.

Returns:

  • (Integer)


21
22
23
# File 'lib/shell_card_management_ap_is/models/card_type_request.rb', line 21

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.

Returns:

  • (Integer)


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

def col_co_id
  @col_co_id
end

#include_purchase_categoriesTrueClass | FalseClass

Include purchase categories in the response. Optional field– default value is False. Possible values: True/False

Returns:

  • (TrueClass | FalseClass)


52
53
54
# File 'lib/shell_card_management_ap_is/models/card_type_request.rb', line 52

def include_purchase_categories
  @include_purchase_categories
end

#include_usage_restrictionsTrueClass | FalseClass

Include usage restrictions in the response. Optional field– default value is False. Possible values: True/False

Returns:

  • (TrueClass | FalseClass)


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

def include_usage_restrictions
  @include_usage_restrictions
end

#payer_idInteger

Payer Id of the selected payer.

Returns:

  • (Integer)


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

def payer_id
  @payer_id
end

#payer_numberString

Payer Number of the selected payer.

Returns:

  • (String)


29
30
31
# File 'lib/shell_card_management_ap_is/models/card_type_request.rb', line 29

def payer_number
  @payer_number
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/shell_card_management_ap_is/models/card_type_request.rb', line 115

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
   = hash.key?('AccountId') ? hash['AccountId'] : SKIP
   = hash.key?('AccountNumber') ? hash['AccountNumber'] : SKIP
  include_usage_restrictions =
    hash.key?('IncludeUsageRestrictions') ? hash['IncludeUsageRestrictions'] : SKIP
  include_purchase_categories =
    hash.key?('IncludePurchaseCategories') ? hash['IncludePurchaseCategories'] : SKIP

  # Create object from extracted values.
  CardTypeRequest.new(col_co_id,
                      col_co_code,
                      payer_id,
                      payer_number,
                      ,
                      ,
                      include_usage_restrictions,
                      include_purchase_categories)
end

.namesObject

A mapping from model property names to API property names.



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

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_id'] = 'AccountId'
  @_hash['account_number'] = 'AccountNumber'
  @_hash['include_usage_restrictions'] = 'IncludeUsageRestrictions'
  @_hash['include_purchase_categories'] = 'IncludePurchaseCategories'
  @_hash
end

.nullablesObject

An array for nullable fields



83
84
85
86
87
88
89
90
91
92
# File 'lib/shell_card_management_ap_is/models/card_type_request.rb', line 83

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

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    col_co_id
    col_co_code
    payer_id
    payer_number
    account_id
    account_number
    include_usage_restrictions
    include_purchase_categories
  ]
end