transferzero-sdk 1.19.3 → 1.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (193) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -11
  3. data/docs/Document.md +1 -1
  4. data/docs/Sender.md +2 -2
  5. data/lib/transferzero-sdk/api/account_debits_api.rb +2 -2
  6. data/lib/transferzero-sdk/api/account_validation_api.rb +2 -2
  7. data/lib/transferzero-sdk/api/accounts_api.rb +2 -2
  8. data/lib/transferzero-sdk/api/api_logs_api.rb +2 -2
  9. data/lib/transferzero-sdk/api/currency_info_api.rb +2 -2
  10. data/lib/transferzero-sdk/api/documents_api.rb +2 -2
  11. data/lib/transferzero-sdk/api/logs_api.rb +2 -2
  12. data/lib/transferzero-sdk/api/payin_methods_api.rb +2 -2
  13. data/lib/transferzero-sdk/api/payment_methods_api.rb +2 -2
  14. data/lib/transferzero-sdk/api/payout_methods_api.rb +2 -2
  15. data/lib/transferzero-sdk/api/recipients_api.rb +2 -2
  16. data/lib/transferzero-sdk/api/senders_api.rb +2 -2
  17. data/lib/transferzero-sdk/api/transactions_api.rb +2 -2
  18. data/lib/transferzero-sdk/api/webhooks_api.rb +2 -2
  19. data/lib/transferzero-sdk/api_client.rb +126 -91
  20. data/lib/transferzero-sdk/api_error.rb +2 -2
  21. data/lib/transferzero-sdk/configuration.rb +97 -21
  22. data/lib/transferzero-sdk/models/account.rb +2 -2
  23. data/lib/transferzero-sdk/models/account_list_response.rb +2 -2
  24. data/lib/transferzero-sdk/models/account_meta.rb +2 -2
  25. data/lib/transferzero-sdk/models/account_response.rb +2 -2
  26. data/lib/transferzero-sdk/models/account_validation_error.rb +2 -2
  27. data/lib/transferzero-sdk/models/account_validation_request.rb +2 -2
  28. data/lib/transferzero-sdk/models/account_validation_response.rb +2 -2
  29. data/lib/transferzero-sdk/models/account_validation_result.rb +2 -2
  30. data/lib/transferzero-sdk/models/api_log.rb +2 -2
  31. data/lib/transferzero-sdk/models/api_log_list_response.rb +2 -2
  32. data/lib/transferzero-sdk/models/api_log_response.rb +2 -2
  33. data/lib/transferzero-sdk/models/currency.rb +2 -2
  34. data/lib/transferzero-sdk/models/currency_exchange.rb +3 -4
  35. data/lib/transferzero-sdk/models/currency_exchange_list_response.rb +2 -2
  36. data/lib/transferzero-sdk/models/currency_list_response.rb +2 -2
  37. data/lib/transferzero-sdk/models/currency_opposite.rb +3 -4
  38. data/lib/transferzero-sdk/models/debit.rb +2 -2
  39. data/lib/transferzero-sdk/models/debit_list_request.rb +2 -2
  40. data/lib/transferzero-sdk/models/debit_list_response.rb +2 -2
  41. data/lib/transferzero-sdk/models/debit_request.rb +2 -2
  42. data/lib/transferzero-sdk/models/debit_request_wrapper.rb +2 -2
  43. data/lib/transferzero-sdk/models/debit_response.rb +2 -2
  44. data/lib/transferzero-sdk/models/document.rb +2 -2
  45. data/lib/transferzero-sdk/models/document_list_response.rb +2 -2
  46. data/lib/transferzero-sdk/models/document_request.rb +2 -2
  47. data/lib/transferzero-sdk/models/document_response.rb +2 -2
  48. data/lib/transferzero-sdk/models/document_webhook.rb +2 -3
  49. data/lib/transferzero-sdk/models/error_status.rb +2 -2
  50. data/lib/transferzero-sdk/models/field_description.rb +2 -2
  51. data/lib/transferzero-sdk/models/field_select_validation.rb +2 -2
  52. data/lib/transferzero-sdk/models/field_validation.rb +2 -2
  53. data/lib/transferzero-sdk/models/pagination.rb +2 -2
  54. data/lib/transferzero-sdk/models/pagination_meta.rb +2 -2
  55. data/lib/transferzero-sdk/models/payin_method.rb +2 -2
  56. data/lib/transferzero-sdk/models/payin_method_details.rb +2 -2
  57. data/lib/transferzero-sdk/models/payin_method_details_btc.rb +2 -2
  58. data/lib/transferzero-sdk/models/payin_method_details_mobile.rb +2 -2
  59. data/lib/transferzero-sdk/models/payin_method_details_ngn_bank.rb +2 -2
  60. data/lib/transferzero-sdk/models/payin_method_request.rb +2 -2
  61. data/lib/transferzero-sdk/models/payin_method_response.rb +2 -2
  62. data/lib/transferzero-sdk/models/payin_method_state.rb +2 -2
  63. data/lib/transferzero-sdk/models/payin_method_ux_flow.rb +2 -2
  64. data/lib/transferzero-sdk/models/payment_method.rb +2 -2
  65. data/lib/transferzero-sdk/models/payment_method_list_response.rb +2 -2
  66. data/lib/transferzero-sdk/models/payment_method_opposite.rb +2 -2
  67. data/lib/transferzero-sdk/models/payout_method.rb +2 -2
  68. data/lib/transferzero-sdk/models/payout_method_bank_account_type_enum.rb +2 -2
  69. data/lib/transferzero-sdk/models/payout_method_cash_provider_enum.rb +2 -2
  70. data/lib/transferzero-sdk/models/payout_method_country_enum.rb +2 -2
  71. data/lib/transferzero-sdk/models/payout_method_details.rb +2 -2
  72. data/lib/transferzero-sdk/models/payout_method_details_balance.rb +2 -2
  73. data/lib/transferzero-sdk/models/payout_method_details_btc.rb +2 -2
  74. data/lib/transferzero-sdk/models/payout_method_details_gbp_bank.rb +2 -2
  75. data/lib/transferzero-sdk/models/payout_method_details_ghs_bank.rb +2 -2
  76. data/lib/transferzero-sdk/models/payout_method_details_ghs_cash.rb +2 -2
  77. data/lib/transferzero-sdk/models/payout_method_details_gnf_mobile.rb +2 -2
  78. data/lib/transferzero-sdk/models/payout_method_details_iban.rb +2 -2
  79. data/lib/transferzero-sdk/models/payout_method_details_kes_bank.rb +2 -2
  80. data/lib/transferzero-sdk/models/payout_method_details_kes_mobile.rb +2 -2
  81. data/lib/transferzero-sdk/models/payout_method_details_mad_cash.rb +2 -2
  82. data/lib/transferzero-sdk/models/payout_method_details_mobile.rb +2 -2
  83. data/lib/transferzero-sdk/models/payout_method_details_ngn_bank.rb +3 -3
  84. data/lib/transferzero-sdk/models/payout_method_details_usd_bank.rb +2 -2
  85. data/lib/transferzero-sdk/models/payout_method_details_usd_cash.rb +2 -2
  86. data/lib/transferzero-sdk/models/payout_method_details_xaf_mobile.rb +2 -2
  87. data/lib/transferzero-sdk/models/payout_method_details_xof_bank.rb +2 -2
  88. data/lib/transferzero-sdk/models/payout_method_details_xof_cash.rb +2 -2
  89. data/lib/transferzero-sdk/models/payout_method_details_xof_mobile.rb +3 -3
  90. data/lib/transferzero-sdk/models/payout_method_details_zar_bank.rb +2 -2
  91. data/lib/transferzero-sdk/models/payout_method_gender_enum.rb +2 -2
  92. data/lib/transferzero-sdk/models/payout_method_identity_card_type_enum.rb +2 -2
  93. data/lib/transferzero-sdk/models/payout_method_legal_entity_type_enum.rb +2 -2
  94. data/lib/transferzero-sdk/models/payout_method_list_response.rb +2 -2
  95. data/lib/transferzero-sdk/models/payout_method_mobile_provider_enum.rb +5 -2
  96. data/lib/transferzero-sdk/models/payout_method_nature_of_business_enum.rb +2 -2
  97. data/lib/transferzero-sdk/models/payout_method_request.rb +2 -2
  98. data/lib/transferzero-sdk/models/payout_method_response.rb +2 -2
  99. data/lib/transferzero-sdk/models/payout_method_transfer_reason_enum.rb +2 -2
  100. data/lib/transferzero-sdk/models/payout_method_webhook.rb +2 -3
  101. data/lib/transferzero-sdk/models/politically_exposed_person.rb +2 -2
  102. data/lib/transferzero-sdk/models/proof_of_payment.rb +2 -2
  103. data/lib/transferzero-sdk/models/proof_of_payment_list_response.rb +2 -2
  104. data/lib/transferzero-sdk/models/recipient.rb +2 -2
  105. data/lib/transferzero-sdk/models/recipient_list_response.rb +2 -2
  106. data/lib/transferzero-sdk/models/recipient_request.rb +2 -2
  107. data/lib/transferzero-sdk/models/recipient_response.rb +2 -2
  108. data/lib/transferzero-sdk/models/recipient_state.rb +2 -2
  109. data/lib/transferzero-sdk/models/recipient_state_reason_details.rb +2 -2
  110. data/lib/transferzero-sdk/models/recipient_webhook.rb +2 -3
  111. data/lib/transferzero-sdk/models/sender.rb +2 -2
  112. data/lib/transferzero-sdk/models/sender_list_response.rb +2 -2
  113. data/lib/transferzero-sdk/models/sender_request.rb +2 -2
  114. data/lib/transferzero-sdk/models/sender_response.rb +2 -2
  115. data/lib/transferzero-sdk/models/sender_response_existing.rb +2 -2
  116. data/lib/transferzero-sdk/models/sender_response_meta.rb +2 -2
  117. data/lib/transferzero-sdk/models/sender_state.rb +2 -2
  118. data/lib/transferzero-sdk/models/sender_webhook.rb +2 -3
  119. data/lib/transferzero-sdk/models/state_reason_details.rb +2 -2
  120. data/lib/transferzero-sdk/models/transaction.rb +2 -2
  121. data/lib/transferzero-sdk/models/transaction_list_response.rb +2 -2
  122. data/lib/transferzero-sdk/models/transaction_request.rb +2 -2
  123. data/lib/transferzero-sdk/models/transaction_response.rb +2 -2
  124. data/lib/transferzero-sdk/models/transaction_response_existing.rb +2 -2
  125. data/lib/transferzero-sdk/models/transaction_response_meta.rb +2 -2
  126. data/lib/transferzero-sdk/models/transaction_state.rb +2 -2
  127. data/lib/transferzero-sdk/models/transaction_traits.rb +2 -2
  128. data/lib/transferzero-sdk/models/transaction_webhook.rb +2 -3
  129. data/lib/transferzero-sdk/models/validation_error_description.rb +2 -2
  130. data/lib/transferzero-sdk/models/webhook.rb +2 -2
  131. data/lib/transferzero-sdk/models/webhook_definition.rb +2 -2
  132. data/lib/transferzero-sdk/models/webhook_definition_event_list_response.rb +2 -2
  133. data/lib/transferzero-sdk/models/webhook_definition_list_response.rb +2 -2
  134. data/lib/transferzero-sdk/models/webhook_definition_request.rb +2 -2
  135. data/lib/transferzero-sdk/models/webhook_definition_response.rb +2 -2
  136. data/lib/transferzero-sdk/models/webhook_log.rb +2 -2
  137. data/lib/transferzero-sdk/models/webhook_log_list_response.rb +2 -2
  138. data/lib/transferzero-sdk/models/webhook_log_metadata.rb +2 -2
  139. data/lib/transferzero-sdk/models/webhook_log_metadata_request.rb +2 -2
  140. data/lib/transferzero-sdk/models/webhook_log_metadata_response.rb +2 -2
  141. data/lib/transferzero-sdk/models/webhook_log_response.rb +2 -2
  142. data/lib/transferzero-sdk/version.rb +3 -3
  143. data/lib/transferzero-sdk.rb +2 -9
  144. data/spec/api/documents_api_spec.rb +0 -15
  145. data/spec/api/payin_methods_api_spec.rb +2 -2
  146. data/spec/api/payout_methods_api_spec.rb +1 -1
  147. data/spec/api/recipients_api_spec.rb +13 -1
  148. data/spec/api/senders_api_spec.rb +1 -1
  149. data/spec/api/transactions_api_spec.rb +1 -0
  150. data/spec/models/account_validation_request_spec.rb +14 -2
  151. data/spec/models/currency_exchange_spec.rb +0 -6
  152. data/spec/models/currency_opposite_spec.rb +4 -4
  153. data/spec/models/currency_spec.rb +0 -6
  154. data/spec/models/document_spec.rb +20 -2
  155. data/spec/models/payin_method_details_mobile_spec.rb +7 -1
  156. data/spec/models/payin_method_details_spec.rb +13 -1
  157. data/spec/models/payin_method_spec.rb +25 -1
  158. data/spec/models/payout_method_details_kes_bank_spec.rb +6 -0
  159. data/spec/models/payout_method_details_kes_mobile_spec.rb +6 -0
  160. data/spec/models/payout_method_details_mobile_spec.rb +6 -0
  161. data/spec/models/payout_method_details_spec.rb +108 -0
  162. data/spec/models/payout_method_details_xof_bank_spec.rb +12 -0
  163. data/spec/models/payout_method_details_xof_cash_spec.rb +3 -9
  164. data/spec/models/payout_method_details_xof_mobile_spec.rb +12 -0
  165. data/spec/models/payout_method_details_zar_bank_spec.rb +48 -0
  166. data/spec/models/recipient_spec.rb +22 -0
  167. data/spec/models/sender_spec.rb +169 -19
  168. data/transferzero-sdk.gemspec +3 -9
  169. metadata +6 -157
  170. data/Gemfile.lock +0 -92
  171. data/docs/CurrencyExchangeAllOf.md +0 -17
  172. data/docs/CurrencyOppositeAllOf.md +0 -21
  173. data/docs/DocumentWebhookAllOf.md +0 -17
  174. data/docs/PayoutMethodWebhookAllOf.md +0 -17
  175. data/docs/RecipientWebhookAllOf.md +0 -17
  176. data/docs/SenderWebhookAllOf.md +0 -17
  177. data/docs/TransactionWebhookAllOf.md +0 -17
  178. data/lib/transferzero-sdk/models/currency_exchange_all_of.rb +0 -205
  179. data/lib/transferzero-sdk/models/currency_opposite_all_of.rb +0 -223
  180. data/lib/transferzero-sdk/models/document_webhook_all_of.rb +0 -202
  181. data/lib/transferzero-sdk/models/payout_method_webhook_all_of.rb +0 -202
  182. data/lib/transferzero-sdk/models/recipient_webhook_all_of.rb +0 -202
  183. data/lib/transferzero-sdk/models/sender_webhook_all_of.rb +0 -202
  184. data/lib/transferzero-sdk/models/transaction_webhook_all_of.rb +0 -202
  185. data/spec/models/currency_exchange_all_of_spec.rb +0 -41
  186. data/spec/models/currency_opposite_all_of_spec.rb +0 -53
  187. data/spec/models/document_webhook_all_of_spec.rb +0 -41
  188. data/spec/models/payout_method_webhook_all_of_spec.rb +0 -41
  189. data/spec/models/recipient_webhook_all_of_spec.rb +0 -41
  190. data/spec/models/sender_webhook_all_of_spec.rb +0 -41
  191. data/spec/models/transaction_webhook_all_of_spec.rb +0 -41
  192. data/transferzero-sdk-1.19.0.gem +0 -0
  193. data/transferzero-sdk-1.19.2.gem +0 -0
@@ -1,202 +0,0 @@
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 PayoutMethodWebhookAllOf
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' => :'PayoutMethod'
30
- }
31
- end
32
-
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::PayoutMethodWebhookAllOf` initialize method"
38
- end
39
-
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::PayoutMethodWebhookAllOf`. 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
51
- end
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
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
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
73
-
74
- # @see the `==` method
75
- # @param [Object] Object to be compared
76
- def eql?(o)
77
- self == o
78
- end
79
-
80
- # Calculates hash code according to all attributes.
81
- # @return [Integer] Hash code
82
- def hash
83
- [object].hash
84
- end
85
-
86
- require 'active_support/core_ext/hash'
87
- require 'active_support/hash_with_indifferent_access.rb'
88
- # Builds the object from hash
89
- # @param [Hash] attributes Model attributes in the form of hash
90
- # @return [Object] Returns the model itself
91
- def build_from_hash(attributes)
92
- return nil unless attributes.is_a?(Hash)
93
- self.class.openapi_types.each_pair do |key, type|
94
- if type =~ /\AArray<(.*)>/i
95
- # check to ensure the input is an array given that the the attribute
96
- # is documented as an array but the input is not
97
- if attributes[self.class.attribute_map[key]].is_a?(Array)
98
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
99
- end
100
- elsif !attributes[self.class.attribute_map[key]].nil?
101
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
102
- end # or else data not found in attributes(hash), not an issue as the data can be optional
103
- end
104
-
105
- self
106
- end
107
-
108
- # Deserializes the data based on type
109
- # @param string type Data type
110
- # @param string value Value to be deserialized
111
- # @return [Object] Deserialized data
112
- def _deserialize(type, value)
113
- case type.to_sym
114
- when :DateTime
115
- DateTime.parse(value)
116
- when :Date
117
- Date.parse(value)
118
- when :String
119
- value.to_s
120
- when :Integer
121
- value.to_i
122
- when :Float
123
- value.to_f
124
- when :Boolean
125
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
126
- true
127
- else
128
- false
129
- end
130
- when :Object
131
- # generic object (usually a Hash), return directly
132
- value
133
- when /\AArray<(?<inner_type>.+)>\z/
134
- inner_type = Regexp.last_match[:inner_type]
135
- value.map { |v| _deserialize(inner_type, v) }
136
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
137
- k_type = Regexp.last_match[:k_type]
138
- v_type = Regexp.last_match[:v_type]
139
- {}.tap do |hash|
140
- value.each do |k, v|
141
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
142
- end
143
- end
144
- else # model
145
- temp_model = TransferZero.const_get(type).new
146
- temp_model.build_from_hash(value)
147
- end
148
- end
149
-
150
- # Returns the string representation of the object
151
- # @return [String] String presentation of the object
152
- def to_s
153
- to_hash.to_s
154
- end
155
-
156
- # to_body is an alias to to_hash (backward compatibility)
157
- # @return [Hash] Returns the object in the form of hash
158
- def to_body
159
- to_hash
160
- end
161
-
162
- # Returns the object in the form of hash
163
- # @return [Hash] Returns the object in the form of hash
164
- def to_hash
165
- hash = {}
166
- self.class.attribute_map.each_pair do |attr, param|
167
- value = self.send(attr)
168
- next if value.nil?
169
- hash[param] = _to_hash(value)
170
- end
171
- ::ActiveSupport::HashWithIndifferentAccess.new(hash)
172
- end
173
-
174
- def [](key)
175
- to_hash[key]
176
- end
177
-
178
- def dig(*args)
179
- to_hash.dig(*args)
180
- end
181
-
182
- # Outputs non-array value in the form of hash
183
- # For object, use to_hash. Otherwise, just return the value
184
- # @param [Object] value Any valid value
185
- # @return [Hash] Returns the value in the form of hash
186
- def _to_hash(value)
187
- if value.is_a?(Array)
188
- value.compact.map { |v| _to_hash(v) }
189
- elsif value.is_a?(Hash)
190
- {}.tap do |hash|
191
- value.each { |k, v| hash[k] = _to_hash(v) }
192
- end
193
- elsif value.respond_to? :to_hash
194
- value.to_hash
195
- else
196
- value
197
- end
198
- end
199
-
200
- end
201
-
202
- end
@@ -1,202 +0,0 @@
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 RecipientWebhookAllOf
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' => :'Recipient'
30
- }
31
- end
32
-
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::RecipientWebhookAllOf` initialize method"
38
- end
39
-
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::RecipientWebhookAllOf`. 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
51
- end
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
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
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
73
-
74
- # @see the `==` method
75
- # @param [Object] Object to be compared
76
- def eql?(o)
77
- self == o
78
- end
79
-
80
- # Calculates hash code according to all attributes.
81
- # @return [Integer] Hash code
82
- def hash
83
- [object].hash
84
- end
85
-
86
- require 'active_support/core_ext/hash'
87
- require 'active_support/hash_with_indifferent_access.rb'
88
- # Builds the object from hash
89
- # @param [Hash] attributes Model attributes in the form of hash
90
- # @return [Object] Returns the model itself
91
- def build_from_hash(attributes)
92
- return nil unless attributes.is_a?(Hash)
93
- self.class.openapi_types.each_pair do |key, type|
94
- if type =~ /\AArray<(.*)>/i
95
- # check to ensure the input is an array given that the the attribute
96
- # is documented as an array but the input is not
97
- if attributes[self.class.attribute_map[key]].is_a?(Array)
98
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
99
- end
100
- elsif !attributes[self.class.attribute_map[key]].nil?
101
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
102
- end # or else data not found in attributes(hash), not an issue as the data can be optional
103
- end
104
-
105
- self
106
- end
107
-
108
- # Deserializes the data based on type
109
- # @param string type Data type
110
- # @param string value Value to be deserialized
111
- # @return [Object] Deserialized data
112
- def _deserialize(type, value)
113
- case type.to_sym
114
- when :DateTime
115
- DateTime.parse(value)
116
- when :Date
117
- Date.parse(value)
118
- when :String
119
- value.to_s
120
- when :Integer
121
- value.to_i
122
- when :Float
123
- value.to_f
124
- when :Boolean
125
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
126
- true
127
- else
128
- false
129
- end
130
- when :Object
131
- # generic object (usually a Hash), return directly
132
- value
133
- when /\AArray<(?<inner_type>.+)>\z/
134
- inner_type = Regexp.last_match[:inner_type]
135
- value.map { |v| _deserialize(inner_type, v) }
136
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
137
- k_type = Regexp.last_match[:k_type]
138
- v_type = Regexp.last_match[:v_type]
139
- {}.tap do |hash|
140
- value.each do |k, v|
141
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
142
- end
143
- end
144
- else # model
145
- temp_model = TransferZero.const_get(type).new
146
- temp_model.build_from_hash(value)
147
- end
148
- end
149
-
150
- # Returns the string representation of the object
151
- # @return [String] String presentation of the object
152
- def to_s
153
- to_hash.to_s
154
- end
155
-
156
- # to_body is an alias to to_hash (backward compatibility)
157
- # @return [Hash] Returns the object in the form of hash
158
- def to_body
159
- to_hash
160
- end
161
-
162
- # Returns the object in the form of hash
163
- # @return [Hash] Returns the object in the form of hash
164
- def to_hash
165
- hash = {}
166
- self.class.attribute_map.each_pair do |attr, param|
167
- value = self.send(attr)
168
- next if value.nil?
169
- hash[param] = _to_hash(value)
170
- end
171
- ::ActiveSupport::HashWithIndifferentAccess.new(hash)
172
- end
173
-
174
- def [](key)
175
- to_hash[key]
176
- end
177
-
178
- def dig(*args)
179
- to_hash.dig(*args)
180
- end
181
-
182
- # Outputs non-array value in the form of hash
183
- # For object, use to_hash. Otherwise, just return the value
184
- # @param [Object] value Any valid value
185
- # @return [Hash] Returns the value in the form of hash
186
- def _to_hash(value)
187
- if value.is_a?(Array)
188
- value.compact.map { |v| _to_hash(v) }
189
- elsif value.is_a?(Hash)
190
- {}.tap do |hash|
191
- value.each { |k, v| hash[k] = _to_hash(v) }
192
- end
193
- elsif value.respond_to? :to_hash
194
- value.to_hash
195
- else
196
- value
197
- end
198
- end
199
-
200
- end
201
-
202
- end
@@ -1,202 +0,0 @@
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 SenderWebhookAllOf
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' => :'Sender'
30
- }
31
- end
32
-
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::SenderWebhookAllOf` initialize method"
38
- end
39
-
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::SenderWebhookAllOf`. 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
51
- end
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
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
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
73
-
74
- # @see the `==` method
75
- # @param [Object] Object to be compared
76
- def eql?(o)
77
- self == o
78
- end
79
-
80
- # Calculates hash code according to all attributes.
81
- # @return [Integer] Hash code
82
- def hash
83
- [object].hash
84
- end
85
-
86
- require 'active_support/core_ext/hash'
87
- require 'active_support/hash_with_indifferent_access.rb'
88
- # Builds the object from hash
89
- # @param [Hash] attributes Model attributes in the form of hash
90
- # @return [Object] Returns the model itself
91
- def build_from_hash(attributes)
92
- return nil unless attributes.is_a?(Hash)
93
- self.class.openapi_types.each_pair do |key, type|
94
- if type =~ /\AArray<(.*)>/i
95
- # check to ensure the input is an array given that the the attribute
96
- # is documented as an array but the input is not
97
- if attributes[self.class.attribute_map[key]].is_a?(Array)
98
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
99
- end
100
- elsif !attributes[self.class.attribute_map[key]].nil?
101
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
102
- end # or else data not found in attributes(hash), not an issue as the data can be optional
103
- end
104
-
105
- self
106
- end
107
-
108
- # Deserializes the data based on type
109
- # @param string type Data type
110
- # @param string value Value to be deserialized
111
- # @return [Object] Deserialized data
112
- def _deserialize(type, value)
113
- case type.to_sym
114
- when :DateTime
115
- DateTime.parse(value)
116
- when :Date
117
- Date.parse(value)
118
- when :String
119
- value.to_s
120
- when :Integer
121
- value.to_i
122
- when :Float
123
- value.to_f
124
- when :Boolean
125
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
126
- true
127
- else
128
- false
129
- end
130
- when :Object
131
- # generic object (usually a Hash), return directly
132
- value
133
- when /\AArray<(?<inner_type>.+)>\z/
134
- inner_type = Regexp.last_match[:inner_type]
135
- value.map { |v| _deserialize(inner_type, v) }
136
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
137
- k_type = Regexp.last_match[:k_type]
138
- v_type = Regexp.last_match[:v_type]
139
- {}.tap do |hash|
140
- value.each do |k, v|
141
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
142
- end
143
- end
144
- else # model
145
- temp_model = TransferZero.const_get(type).new
146
- temp_model.build_from_hash(value)
147
- end
148
- end
149
-
150
- # Returns the string representation of the object
151
- # @return [String] String presentation of the object
152
- def to_s
153
- to_hash.to_s
154
- end
155
-
156
- # to_body is an alias to to_hash (backward compatibility)
157
- # @return [Hash] Returns the object in the form of hash
158
- def to_body
159
- to_hash
160
- end
161
-
162
- # Returns the object in the form of hash
163
- # @return [Hash] Returns the object in the form of hash
164
- def to_hash
165
- hash = {}
166
- self.class.attribute_map.each_pair do |attr, param|
167
- value = self.send(attr)
168
- next if value.nil?
169
- hash[param] = _to_hash(value)
170
- end
171
- ::ActiveSupport::HashWithIndifferentAccess.new(hash)
172
- end
173
-
174
- def [](key)
175
- to_hash[key]
176
- end
177
-
178
- def dig(*args)
179
- to_hash.dig(*args)
180
- end
181
-
182
- # Outputs non-array value in the form of hash
183
- # For object, use to_hash. Otherwise, just return the value
184
- # @param [Object] value Any valid value
185
- # @return [Hash] Returns the value in the form of hash
186
- def _to_hash(value)
187
- if value.is_a?(Array)
188
- value.compact.map { |v| _to_hash(v) }
189
- elsif value.is_a?(Hash)
190
- {}.tap do |hash|
191
- value.each { |k, v| hash[k] = _to_hash(v) }
192
- end
193
- elsif value.respond_to? :to_hash
194
- value.to_hash
195
- else
196
- value
197
- end
198
- end
199
-
200
- end
201
-
202
- end