transferzero-sdk 1.5.0 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -5
  3. data/docs/Currency.md +0 -2
  4. data/docs/CurrencyExchange.md +0 -2
  5. data/docs/CurrencyOpposite.md +3 -3
  6. data/docs/Document.md +3 -3
  7. data/docs/DocumentsApi.md +2 -74
  8. data/docs/PayinMethodDetails.md +3 -1
  9. data/docs/PayinMethodDetailsBTC.md +17 -0
  10. data/docs/PayoutMethod.md +1 -1
  11. data/docs/PayoutMethodDetails.md +17 -1
  12. data/docs/PayoutMethodDetailsBTC.md +23 -0
  13. data/docs/PayoutMethodDetailsGBPBank.md +29 -0
  14. data/docs/PayoutMethodDetailsIBAN.md +1 -1
  15. data/docs/PayoutMethodDetailsMobile.md +3 -1
  16. data/docs/PayoutMethodDetailsZARBank.md +35 -0
  17. data/docs/PoliticallyExposedPerson.md +31 -0
  18. data/docs/Recipient.md +1 -1
  19. data/docs/RecipientsApi.md +1 -1
  20. data/docs/Sender.md +72 -32
  21. data/docs/Transaction.md +3 -3
  22. data/lib/transferzero-sdk.rb +5 -0
  23. data/lib/transferzero-sdk/api/documents_api.rb +0 -63
  24. data/lib/transferzero-sdk/api/recipients_api.rb +2 -2
  25. data/lib/transferzero-sdk/api_client.rb +5 -3
  26. data/lib/transferzero-sdk/models/account.rb +70 -69
  27. data/lib/transferzero-sdk/models/account_list_response.rb +67 -66
  28. data/lib/transferzero-sdk/models/account_meta.rb +61 -60
  29. data/lib/transferzero-sdk/models/account_response.rb +66 -65
  30. data/lib/transferzero-sdk/models/account_validation_error.rb +61 -60
  31. data/lib/transferzero-sdk/models/account_validation_request.rb +164 -163
  32. data/lib/transferzero-sdk/models/account_validation_response.rb +66 -65
  33. data/lib/transferzero-sdk/models/account_validation_result.rb +61 -60
  34. data/lib/transferzero-sdk/models/api_log.rb +136 -135
  35. data/lib/transferzero-sdk/models/api_log_list_response.rb +70 -69
  36. data/lib/transferzero-sdk/models/api_log_response.rb +60 -59
  37. data/lib/transferzero-sdk/models/currency.rb +133 -142
  38. data/lib/transferzero-sdk/models/currency_exchange.rb +149 -158
  39. data/lib/transferzero-sdk/models/currency_exchange_list_response.rb +62 -61
  40. data/lib/transferzero-sdk/models/currency_list_response.rb +62 -61
  41. data/lib/transferzero-sdk/models/currency_opposite.rb +166 -165
  42. data/lib/transferzero-sdk/models/debit.rb +151 -150
  43. data/lib/transferzero-sdk/models/debit_list_request.rb +61 -60
  44. data/lib/transferzero-sdk/models/debit_list_response.rb +67 -66
  45. data/lib/transferzero-sdk/models/debit_request.rb +60 -59
  46. data/lib/transferzero-sdk/models/debit_request_wrapper.rb +80 -79
  47. data/lib/transferzero-sdk/models/debit_response.rb +60 -59
  48. data/lib/transferzero-sdk/models/document.rb +179 -177
  49. data/lib/transferzero-sdk/models/document_list_response.rb +67 -66
  50. data/lib/transferzero-sdk/models/document_request.rb +60 -59
  51. data/lib/transferzero-sdk/models/document_response.rb +60 -59
  52. data/lib/transferzero-sdk/models/document_webhook.rb +96 -95
  53. data/lib/transferzero-sdk/models/error_status.rb +66 -65
  54. data/lib/transferzero-sdk/models/field_description.rb +95 -94
  55. data/lib/transferzero-sdk/models/field_select_validation.rb +70 -69
  56. data/lib/transferzero-sdk/models/field_validation.rb +78 -77
  57. data/lib/transferzero-sdk/models/pagination.rb +97 -96
  58. data/lib/transferzero-sdk/models/pagination_meta.rb +60 -59
  59. data/lib/transferzero-sdk/models/payin_method.rb +97 -96
  60. data/lib/transferzero-sdk/models/payin_method_details.rb +122 -110
  61. data/lib/transferzero-sdk/models/payin_method_details_btc.rb +204 -0
  62. data/lib/transferzero-sdk/models/payin_method_details_mobile.rb +75 -74
  63. data/lib/transferzero-sdk/models/payin_method_details_ngn_bank.rb +71 -70
  64. data/lib/transferzero-sdk/models/payin_method_request.rb +60 -59
  65. data/lib/transferzero-sdk/models/payment_method.rb +109 -108
  66. data/lib/transferzero-sdk/models/payment_method_list_response.rb +61 -60
  67. data/lib/transferzero-sdk/models/payment_method_opposite.rb +124 -123
  68. data/lib/transferzero-sdk/models/payout_method.rb +107 -106
  69. data/lib/transferzero-sdk/models/payout_method_bank_account_type_enum.rb +14 -19
  70. data/lib/transferzero-sdk/models/payout_method_details.rb +398 -297
  71. data/lib/transferzero-sdk/models/payout_method_details_balance.rb +61 -60
  72. data/lib/transferzero-sdk/models/payout_method_details_btc.rb +250 -0
  73. data/lib/transferzero-sdk/models/payout_method_details_gbp_bank.rb +267 -0
  74. data/lib/transferzero-sdk/models/payout_method_details_ghs_bank.rb +97 -96
  75. data/lib/transferzero-sdk/models/payout_method_details_iban.rb +100 -104
  76. data/lib/transferzero-sdk/models/payout_method_details_mad_cash.rb +162 -161
  77. data/lib/transferzero-sdk/models/payout_method_details_mobile.rb +93 -83
  78. data/lib/transferzero-sdk/models/payout_method_details_ngn_bank.rb +104 -103
  79. data/lib/transferzero-sdk/models/payout_method_details_xof_bank.rb +108 -107
  80. data/lib/transferzero-sdk/models/payout_method_details_xof_mobile.rb +97 -96
  81. data/lib/transferzero-sdk/models/payout_method_details_zar_bank.rb +324 -0
  82. data/lib/transferzero-sdk/models/payout_method_gender_enum.rb +14 -19
  83. data/lib/transferzero-sdk/models/payout_method_identity_card_type_enum.rb +15 -20
  84. data/lib/transferzero-sdk/models/payout_method_list_response.rb +67 -66
  85. data/lib/transferzero-sdk/models/payout_method_mobile_provider_enum.rb +17 -19
  86. data/lib/transferzero-sdk/models/payout_method_request.rb +60 -59
  87. data/lib/transferzero-sdk/models/payout_method_response.rb +60 -59
  88. data/lib/transferzero-sdk/models/payout_method_webhook.rb +96 -95
  89. data/lib/transferzero-sdk/models/politically_exposed_person.rb +272 -0
  90. data/lib/transferzero-sdk/models/recipient.rb +230 -229
  91. data/lib/transferzero-sdk/models/recipient_list_response.rb +67 -66
  92. data/lib/transferzero-sdk/models/recipient_request.rb +60 -59
  93. data/lib/transferzero-sdk/models/recipient_response.rb +60 -59
  94. data/lib/transferzero-sdk/models/recipient_state.rb +22 -27
  95. data/lib/transferzero-sdk/models/recipient_webhook.rb +96 -95
  96. data/lib/transferzero-sdk/models/sender.rb +587 -348
  97. data/lib/transferzero-sdk/models/sender_list_response.rb +67 -66
  98. data/lib/transferzero-sdk/models/sender_request.rb +60 -59
  99. data/lib/transferzero-sdk/models/sender_response.rb +66 -65
  100. data/lib/transferzero-sdk/models/sender_response_existing.rb +60 -59
  101. data/lib/transferzero-sdk/models/sender_response_meta.rb +60 -59
  102. data/lib/transferzero-sdk/models/sender_state.rb +19 -24
  103. data/lib/transferzero-sdk/models/sender_webhook.rb +96 -95
  104. data/lib/transferzero-sdk/models/transaction.rb +192 -191
  105. data/lib/transferzero-sdk/models/transaction_list_response.rb +67 -66
  106. data/lib/transferzero-sdk/models/transaction_request.rb +60 -59
  107. data/lib/transferzero-sdk/models/transaction_response.rb +66 -65
  108. data/lib/transferzero-sdk/models/transaction_response_existing.rb +66 -65
  109. data/lib/transferzero-sdk/models/transaction_response_meta.rb +60 -59
  110. data/lib/transferzero-sdk/models/transaction_state.rb +23 -28
  111. data/lib/transferzero-sdk/models/transaction_traits.rb +71 -70
  112. data/lib/transferzero-sdk/models/transaction_webhook.rb +96 -95
  113. data/lib/transferzero-sdk/models/validation_error_description.rb +62 -61
  114. data/lib/transferzero-sdk/models/webhook.rb +92 -91
  115. data/lib/transferzero-sdk/models/webhook_definition.rb +107 -106
  116. data/lib/transferzero-sdk/models/webhook_definition_event_list_response.rb +61 -60
  117. data/lib/transferzero-sdk/models/webhook_definition_list_response.rb +67 -66
  118. data/lib/transferzero-sdk/models/webhook_definition_request.rb +60 -59
  119. data/lib/transferzero-sdk/models/webhook_definition_response.rb +60 -59
  120. data/lib/transferzero-sdk/models/webhook_log.rb +97 -96
  121. data/lib/transferzero-sdk/models/webhook_log_list_response.rb +70 -69
  122. data/lib/transferzero-sdk/models/webhook_log_metadata.rb +129 -128
  123. data/lib/transferzero-sdk/models/webhook_log_metadata_request.rb +80 -79
  124. data/lib/transferzero-sdk/models/webhook_log_metadata_response.rb +81 -80
  125. data/lib/transferzero-sdk/models/webhook_log_response.rb +60 -59
  126. data/lib/transferzero-sdk/version.rb +1 -1
  127. data/spec/models/payin_method_details_btc_spec.rb +41 -0
  128. data/spec/models/payout_method_details_btc_spec.rb +59 -0
  129. data/spec/models/payout_method_details_gbp_bank_spec.rb +77 -0
  130. data/spec/models/payout_method_details_zar_bank_spec.rb +89 -0
  131. data/spec/models/politically_exposed_person_spec.rb +83 -0
  132. metadata +32 -13
  133. data/transferzero-sdk-1.4.0.gem +0 -0
@@ -13,87 +13,87 @@ OpenAPI Generator version: 4.0.0-beta3
13
13
  require 'date'
14
14
 
15
15
  module TransferZero
16
- class ApiLogListResponse
17
- # Array of API log objects
18
- attr_accessor :object
19
-
20
- attr_accessor :meta
21
-
22
- # Attribute mapping from ruby-style variable name to JSON key.
23
- def self.attribute_map
24
- {
25
- :'object' => :'object',
26
- :'meta' => :'meta'
27
- }
28
- end
16
+ class ApiLogListResponse
17
+ # Array of API log objects
18
+ attr_accessor :object
19
+
20
+ attr_accessor :meta
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'object' => :'object',
26
+ :'meta' => :'meta'
27
+ }
28
+ end
29
29
 
30
- # Attribute type mapping.
31
- def self.openapi_types
32
- {
33
- :'object' => :'Array<ApiLog>',
34
- :'meta' => :'PaginationMeta'
35
- }
36
- end
30
+ # Attribute type mapping.
31
+ def self.openapi_types
32
+ {
33
+ :'object' => :'Array<ApiLog>',
34
+ :'meta' => :'PaginationMeta'
35
+ }
36
+ end
37
37
 
38
- # Initializes the object
39
- # @param [Hash] attributes Model attributes in the form of hash
40
- def initialize(attributes = {})
41
- if (!attributes.is_a?(Hash))
42
- fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::ApiLogListResponse` initialize method"
43
- end
38
+ # Initializes the object
39
+ # @param [Hash] attributes Model attributes in the form of hash
40
+ def initialize(attributes = {})
41
+ if (!attributes.is_a?(Hash))
42
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::ApiLogListResponse` initialize method"
43
+ end
44
44
 
45
- # check to see if the attribute exists and convert string to symbol for hash key
46
- attributes = attributes.each_with_object({}) { |(k, v), h|
47
- if (!self.class.attribute_map.key?(k.to_sym))
48
- fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::ApiLogListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
49
- end
50
- h[k.to_sym] = v
51
- }
52
-
53
- if attributes.key?(:'object')
54
- if (value = attributes[:'object']).is_a?(Array)
55
- self.object = value
56
- end
45
+ # check to see if the attribute exists and convert string to symbol for hash key
46
+ attributes = attributes.each_with_object({}) { |(k, v), h|
47
+ if (!self.class.attribute_map.key?(k.to_sym))
48
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::ApiLogListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
49
  end
50
+ h[k.to_sym] = v
51
+ }
58
52
 
59
- if attributes.key?(:'meta')
60
- self.meta = attributes[:'meta']
53
+ if attributes.key?(:'object')
54
+ if (value = attributes[:'object']).is_a?(Array)
55
+ self.object = value
61
56
  end
62
57
  end
63
58
 
64
- # Show invalid properties with the reasons. Usually used together with valid?
65
- # @return Array for valid properties with the reasons
66
- def list_invalid_properties
67
- invalid_properties = Array.new
68
- invalid_properties
59
+ if attributes.key?(:'meta')
60
+ self.meta = attributes[:'meta']
69
61
  end
62
+ end
70
63
 
71
- # Check to see if the all the properties in the model are valid
72
- # @return true if the model is valid
73
- def valid?
74
- true
75
- end
64
+ # Show invalid properties with the reasons. Usually used together with valid?
65
+ # @return Array for valid properties with the reasons
66
+ def list_invalid_properties
67
+ invalid_properties = Array.new
68
+ invalid_properties
69
+ end
76
70
 
77
- # Checks equality by comparing each attribute.
78
- # @param [Object] Object to be compared
79
- def ==(o)
80
- return true if self.equal?(o)
81
- self.class == o.class &&
82
- object == o.object &&
83
- meta == o.meta
84
- end
71
+ # Check to see if the all the properties in the model are valid
72
+ # @return true if the model is valid
73
+ def valid?
74
+ true
75
+ end
85
76
 
86
- # @see the `==` method
87
- # @param [Object] Object to be compared
88
- def eql?(o)
89
- self == o
90
- end
77
+ # Checks equality by comparing each attribute.
78
+ # @param [Object] Object to be compared
79
+ def ==(o)
80
+ return true if self.equal?(o)
81
+ self.class == o.class &&
82
+ object == o.object &&
83
+ meta == o.meta
84
+ end
91
85
 
92
- # Calculates hash code according to all attributes.
93
- # @return [Integer] Hash code
94
- def hash
95
- [object, meta].hash
96
- end
86
+ # @see the `==` method
87
+ # @param [Object] Object to be compared
88
+ def eql?(o)
89
+ self == o
90
+ end
91
+
92
+ # Calculates hash code according to all attributes.
93
+ # @return [Integer] Hash code
94
+ def hash
95
+ [object, meta].hash
96
+ end
97
97
 
98
98
  require 'active_support/core_ext/hash'
99
99
  require 'active_support/hash_with_indifferent_access.rb'
@@ -209,5 +209,6 @@ def _to_hash(value)
209
209
  end
210
210
  end
211
211
 
212
- end
212
+ end
213
+
213
214
  end
@@ -13,75 +13,75 @@ OpenAPI Generator version: 4.0.0-beta3
13
13
  require 'date'
14
14
 
15
15
  module TransferZero
16
- class ApiLogResponse
17
- attr_accessor :object
18
-
19
- # Attribute mapping from ruby-style variable name to JSON key.
20
- def self.attribute_map
21
- {
22
- :'object' => :'object'
23
- }
24
- end
16
+ class ApiLogResponse
17
+ attr_accessor :object
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'object' => :'object'
23
+ }
24
+ end
25
+
26
+ # Attribute type mapping.
27
+ def self.openapi_types
28
+ {
29
+ :'object' => :'ApiLog'
30
+ }
31
+ end
25
32
 
26
- # Attribute type mapping.
27
- def self.openapi_types
28
- {
29
- :'object' => :'ApiLog'
30
- }
33
+ # Initializes the object
34
+ # @param [Hash] attributes Model attributes in the form of hash
35
+ def initialize(attributes = {})
36
+ if (!attributes.is_a?(Hash))
37
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::ApiLogResponse` initialize method"
31
38
  end
32
39
 
33
- # Initializes the object
34
- # @param [Hash] attributes Model attributes in the form of hash
35
- def initialize(attributes = {})
36
- if (!attributes.is_a?(Hash))
37
- fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::ApiLogResponse` initialize method"
40
+ # check to see if the attribute exists and convert string to symbol for hash key
41
+ attributes = attributes.each_with_object({}) { |(k, v), h|
42
+ if (!self.class.attribute_map.key?(k.to_sym))
43
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::ApiLogResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
38
44
  end
45
+ h[k.to_sym] = v
46
+ }
39
47
 
40
- # check to see if the attribute exists and convert string to symbol for hash key
41
- attributes = attributes.each_with_object({}) { |(k, v), h|
42
- if (!self.class.attribute_map.key?(k.to_sym))
43
- fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::ApiLogResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
44
- end
45
- h[k.to_sym] = v
46
- }
47
-
48
- if attributes.key?(:'object')
49
- self.object = attributes[:'object']
50
- end
48
+ if attributes.key?(:'object')
49
+ self.object = attributes[:'object']
51
50
  end
51
+ end
52
52
 
53
- # Show invalid properties with the reasons. Usually used together with valid?
54
- # @return Array for valid properties with the reasons
55
- def list_invalid_properties
56
- invalid_properties = Array.new
57
- invalid_properties
58
- end
53
+ # Show invalid properties with the reasons. Usually used together with valid?
54
+ # @return Array for valid properties with the reasons
55
+ def list_invalid_properties
56
+ invalid_properties = Array.new
57
+ invalid_properties
58
+ end
59
59
 
60
- # Check to see if the all the properties in the model are valid
61
- # @return true if the model is valid
62
- def valid?
63
- true
64
- end
60
+ # Check to see if the all the properties in the model are valid
61
+ # @return true if the model is valid
62
+ def valid?
63
+ true
64
+ end
65
65
 
66
- # Checks equality by comparing each attribute.
67
- # @param [Object] Object to be compared
68
- def ==(o)
69
- return true if self.equal?(o)
70
- self.class == o.class &&
71
- object == o.object
72
- end
66
+ # Checks equality by comparing each attribute.
67
+ # @param [Object] Object to be compared
68
+ def ==(o)
69
+ return true if self.equal?(o)
70
+ self.class == o.class &&
71
+ object == o.object
72
+ end
73
73
 
74
- # @see the `==` method
75
- # @param [Object] Object to be compared
76
- def eql?(o)
77
- self == o
78
- end
74
+ # @see the `==` method
75
+ # @param [Object] Object to be compared
76
+ def eql?(o)
77
+ self == o
78
+ end
79
79
 
80
- # Calculates hash code according to all attributes.
81
- # @return [Integer] Hash code
82
- def hash
83
- [object].hash
84
- end
80
+ # Calculates hash code according to all attributes.
81
+ # @return [Integer] Hash code
82
+ def hash
83
+ [object].hash
84
+ end
85
85
 
86
86
  require 'active_support/core_ext/hash'
87
87
  require 'active_support/hash_with_indifferent_access.rb'
@@ -197,5 +197,6 @@ def _to_hash(value)
197
197
  end
198
198
  end
199
199
 
200
- end
200
+ end
201
+
201
202
  end
@@ -13,166 +13,156 @@ OpenAPI Generator version: 4.0.0-beta3
13
13
  require 'date'
14
14
 
15
15
  module TransferZero
16
- class Currency
17
- # The currency code in 3-character alpha ISO 4217 currency format
18
- attr_accessor :code
19
-
20
- # Name of currency
21
- attr_accessor :name
22
-
23
- # Symbol of currency
24
- attr_accessor :symbol
25
-
26
- # Number of decimal points
27
- attr_accessor :decimals
28
-
29
- # Subunits in Unit (eg. there are 100 cents in 1 US Dollar)
30
- attr_accessor :subunit_to_unit
31
-
32
- # Is this a primary currency?
33
- attr_accessor :primary
34
-
35
- # The minimum amount allowed in a transaction
36
- attr_accessor :min
37
-
38
- # The maximum amount allowed in a transaction
39
- attr_accessor :max
40
-
41
- # The margin set for transactions in this currency
42
- attr_accessor :margin
43
-
44
- # The equivalent of the currency to 1 USD
45
- attr_accessor :usd_equivalent
46
-
47
- # Attribute mapping from ruby-style variable name to JSON key.
48
- def self.attribute_map
49
- {
50
- :'code' => :'code',
51
- :'name' => :'name',
52
- :'symbol' => :'symbol',
53
- :'decimals' => :'decimals',
54
- :'subunit_to_unit' => :'subunit_to_unit',
55
- :'primary' => :'primary',
56
- :'min' => :'min',
57
- :'max' => :'max',
58
- :'margin' => :'margin',
59
- :'usd_equivalent' => :'usd_equivalent'
60
- }
61
- end
62
-
63
- # Attribute type mapping.
64
- def self.openapi_types
65
- {
66
- :'code' => :'String',
67
- :'name' => :'String',
68
- :'symbol' => :'String',
69
- :'decimals' => :'Float',
70
- :'subunit_to_unit' => :'String',
71
- :'primary' => :'Boolean',
72
- :'min' => :'String',
73
- :'max' => :'String',
74
- :'margin' => :'String',
75
- :'usd_equivalent' => :'String'
76
- }
77
- end
78
-
79
- # Initializes the object
80
- # @param [Hash] attributes Model attributes in the form of hash
81
- def initialize(attributes = {})
82
- if (!attributes.is_a?(Hash))
83
- fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::Currency` initialize method"
84
- end
85
-
86
- # check to see if the attribute exists and convert string to symbol for hash key
87
- attributes = attributes.each_with_object({}) { |(k, v), h|
88
- if (!self.class.attribute_map.key?(k.to_sym))
89
- fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::Currency`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
90
- end
91
- h[k.to_sym] = v
92
- }
93
-
94
- if attributes.key?(:'code')
95
- self.code = attributes[:'code']
96
- end
97
-
98
- if attributes.key?(:'name')
99
- self.name = attributes[:'name']
100
- end
101
-
102
- if attributes.key?(:'symbol')
103
- self.symbol = attributes[:'symbol']
104
- end
16
+ class Currency
17
+ # The currency code in 3-character alpha ISO 4217 currency format
18
+ attr_accessor :code
19
+
20
+ # Name of currency
21
+ attr_accessor :name
22
+
23
+ # Symbol of currency
24
+ attr_accessor :symbol
25
+
26
+ # Number of decimal points
27
+ attr_accessor :decimals
28
+
29
+ # Subunits in Unit (eg. there are 100 cents in 1 US Dollar)
30
+ attr_accessor :subunit_to_unit
31
+
32
+ # Is this a primary currency?
33
+ attr_accessor :primary
34
+
35
+ # The minimum amount allowed in a transaction
36
+ attr_accessor :min
37
+
38
+ # The maximum amount allowed in a transaction
39
+ attr_accessor :max
40
+
41
+ # The equivalent of the currency to 1 USD
42
+ attr_accessor :usd_equivalent
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'code' => :'code',
48
+ :'name' => :'name',
49
+ :'symbol' => :'symbol',
50
+ :'decimals' => :'decimals',
51
+ :'subunit_to_unit' => :'subunit_to_unit',
52
+ :'primary' => :'primary',
53
+ :'min' => :'min',
54
+ :'max' => :'max',
55
+ :'usd_equivalent' => :'usd_equivalent'
56
+ }
57
+ end
105
58
 
106
- if attributes.key?(:'decimals')
107
- self.decimals = attributes[:'decimals']
108
- end
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'code' => :'String',
63
+ :'name' => :'String',
64
+ :'symbol' => :'String',
65
+ :'decimals' => :'Float',
66
+ :'subunit_to_unit' => :'String',
67
+ :'primary' => :'Boolean',
68
+ :'min' => :'String',
69
+ :'max' => :'String',
70
+ :'usd_equivalent' => :'String'
71
+ }
72
+ end
109
73
 
110
- if attributes.key?(:'subunit_to_unit')
111
- self.subunit_to_unit = attributes[:'subunit_to_unit']
112
- end
74
+ # Initializes the object
75
+ # @param [Hash] attributes Model attributes in the form of hash
76
+ def initialize(attributes = {})
77
+ if (!attributes.is_a?(Hash))
78
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::Currency` initialize method"
79
+ end
113
80
 
114
- if attributes.key?(:'primary')
115
- self.primary = attributes[:'primary']
81
+ # check to see if the attribute exists and convert string to symbol for hash key
82
+ attributes = attributes.each_with_object({}) { |(k, v), h|
83
+ if (!self.class.attribute_map.key?(k.to_sym))
84
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::Currency`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
116
85
  end
86
+ h[k.to_sym] = v
87
+ }
117
88
 
118
- if attributes.key?(:'min')
119
- self.min = attributes[:'min']
120
- end
89
+ if attributes.key?(:'code')
90
+ self.code = attributes[:'code']
91
+ end
121
92
 
122
- if attributes.key?(:'max')
123
- self.max = attributes[:'max']
124
- end
93
+ if attributes.key?(:'name')
94
+ self.name = attributes[:'name']
95
+ end
125
96
 
126
- if attributes.key?(:'margin')
127
- self.margin = attributes[:'margin']
128
- end
97
+ if attributes.key?(:'symbol')
98
+ self.symbol = attributes[:'symbol']
99
+ end
129
100
 
130
- if attributes.key?(:'usd_equivalent')
131
- self.usd_equivalent = attributes[:'usd_equivalent']
132
- end
101
+ if attributes.key?(:'decimals')
102
+ self.decimals = attributes[:'decimals']
133
103
  end
134
104
 
135
- # Show invalid properties with the reasons. Usually used together with valid?
136
- # @return Array for valid properties with the reasons
137
- def list_invalid_properties
138
- invalid_properties = Array.new
139
- invalid_properties
105
+ if attributes.key?(:'subunit_to_unit')
106
+ self.subunit_to_unit = attributes[:'subunit_to_unit']
140
107
  end
141
108
 
142
- # Check to see if the all the properties in the model are valid
143
- # @return true if the model is valid
144
- def valid?
145
- true
109
+ if attributes.key?(:'primary')
110
+ self.primary = attributes[:'primary']
146
111
  end
147
112
 
148
- # Checks equality by comparing each attribute.
149
- # @param [Object] Object to be compared
150
- def ==(o)
151
- return true if self.equal?(o)
152
- self.class == o.class &&
153
- code == o.code &&
154
- name == o.name &&
155
- symbol == o.symbol &&
156
- decimals == o.decimals &&
157
- subunit_to_unit == o.subunit_to_unit &&
158
- primary == o.primary &&
159
- min == o.min &&
160
- max == o.max &&
161
- margin == o.margin &&
162
- usd_equivalent == o.usd_equivalent
113
+ if attributes.key?(:'min')
114
+ self.min = attributes[:'min']
163
115
  end
164
116
 
165
- # @see the `==` method
166
- # @param [Object] Object to be compared
167
- def eql?(o)
168
- self == o
117
+ if attributes.key?(:'max')
118
+ self.max = attributes[:'max']
169
119
  end
170
120
 
171
- # Calculates hash code according to all attributes.
172
- # @return [Integer] Hash code
173
- def hash
174
- [code, name, symbol, decimals, subunit_to_unit, primary, min, max, margin, usd_equivalent].hash
121
+ if attributes.key?(:'usd_equivalent')
122
+ self.usd_equivalent = attributes[:'usd_equivalent']
175
123
  end
124
+ end
125
+
126
+ # Show invalid properties with the reasons. Usually used together with valid?
127
+ # @return Array for valid properties with the reasons
128
+ def list_invalid_properties
129
+ invalid_properties = Array.new
130
+ invalid_properties
131
+ end
132
+
133
+ # Check to see if the all the properties in the model are valid
134
+ # @return true if the model is valid
135
+ def valid?
136
+ true
137
+ end
138
+
139
+ # Checks equality by comparing each attribute.
140
+ # @param [Object] Object to be compared
141
+ def ==(o)
142
+ return true if self.equal?(o)
143
+ self.class == o.class &&
144
+ code == o.code &&
145
+ name == o.name &&
146
+ symbol == o.symbol &&
147
+ decimals == o.decimals &&
148
+ subunit_to_unit == o.subunit_to_unit &&
149
+ primary == o.primary &&
150
+ min == o.min &&
151
+ max == o.max &&
152
+ usd_equivalent == o.usd_equivalent
153
+ end
154
+
155
+ # @see the `==` method
156
+ # @param [Object] Object to be compared
157
+ def eql?(o)
158
+ self == o
159
+ end
160
+
161
+ # Calculates hash code according to all attributes.
162
+ # @return [Integer] Hash code
163
+ def hash
164
+ [code, name, symbol, decimals, subunit_to_unit, primary, min, max, usd_equivalent].hash
165
+ end
176
166
 
177
167
  require 'active_support/core_ext/hash'
178
168
  require 'active_support/hash_with_indifferent_access.rb'
@@ -288,5 +278,6 @@ def _to_hash(value)
288
278
  end
289
279
  end
290
280
 
291
- end
281
+ end
282
+
292
283
  end