transferzero-sdk 1.8.0 → 1.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +93 -0
  3. data/README.md +15 -5
  4. data/docs/AccountMeta.md +1 -1
  5. data/docs/AccountValidationRequest.md +2 -0
  6. data/docs/Currency.md +1 -3
  7. data/docs/CurrencyExchange.md +1 -3
  8. data/docs/CurrencyOpposite.md +4 -4
  9. data/docs/Document.md +7 -3
  10. data/docs/DocumentsApi.md +2 -74
  11. data/docs/FieldSelectValidation.md +1 -1
  12. data/docs/FieldValidation.md +1 -1
  13. data/docs/PayinMethodDetails.md +3 -1
  14. data/docs/PayinMethodDetailsBTC.md +17 -0
  15. data/docs/PayinMethodDetailsMobile.md +1 -1
  16. data/docs/PaymentMethod.md +2 -2
  17. data/docs/PaymentMethodOpposite.md +2 -2
  18. data/docs/PayoutMethod.md +1 -1
  19. data/docs/PayoutMethodCashProviderEnum.md +16 -0
  20. data/docs/PayoutMethodCountryEnum.md +16 -0
  21. data/docs/PayoutMethodDetails.md +21 -1
  22. data/docs/PayoutMethodDetailsBTC.md +23 -0
  23. data/docs/PayoutMethodDetailsGBPBank.md +29 -0
  24. data/docs/PayoutMethodDetailsIBAN.md +1 -1
  25. data/docs/PayoutMethodDetailsMobile.md +3 -1
  26. data/docs/PayoutMethodDetailsXOFCash.md +25 -0
  27. data/docs/PayoutMethodDetailsZARBank.md +35 -0
  28. data/docs/ProofOfPayment.md +23 -0
  29. data/docs/ProofOfPaymentListResponse.md +17 -0
  30. data/docs/Recipient.md +8 -4
  31. data/docs/RecipientStateReasonDetails.md +23 -0
  32. data/docs/RecipientsApi.md +63 -1
  33. data/docs/Sender.md +74 -34
  34. data/lib/transferzero-sdk.rb +10 -0
  35. data/lib/transferzero-sdk/api/documents_api.rb +0 -63
  36. data/lib/transferzero-sdk/api/recipients_api.rb +56 -2
  37. data/lib/transferzero-sdk/api_client.rb +5 -3
  38. data/lib/transferzero-sdk/models/account.rb +70 -69
  39. data/lib/transferzero-sdk/models/account_list_response.rb +67 -66
  40. data/lib/transferzero-sdk/models/account_meta.rb +61 -60
  41. data/lib/transferzero-sdk/models/account_response.rb +66 -65
  42. data/lib/transferzero-sdk/models/account_validation_error.rb +61 -60
  43. data/lib/transferzero-sdk/models/account_validation_request.rb +171 -161
  44. data/lib/transferzero-sdk/models/account_validation_response.rb +66 -65
  45. data/lib/transferzero-sdk/models/account_validation_result.rb +61 -60
  46. data/lib/transferzero-sdk/models/api_log.rb +136 -135
  47. data/lib/transferzero-sdk/models/api_log_list_response.rb +70 -69
  48. data/lib/transferzero-sdk/models/api_log_response.rb +60 -59
  49. data/lib/transferzero-sdk/models/currency.rb +133 -142
  50. data/lib/transferzero-sdk/models/currency_exchange.rb +149 -158
  51. data/lib/transferzero-sdk/models/currency_exchange_list_response.rb +62 -61
  52. data/lib/transferzero-sdk/models/currency_list_response.rb +62 -61
  53. data/lib/transferzero-sdk/models/currency_opposite.rb +166 -165
  54. data/lib/transferzero-sdk/models/debit.rb +151 -150
  55. data/lib/transferzero-sdk/models/debit_list_request.rb +61 -60
  56. data/lib/transferzero-sdk/models/debit_list_response.rb +67 -66
  57. data/lib/transferzero-sdk/models/debit_request.rb +60 -59
  58. data/lib/transferzero-sdk/models/debit_request_wrapper.rb +80 -79
  59. data/lib/transferzero-sdk/models/debit_response.rb +60 -59
  60. data/lib/transferzero-sdk/models/document.rb +197 -175
  61. data/lib/transferzero-sdk/models/document_list_response.rb +67 -66
  62. data/lib/transferzero-sdk/models/document_request.rb +60 -59
  63. data/lib/transferzero-sdk/models/document_response.rb +60 -59
  64. data/lib/transferzero-sdk/models/document_webhook.rb +96 -95
  65. data/lib/transferzero-sdk/models/error_status.rb +66 -65
  66. data/lib/transferzero-sdk/models/field_description.rb +95 -94
  67. data/lib/transferzero-sdk/models/field_select_validation.rb +70 -69
  68. data/lib/transferzero-sdk/models/field_validation.rb +78 -77
  69. data/lib/transferzero-sdk/models/pagination.rb +97 -96
  70. data/lib/transferzero-sdk/models/pagination_meta.rb +60 -59
  71. data/lib/transferzero-sdk/models/payin_method.rb +97 -96
  72. data/lib/transferzero-sdk/models/payin_method_details.rb +122 -110
  73. data/lib/transferzero-sdk/models/payin_method_details_btc.rb +204 -0
  74. data/lib/transferzero-sdk/models/payin_method_details_mobile.rb +75 -74
  75. data/lib/transferzero-sdk/models/payin_method_details_ngn_bank.rb +71 -70
  76. data/lib/transferzero-sdk/models/payin_method_request.rb +60 -59
  77. data/lib/transferzero-sdk/models/payment_method.rb +109 -108
  78. data/lib/transferzero-sdk/models/payment_method_list_response.rb +61 -60
  79. data/lib/transferzero-sdk/models/payment_method_opposite.rb +124 -123
  80. data/lib/transferzero-sdk/models/payout_method.rb +107 -106
  81. data/lib/transferzero-sdk/models/payout_method_bank_account_type_enum.rb +14 -19
  82. data/lib/transferzero-sdk/models/payout_method_cash_provider_enum.rb +31 -0
  83. data/lib/transferzero-sdk/models/payout_method_country_enum.rb +32 -0
  84. data/lib/transferzero-sdk/models/payout_method_details.rb +417 -297
  85. data/lib/transferzero-sdk/models/payout_method_details_balance.rb +61 -60
  86. data/lib/transferzero-sdk/models/payout_method_details_btc.rb +250 -0
  87. data/lib/transferzero-sdk/models/payout_method_details_gbp_bank.rb +267 -0
  88. data/lib/transferzero-sdk/models/payout_method_details_ghs_bank.rb +97 -96
  89. data/lib/transferzero-sdk/models/payout_method_details_iban.rb +100 -104
  90. data/lib/transferzero-sdk/models/payout_method_details_mad_cash.rb +162 -161
  91. data/lib/transferzero-sdk/models/payout_method_details_mobile.rb +93 -83
  92. data/lib/transferzero-sdk/models/payout_method_details_ngn_bank.rb +104 -103
  93. data/lib/transferzero-sdk/models/payout_method_details_xof_bank.rb +108 -107
  94. data/lib/transferzero-sdk/models/payout_method_details_xof_cash.rb +254 -0
  95. data/lib/transferzero-sdk/models/payout_method_details_xof_mobile.rb +97 -96
  96. data/lib/transferzero-sdk/models/payout_method_details_zar_bank.rb +324 -0
  97. data/lib/transferzero-sdk/models/payout_method_gender_enum.rb +14 -19
  98. data/lib/transferzero-sdk/models/payout_method_identity_card_type_enum.rb +15 -20
  99. data/lib/transferzero-sdk/models/payout_method_list_response.rb +67 -66
  100. data/lib/transferzero-sdk/models/payout_method_mobile_provider_enum.rb +17 -19
  101. data/lib/transferzero-sdk/models/payout_method_request.rb +60 -59
  102. data/lib/transferzero-sdk/models/payout_method_response.rb +60 -59
  103. data/lib/transferzero-sdk/models/payout_method_webhook.rb +96 -95
  104. data/lib/transferzero-sdk/models/politically_exposed_person.rb +123 -123
  105. data/lib/transferzero-sdk/models/proof_of_payment.rb +233 -0
  106. data/lib/transferzero-sdk/models/proof_of_payment_list_response.rb +204 -0
  107. data/lib/transferzero-sdk/models/recipient.rb +246 -226
  108. data/lib/transferzero-sdk/models/recipient_list_response.rb +67 -66
  109. data/lib/transferzero-sdk/models/recipient_request.rb +60 -59
  110. data/lib/transferzero-sdk/models/recipient_response.rb +60 -59
  111. data/lib/transferzero-sdk/models/recipient_state.rb +22 -27
  112. data/lib/transferzero-sdk/models/recipient_state_reason_details.rb +235 -0
  113. data/lib/transferzero-sdk/models/recipient_webhook.rb +96 -95
  114. data/lib/transferzero-sdk/models/sender.rb +595 -358
  115. data/lib/transferzero-sdk/models/sender_list_response.rb +67 -66
  116. data/lib/transferzero-sdk/models/sender_request.rb +60 -59
  117. data/lib/transferzero-sdk/models/sender_response.rb +66 -65
  118. data/lib/transferzero-sdk/models/sender_response_existing.rb +60 -59
  119. data/lib/transferzero-sdk/models/sender_response_meta.rb +60 -59
  120. data/lib/transferzero-sdk/models/sender_state.rb +19 -24
  121. data/lib/transferzero-sdk/models/sender_webhook.rb +96 -95
  122. data/lib/transferzero-sdk/models/transaction.rb +192 -191
  123. data/lib/transferzero-sdk/models/transaction_list_response.rb +67 -66
  124. data/lib/transferzero-sdk/models/transaction_request.rb +60 -59
  125. data/lib/transferzero-sdk/models/transaction_response.rb +66 -65
  126. data/lib/transferzero-sdk/models/transaction_response_existing.rb +66 -65
  127. data/lib/transferzero-sdk/models/transaction_response_meta.rb +60 -59
  128. data/lib/transferzero-sdk/models/transaction_state.rb +23 -28
  129. data/lib/transferzero-sdk/models/transaction_traits.rb +71 -70
  130. data/lib/transferzero-sdk/models/transaction_webhook.rb +96 -95
  131. data/lib/transferzero-sdk/models/validation_error_description.rb +62 -61
  132. data/lib/transferzero-sdk/models/webhook.rb +92 -91
  133. data/lib/transferzero-sdk/models/webhook_definition.rb +107 -106
  134. data/lib/transferzero-sdk/models/webhook_definition_event_list_response.rb +61 -60
  135. data/lib/transferzero-sdk/models/webhook_definition_list_response.rb +67 -66
  136. data/lib/transferzero-sdk/models/webhook_definition_request.rb +60 -59
  137. data/lib/transferzero-sdk/models/webhook_definition_response.rb +60 -59
  138. data/lib/transferzero-sdk/models/webhook_log.rb +97 -96
  139. data/lib/transferzero-sdk/models/webhook_log_list_response.rb +70 -69
  140. data/lib/transferzero-sdk/models/webhook_log_metadata.rb +129 -128
  141. data/lib/transferzero-sdk/models/webhook_log_metadata_request.rb +80 -79
  142. data/lib/transferzero-sdk/models/webhook_log_metadata_response.rb +81 -80
  143. data/lib/transferzero-sdk/models/webhook_log_response.rb +60 -59
  144. data/lib/transferzero-sdk/version.rb +1 -1
  145. data/spec/models/payin_method_details_btc_spec.rb +41 -0
  146. data/spec/models/payout_method_cash_provider_enum_spec.rb +35 -0
  147. data/spec/models/payout_method_country_enum_spec.rb +35 -0
  148. data/spec/models/payout_method_details_btc_spec.rb +59 -0
  149. data/spec/models/payout_method_details_gbp_bank_spec.rb +77 -0
  150. data/spec/models/payout_method_details_xof_cash_spec.rb +71 -0
  151. data/spec/models/payout_method_details_zar_bank_spec.rb +89 -0
  152. data/spec/models/proof_of_payment_list_response_spec.rb +41 -0
  153. data/spec/models/proof_of_payment_spec.rb +59 -0
  154. data/spec/models/recipient_state_reason_details_spec.rb +59 -0
  155. data/transferzero-sdk-1.10.0.gem +0 -0
  156. data/transferzero-sdk-1.11.0.gem +0 -0
  157. metadata +46 -3
@@ -13,146 +13,145 @@ OpenAPI Generator version: 4.0.0-beta3
13
13
  require 'date'
14
14
 
15
15
  module TransferZero
16
- # An optional list of politically exposed people, individuals who are or have been entrusted with prominent public functions by a country, for example heads of state or heads of government, senior politicians, senior government, judicial or military officials, senior executives of state owned corporations, important political party officials. There is a limit of three (3) politically exposed people per Sender. Politically exposed person example: ```json { \"name\": \"Ronald Reagan\", \"position\": \"President of the United States\", \"started_date\": \"1981-01-20T00:00:00.000Z\", \"ended_date\": \"1989-01-20T00:00:00.000Z\" } ```
17
- class PoliticallyExposedPerson
18
- attr_accessor :id
19
-
20
- # Full name of the politically exposed person
21
- attr_accessor :name
22
-
23
- # The office held by the politically exposed person
24
- attr_accessor :position
25
-
26
- # The date on which the person started holding the office
27
- attr_accessor :started_date
28
-
29
- # The date on which the person ended holding the office
30
- attr_accessor :ended_date
31
-
32
- # The ID of the Sender to whom the person is attached to
33
- attr_accessor :sender_id
34
-
35
- # Date and time the person was created
36
- attr_accessor :created_at
37
-
38
- # Date and time the person was updated
39
- attr_accessor :updated_at
40
-
41
- # Attribute mapping from ruby-style variable name to JSON key.
42
- def self.attribute_map
43
- {
44
- :'id' => :'id',
45
- :'name' => :'name',
46
- :'position' => :'position',
47
- :'started_date' => :'started_date',
48
- :'ended_date' => :'ended_date',
49
- :'sender_id' => :'sender_id',
50
- :'created_at' => :'created_at',
51
- :'updated_at' => :'updated_at'
52
- }
53
- end
54
-
55
- # Attribute type mapping.
56
- def self.openapi_types
57
- {
58
- :'id' => :'Integer',
59
- :'name' => :'String',
60
- :'position' => :'String',
61
- :'started_date' => :'DateTime',
62
- :'ended_date' => :'DateTime',
63
- :'sender_id' => :'String',
64
- :'created_at' => :'DateTime',
65
- :'updated_at' => :'DateTime'
66
- }
67
- end
68
-
69
- # Initializes the object
70
- # @param [Hash] attributes Model attributes in the form of hash
71
- def initialize(attributes = {})
72
- if (!attributes.is_a?(Hash))
73
- fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::PoliticallyExposedPerson` initialize method"
74
- end
75
-
76
- # check to see if the attribute exists and convert string to symbol for hash key
77
- attributes = attributes.each_with_object({}) { |(k, v), h|
78
- if (!self.class.attribute_map.key?(k.to_sym))
79
- fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::PoliticallyExposedPerson`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
80
- end
81
- h[k.to_sym] = v
82
- }
83
-
84
- if attributes.key?(:'id')
85
- self.id = attributes[:'id']
86
- end
87
-
88
- if attributes.key?(:'name')
89
- self.name = attributes[:'name']
90
- end
16
+ class PoliticallyExposedPerson
17
+ attr_accessor :id
18
+
19
+ # Full name of the politically exposed person
20
+ attr_accessor :name
21
+
22
+ # The office held by the politically exposed person
23
+ attr_accessor :position
24
+
25
+ # The date on which the person started holding the office
26
+ attr_accessor :started_date
27
+
28
+ # The date on which the person ended holding the office
29
+ attr_accessor :ended_date
30
+
31
+ # The ID of the Sender to whom the person is attached to
32
+ attr_accessor :sender_id
33
+
34
+ # Date and time the person was created
35
+ attr_accessor :created_at
36
+
37
+ # Date and time the person was updated
38
+ attr_accessor :updated_at
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'id' => :'id',
44
+ :'name' => :'name',
45
+ :'position' => :'position',
46
+ :'started_date' => :'started_date',
47
+ :'ended_date' => :'ended_date',
48
+ :'sender_id' => :'sender_id',
49
+ :'created_at' => :'created_at',
50
+ :'updated_at' => :'updated_at'
51
+ }
52
+ end
91
53
 
92
- if attributes.key?(:'position')
93
- self.position = attributes[:'position']
94
- end
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'id' => :'Integer',
58
+ :'name' => :'String',
59
+ :'position' => :'String',
60
+ :'started_date' => :'DateTime',
61
+ :'ended_date' => :'DateTime',
62
+ :'sender_id' => :'String',
63
+ :'created_at' => :'DateTime',
64
+ :'updated_at' => :'DateTime'
65
+ }
66
+ end
95
67
 
96
- if attributes.key?(:'started_date')
97
- self.started_date = attributes[:'started_date']
98
- end
68
+ # Initializes the object
69
+ # @param [Hash] attributes Model attributes in the form of hash
70
+ def initialize(attributes = {})
71
+ if (!attributes.is_a?(Hash))
72
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::PoliticallyExposedPerson` initialize method"
73
+ end
99
74
 
100
- if attributes.key?(:'ended_date')
101
- self.ended_date = attributes[:'ended_date']
75
+ # check to see if the attribute exists and convert string to symbol for hash key
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!self.class.attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::PoliticallyExposedPerson`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
102
79
  end
80
+ h[k.to_sym] = v
81
+ }
103
82
 
104
- if attributes.key?(:'sender_id')
105
- self.sender_id = attributes[:'sender_id']
106
- end
83
+ if attributes.key?(:'id')
84
+ self.id = attributes[:'id']
85
+ end
107
86
 
108
- if attributes.key?(:'created_at')
109
- self.created_at = attributes[:'created_at']
110
- end
87
+ if attributes.key?(:'name')
88
+ self.name = attributes[:'name']
89
+ end
111
90
 
112
- if attributes.key?(:'updated_at')
113
- self.updated_at = attributes[:'updated_at']
114
- end
91
+ if attributes.key?(:'position')
92
+ self.position = attributes[:'position']
115
93
  end
116
94
 
117
- # Show invalid properties with the reasons. Usually used together with valid?
118
- # @return Array for valid properties with the reasons
119
- def list_invalid_properties
120
- invalid_properties = Array.new
121
- invalid_properties
95
+ if attributes.key?(:'started_date')
96
+ self.started_date = attributes[:'started_date']
122
97
  end
123
98
 
124
- # Check to see if the all the properties in the model are valid
125
- # @return true if the model is valid
126
- def valid?
127
- true
99
+ if attributes.key?(:'ended_date')
100
+ self.ended_date = attributes[:'ended_date']
128
101
  end
129
102
 
130
- # Checks equality by comparing each attribute.
131
- # @param [Object] Object to be compared
132
- def ==(o)
133
- return true if self.equal?(o)
134
- self.class == o.class &&
135
- id == o.id &&
136
- name == o.name &&
137
- position == o.position &&
138
- started_date == o.started_date &&
139
- ended_date == o.ended_date &&
140
- sender_id == o.sender_id &&
141
- created_at == o.created_at &&
142
- updated_at == o.updated_at
103
+ if attributes.key?(:'sender_id')
104
+ self.sender_id = attributes[:'sender_id']
143
105
  end
144
106
 
145
- # @see the `==` method
146
- # @param [Object] Object to be compared
147
- def eql?(o)
148
- self == o
107
+ if attributes.key?(:'created_at')
108
+ self.created_at = attributes[:'created_at']
149
109
  end
150
110
 
151
- # Calculates hash code according to all attributes.
152
- # @return [Integer] Hash code
153
- def hash
154
- [id, name, position, started_date, ended_date, sender_id, created_at, updated_at].hash
111
+ if attributes.key?(:'updated_at')
112
+ self.updated_at = attributes[:'updated_at']
155
113
  end
114
+ end
115
+
116
+ # Show invalid properties with the reasons. Usually used together with valid?
117
+ # @return Array for valid properties with the reasons
118
+ def list_invalid_properties
119
+ invalid_properties = Array.new
120
+ invalid_properties
121
+ end
122
+
123
+ # Check to see if the all the properties in the model are valid
124
+ # @return true if the model is valid
125
+ def valid?
126
+ true
127
+ end
128
+
129
+ # Checks equality by comparing each attribute.
130
+ # @param [Object] Object to be compared
131
+ def ==(o)
132
+ return true if self.equal?(o)
133
+ self.class == o.class &&
134
+ id == o.id &&
135
+ name == o.name &&
136
+ position == o.position &&
137
+ started_date == o.started_date &&
138
+ ended_date == o.ended_date &&
139
+ sender_id == o.sender_id &&
140
+ created_at == o.created_at &&
141
+ updated_at == o.updated_at
142
+ end
143
+
144
+ # @see the `==` method
145
+ # @param [Object] Object to be compared
146
+ def eql?(o)
147
+ self == o
148
+ end
149
+
150
+ # Calculates hash code according to all attributes.
151
+ # @return [Integer] Hash code
152
+ def hash
153
+ [id, name, position, started_date, ended_date, sender_id, created_at, updated_at].hash
154
+ end
156
155
 
157
156
  require 'active_support/core_ext/hash'
158
157
  require 'active_support/hash_with_indifferent_access.rb'
@@ -268,5 +267,6 @@ def _to_hash(value)
268
267
  end
269
268
  end
270
269
 
271
- end
270
+ end
271
+
272
272
  end
@@ -0,0 +1,233 @@
1
+ =begin
2
+ #TransferZero API
3
+
4
+ #Reference documentation for the TransferZero API V1
5
+
6
+ OpenAPI spec version: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.0.0-beta3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module TransferZero
16
+ class ProofOfPayment
17
+ # UUID of the uploaded document
18
+ attr_accessor :id
19
+
20
+ # Name of the uploaded file
21
+ attr_accessor :file_name
22
+
23
+ # URL to thumbnail image of the uploaded file
24
+ attr_accessor :thumbnail
25
+
26
+ # URL to uploaded file
27
+ attr_accessor :url
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'id' => :'id',
33
+ :'file_name' => :'file_name',
34
+ :'thumbnail' => :'thumbnail',
35
+ :'url' => :'url'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.openapi_types
41
+ {
42
+ :'id' => :'String',
43
+ :'file_name' => :'String',
44
+ :'thumbnail' => :'String',
45
+ :'url' => :'String'
46
+ }
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::ProofOfPayment` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::ProofOfPayment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'id')
65
+ self.id = attributes[:'id']
66
+ end
67
+
68
+ if attributes.key?(:'file_name')
69
+ self.file_name = attributes[:'file_name']
70
+ end
71
+
72
+ if attributes.key?(:'thumbnail')
73
+ self.thumbnail = attributes[:'thumbnail']
74
+ end
75
+
76
+ if attributes.key?(:'url')
77
+ self.url = attributes[:'url']
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ invalid_properties = Array.new
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ id == o.id &&
100
+ file_name == o.file_name &&
101
+ thumbnail == o.thumbnail &&
102
+ url == o.url
103
+ end
104
+
105
+ # @see the `==` method
106
+ # @param [Object] Object to be compared
107
+ def eql?(o)
108
+ self == o
109
+ end
110
+
111
+ # Calculates hash code according to all attributes.
112
+ # @return [Integer] Hash code
113
+ def hash
114
+ [id, file_name, thumbnail, url].hash
115
+ end
116
+
117
+ require 'active_support/core_ext/hash'
118
+ require 'active_support/hash_with_indifferent_access.rb'
119
+ # Builds the object from hash
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ # @return [Object] Returns the model itself
122
+ def build_from_hash(attributes)
123
+ return nil unless attributes.is_a?(Hash)
124
+ self.class.openapi_types.each_pair do |key, type|
125
+ if type =~ /\AArray<(.*)>/i
126
+ # check to ensure the input is an array given that the the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
129
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
130
+ end
131
+ elsif !attributes[self.class.attribute_map[key]].nil?
132
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
133
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
134
+ end
135
+
136
+ self
137
+ end
138
+
139
+ # Deserializes the data based on type
140
+ # @param string type Data type
141
+ # @param string value Value to be deserialized
142
+ # @return [Object] Deserialized data
143
+ def _deserialize(type, value)
144
+ case type.to_sym
145
+ when :DateTime
146
+ DateTime.parse(value)
147
+ when :Date
148
+ Date.parse(value)
149
+ when :String
150
+ value.to_s
151
+ when :Integer
152
+ value.to_i
153
+ when :Float
154
+ value.to_f
155
+ when :Boolean
156
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
157
+ true
158
+ else
159
+ false
160
+ end
161
+ when :Object
162
+ # generic object (usually a Hash), return directly
163
+ value
164
+ when /\AArray<(?<inner_type>.+)>\z/
165
+ inner_type = Regexp.last_match[:inner_type]
166
+ value.map { |v| _deserialize(inner_type, v) }
167
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
168
+ k_type = Regexp.last_match[:k_type]
169
+ v_type = Regexp.last_match[:v_type]
170
+ {}.tap do |hash|
171
+ value.each do |k, v|
172
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
173
+ end
174
+ end
175
+ else # model
176
+ temp_model = TransferZero.const_get(type).new
177
+ temp_model.build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ next if value.nil?
200
+ hash[param] = _to_hash(value)
201
+ end
202
+ ::ActiveSupport::HashWithIndifferentAccess.new(hash)
203
+ end
204
+
205
+ def [](key)
206
+ to_hash[key]
207
+ end
208
+
209
+ def dig(*args)
210
+ to_hash.dig(*args)
211
+ end
212
+
213
+ # Outputs non-array value in the form of hash
214
+ # For object, use to_hash. Otherwise, just return the value
215
+ # @param [Object] value Any valid value
216
+ # @return [Hash] Returns the value in the form of hash
217
+ def _to_hash(value)
218
+ if value.is_a?(Array)
219
+ value.compact.map { |v| _to_hash(v) }
220
+ elsif value.is_a?(Hash)
221
+ {}.tap do |hash|
222
+ value.each { |k, v| hash[k] = _to_hash(v) }
223
+ end
224
+ elsif value.respond_to? :to_hash
225
+ value.to_hash
226
+ else
227
+ value
228
+ end
229
+ end
230
+
231
+ end
232
+
233
+ end