Class: PaysecureApiDocumentationLive::NewRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaysecureApiDocumentationLive::NewRequest
- Defined in:
- lib/paysecure_api_documentation_live/models/new_request.rb
Overview
NewRequest Model.
Instance Attribute Summary collapse
-
#amount ⇒ Integer
TODO: Write general description for this method.
-
#amount_unit ⇒ String
TODO: Write general description for this method.
-
#client ⇒ Client68
TODO: Write general description for this method.
-
#created_on ⇒ Integer
TODO: Write general description for this method.
-
#currency ⇒ String
TODO: Write general description for this method.
-
#error_msg ⇒ String
TODO: Write general description for this method.
-
#failure_callback ⇒ String
TODO: Write general description for this method.
-
#merchant_ref ⇒ String
TODO: Write general description for this method.
-
#payment_on ⇒ Integer
TODO: Write general description for this method.
-
#payout_id ⇒ String
TODO: Write general description for this method.
-
#payout_method ⇒ String
TODO: Write general description for this method.
-
#purpose ⇒ String
TODO: Write general description for this method.
-
#redirect_type ⇒ String
TODO: Write general description for this method.
-
#status ⇒ String
TODO: Write general description for this method.
-
#status_history ⇒ Array[StatusHistory]
TODO: Write general description for this method.
-
#success_callback ⇒ String
TODO: Write general description for this method.
-
#tax_amount ⇒ Integer
TODO: Write general description for this method.
-
#tax_percent ⇒ Integer
TODO: Write general description for this method.
-
#updated_on ⇒ Integer
TODO: Write general description for this method.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(payout_id:, client:, updated_on:, payout_method:, amount_unit:, amount:, error_msg:, purpose:, created_on:, merchant_ref:, status:, status_history:, currency:, payment_on:, tax_amount:, tax_percent:, redirect_type:, success_callback:, failure_callback:, additional_properties: nil) ⇒ NewRequest
constructor
A new instance of NewRequest.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(payout_id:, client:, updated_on:, payout_method:, amount_unit:, amount:, error_msg:, purpose:, created_on:, merchant_ref:, status:, status_history:, currency:, payment_on:, tax_amount:, tax_percent:, redirect_type:, success_callback:, failure_callback:, additional_properties: nil) ⇒ NewRequest
Returns a new instance of NewRequest.
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 |
# File 'lib/paysecure_api_documentation_live/models/new_request.rb', line 123 def initialize(payout_id:, client:, updated_on:, payout_method:, amount_unit:, amount:, error_msg:, purpose:, created_on:, merchant_ref:, status:, status_history:, currency:, payment_on:, tax_amount:, tax_percent:, redirect_type:, success_callback:, failure_callback:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @payout_id = payout_id @client = client @updated_on = updated_on @payout_method = payout_method @amount_unit = amount_unit @amount = amount @error_msg = error_msg @purpose = purpose @created_on = created_on @merchant_ref = merchant_ref @status = status @status_history = status_history @currency = currency @payment_on = payment_on @tax_amount = tax_amount @tax_percent = tax_percent @redirect_type = redirect_type @success_callback = success_callback @failure_callback = failure_callback @additional_properties = additional_properties end |
Instance Attribute Details
#amount ⇒ Integer
TODO: Write general description for this method
34 35 36 |
# File 'lib/paysecure_api_documentation_live/models/new_request.rb', line 34 def amount @amount end |
#amount_unit ⇒ String
TODO: Write general description for this method
30 31 32 |
# File 'lib/paysecure_api_documentation_live/models/new_request.rb', line 30 def amount_unit @amount_unit end |
#client ⇒ Client68
TODO: Write general description for this method
18 19 20 |
# File 'lib/paysecure_api_documentation_live/models/new_request.rb', line 18 def client @client end |
#created_on ⇒ Integer
TODO: Write general description for this method
46 47 48 |
# File 'lib/paysecure_api_documentation_live/models/new_request.rb', line 46 def created_on @created_on end |
#currency ⇒ String
TODO: Write general description for this method
62 63 64 |
# File 'lib/paysecure_api_documentation_live/models/new_request.rb', line 62 def currency @currency end |
#error_msg ⇒ String
TODO: Write general description for this method
38 39 40 |
# File 'lib/paysecure_api_documentation_live/models/new_request.rb', line 38 def error_msg @error_msg end |
#failure_callback ⇒ String
TODO: Write general description for this method
86 87 88 |
# File 'lib/paysecure_api_documentation_live/models/new_request.rb', line 86 def failure_callback @failure_callback end |
#merchant_ref ⇒ String
TODO: Write general description for this method
50 51 52 |
# File 'lib/paysecure_api_documentation_live/models/new_request.rb', line 50 def merchant_ref @merchant_ref end |
#payment_on ⇒ Integer
TODO: Write general description for this method
66 67 68 |
# File 'lib/paysecure_api_documentation_live/models/new_request.rb', line 66 def payment_on @payment_on end |
#payout_id ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/paysecure_api_documentation_live/models/new_request.rb', line 14 def payout_id @payout_id end |
#payout_method ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/paysecure_api_documentation_live/models/new_request.rb', line 26 def payout_method @payout_method end |
#purpose ⇒ String
TODO: Write general description for this method
42 43 44 |
# File 'lib/paysecure_api_documentation_live/models/new_request.rb', line 42 def purpose @purpose end |
#redirect_type ⇒ String
TODO: Write general description for this method
78 79 80 |
# File 'lib/paysecure_api_documentation_live/models/new_request.rb', line 78 def redirect_type @redirect_type end |
#status ⇒ String
TODO: Write general description for this method
54 55 56 |
# File 'lib/paysecure_api_documentation_live/models/new_request.rb', line 54 def status @status end |
#status_history ⇒ Array[StatusHistory]
TODO: Write general description for this method
58 59 60 |
# File 'lib/paysecure_api_documentation_live/models/new_request.rb', line 58 def status_history @status_history end |
#success_callback ⇒ String
TODO: Write general description for this method
82 83 84 |
# File 'lib/paysecure_api_documentation_live/models/new_request.rb', line 82 def success_callback @success_callback end |
#tax_amount ⇒ Integer
TODO: Write general description for this method
70 71 72 |
# File 'lib/paysecure_api_documentation_live/models/new_request.rb', line 70 def tax_amount @tax_amount end |
#tax_percent ⇒ Integer
TODO: Write general description for this method
74 75 76 |
# File 'lib/paysecure_api_documentation_live/models/new_request.rb', line 74 def tax_percent @tax_percent end |
#updated_on ⇒ Integer
TODO: Write general description for this method
22 23 24 |
# File 'lib/paysecure_api_documentation_live/models/new_request.rb', line 22 def updated_on @updated_on end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 |
# File 'lib/paysecure_api_documentation_live/models/new_request.rb', line 155 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. payout_id = hash.key?('payoutId') ? hash['payoutId'] : nil client = Client68.from_hash(hash['client']) if hash['client'] updated_on = hash.key?('updated_on') ? hash['updated_on'] : nil payout_method = hash.key?('payoutMethod') ? hash['payoutMethod'] : nil amount_unit = hash.key?('amountUnit') ? hash['amountUnit'] : nil amount = hash.key?('amount') ? hash['amount'] : nil error_msg = hash.key?('errorMsg') ? hash['errorMsg'] : nil purpose = hash.key?('purpose') ? hash['purpose'] : nil created_on = hash.key?('created_on') ? hash['created_on'] : nil merchant_ref = hash.key?('merchantRef') ? hash['merchantRef'] : nil status = hash.key?('status') ? hash['status'] : nil # Parameter is an array, so we need to iterate through it status_history = nil unless hash['status_history'].nil? status_history = [] hash['status_history'].each do |structure| status_history << (StatusHistory.from_hash(structure) if structure) end end status_history = nil unless hash.key?('status_history') currency = hash.key?('currency') ? hash['currency'] : nil payment_on = hash.key?('paymentOn') ? hash['paymentOn'] : nil tax_amount = hash.key?('taxAmount') ? hash['taxAmount'] : nil tax_percent = hash.key?('taxPercent') ? hash['taxPercent'] : nil redirect_type = hash.key?('redirectType') ? hash['redirectType'] : nil success_callback = hash.key?('success_callback') ? hash['success_callback'] : nil failure_callback = hash.key?('failure_callback') ? hash['failure_callback'] : nil # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. NewRequest.new(payout_id: payout_id, client: client, updated_on: updated_on, payout_method: payout_method, amount_unit: amount_unit, amount: amount, error_msg: error_msg, purpose: purpose, created_on: created_on, merchant_ref: merchant_ref, status: status, status_history: status_history, currency: currency, payment_on: payment_on, tax_amount: tax_amount, tax_percent: tax_percent, redirect_type: redirect_type, success_callback: success_callback, failure_callback: failure_callback, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/paysecure_api_documentation_live/models/new_request.rb', line 89 def self.names @_hash = {} if @_hash.nil? @_hash['payout_id'] = 'payoutId' @_hash['client'] = 'client' @_hash['updated_on'] = 'updated_on' @_hash['payout_method'] = 'payoutMethod' @_hash['amount_unit'] = 'amountUnit' @_hash['amount'] = 'amount' @_hash['error_msg'] = 'errorMsg' @_hash['purpose'] = 'purpose' @_hash['created_on'] = 'created_on' @_hash['merchant_ref'] = 'merchantRef' @_hash['status'] = 'status' @_hash['status_history'] = 'status_history' @_hash['currency'] = 'currency' @_hash['payment_on'] = 'paymentOn' @_hash['tax_amount'] = 'taxAmount' @_hash['tax_percent'] = 'taxPercent' @_hash['redirect_type'] = 'redirectType' @_hash['success_callback'] = 'success_callback' @_hash['failure_callback'] = 'failure_callback' @_hash end |
.nullables ⇒ Object
An array for nullable fields
119 120 121 |
# File 'lib/paysecure_api_documentation_live/models/new_request.rb', line 119 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
114 115 116 |
# File 'lib/paysecure_api_documentation_live/models/new_request.rb', line 114 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
233 234 235 236 237 238 239 240 241 242 243 244 245 |
# File 'lib/paysecure_api_documentation_live/models/new_request.rb', line 233 def inspect class_name = self.class.name.split('::').last "<#{class_name} payout_id: #{@payout_id.inspect}, client: #{@client.inspect}, updated_on:"\ " #{@updated_on.inspect}, payout_method: #{@payout_method.inspect}, amount_unit:"\ " #{@amount_unit.inspect}, amount: #{@amount.inspect}, error_msg: #{@error_msg.inspect},"\ " purpose: #{@purpose.inspect}, created_on: #{@created_on.inspect}, merchant_ref:"\ " #{@merchant_ref.inspect}, status: #{@status.inspect}, status_history:"\ " #{@status_history.inspect}, currency: #{@currency.inspect}, payment_on:"\ " #{@payment_on.inspect}, tax_amount: #{@tax_amount.inspect}, tax_percent:"\ " #{@tax_percent.inspect}, redirect_type: #{@redirect_type.inspect}, success_callback:"\ " #{@success_callback.inspect}, failure_callback: #{@failure_callback.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
221 222 223 224 225 226 227 228 229 230 |
# File 'lib/paysecure_api_documentation_live/models/new_request.rb', line 221 def to_s class_name = self.class.name.split('::').last "<#{class_name} payout_id: #{@payout_id}, client: #{@client}, updated_on: #{@updated_on},"\ " payout_method: #{@payout_method}, amount_unit: #{@amount_unit}, amount: #{@amount},"\ " error_msg: #{@error_msg}, purpose: #{@purpose}, created_on: #{@created_on}, merchant_ref:"\ " #{@merchant_ref}, status: #{@status}, status_history: #{@status_history}, currency:"\ " #{@currency}, payment_on: #{@payment_on}, tax_amount: #{@tax_amount}, tax_percent:"\ " #{@tax_percent}, redirect_type: #{@redirect_type}, success_callback: #{@success_callback},"\ " failure_callback: #{@failure_callback}, additional_properties: #{@additional_properties}>" end |