transferzero-sdk 1.8.0 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,75 +13,75 @@ OpenAPI Generator version: 4.0.0-beta3
13
13
  require 'date'
14
14
 
15
15
  module TransferZero
16
- class DebitResponse
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 DebitResponse
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' => :'Debit'
30
+ }
31
+ end
25
32
 
26
- # Attribute type mapping.
27
- def self.openapi_types
28
- {
29
- :'object' => :'Debit'
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::DebitResponse` 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::DebitResponse` 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::DebitResponse`. 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::DebitResponse`. 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,228 +13,249 @@ OpenAPI Generator version: 4.0.0-beta3
13
13
  require 'date'
14
14
 
15
15
  module TransferZero
16
- class Document
17
- attr_accessor :sender_id
16
+ class Document
17
+ # Base64 encoded data uri of an image/pdf file or a fully qualified url
18
+ attr_accessor :upload
18
19
 
19
- # Base64 encoded data uri of an image/pdf file or a fully qualified url
20
- attr_accessor :upload
20
+ # URL of the document location
21
+ attr_accessor :url
21
22
 
22
- # Name of the upload
23
- attr_accessor :upload_file_name
23
+ # Name of the upload
24
+ attr_accessor :upload_file_name
24
25
 
25
- # Metadata of document
26
- attr_accessor :metadata
26
+ # Metadata of document
27
+ attr_accessor :metadata
27
28
 
28
- attr_accessor :upload_content_type
29
+ attr_accessor :upload_content_type
29
30
 
30
- attr_accessor :upload_file_size
31
+ attr_accessor :upload_file_size
31
32
 
32
- # uncategorised
33
- attr_accessor :category
33
+ # uncategorised
34
+ attr_accessor :category
34
35
 
35
- # The side of the KYC ID. One of 'front' or 'back'
36
- attr_accessor :side
36
+ # The side of the KYC ID. One of 'front' or 'back'
37
+ attr_accessor :side
37
38
 
38
- # This is a brief description of the document type
39
- attr_accessor :document_type
39
+ # This is a brief description of the document type
40
+ attr_accessor :document_type
40
41
 
41
- # Issuing country of ID in 2-character alpha ISO 3166-2 country format
42
- attr_accessor :issuing_country
42
+ # Issuing country of ID in 2-character alpha ISO 3166-2 country format
43
+ attr_accessor :issuing_country
43
44
 
44
- attr_accessor :id
45
+ attr_accessor :id
45
46
 
46
- # The fields that have some problems and don't pass validation
47
- attr_accessor :errors
47
+ # Document ID issued by government
48
+ attr_accessor :document_id
48
49
 
49
- class EnumAttributeValidator
50
- attr_reader :datatype
51
- attr_reader :allowable_values
50
+ # Document expiry date issued by government
51
+ attr_accessor :expiry_date
52
52
 
53
- def initialize(datatype, allowable_values)
54
- @allowable_values = allowable_values.map do |value|
55
- case datatype.to_s
56
- when /Integer/i
57
- value.to_i
58
- when /Float/i
59
- value.to_f
60
- else
61
- value
62
- end
63
- end
64
- end
53
+ # The fields that have some problems and don't pass validation
54
+ attr_accessor :errors
65
55
 
66
- def valid?(value)
67
- !value || allowable_values.include?(value)
68
- end
69
- end
56
+ class EnumAttributeValidator
57
+ attr_reader :datatype
58
+ attr_reader :allowable_values
70
59
 
71
- # Attribute mapping from ruby-style variable name to JSON key.
72
- def self.attribute_map
73
- {
74
- :'sender_id' => :'sender_id',
75
- :'upload' => :'upload',
76
- :'upload_file_name' => :'upload_file_name',
77
- :'metadata' => :'metadata',
78
- :'upload_content_type' => :'upload_content_type',
79
- :'upload_file_size' => :'upload_file_size',
80
- :'category' => :'category',
81
- :'side' => :'side',
82
- :'document_type' => :'document_type',
83
- :'issuing_country' => :'issuing_country',
84
- :'id' => :'id',
85
- :'errors' => :'errors'
86
- }
60
+ def initialize(datatype, allowable_values)
61
+ @allowable_values = allowable_values.map do |value|
62
+ case datatype.to_s
63
+ when /Integer/i
64
+ value.to_i
65
+ when /Float/i
66
+ value.to_f
67
+ else
68
+ value
69
+ end
70
+ end
87
71
  end
88
72
 
89
- # Attribute type mapping.
90
- def self.openapi_types
91
- {
92
- :'sender_id' => :'String',
93
- :'upload' => :'String',
94
- :'upload_file_name' => :'String',
95
- :'metadata' => :'Object',
96
- :'upload_content_type' => :'String',
97
- :'upload_file_size' => :'Integer',
98
- :'category' => :'String',
99
- :'side' => :'String',
100
- :'document_type' => :'String',
101
- :'issuing_country' => :'String',
102
- :'id' => :'String',
103
- :'errors' => :'Hash<String, Array<ValidationErrorDescription>>'
104
- }
73
+ def valid?(value)
74
+ !value || allowable_values.include?(value)
105
75
  end
76
+ end
106
77
 
107
- # Initializes the object
108
- # @param [Hash] attributes Model attributes in the form of hash
109
- def initialize(attributes = {})
110
- if (!attributes.is_a?(Hash))
111
- fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::Document` initialize method"
112
- end
113
-
114
- # check to see if the attribute exists and convert string to symbol for hash key
115
- attributes = attributes.each_with_object({}) { |(k, v), h|
116
- if (!self.class.attribute_map.key?(k.to_sym))
117
- fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::Document`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
118
- end
119
- h[k.to_sym] = v
120
- }
78
+ # Attribute mapping from ruby-style variable name to JSON key.
79
+ def self.attribute_map
80
+ {
81
+ :'upload' => :'upload',
82
+ :'url' => :'url',
83
+ :'upload_file_name' => :'upload_file_name',
84
+ :'metadata' => :'metadata',
85
+ :'upload_content_type' => :'upload_content_type',
86
+ :'upload_file_size' => :'upload_file_size',
87
+ :'category' => :'category',
88
+ :'side' => :'side',
89
+ :'document_type' => :'document_type',
90
+ :'issuing_country' => :'issuing_country',
91
+ :'id' => :'id',
92
+ :'document_id' => :'document_id',
93
+ :'expiry_date' => :'expiry_date',
94
+ :'errors' => :'errors'
95
+ }
96
+ end
121
97
 
122
- if attributes.key?(:'sender_id')
123
- self.sender_id = attributes[:'sender_id']
124
- end
98
+ # Attribute type mapping.
99
+ def self.openapi_types
100
+ {
101
+ :'upload' => :'String',
102
+ :'url' => :'String',
103
+ :'upload_file_name' => :'String',
104
+ :'metadata' => :'Object',
105
+ :'upload_content_type' => :'String',
106
+ :'upload_file_size' => :'Integer',
107
+ :'category' => :'String',
108
+ :'side' => :'String',
109
+ :'document_type' => :'String',
110
+ :'issuing_country' => :'String',
111
+ :'id' => :'String',
112
+ :'document_id' => :'String',
113
+ :'expiry_date' => :'Date',
114
+ :'errors' => :'Hash<String, Array<ValidationErrorDescription>>'
115
+ }
116
+ end
125
117
 
126
- if attributes.key?(:'upload')
127
- self.upload = attributes[:'upload']
128
- end
118
+ # Initializes the object
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ def initialize(attributes = {})
121
+ if (!attributes.is_a?(Hash))
122
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::Document` initialize method"
123
+ end
129
124
 
130
- if attributes.key?(:'upload_file_name')
131
- self.upload_file_name = attributes[:'upload_file_name']
125
+ # check to see if the attribute exists and convert string to symbol for hash key
126
+ attributes = attributes.each_with_object({}) { |(k, v), h|
127
+ if (!self.class.attribute_map.key?(k.to_sym))
128
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::Document`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
132
129
  end
130
+ h[k.to_sym] = v
131
+ }
133
132
 
134
- if attributes.key?(:'metadata')
135
- self.metadata = attributes[:'metadata']
136
- end
133
+ if attributes.key?(:'upload')
134
+ self.upload = attributes[:'upload']
135
+ end
137
136
 
138
- if attributes.key?(:'upload_content_type')
139
- self.upload_content_type = attributes[:'upload_content_type']
140
- end
137
+ if attributes.key?(:'url')
138
+ self.url = attributes[:'url']
139
+ end
141
140
 
142
- if attributes.key?(:'upload_file_size')
143
- self.upload_file_size = attributes[:'upload_file_size']
144
- end
141
+ if attributes.key?(:'upload_file_name')
142
+ self.upload_file_name = attributes[:'upload_file_name']
143
+ end
145
144
 
146
- if attributes.key?(:'category')
147
- self.category = attributes[:'category']
148
- end
145
+ if attributes.key?(:'metadata')
146
+ self.metadata = attributes[:'metadata']
147
+ end
149
148
 
150
- if attributes.key?(:'side')
151
- self.side = attributes[:'side']
152
- end
149
+ if attributes.key?(:'upload_content_type')
150
+ self.upload_content_type = attributes[:'upload_content_type']
151
+ end
153
152
 
154
- if attributes.key?(:'document_type')
155
- self.document_type = attributes[:'document_type']
156
- end
153
+ if attributes.key?(:'upload_file_size')
154
+ self.upload_file_size = attributes[:'upload_file_size']
155
+ end
157
156
 
158
- if attributes.key?(:'issuing_country')
159
- self.issuing_country = attributes[:'issuing_country']
160
- end
157
+ if attributes.key?(:'category')
158
+ self.category = attributes[:'category']
159
+ end
161
160
 
162
- if attributes.key?(:'id')
163
- self.id = attributes[:'id']
164
- end
161
+ if attributes.key?(:'side')
162
+ self.side = attributes[:'side']
163
+ end
165
164
 
166
- if attributes.key?(:'errors')
167
- if (value = attributes[:'errors']).is_a?(Hash)
168
- self.errors = value
169
- end
170
- end
165
+ if attributes.key?(:'document_type')
166
+ self.document_type = attributes[:'document_type']
171
167
  end
172
168
 
173
- # Show invalid properties with the reasons. Usually used together with valid?
174
- # @return Array for valid properties with the reasons
175
- def list_invalid_properties
176
- invalid_properties = Array.new
177
- if @upload.nil?
178
- invalid_properties.push('invalid value for "upload", upload cannot be nil.')
179
- end
169
+ if attributes.key?(:'issuing_country')
170
+ self.issuing_country = attributes[:'issuing_country']
171
+ end
180
172
 
181
- if @upload_file_name.nil?
182
- invalid_properties.push('invalid value for "upload_file_name", upload_file_name cannot be nil.')
183
- end
173
+ if attributes.key?(:'id')
174
+ self.id = attributes[:'id']
175
+ end
184
176
 
185
- invalid_properties
177
+ if attributes.key?(:'document_id')
178
+ self.document_id = attributes[:'document_id']
186
179
  end
187
180
 
188
- # Check to see if the all the properties in the model are valid
189
- # @return true if the model is valid
190
- def valid?
191
- return false if @upload.nil?
192
- return false if @upload_file_name.nil?
193
- side_validator = EnumAttributeValidator.new('String', ["front", "back"])
194
- return false unless side_validator.valid?(@side)
195
- true
181
+ if attributes.key?(:'expiry_date')
182
+ self.expiry_date = attributes[:'expiry_date']
196
183
  end
197
184
 
198
- # Custom attribute writer method checking allowed values (enum).
199
- # @param [Object] side Object to be assigned
200
- def side=(side)
201
- validator = EnumAttributeValidator.new('String', ["front", "back"])
202
- unless validator.valid?(side)
203
- fail ArgumentError, "invalid value for \"side\", must be one of #{validator.allowable_values}."
185
+ if attributes.key?(:'errors')
186
+ if (value = attributes[:'errors']).is_a?(Hash)
187
+ self.errors = value
204
188
  end
205
- @side = side
206
189
  end
190
+ end
207
191
 
208
- # Checks equality by comparing each attribute.
209
- # @param [Object] Object to be compared
210
- def ==(o)
211
- return true if self.equal?(o)
212
- self.class == o.class &&
213
- sender_id == o.sender_id &&
214
- upload == o.upload &&
215
- upload_file_name == o.upload_file_name &&
216
- metadata == o.metadata &&
217
- upload_content_type == o.upload_content_type &&
218
- upload_file_size == o.upload_file_size &&
219
- category == o.category &&
220
- side == o.side &&
221
- document_type == o.document_type &&
222
- issuing_country == o.issuing_country &&
223
- id == o.id &&
224
- errors == o.errors
192
+ # Show invalid properties with the reasons. Usually used together with valid?
193
+ # @return Array for valid properties with the reasons
194
+ def list_invalid_properties
195
+ invalid_properties = Array.new
196
+ if @upload.nil?
197
+ invalid_properties.push('invalid value for "upload", upload cannot be nil.')
225
198
  end
226
199
 
227
- # @see the `==` method
228
- # @param [Object] Object to be compared
229
- def eql?(o)
230
- self == o
200
+ if @upload_file_name.nil?
201
+ invalid_properties.push('invalid value for "upload_file_name", upload_file_name cannot be nil.')
231
202
  end
232
203
 
233
- # Calculates hash code according to all attributes.
234
- # @return [Integer] Hash code
235
- def hash
236
- [sender_id, upload, upload_file_name, metadata, upload_content_type, upload_file_size, category, side, document_type, issuing_country, id, errors].hash
204
+ invalid_properties
205
+ end
206
+
207
+ # Check to see if the all the properties in the model are valid
208
+ # @return true if the model is valid
209
+ def valid?
210
+ return false if @upload.nil?
211
+ return false if @upload_file_name.nil?
212
+ side_validator = EnumAttributeValidator.new('String', ["front", "back"])
213
+ return false unless side_validator.valid?(@side)
214
+ true
215
+ end
216
+
217
+ # Custom attribute writer method checking allowed values (enum).
218
+ # @param [Object] side Object to be assigned
219
+ def side=(side)
220
+ validator = EnumAttributeValidator.new('String', ["front", "back"])
221
+ unless validator.valid?(side) || side.empty?
222
+ fail ArgumentError, "invalid value for \"side\", must be one of #{validator.allowable_values}."
237
223
  end
224
+ @side = side
225
+ end
226
+
227
+ # Checks equality by comparing each attribute.
228
+ # @param [Object] Object to be compared
229
+ def ==(o)
230
+ return true if self.equal?(o)
231
+ self.class == o.class &&
232
+ upload == o.upload &&
233
+ url == o.url &&
234
+ upload_file_name == o.upload_file_name &&
235
+ metadata == o.metadata &&
236
+ upload_content_type == o.upload_content_type &&
237
+ upload_file_size == o.upload_file_size &&
238
+ category == o.category &&
239
+ side == o.side &&
240
+ document_type == o.document_type &&
241
+ issuing_country == o.issuing_country &&
242
+ id == o.id &&
243
+ document_id == o.document_id &&
244
+ expiry_date == o.expiry_date &&
245
+ errors == o.errors
246
+ end
247
+
248
+ # @see the `==` method
249
+ # @param [Object] Object to be compared
250
+ def eql?(o)
251
+ self == o
252
+ end
253
+
254
+ # Calculates hash code according to all attributes.
255
+ # @return [Integer] Hash code
256
+ def hash
257
+ [upload, url, upload_file_name, metadata, upload_content_type, upload_file_size, category, side, document_type, issuing_country, id, document_id, expiry_date, errors].hash
258
+ end
238
259
 
239
260
  require 'active_support/core_ext/hash'
240
261
  require 'active_support/hash_with_indifferent_access.rb'
@@ -350,5 +371,6 @@ def _to_hash(value)
350
371
  end
351
372
  end
352
373
 
353
- end
374
+ end
375
+
354
376
  end