transferzero-sdk 1.19.2 → 1.19.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (171) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -4
  3. data/docs/CurrencyExchangeAllOf.md +17 -0
  4. data/docs/CurrencyOppositeAllOf.md +21 -0
  5. data/docs/Document.md +1 -1
  6. data/docs/DocumentWebhookAllOf.md +17 -0
  7. data/docs/PayinMethod.md +1 -1
  8. data/docs/PayinMethodsApi.md +1 -1
  9. data/docs/PayoutMethodWebhookAllOf.md +17 -0
  10. data/docs/PayoutMethodsApi.md +1 -1
  11. data/docs/RecipientWebhookAllOf.md +17 -0
  12. data/docs/Sender.md +2 -2
  13. data/docs/SenderWebhookAllOf.md +17 -0
  14. data/docs/SendersApi.md +1 -1
  15. data/docs/TransactionWebhookAllOf.md +17 -0
  16. data/lib/transferzero-sdk/api/account_debits_api.rb +2 -2
  17. data/lib/transferzero-sdk/api/account_validation_api.rb +2 -2
  18. data/lib/transferzero-sdk/api/accounts_api.rb +2 -2
  19. data/lib/transferzero-sdk/api/api_logs_api.rb +2 -2
  20. data/lib/transferzero-sdk/api/currency_info_api.rb +2 -2
  21. data/lib/transferzero-sdk/api/documents_api.rb +2 -2
  22. data/lib/transferzero-sdk/api/logs_api.rb +2 -2
  23. data/lib/transferzero-sdk/api/payin_methods_api.rb +4 -4
  24. data/lib/transferzero-sdk/api/payment_methods_api.rb +2 -2
  25. data/lib/transferzero-sdk/api/payout_methods_api.rb +4 -4
  26. data/lib/transferzero-sdk/api/recipients_api.rb +2 -2
  27. data/lib/transferzero-sdk/api/senders_api.rb +4 -4
  28. data/lib/transferzero-sdk/api/transactions_api.rb +2 -2
  29. data/lib/transferzero-sdk/api/webhooks_api.rb +2 -2
  30. data/lib/transferzero-sdk/api_client.rb +3 -3
  31. data/lib/transferzero-sdk/api_error.rb +2 -2
  32. data/lib/transferzero-sdk/configuration.rb +2 -2
  33. data/lib/transferzero-sdk/models/account.rb +2 -2
  34. data/lib/transferzero-sdk/models/account_list_response.rb +2 -2
  35. data/lib/transferzero-sdk/models/account_meta.rb +2 -2
  36. data/lib/transferzero-sdk/models/account_response.rb +2 -2
  37. data/lib/transferzero-sdk/models/account_validation_error.rb +2 -2
  38. data/lib/transferzero-sdk/models/account_validation_request.rb +2 -2
  39. data/lib/transferzero-sdk/models/account_validation_response.rb +2 -2
  40. data/lib/transferzero-sdk/models/account_validation_result.rb +2 -2
  41. data/lib/transferzero-sdk/models/api_log.rb +2 -2
  42. data/lib/transferzero-sdk/models/api_log_list_response.rb +2 -2
  43. data/lib/transferzero-sdk/models/api_log_response.rb +2 -2
  44. data/lib/transferzero-sdk/models/currency.rb +2 -2
  45. data/lib/transferzero-sdk/models/currency_exchange.rb +4 -3
  46. data/lib/transferzero-sdk/models/currency_exchange_all_of.rb +205 -0
  47. data/lib/transferzero-sdk/models/currency_exchange_list_response.rb +2 -2
  48. data/lib/transferzero-sdk/models/currency_list_response.rb +2 -2
  49. data/lib/transferzero-sdk/models/currency_opposite.rb +4 -3
  50. data/lib/transferzero-sdk/models/currency_opposite_all_of.rb +223 -0
  51. data/lib/transferzero-sdk/models/debit.rb +2 -2
  52. data/lib/transferzero-sdk/models/debit_list_request.rb +2 -2
  53. data/lib/transferzero-sdk/models/debit_list_response.rb +2 -2
  54. data/lib/transferzero-sdk/models/debit_request.rb +2 -2
  55. data/lib/transferzero-sdk/models/debit_request_wrapper.rb +2 -2
  56. data/lib/transferzero-sdk/models/debit_response.rb +2 -2
  57. data/lib/transferzero-sdk/models/document.rb +2 -2
  58. data/lib/transferzero-sdk/models/document_list_response.rb +2 -2
  59. data/lib/transferzero-sdk/models/document_request.rb +2 -2
  60. data/lib/transferzero-sdk/models/document_response.rb +2 -2
  61. data/lib/transferzero-sdk/models/document_webhook.rb +3 -2
  62. data/lib/transferzero-sdk/models/document_webhook_all_of.rb +202 -0
  63. data/lib/transferzero-sdk/models/error_status.rb +2 -2
  64. data/lib/transferzero-sdk/models/field_description.rb +2 -2
  65. data/lib/transferzero-sdk/models/field_select_validation.rb +2 -2
  66. data/lib/transferzero-sdk/models/field_validation.rb +2 -2
  67. data/lib/transferzero-sdk/models/pagination.rb +2 -2
  68. data/lib/transferzero-sdk/models/pagination_meta.rb +2 -2
  69. data/lib/transferzero-sdk/models/payin_method.rb +3 -3
  70. data/lib/transferzero-sdk/models/payin_method_details.rb +2 -2
  71. data/lib/transferzero-sdk/models/payin_method_details_btc.rb +2 -2
  72. data/lib/transferzero-sdk/models/payin_method_details_mobile.rb +2 -2
  73. data/lib/transferzero-sdk/models/payin_method_details_ngn_bank.rb +2 -2
  74. data/lib/transferzero-sdk/models/payin_method_request.rb +2 -2
  75. data/lib/transferzero-sdk/models/payin_method_response.rb +2 -2
  76. data/lib/transferzero-sdk/models/payin_method_state.rb +2 -2
  77. data/lib/transferzero-sdk/models/payin_method_ux_flow.rb +3 -2
  78. data/lib/transferzero-sdk/models/payment_method.rb +2 -2
  79. data/lib/transferzero-sdk/models/payment_method_list_response.rb +2 -2
  80. data/lib/transferzero-sdk/models/payment_method_opposite.rb +2 -2
  81. data/lib/transferzero-sdk/models/payout_method.rb +2 -2
  82. data/lib/transferzero-sdk/models/payout_method_bank_account_type_enum.rb +2 -2
  83. data/lib/transferzero-sdk/models/payout_method_cash_provider_enum.rb +2 -2
  84. data/lib/transferzero-sdk/models/payout_method_country_enum.rb +3 -3
  85. data/lib/transferzero-sdk/models/payout_method_details.rb +2 -2
  86. data/lib/transferzero-sdk/models/payout_method_details_balance.rb +2 -2
  87. data/lib/transferzero-sdk/models/payout_method_details_btc.rb +2 -2
  88. data/lib/transferzero-sdk/models/payout_method_details_gbp_bank.rb +2 -2
  89. data/lib/transferzero-sdk/models/payout_method_details_ghs_bank.rb +2 -2
  90. data/lib/transferzero-sdk/models/payout_method_details_ghs_cash.rb +2 -2
  91. data/lib/transferzero-sdk/models/payout_method_details_gnf_mobile.rb +2 -2
  92. data/lib/transferzero-sdk/models/payout_method_details_iban.rb +2 -2
  93. data/lib/transferzero-sdk/models/payout_method_details_kes_bank.rb +2 -2
  94. data/lib/transferzero-sdk/models/payout_method_details_kes_mobile.rb +2 -2
  95. data/lib/transferzero-sdk/models/payout_method_details_mad_cash.rb +2 -2
  96. data/lib/transferzero-sdk/models/payout_method_details_mobile.rb +2 -2
  97. data/lib/transferzero-sdk/models/payout_method_details_ngn_bank.rb +2 -2
  98. data/lib/transferzero-sdk/models/payout_method_details_usd_bank.rb +2 -2
  99. data/lib/transferzero-sdk/models/payout_method_details_usd_cash.rb +2 -2
  100. data/lib/transferzero-sdk/models/payout_method_details_xaf_mobile.rb +2 -2
  101. data/lib/transferzero-sdk/models/payout_method_details_xof_bank.rb +2 -2
  102. data/lib/transferzero-sdk/models/payout_method_details_xof_cash.rb +2 -2
  103. data/lib/transferzero-sdk/models/payout_method_details_xof_mobile.rb +2 -2
  104. data/lib/transferzero-sdk/models/payout_method_details_zar_bank.rb +2 -2
  105. data/lib/transferzero-sdk/models/payout_method_gender_enum.rb +2 -2
  106. data/lib/transferzero-sdk/models/payout_method_identity_card_type_enum.rb +2 -2
  107. data/lib/transferzero-sdk/models/payout_method_legal_entity_type_enum.rb +2 -2
  108. data/lib/transferzero-sdk/models/payout_method_list_response.rb +2 -2
  109. data/lib/transferzero-sdk/models/payout_method_mobile_provider_enum.rb +2 -2
  110. data/lib/transferzero-sdk/models/payout_method_nature_of_business_enum.rb +2 -2
  111. data/lib/transferzero-sdk/models/payout_method_request.rb +2 -2
  112. data/lib/transferzero-sdk/models/payout_method_response.rb +2 -2
  113. data/lib/transferzero-sdk/models/payout_method_transfer_reason_enum.rb +2 -2
  114. data/lib/transferzero-sdk/models/payout_method_webhook.rb +3 -2
  115. data/lib/transferzero-sdk/models/payout_method_webhook_all_of.rb +202 -0
  116. data/lib/transferzero-sdk/models/politically_exposed_person.rb +2 -2
  117. data/lib/transferzero-sdk/models/proof_of_payment.rb +2 -2
  118. data/lib/transferzero-sdk/models/proof_of_payment_list_response.rb +2 -2
  119. data/lib/transferzero-sdk/models/recipient.rb +2 -2
  120. data/lib/transferzero-sdk/models/recipient_list_response.rb +2 -2
  121. data/lib/transferzero-sdk/models/recipient_request.rb +2 -2
  122. data/lib/transferzero-sdk/models/recipient_response.rb +2 -2
  123. data/lib/transferzero-sdk/models/recipient_state.rb +2 -2
  124. data/lib/transferzero-sdk/models/recipient_state_reason_details.rb +2 -2
  125. data/lib/transferzero-sdk/models/recipient_webhook.rb +3 -2
  126. data/lib/transferzero-sdk/models/recipient_webhook_all_of.rb +202 -0
  127. data/lib/transferzero-sdk/models/sender.rb +2 -2
  128. data/lib/transferzero-sdk/models/sender_list_response.rb +2 -2
  129. data/lib/transferzero-sdk/models/sender_request.rb +2 -2
  130. data/lib/transferzero-sdk/models/sender_response.rb +2 -2
  131. data/lib/transferzero-sdk/models/sender_response_existing.rb +2 -2
  132. data/lib/transferzero-sdk/models/sender_response_meta.rb +2 -2
  133. data/lib/transferzero-sdk/models/sender_state.rb +2 -2
  134. data/lib/transferzero-sdk/models/sender_webhook.rb +3 -2
  135. data/lib/transferzero-sdk/models/sender_webhook_all_of.rb +202 -0
  136. data/lib/transferzero-sdk/models/state_reason_details.rb +2 -2
  137. data/lib/transferzero-sdk/models/transaction.rb +2 -2
  138. data/lib/transferzero-sdk/models/transaction_list_response.rb +2 -2
  139. data/lib/transferzero-sdk/models/transaction_request.rb +2 -2
  140. data/lib/transferzero-sdk/models/transaction_response.rb +2 -2
  141. data/lib/transferzero-sdk/models/transaction_response_existing.rb +2 -2
  142. data/lib/transferzero-sdk/models/transaction_response_meta.rb +2 -2
  143. data/lib/transferzero-sdk/models/transaction_state.rb +2 -2
  144. data/lib/transferzero-sdk/models/transaction_traits.rb +2 -2
  145. data/lib/transferzero-sdk/models/transaction_webhook.rb +3 -2
  146. data/lib/transferzero-sdk/models/transaction_webhook_all_of.rb +202 -0
  147. data/lib/transferzero-sdk/models/validation_error_description.rb +2 -2
  148. data/lib/transferzero-sdk/models/webhook.rb +2 -2
  149. data/lib/transferzero-sdk/models/webhook_definition.rb +2 -2
  150. data/lib/transferzero-sdk/models/webhook_definition_event_list_response.rb +2 -2
  151. data/lib/transferzero-sdk/models/webhook_definition_list_response.rb +2 -2
  152. data/lib/transferzero-sdk/models/webhook_definition_request.rb +2 -2
  153. data/lib/transferzero-sdk/models/webhook_definition_response.rb +2 -2
  154. data/lib/transferzero-sdk/models/webhook_log.rb +2 -2
  155. data/lib/transferzero-sdk/models/webhook_log_list_response.rb +2 -2
  156. data/lib/transferzero-sdk/models/webhook_log_metadata.rb +2 -2
  157. data/lib/transferzero-sdk/models/webhook_log_metadata_request.rb +2 -2
  158. data/lib/transferzero-sdk/models/webhook_log_metadata_response.rb +2 -2
  159. data/lib/transferzero-sdk/models/webhook_log_response.rb +2 -2
  160. data/lib/transferzero-sdk/version.rb +3 -3
  161. data/lib/transferzero-sdk.rb +9 -2
  162. data/spec/models/currency_exchange_all_of_spec.rb +41 -0
  163. data/spec/models/currency_opposite_all_of_spec.rb +53 -0
  164. data/spec/models/document_webhook_all_of_spec.rb +41 -0
  165. data/spec/models/payout_method_webhook_all_of_spec.rb +41 -0
  166. data/spec/models/recipient_webhook_all_of_spec.rb +41 -0
  167. data/spec/models/sender_webhook_all_of_spec.rb +41 -0
  168. data/spec/models/transaction_webhook_all_of_spec.rb +41 -0
  169. data/transferzero-sdk-1.19.2.gem +0 -0
  170. data/transferzero-sdk.gemspec +3 -3
  171. metadata +37 -2
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Reference documentation for the TransferZero API V1
5
5
 
6
- OpenAPI spec version: 1.0
6
+ The version of the OpenAPI document: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.0-beta3
9
+ OpenAPI Generator version: 4.1.1
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Reference documentation for the TransferZero API V1
5
5
 
6
- OpenAPI spec version: 1.0
6
+ The version of the OpenAPI document: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.0-beta3
9
+ OpenAPI Generator version: 4.1.1
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Reference documentation for the TransferZero API V1
5
5
 
6
- OpenAPI spec version: 1.0
6
+ The version of the OpenAPI document: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.0-beta3
9
+ OpenAPI Generator version: 4.1.1
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Reference documentation for the TransferZero API V1
5
5
 
6
- OpenAPI spec version: 1.0
6
+ The version of the OpenAPI document: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.0-beta3
9
+ OpenAPI Generator version: 4.1.1
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Reference documentation for the TransferZero API V1
5
5
 
6
- OpenAPI spec version: 1.0
6
+ The version of the OpenAPI document: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.0-beta3
9
+ OpenAPI Generator version: 4.1.1
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Reference documentation for the TransferZero API V1
5
5
 
6
- OpenAPI spec version: 1.0
6
+ The version of the OpenAPI document: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.0-beta3
9
+ OpenAPI Generator version: 4.1.1
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Reference documentation for the TransferZero API V1
5
5
 
6
- OpenAPI spec version: 1.0
6
+ The version of the OpenAPI document: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.0-beta3
9
+ OpenAPI Generator version: 4.1.1
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Reference documentation for the TransferZero API V1
5
5
 
6
- OpenAPI spec version: 1.0
6
+ The version of the OpenAPI document: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.0-beta3
9
+ OpenAPI Generator version: 4.1.1
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Reference documentation for the TransferZero API V1
5
5
 
6
- OpenAPI spec version: 1.0
6
+ The version of the OpenAPI document: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.0-beta3
9
+ OpenAPI Generator version: 4.1.1
10
10
 
11
11
  =end
12
12
 
@@ -79,7 +79,8 @@ class CurrencyExchange
79
79
  # List of class defined in allOf (OpenAPI v3)
80
80
  def self.openapi_all_of
81
81
  [
82
- :'Currency'
82
+ :'Currency',
83
+ :'CurrencyExchangeAllOf'
83
84
  ]
84
85
  end
85
86
 
@@ -0,0 +1,205 @@
1
+ =begin
2
+ #TransferZero API
3
+
4
+ #Reference documentation for the TransferZero API V1
5
+
6
+ The version of the OpenAPI document: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.1.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module TransferZero
16
+ class CurrencyExchangeAllOf
17
+ # Lists the currencies where you can exchange from this one
18
+ attr_accessor :opposites
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'opposites' => :'opposites'
24
+ }
25
+ end
26
+
27
+ # Attribute type mapping.
28
+ def self.openapi_types
29
+ {
30
+ :'opposites' => :'Array<CurrencyOpposite>'
31
+ }
32
+ end
33
+
34
+ # Initializes the object
35
+ # @param [Hash] attributes Model attributes in the form of hash
36
+ def initialize(attributes = {})
37
+ if (!attributes.is_a?(Hash))
38
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::CurrencyExchangeAllOf` initialize method"
39
+ end
40
+
41
+ # check to see if the attribute exists and convert string to symbol for hash key
42
+ attributes = attributes.each_with_object({}) { |(k, v), h|
43
+ if (!self.class.attribute_map.key?(k.to_sym))
44
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::CurrencyExchangeAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
45
+ end
46
+ h[k.to_sym] = v
47
+ }
48
+
49
+ if attributes.key?(:'opposites')
50
+ if (value = attributes[:'opposites']).is_a?(Array)
51
+ self.opposites = value
52
+ end
53
+ end
54
+ end
55
+
56
+ # Show invalid properties with the reasons. Usually used together with valid?
57
+ # @return Array for valid properties with the reasons
58
+ def list_invalid_properties
59
+ invalid_properties = Array.new
60
+ invalid_properties
61
+ end
62
+
63
+ # Check to see if the all the properties in the model are valid
64
+ # @return true if the model is valid
65
+ def valid?
66
+ true
67
+ end
68
+
69
+ # Checks equality by comparing each attribute.
70
+ # @param [Object] Object to be compared
71
+ def ==(o)
72
+ return true if self.equal?(o)
73
+ self.class == o.class &&
74
+ opposites == o.opposites
75
+ end
76
+
77
+ # @see the `==` method
78
+ # @param [Object] Object to be compared
79
+ def eql?(o)
80
+ self == o
81
+ end
82
+
83
+ # Calculates hash code according to all attributes.
84
+ # @return [Integer] Hash code
85
+ def hash
86
+ [opposites].hash
87
+ end
88
+
89
+ require 'active_support/core_ext/hash'
90
+ require 'active_support/hash_with_indifferent_access.rb'
91
+ # Builds the object from hash
92
+ # @param [Hash] attributes Model attributes in the form of hash
93
+ # @return [Object] Returns the model itself
94
+ def build_from_hash(attributes)
95
+ return nil unless attributes.is_a?(Hash)
96
+ self.class.openapi_types.each_pair do |key, type|
97
+ if type =~ /\AArray<(.*)>/i
98
+ # check to ensure the input is an array given that the the attribute
99
+ # is documented as an array but the input is not
100
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
101
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
102
+ end
103
+ elsif !attributes[self.class.attribute_map[key]].nil?
104
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
105
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
106
+ end
107
+
108
+ self
109
+ end
110
+
111
+ # Deserializes the data based on type
112
+ # @param string type Data type
113
+ # @param string value Value to be deserialized
114
+ # @return [Object] Deserialized data
115
+ def _deserialize(type, value)
116
+ case type.to_sym
117
+ when :DateTime
118
+ DateTime.parse(value)
119
+ when :Date
120
+ Date.parse(value)
121
+ when :String
122
+ value.to_s
123
+ when :Integer
124
+ value.to_i
125
+ when :Float
126
+ value.to_f
127
+ when :Boolean
128
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
129
+ true
130
+ else
131
+ false
132
+ end
133
+ when :Object
134
+ # generic object (usually a Hash), return directly
135
+ value
136
+ when /\AArray<(?<inner_type>.+)>\z/
137
+ inner_type = Regexp.last_match[:inner_type]
138
+ value.map { |v| _deserialize(inner_type, v) }
139
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
140
+ k_type = Regexp.last_match[:k_type]
141
+ v_type = Regexp.last_match[:v_type]
142
+ {}.tap do |hash|
143
+ value.each do |k, v|
144
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
145
+ end
146
+ end
147
+ else # model
148
+ temp_model = TransferZero.const_get(type).new
149
+ temp_model.build_from_hash(value)
150
+ end
151
+ end
152
+
153
+ # Returns the string representation of the object
154
+ # @return [String] String presentation of the object
155
+ def to_s
156
+ to_hash.to_s
157
+ end
158
+
159
+ # to_body is an alias to to_hash (backward compatibility)
160
+ # @return [Hash] Returns the object in the form of hash
161
+ def to_body
162
+ to_hash
163
+ end
164
+
165
+ # Returns the object in the form of hash
166
+ # @return [Hash] Returns the object in the form of hash
167
+ def to_hash
168
+ hash = {}
169
+ self.class.attribute_map.each_pair do |attr, param|
170
+ value = self.send(attr)
171
+ next if value.nil?
172
+ hash[param] = _to_hash(value)
173
+ end
174
+ ::ActiveSupport::HashWithIndifferentAccess.new(hash)
175
+ end
176
+
177
+ def [](key)
178
+ to_hash[key]
179
+ end
180
+
181
+ def dig(*args)
182
+ to_hash.dig(*args)
183
+ end
184
+
185
+ # Outputs non-array value in the form of hash
186
+ # For object, use to_hash. Otherwise, just return the value
187
+ # @param [Object] value Any valid value
188
+ # @return [Hash] Returns the value in the form of hash
189
+ def _to_hash(value)
190
+ if value.is_a?(Array)
191
+ value.compact.map { |v| _to_hash(v) }
192
+ elsif value.is_a?(Hash)
193
+ {}.tap do |hash|
194
+ value.each { |k, v| hash[k] = _to_hash(v) }
195
+ end
196
+ elsif value.respond_to? :to_hash
197
+ value.to_hash
198
+ else
199
+ value
200
+ end
201
+ end
202
+
203
+ end
204
+
205
+ end
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Reference documentation for the TransferZero API V1
5
5
 
6
- OpenAPI spec version: 1.0
6
+ The version of the OpenAPI document: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.0-beta3
9
+ OpenAPI Generator version: 4.1.1
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Reference documentation for the TransferZero API V1
5
5
 
6
- OpenAPI spec version: 1.0
6
+ The version of the OpenAPI document: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.0-beta3
9
+ OpenAPI Generator version: 4.1.1
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Reference documentation for the TransferZero API V1
5
5
 
6
- OpenAPI spec version: 1.0
6
+ The version of the OpenAPI document: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.0-beta3
9
+ OpenAPI Generator version: 4.1.1
10
10
 
11
11
  =end
12
12
 
@@ -89,7 +89,8 @@ class CurrencyOpposite
89
89
  # List of class defined in allOf (OpenAPI v3)
90
90
  def self.openapi_all_of
91
91
  [
92
- :'Currency'
92
+ :'Currency',
93
+ :'CurrencyOppositeAllOf'
93
94
  ]
94
95
  end
95
96
 
@@ -0,0 +1,223 @@
1
+ =begin
2
+ #TransferZero API
3
+
4
+ #Reference documentation for the TransferZero API V1
5
+
6
+ The version of the OpenAPI document: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.1.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module TransferZero
16
+ class CurrencyOppositeAllOf
17
+ # The rate of this particular currency with the base one
18
+ attr_accessor :rate
19
+
20
+ # Mark to market rate of this particular currency against the base one with the margin factored in
21
+ attr_accessor :mtm_rate
22
+
23
+ # The margin set for transactions of this particular currency with the base one
24
+ attr_accessor :margin
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'rate' => :'rate',
30
+ :'mtm_rate' => :'mtm_rate',
31
+ :'margin' => :'margin'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'rate' => :'Float',
39
+ :'mtm_rate' => :'Float',
40
+ :'margin' => :'String'
41
+ }
42
+ end
43
+
44
+ # Initializes the object
45
+ # @param [Hash] attributes Model attributes in the form of hash
46
+ def initialize(attributes = {})
47
+ if (!attributes.is_a?(Hash))
48
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::CurrencyOppositeAllOf` initialize method"
49
+ end
50
+
51
+ # check to see if the attribute exists and convert string to symbol for hash key
52
+ attributes = attributes.each_with_object({}) { |(k, v), h|
53
+ if (!self.class.attribute_map.key?(k.to_sym))
54
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::CurrencyOppositeAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
55
+ end
56
+ h[k.to_sym] = v
57
+ }
58
+
59
+ if attributes.key?(:'rate')
60
+ self.rate = attributes[:'rate']
61
+ end
62
+
63
+ if attributes.key?(:'mtm_rate')
64
+ self.mtm_rate = attributes[:'mtm_rate']
65
+ end
66
+
67
+ if attributes.key?(:'margin')
68
+ self.margin = attributes[:'margin']
69
+ end
70
+ end
71
+
72
+ # Show invalid properties with the reasons. Usually used together with valid?
73
+ # @return Array for valid properties with the reasons
74
+ def list_invalid_properties
75
+ invalid_properties = Array.new
76
+ invalid_properties
77
+ end
78
+
79
+ # Check to see if the all the properties in the model are valid
80
+ # @return true if the model is valid
81
+ def valid?
82
+ true
83
+ end
84
+
85
+ # Checks equality by comparing each attribute.
86
+ # @param [Object] Object to be compared
87
+ def ==(o)
88
+ return true if self.equal?(o)
89
+ self.class == o.class &&
90
+ rate == o.rate &&
91
+ mtm_rate == o.mtm_rate &&
92
+ margin == o.margin
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Integer] Hash code
103
+ def hash
104
+ [rate, mtm_rate, margin].hash
105
+ end
106
+
107
+ require 'active_support/core_ext/hash'
108
+ require 'active_support/hash_with_indifferent_access.rb'
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def build_from_hash(attributes)
113
+ return nil unless attributes.is_a?(Hash)
114
+ self.class.openapi_types.each_pair do |key, type|
115
+ if type =~ /\AArray<(.*)>/i
116
+ # check to ensure the input is an array given that the the attribute
117
+ # is documented as an array but the input is not
118
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
119
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
120
+ end
121
+ elsif !attributes[self.class.attribute_map[key]].nil?
122
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
123
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
124
+ end
125
+
126
+ self
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def _deserialize(type, value)
134
+ case type.to_sym
135
+ when :DateTime
136
+ DateTime.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :Boolean
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ temp_model = TransferZero.const_get(type).new
167
+ temp_model.build_from_hash(value)
168
+ end
169
+ end
170
+
171
+ # Returns the string representation of the object
172
+ # @return [String] String presentation of the object
173
+ def to_s
174
+ to_hash.to_s
175
+ end
176
+
177
+ # to_body is an alias to to_hash (backward compatibility)
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_body
180
+ to_hash
181
+ end
182
+
183
+ # Returns the object in the form of hash
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_hash
186
+ hash = {}
187
+ self.class.attribute_map.each_pair do |attr, param|
188
+ value = self.send(attr)
189
+ next if value.nil?
190
+ hash[param] = _to_hash(value)
191
+ end
192
+ ::ActiveSupport::HashWithIndifferentAccess.new(hash)
193
+ end
194
+
195
+ def [](key)
196
+ to_hash[key]
197
+ end
198
+
199
+ def dig(*args)
200
+ to_hash.dig(*args)
201
+ end
202
+
203
+ # Outputs non-array value in the form of hash
204
+ # For object, use to_hash. Otherwise, just return the value
205
+ # @param [Object] value Any valid value
206
+ # @return [Hash] Returns the value in the form of hash
207
+ def _to_hash(value)
208
+ if value.is_a?(Array)
209
+ value.compact.map { |v| _to_hash(v) }
210
+ elsif value.is_a?(Hash)
211
+ {}.tap do |hash|
212
+ value.each { |k, v| hash[k] = _to_hash(v) }
213
+ end
214
+ elsif value.respond_to? :to_hash
215
+ value.to_hash
216
+ else
217
+ value
218
+ end
219
+ end
220
+
221
+ end
222
+
223
+ end
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Reference documentation for the TransferZero API V1
5
5
 
6
- OpenAPI spec version: 1.0
6
+ The version of the OpenAPI document: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.0-beta3
9
+ OpenAPI Generator version: 4.1.1
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Reference documentation for the TransferZero API V1
5
5
 
6
- OpenAPI spec version: 1.0
6
+ The version of the OpenAPI document: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.0-beta3
9
+ OpenAPI Generator version: 4.1.1
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Reference documentation for the TransferZero API V1
5
5
 
6
- OpenAPI spec version: 1.0
6
+ The version of the OpenAPI document: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.0-beta3
9
+ OpenAPI Generator version: 4.1.1
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Reference documentation for the TransferZero API V1
5
5
 
6
- OpenAPI spec version: 1.0
6
+ The version of the OpenAPI document: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.0-beta3
9
+ OpenAPI Generator version: 4.1.1
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Reference documentation for the TransferZero API V1
5
5
 
6
- OpenAPI spec version: 1.0
6
+ The version of the OpenAPI document: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.0-beta3
9
+ OpenAPI Generator version: 4.1.1
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #Reference documentation for the TransferZero API V1
5
5
 
6
- OpenAPI spec version: 1.0
6
+ The version of the OpenAPI document: 1.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.0-beta3
9
+ OpenAPI Generator version: 4.1.1
10
10
 
11
11
  =end
12
12