Class: DevDraftAI::CreateBankPaymentIntentDto

Inherits:
Object
  • Object
show all
Defined in:
lib/devdraft/models/create_bank_payment_intent_dto.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ CreateBankPaymentIntentDto

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



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
153
154
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
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 126

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `DevDraftAI::CreateBankPaymentIntentDto` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `DevDraftAI::CreateBankPaymentIntentDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'source_payment_rail')
    self.source_payment_rail = attributes[:'source_payment_rail']
  end

  if attributes.key?(:'source_currency')
    self.source_currency = attributes[:'source_currency']
  end

  if attributes.key?(:'destination_currency')
    self.destination_currency = attributes[:'destination_currency']
  end

  if attributes.key?(:'destination_network')
    self.destination_network = attributes[:'destination_network']
  end

  if attributes.key?(:'destination_address')
    self.destination_address = attributes[:'destination_address']
  end

  if attributes.key?(:'amount')
    self.amount = attributes[:'amount']
  end

  if attributes.key?(:'customer_first_name')
    self.customer_first_name = attributes[:'customer_first_name']
  end

  if attributes.key?(:'customer_last_name')
    self.customer_last_name = attributes[:'customer_last_name']
  end

  if attributes.key?(:'customer_email')
    self.customer_email = attributes[:'customer_email']
  end

  if attributes.key?(:'customer_address')
    self.customer_address = attributes[:'customer_address']
  end

  if attributes.key?(:'customer_country')
    self.customer_country = attributes[:'customer_country']
  end

  if attributes.key?(:'customer_country_iso')
    self.customer_country_iso = attributes[:'customer_country_iso']
  end

  if attributes.key?(:'customer_province')
    self.customer_province = attributes[:'customer_province']
  end

  if attributes.key?(:'customer_province_iso')
    self.customer_province_iso = attributes[:'customer_province_iso']
  end

  if attributes.key?(:'phone_number')
    self.phone_number = attributes[:'phone_number']
  end

  if attributes.key?(:'wire_message')
    self.wire_message = attributes[:'wire_message']
  end

  if attributes.key?(:'sepa_reference')
    self.sepa_reference = attributes[:'sepa_reference']
  end

  if attributes.key?(:'ach_reference')
    self.ach_reference = attributes[:'ach_reference']
  end
end

Instance Attribute Details

#ach_referenceObject

ACH reference (for ACH transfers)



68
69
70
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 68

def ach_reference
  @ach_reference
end

#amountObject

Payment amount (optional for flexible amount)



32
33
34
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 32

def amount
  @amount
end

#customer_addressObject

Customer address



44
45
46
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 44

def customer_address
  @customer_address
end

#customer_countryObject

Customer country



47
48
49
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 47

def customer_country
  @customer_country
end

#customer_country_isoObject

Customer country ISO code



50
51
52
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 50

def customer_country_iso
  @customer_country_iso
end

#customer_emailObject

Customer email address



41
42
43
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 41

def customer_email
  @customer_email
end

#customer_first_nameObject

Customer first name



35
36
37
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 35

def customer_first_name
  @customer_first_name
end

#customer_last_nameObject

Customer last name



38
39
40
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 38

def customer_last_name
  @customer_last_name
end

#customer_provinceObject

Customer province/state



53
54
55
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 53

def customer_province
  @customer_province
end

#customer_province_isoObject

Customer province/state ISO code



56
57
58
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 56

def customer_province_iso
  @customer_province_iso
end

#destination_addressObject

Destination wallet address. Supports Ethereum (0x…) and Solana address formats.



29
30
31
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 29

def destination_address
  @destination_address
end

#destination_currencyObject

The stablecoin currency to convert TO. The customer will receive this currency.



23
24
25
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 23

def destination_currency
  @destination_currency
end

#destination_networkObject

The blockchain network where the stablecoin will be delivered. Must support the destination currency.



26
27
28
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 26

def destination_network
  @destination_network
end

#phone_numberObject

Customer phone number



59
60
61
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 59

def phone_number
  @phone_number
end

#sepa_referenceObject

SEPA reference (for SEPA transfers)



65
66
67
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 65

def sepa_reference
  @sepa_reference
end

#source_currencyObject

The fiat currency to convert FROM. Must match the currency of the source payment rail.



20
21
22
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 20

def source_currency
  @source_currency
end

#source_payment_railObject

The banking payment method to use for the transfer. Determines processing time and fees.



17
18
19
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 17

def source_payment_rail
  @source_payment_rail
end

#wire_messageObject

Wire transfer message (for WIRE transfers)



62
63
64
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 62

def wire_message
  @wire_message
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 71

def self.attribute_map
  {
    :'source_payment_rail' => :'sourcePaymentRail',
    :'source_currency' => :'sourceCurrency',
    :'destination_currency' => :'destinationCurrency',
    :'destination_network' => :'destinationNetwork',
    :'destination_address' => :'destinationAddress',
    :'amount' => :'amount',
    :'customer_first_name' => :'customer_first_name',
    :'customer_last_name' => :'customer_last_name',
    :'customer_email' => :'customer_email',
    :'customer_address' => :'customer_address',
    :'customer_country' => :'customer_country',
    :'customer_country_iso' => :'customer_countryISO',
    :'customer_province' => :'customer_province',
    :'customer_province_iso' => :'customer_provinceISO',
    :'phone_number' => :'phoneNumber',
    :'wire_message' => :'wire_message',
    :'sepa_reference' => :'sepa_reference',
    :'ach_reference' => :'ach_reference'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



285
286
287
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 285

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



119
120
121
122
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 119

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 95

def self.openapi_types
  {
    :'source_payment_rail' => :'Object',
    :'source_currency' => :'Object',
    :'destination_currency' => :'Object',
    :'destination_network' => :'Object',
    :'destination_address' => :'Object',
    :'amount' => :'Object',
    :'customer_first_name' => :'Object',
    :'customer_last_name' => :'Object',
    :'customer_email' => :'Object',
    :'customer_address' => :'Object',
    :'customer_country' => :'Object',
    :'customer_country_iso' => :'Object',
    :'customer_province' => :'Object',
    :'customer_province_iso' => :'Object',
    :'phone_number' => :'Object',
    :'wire_message' => :'Object',
    :'sepa_reference' => :'Object',
    :'ach_reference' => :'Object'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 247

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      source_payment_rail == o.source_payment_rail &&
      source_currency == o.source_currency &&
      destination_currency == o.destination_currency &&
      destination_network == o.destination_network &&
      destination_address == o.destination_address &&
      amount == o.amount &&
      customer_first_name == o.customer_first_name &&
      customer_last_name == o.customer_last_name &&
      customer_email == o.customer_email &&
      customer_address == o.customer_address &&
      customer_country == o.customer_country &&
      customer_country_iso == o.customer_country_iso &&
      customer_province == o.customer_province &&
      customer_province_iso == o.customer_province_iso &&
      phone_number == o.phone_number &&
      wire_message == o.wire_message &&
      sepa_reference == o.sepa_reference &&
      ach_reference == o.ach_reference
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 315

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    DevDraftAI.const_get(type).build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



384
385
386
387
388
389
390
391
392
393
394
395
396
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 384

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 292

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{key}=", nil)
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


272
273
274
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 272

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



278
279
280
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 278

def hash
  [source_payment_rail, source_currency, destination_currency, destination_network, destination_address, amount, customer_first_name, customer_last_name, customer_email, customer_address, customer_country, customer_country_iso, customer_province, customer_province_iso, phone_number, wire_message, sepa_reference, ach_reference].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 214

def list_invalid_properties
  invalid_properties = Array.new
  if @source_payment_rail.nil?
    invalid_properties.push('invalid value for "source_payment_rail", source_payment_rail cannot be nil.')
  end

  if @source_currency.nil?
    invalid_properties.push('invalid value for "source_currency", source_currency cannot be nil.')
  end

  if @destination_currency.nil?
    invalid_properties.push('invalid value for "destination_currency", destination_currency cannot be nil.')
  end

  if @destination_network.nil?
    invalid_properties.push('invalid value for "destination_network", destination_network cannot be nil.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



360
361
362
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 360

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



366
367
368
369
370
371
372
373
374
375
376
377
378
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 366

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



354
355
356
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 354

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



237
238
239
240
241
242
243
# File 'lib/devdraft/models/create_bank_payment_intent_dto.rb', line 237

def valid?
  return false if @source_payment_rail.nil?
  return false if @source_currency.nil?
  return false if @destination_currency.nil?
  return false if @destination_network.nil?
  true
end