Class: TreezorClient::SepaSctrInst

Inherits:
Object
  • Object
show all
Defined in:
lib/treezor_client/models/sepa_sctr_inst.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SepaSctrInst

Initializes the object

Parameters:

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

    Model attributes in the form of hash



108
109
110
111
112
113
114
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
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
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 108

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.has_key?(:'walletId')
    self.wallet_id = attributes[:'walletId']
  end

  if attributes.has_key?(:'debtorBic')
    self.debtor_bic = attributes[:'debtorBic']
  end

  if attributes.has_key?(:'debtorIban')
    self.debtor_iban = attributes[:'debtorIban']
  end

  if attributes.has_key?(:'debitorName')
    self.debitor_name = attributes[:'debitorName']
  end

  if attributes.has_key?(:'debitorCountry')
    self.debitor_country = attributes[:'debitorCountry']
  end

  if attributes.has_key?(:'debitorAddressLine')
    self.debitor_address_line = attributes[:'debitorAddressLine']
  end

  if attributes.has_key?(:'creditorBIC')
    self.creditor_bic = attributes[:'creditorBIC']
  end

  if attributes.has_key?(:'creditorIban')
    self.creditor_iban = attributes[:'creditorIban']
  end

  if attributes.has_key?(:'creditorName')
    self.creditor_name = attributes[:'creditorName']
  end

  if attributes.has_key?(:'creditorAddressLine')
    self.creditor_address_line = attributes[:'creditorAddressLine']
  end

  if attributes.has_key?(:'creditorCountry')
    self.creditor_country = attributes[:'creditorCountry']
  end

  if attributes.has_key?(:'transactionId')
    self.transaction_id = attributes[:'transactionId']
  end

  if attributes.has_key?(:'virtualIbanId')
    self.virtual_iban_id = attributes[:'virtualIbanId']
  end

  if attributes.has_key?(:'settlementDate')
    self.settlement_date = attributes[:'settlementDate']
  end

  if attributes.has_key?(:'settlementAmount')
    self.settlement_amount = attributes[:'settlementAmount']
  end

  if attributes.has_key?(:'return_reason_code')
    self.return_reason_code = attributes[:'return_reason_code']
  end

  if attributes.has_key?(:'virtualIbanReference')
    self.virtual_iban_reference = attributes[:'virtualIbanReference']
  end

  if attributes.has_key?(:'remittanceInformation')
    self.remittance_information = attributes[:'remittanceInformation']
  end

  if attributes.has_key?(:'transactionEndToEndId')
    self.transaction_end_to_end_id = attributes[:'transactionEndToEndId']
  end
end

Instance Attribute Details

#creditor_address_lineObject

Returns the value of attribute creditor_address_line.



35
36
37
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 35

def creditor_address_line
  @creditor_address_line
end

#creditor_bicObject

Returns the value of attribute creditor_bic.



29
30
31
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 29

def creditor_bic
  @creditor_bic
end

#creditor_countryObject

Returns the value of attribute creditor_country.



37
38
39
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 37

def creditor_country
  @creditor_country
end

#creditor_ibanObject

Returns the value of attribute creditor_iban.



31
32
33
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 31

def creditor_iban
  @creditor_iban
end

#creditor_nameObject

Returns the value of attribute creditor_name.



33
34
35
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 33

def creditor_name
  @creditor_name
end

#debitor_address_lineObject

Returns the value of attribute debitor_address_line.



27
28
29
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 27

def debitor_address_line
  @debitor_address_line
end

#debitor_countryObject

Returns the value of attribute debitor_country.



25
26
27
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 25

def debitor_country
  @debitor_country
end

#debitor_nameObject

Returns the value of attribute debitor_name.



23
24
25
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 23

def debitor_name
  @debitor_name
end

#debtor_bicObject

Returns the value of attribute debtor_bic.



19
20
21
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 19

def debtor_bic
  @debtor_bic
end

#debtor_ibanObject

Returns the value of attribute debtor_iban.



21
22
23
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 21

def debtor_iban
  @debtor_iban
end

#remittance_informationObject

Returns the value of attribute remittance_information.



52
53
54
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 52

def remittance_information
  @remittance_information
end

#return_reason_codeObject

Returns the value of attribute return_reason_code.



48
49
50
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 48

def return_reason_code
  @return_reason_code
end

#settlement_amountObject

Returns the value of attribute settlement_amount.



46
47
48
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 46

def settlement_amount
  @settlement_amount
end

#settlement_dateObject

RFC 3339



44
45
46
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 44

def settlement_date
  @settlement_date
end

#transaction_end_to_end_idObject

Returns the value of attribute transaction_end_to_end_id.



54
55
56
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 54

def transaction_end_to_end_id
  @transaction_end_to_end_id
end

#transaction_idObject

Returns the value of attribute transaction_id.



39
40
41
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 39

def transaction_id
  @transaction_id
end

#virtual_iban_idObject

Returns the value of attribute virtual_iban_id.



41
42
43
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 41

def virtual_iban_id
  @virtual_iban_id
end

#virtual_iban_referenceObject

Returns the value of attribute virtual_iban_reference.



50
51
52
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 50

def virtual_iban_reference
  @virtual_iban_reference
end

#wallet_idObject

Returns the value of attribute wallet_id.



17
18
19
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 17

def wallet_id
  @wallet_id
end

Class Method Details

.attribute_mapObject

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



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 57

def self.attribute_map
  {
    :'wallet_id' => :'walletId',
    :'debtor_bic' => :'debtorBic',
    :'debtor_iban' => :'debtorIban',
    :'debitor_name' => :'debitorName',
    :'debitor_country' => :'debitorCountry',
    :'debitor_address_line' => :'debitorAddressLine',
    :'creditor_bic' => :'creditorBIC',
    :'creditor_iban' => :'creditorIban',
    :'creditor_name' => :'creditorName',
    :'creditor_address_line' => :'creditorAddressLine',
    :'creditor_country' => :'creditorCountry',
    :'transaction_id' => :'transactionId',
    :'virtual_iban_id' => :'virtualIbanId',
    :'settlement_date' => :'settlementDate',
    :'settlement_amount' => :'settlementAmount',
    :'return_reason_code' => :'return_reason_code',
    :'virtual_iban_reference' => :'virtualIbanReference',
    :'remittance_information' => :'remittanceInformation',
    :'transaction_end_to_end_id' => :'transactionEndToEndId'
  }
end

.swagger_typesObject

Attribute type mapping.



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 82

def self.swagger_types
  {
    :'wallet_id' => :'Integer',
    :'debtor_bic' => :'String',
    :'debtor_iban' => :'String',
    :'debitor_name' => :'String',
    :'debitor_country' => :'String',
    :'debitor_address_line' => :'String',
    :'creditor_bic' => :'String',
    :'creditor_iban' => :'String',
    :'creditor_name' => :'String',
    :'creditor_address_line' => :'String',
    :'creditor_country' => :'String',
    :'transaction_id' => :'String',
    :'virtual_iban_id' => :'String',
    :'settlement_date' => :'String',
    :'settlement_amount' => :'String',
    :'return_reason_code' => :'String',
    :'virtual_iban_reference' => :'String',
    :'remittance_information' => :'String',
    :'transaction_end_to_end_id' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 206

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      wallet_id == o.wallet_id &&
      debtor_bic == o.debtor_bic &&
      debtor_iban == o.debtor_iban &&
      debitor_name == o.debitor_name &&
      debitor_country == o.debitor_country &&
      debitor_address_line == o.debitor_address_line &&
      creditor_bic == o.creditor_bic &&
      creditor_iban == o.creditor_iban &&
      creditor_name == o.creditor_name &&
      creditor_address_line == o.creditor_address_line &&
      creditor_country == o.creditor_country &&
      transaction_id == o.transaction_id &&
      virtual_iban_id == o.virtual_iban_id &&
      settlement_date == o.settlement_date &&
      settlement_amount == o.settlement_amount &&
      return_reason_code == o.return_reason_code &&
      virtual_iban_reference == o.virtual_iban_reference &&
      remittance_information == o.remittance_information &&
      transaction_end_to_end_id == o.transaction_end_to_end_id
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



266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 266

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
    temp_model = TreezorClient.const_get(type).new
    temp_model.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



332
333
334
335
336
337
338
339
340
341
342
343
344
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 332

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



245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 245

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_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]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


232
233
234
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 232

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



238
239
240
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 238

def hash
  [wallet_id, debtor_bic, debtor_iban, debitor_name, debitor_country, debitor_address_line, creditor_bic, creditor_iban, creditor_name, creditor_address_line, creditor_country, transaction_id, virtual_iban_id, settlement_date, settlement_amount, return_reason_code, virtual_iban_reference, remittance_information, transaction_end_to_end_id].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



193
194
195
196
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 193

def list_invalid_properties
  invalid_properties = Array.new
  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



312
313
314
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 312

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



318
319
320
321
322
323
324
325
326
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 318

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



306
307
308
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 306

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



200
201
202
# File 'lib/treezor_client/models/sepa_sctr_inst.rb', line 200

def valid?
  true
end