qwil_api 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (230) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +91 -0
  3. data/docs/AccountSerializer.md +18 -0
  4. data/docs/AccountsApi.md +243 -0
  5. data/docs/ApitokenauthApi.md +57 -0
  6. data/docs/CashoutCalculationSerializer.md +10 -0
  7. data/docs/CashoutSerializer.md +20 -0
  8. data/docs/CashoutSliceSerializer.md +11 -0
  9. data/docs/CashoutsApi.md +56 -0
  10. data/docs/CompanyInformationSerializer.md +18 -0
  11. data/docs/ContactInfoSerializer.md +10 -0
  12. data/docs/ContactInformationSerializer.md +16 -0
  13. data/docs/ContractorSerializer.md +20 -0
  14. data/docs/IncomeApi.md +98 -0
  15. data/docs/IncomeNestedSerializer.md +18 -0
  16. data/docs/IncomeSerializer.md +18 -0
  17. data/docs/IncomeSerializerFixedSource.md +18 -0
  18. data/docs/InvoiceSerializer.md +17 -0
  19. data/docs/InvoiceSerializerFixedSourceCreate.md +17 -0
  20. data/docs/InvoicesApi.md +98 -0
  21. data/docs/JSONWebTokenSerializer.md +7 -0
  22. data/docs/ManagerPlatformSerializer.md +22 -0
  23. data/docs/ManagerSerializer.md +10 -0
  24. data/docs/ManagersApi.md +172 -0
  25. data/docs/MembershipSerializer.md +9 -0
  26. data/docs/MembershipsApi.md +56 -0
  27. data/docs/PersonalInformationSerializer.md +16 -0
  28. data/docs/PlaidPublicTokenSerializer.md +8 -0
  29. data/docs/PlatformIncomeRequestSerializer.md +15 -0
  30. data/docs/PlatformMembershipRequestSerializer.md +11 -0
  31. data/docs/PlatformSerializer.md +30 -0
  32. data/docs/PlatformSummarySerializer.md +10 -0
  33. data/docs/PlatformsApi.md +1369 -0
  34. data/docs/RebateSerializer.md +15 -0
  35. data/docs/RebatesApi.md +98 -0
  36. data/docs/ReceivablesSerializer.md +9 -0
  37. data/docs/TaxSavingsSerializer.md +10 -0
  38. data/docs/UserAccountSerializer.md +17 -0
  39. data/docs/UserCashoutSerializer.md +20 -0
  40. data/docs/UserIncomeRequestSerializer.md +15 -0
  41. data/docs/UserPlatformMembershipRequestSerializer.md +13 -0
  42. data/docs/UserSerializer.md +40 -0
  43. data/docs/UsersApi.md +2173 -0
  44. data/docs/WriteAccountSerializer.md +16 -0
  45. data/docs/WriteCashoutCalculationSerializer.md +8 -0
  46. data/docs/WriteCashoutSerializer.md +16 -0
  47. data/docs/WriteCashoutSliceSerializer.md +11 -0
  48. data/docs/WriteCompanyInformationSerializer.md +17 -0
  49. data/docs/WriteContactInfoSerializer.md +10 -0
  50. data/docs/WriteContactInformationSerializer.md +15 -0
  51. data/docs/WriteContractorSerializer.md +14 -0
  52. data/docs/WriteIncomeNestedSerializer.md +12 -0
  53. data/docs/WriteIncomeSerializer.md +13 -0
  54. data/docs/WriteIncomeSerializerFixedSource.md +12 -0
  55. data/docs/WriteInvoiceSerializer.md +13 -0
  56. data/docs/WriteInvoiceSerializerFixedSourceCreate.md +9 -0
  57. data/docs/WriteJSONWebTokenSerializer.md +7 -0
  58. data/docs/WriteManagerPlatformSerializer.md +15 -0
  59. data/docs/WriteManagerSerializer.md +8 -0
  60. data/docs/WriteMembershipSerializer.md +8 -0
  61. data/docs/WritePersonalInformationSerializer.md +16 -0
  62. data/docs/WritePlaidPublicTokenSerializer.md +8 -0
  63. data/docs/WritePlatformIncomeRequestSerializer.md +10 -0
  64. data/docs/WritePlatformMembershipRequestSerializer.md +7 -0
  65. data/docs/WritePlatformSerializer.md +19 -0
  66. data/docs/WritePlatformSummarySerializer.md +8 -0
  67. data/docs/WriteRebateSerializer.md +9 -0
  68. data/docs/WriteReceivablesSerializer.md +8 -0
  69. data/docs/WriteTaxSavingsSerializer.md +8 -0
  70. data/docs/WriteUserAccountSerializer.md +14 -0
  71. data/docs/WriteUserCashoutSerializer.md +15 -0
  72. data/docs/WriteUserIncomeRequestSerializer.md +10 -0
  73. data/docs/WriteUserPlatformMembershipRequestSerializer.md +9 -0
  74. data/docs/WriteUserSerializer.md +21 -0
  75. data/generate-client.sh +6 -0
  76. data/lib/qwil_api/api/accounts_api.rb +320 -0
  77. data/lib/qwil_api/api/apitokenauth_api.rb +87 -0
  78. data/lib/qwil_api/api/cashouts_api.rb +89 -0
  79. data/lib/qwil_api/api/income_api.rb +142 -0
  80. data/lib/qwil_api/api/invoices_api.rb +142 -0
  81. data/lib/qwil_api/api/managers_api.rb +237 -0
  82. data/lib/qwil_api/api/memberships_api.rb +89 -0
  83. data/lib/qwil_api/api/platforms_api.rb +1674 -0
  84. data/lib/qwil_api/api/rebates_api.rb +142 -0
  85. data/lib/qwil_api/api/users_api.rb +2672 -0
  86. data/lib/qwil_api/api_client.rb +376 -0
  87. data/lib/qwil_api/api_error.rb +45 -0
  88. data/lib/qwil_api/configuration.rb +205 -0
  89. data/lib/qwil_api/models/account_serializer.rb +370 -0
  90. data/lib/qwil_api/models/cashout_calculation_serializer.rb +221 -0
  91. data/lib/qwil_api/models/cashout_serializer.rb +379 -0
  92. data/lib/qwil_api/models/cashout_slice_serializer.rb +232 -0
  93. data/lib/qwil_api/models/company_information_serializer.rb +299 -0
  94. data/lib/qwil_api/models/contact_info_serializer.rb +218 -0
  95. data/lib/qwil_api/models/contact_information_serializer.rb +280 -0
  96. data/lib/qwil_api/models/contractor_serializer.rb +361 -0
  97. data/lib/qwil_api/models/income_nested_serializer.rb +302 -0
  98. data/lib/qwil_api/models/income_serializer.rb +302 -0
  99. data/lib/qwil_api/models/income_serializer_fixed_source.rb +302 -0
  100. data/lib/qwil_api/models/invoice_serializer.rb +299 -0
  101. data/lib/qwil_api/models/invoice_serializer_fixed_source_create.rb +299 -0
  102. data/lib/qwil_api/models/json_web_token_serializer.rb +188 -0
  103. data/lib/qwil_api/models/manager_platform_serializer.rb +391 -0
  104. data/lib/qwil_api/models/manager_serializer.rb +218 -0
  105. data/lib/qwil_api/models/membership_serializer.rb +208 -0
  106. data/lib/qwil_api/models/personal_information_serializer.rb +279 -0
  107. data/lib/qwil_api/models/plaid_public_token_serializer.rb +199 -0
  108. data/lib/qwil_api/models/platform_income_request_serializer.rb +307 -0
  109. data/lib/qwil_api/models/platform_membership_request_serializer.rb +262 -0
  110. data/lib/qwil_api/models/platform_serializer.rb +480 -0
  111. data/lib/qwil_api/models/platform_summary_serializer.rb +218 -0
  112. data/lib/qwil_api/models/rebate_serializer.rb +276 -0
  113. data/lib/qwil_api/models/receivables_serializer.rb +208 -0
  114. data/lib/qwil_api/models/tax_savings_serializer.rb +219 -0
  115. data/lib/qwil_api/models/user_account_serializer.rb +359 -0
  116. data/lib/qwil_api/models/user_cashout_serializer.rb +379 -0
  117. data/lib/qwil_api/models/user_income_request_serializer.rb +307 -0
  118. data/lib/qwil_api/models/user_platform_membership_request_serializer.rb +283 -0
  119. data/lib/qwil_api/models/user_serializer.rb +592 -0
  120. data/lib/qwil_api/models/write_account_serializer.rb +331 -0
  121. data/lib/qwil_api/models/write_cashout_calculation_serializer.rb +198 -0
  122. data/lib/qwil_api/models/write_cashout_serializer.rb +316 -0
  123. data/lib/qwil_api/models/write_cashout_slice_serializer.rb +232 -0
  124. data/lib/qwil_api/models/write_company_information_serializer.rb +280 -0
  125. data/lib/qwil_api/models/write_contact_info_serializer.rb +218 -0
  126. data/lib/qwil_api/models/write_contact_information_serializer.rb +262 -0
  127. data/lib/qwil_api/models/write_contractor_serializer.rb +289 -0
  128. data/lib/qwil_api/models/write_income_nested_serializer.rb +236 -0
  129. data/lib/qwil_api/models/write_income_serializer.rb +247 -0
  130. data/lib/qwil_api/models/write_income_serializer_fixed_source.rb +236 -0
  131. data/lib/qwil_api/models/write_invoice_serializer.rb +252 -0
  132. data/lib/qwil_api/models/write_invoice_serializer_fixed_source_create.rb +210 -0
  133. data/lib/qwil_api/models/write_json_web_token_serializer.rb +188 -0
  134. data/lib/qwil_api/models/write_manager_platform_serializer.rb +314 -0
  135. data/lib/qwil_api/models/write_manager_serializer.rb +198 -0
  136. data/lib/qwil_api/models/write_membership_serializer.rb +198 -0
  137. data/lib/qwil_api/models/write_personal_information_serializer.rb +270 -0
  138. data/lib/qwil_api/models/write_plaid_public_token_serializer.rb +199 -0
  139. data/lib/qwil_api/models/write_platform_income_request_serializer.rb +220 -0
  140. data/lib/qwil_api/models/write_platform_membership_request_serializer.rb +188 -0
  141. data/lib/qwil_api/models/write_platform_serializer.rb +309 -0
  142. data/lib/qwil_api/models/write_platform_summary_serializer.rb +198 -0
  143. data/lib/qwil_api/models/write_rebate_serializer.rb +209 -0
  144. data/lib/qwil_api/models/write_receivables_serializer.rb +198 -0
  145. data/lib/qwil_api/models/write_tax_savings_serializer.rb +198 -0
  146. data/lib/qwil_api/models/write_user_account_serializer.rb +312 -0
  147. data/lib/qwil_api/models/write_user_cashout_serializer.rb +307 -0
  148. data/lib/qwil_api/models/write_user_income_request_serializer.rb +220 -0
  149. data/lib/qwil_api/models/write_user_platform_membership_request_serializer.rb +208 -0
  150. data/lib/qwil_api/models/write_user_serializer.rb +358 -0
  151. data/lib/qwil_api/version.rb +24 -0
  152. data/lib/qwil_api.rb +51 -0
  153. data/qwil_api.gemspec +53 -0
  154. data/spec/api/accounts_api_spec.rb +110 -0
  155. data/spec/api/apitokenauth_api_spec.rb +56 -0
  156. data/spec/api/cashouts_api_spec.rb +56 -0
  157. data/spec/api/income_api_spec.rb +67 -0
  158. data/spec/api/invoices_api_spec.rb +67 -0
  159. data/spec/api/managers_api_spec.rb +88 -0
  160. data/spec/api/memberships_api_spec.rb +56 -0
  161. data/spec/api/platforms_api_spec.rb +398 -0
  162. data/spec/api/rebates_api_spec.rb +67 -0
  163. data/spec/api/users_api_spec.rb +625 -0
  164. data/spec/api_client_spec.rb +235 -0
  165. data/spec/configuration_spec.rb +51 -0
  166. data/spec/models/account_serializer_spec.rb +111 -0
  167. data/spec/models/cashout_calculation_serializer_spec.rb +63 -0
  168. data/spec/models/cashout_serializer_spec.rb +135 -0
  169. data/spec/models/cashout_slice_serializer_spec.rb +69 -0
  170. data/spec/models/company_information_serializer_spec.rb +111 -0
  171. data/spec/models/contact_info_serializer_spec.rb +63 -0
  172. data/spec/models/contact_information_serializer_spec.rb +99 -0
  173. data/spec/models/contractor_serializer_spec.rb +127 -0
  174. data/spec/models/income_nested_serializer_spec.rb +111 -0
  175. data/spec/models/income_serializer_fixed_source_spec.rb +111 -0
  176. data/spec/models/income_serializer_spec.rb +111 -0
  177. data/spec/models/invoice_serializer_fixed_source_create_spec.rb +105 -0
  178. data/spec/models/invoice_serializer_spec.rb +105 -0
  179. data/spec/models/json_web_token_serializer_spec.rb +45 -0
  180. data/spec/models/manager_platform_serializer_spec.rb +143 -0
  181. data/spec/models/manager_serializer_spec.rb +63 -0
  182. data/spec/models/membership_serializer_spec.rb +57 -0
  183. data/spec/models/personal_information_serializer_spec.rb +99 -0
  184. data/spec/models/plaid_public_token_serializer_spec.rb +51 -0
  185. data/spec/models/platform_income_request_serializer_spec.rb +97 -0
  186. data/spec/models/platform_membership_request_serializer_spec.rb +73 -0
  187. data/spec/models/platform_serializer_spec.rb +191 -0
  188. data/spec/models/platform_summary_serializer_spec.rb +63 -0
  189. data/spec/models/rebate_serializer_spec.rb +93 -0
  190. data/spec/models/receivables_serializer_spec.rb +57 -0
  191. data/spec/models/tax_savings_serializer_spec.rb +63 -0
  192. data/spec/models/user_account_serializer_spec.rb +105 -0
  193. data/spec/models/user_cashout_serializer_spec.rb +135 -0
  194. data/spec/models/user_income_request_serializer_spec.rb +97 -0
  195. data/spec/models/user_platform_membership_request_serializer_spec.rb +85 -0
  196. data/spec/models/user_serializer_spec.rb +251 -0
  197. data/spec/models/write_account_serializer_spec.rb +99 -0
  198. data/spec/models/write_cashout_calculation_serializer_spec.rb +51 -0
  199. data/spec/models/write_cashout_serializer_spec.rb +107 -0
  200. data/spec/models/write_cashout_slice_serializer_spec.rb +69 -0
  201. data/spec/models/write_company_information_serializer_spec.rb +105 -0
  202. data/spec/models/write_contact_info_serializer_spec.rb +63 -0
  203. data/spec/models/write_contact_information_serializer_spec.rb +93 -0
  204. data/spec/models/write_contractor_serializer_spec.rb +91 -0
  205. data/spec/models/write_income_nested_serializer_spec.rb +75 -0
  206. data/spec/models/write_income_serializer_fixed_source_spec.rb +75 -0
  207. data/spec/models/write_income_serializer_spec.rb +81 -0
  208. data/spec/models/write_invoice_serializer_fixed_source_create_spec.rb +57 -0
  209. data/spec/models/write_invoice_serializer_spec.rb +81 -0
  210. data/spec/models/write_json_web_token_serializer_spec.rb +45 -0
  211. data/spec/models/write_manager_platform_serializer_spec.rb +101 -0
  212. data/spec/models/write_manager_serializer_spec.rb +51 -0
  213. data/spec/models/write_membership_serializer_spec.rb +51 -0
  214. data/spec/models/write_personal_information_serializer_spec.rb +99 -0
  215. data/spec/models/write_plaid_public_token_serializer_spec.rb +51 -0
  216. data/spec/models/write_platform_income_request_serializer_spec.rb +63 -0
  217. data/spec/models/write_platform_membership_request_serializer_spec.rb +45 -0
  218. data/spec/models/write_platform_serializer_spec.rb +117 -0
  219. data/spec/models/write_platform_summary_serializer_spec.rb +51 -0
  220. data/spec/models/write_rebate_serializer_spec.rb +57 -0
  221. data/spec/models/write_receivables_serializer_spec.rb +51 -0
  222. data/spec/models/write_tax_savings_serializer_spec.rb +51 -0
  223. data/spec/models/write_user_account_serializer_spec.rb +87 -0
  224. data/spec/models/write_user_cashout_serializer_spec.rb +101 -0
  225. data/spec/models/write_user_income_request_serializer_spec.rb +63 -0
  226. data/spec/models/write_user_platform_membership_request_serializer_spec.rb +57 -0
  227. data/spec/models/write_user_serializer_spec.rb +133 -0
  228. data/spec/spec_helper.rb +120 -0
  229. data/swagger-codegen-config.json +9 -0
  230. metadata +527 -0
@@ -0,0 +1,379 @@
1
+ =begin
2
+ #No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
3
+
4
+ OpenAPI spec version:
5
+
6
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
7
+
8
+ Licensed under the Apache License, Version 2.0 (the "License");
9
+ you may not use this file except in compliance with the License.
10
+ You may obtain a copy of the License at
11
+
12
+ http://www.apache.org/licenses/LICENSE-2.0
13
+
14
+ Unless required by applicable law or agreed to in writing, software
15
+ distributed under the License is distributed on an "AS IS" BASIS,
16
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ See the License for the specific language governing permissions and
18
+ limitations under the License.
19
+
20
+ =end
21
+
22
+ require 'date'
23
+
24
+ module QwilAPI
25
+
26
+ class UserCashoutSerializer
27
+ attr_accessor :url
28
+
29
+ attr_accessor :amount
30
+
31
+ attr_accessor :fee
32
+
33
+ attr_accessor :cashout_time
34
+
35
+ attr_accessor :notes
36
+
37
+ attr_accessor :type
38
+
39
+ attr_accessor :method
40
+
41
+ attr_accessor :status
42
+
43
+ attr_accessor :transmit_time
44
+
45
+ attr_accessor :user
46
+
47
+ # The Rebate against which this Cashout will be collected.
48
+ attr_accessor :rebate
49
+
50
+ attr_accessor :account
51
+
52
+ # The Incomes that fund this Cashout.
53
+ attr_accessor :incomes
54
+
55
+ class EnumAttributeValidator
56
+ attr_reader :datatype
57
+ attr_reader :allowable_values
58
+
59
+ def initialize(datatype, allowable_values)
60
+ @allowable_values = allowable_values.map do |value|
61
+ case datatype.to_s
62
+ when /Integer/i
63
+ value.to_i
64
+ when /Float/i
65
+ value.to_f
66
+ else
67
+ value
68
+ end
69
+ end
70
+ end
71
+
72
+ def valid?(value)
73
+ !value || allowable_values.include?(value)
74
+ end
75
+ end
76
+
77
+ # Attribute mapping from ruby-style variable name to JSON key.
78
+ def self.attribute_map
79
+ {
80
+ :'url' => :'url',
81
+ :'amount' => :'amount',
82
+ :'fee' => :'fee',
83
+ :'cashout_time' => :'cashout_time',
84
+ :'notes' => :'notes',
85
+ :'type' => :'type',
86
+ :'method' => :'method',
87
+ :'status' => :'status',
88
+ :'transmit_time' => :'transmit_time',
89
+ :'user' => :'user',
90
+ :'rebate' => :'rebate',
91
+ :'account' => :'account',
92
+ :'incomes' => :'incomes'
93
+ }
94
+ end
95
+
96
+ # Attribute type mapping.
97
+ def self.swagger_types
98
+ {
99
+ :'url' => :'String',
100
+ :'amount' => :'String',
101
+ :'fee' => :'String',
102
+ :'cashout_time' => :'DateTime',
103
+ :'notes' => :'String',
104
+ :'type' => :'String',
105
+ :'method' => :'String',
106
+ :'status' => :'String',
107
+ :'transmit_time' => :'DateTime',
108
+ :'user' => :'String',
109
+ :'rebate' => :'String',
110
+ :'account' => :'String',
111
+ :'incomes' => :'Array<String>'
112
+ }
113
+ end
114
+
115
+ # Initializes the object
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ def initialize(attributes = {})
118
+ return unless attributes.is_a?(Hash)
119
+
120
+ # convert string to symbol for hash key
121
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
122
+
123
+ if attributes.has_key?(:'url')
124
+ self.url = attributes[:'url']
125
+ end
126
+
127
+ if attributes.has_key?(:'amount')
128
+ self.amount = attributes[:'amount']
129
+ end
130
+
131
+ if attributes.has_key?(:'fee')
132
+ self.fee = attributes[:'fee']
133
+ end
134
+
135
+ if attributes.has_key?(:'cashout_time')
136
+ self.cashout_time = attributes[:'cashout_time']
137
+ end
138
+
139
+ if attributes.has_key?(:'notes')
140
+ self.notes = attributes[:'notes']
141
+ end
142
+
143
+ if attributes.has_key?(:'type')
144
+ self.type = attributes[:'type']
145
+ end
146
+
147
+ if attributes.has_key?(:'method')
148
+ self.method = attributes[:'method']
149
+ end
150
+
151
+ if attributes.has_key?(:'status')
152
+ self.status = attributes[:'status']
153
+ end
154
+
155
+ if attributes.has_key?(:'transmit_time')
156
+ self.transmit_time = attributes[:'transmit_time']
157
+ end
158
+
159
+ if attributes.has_key?(:'user')
160
+ self.user = attributes[:'user']
161
+ end
162
+
163
+ if attributes.has_key?(:'rebate')
164
+ self.rebate = attributes[:'rebate']
165
+ end
166
+
167
+ if attributes.has_key?(:'account')
168
+ self.account = attributes[:'account']
169
+ end
170
+
171
+ if attributes.has_key?(:'incomes')
172
+ if (value = attributes[:'incomes']).is_a?(Array)
173
+ self.incomes = value
174
+ end
175
+ end
176
+
177
+ end
178
+
179
+ # Show invalid properties with the reasons. Usually used together with valid?
180
+ # @return Array for valid properies with the reasons
181
+ def list_invalid_properties
182
+ invalid_properties = Array.new
183
+ return invalid_properties
184
+ end
185
+
186
+ # Check to see if the all the properties in the model are valid
187
+ # @return true if the model is valid
188
+ def valid?
189
+ return false if @url.nil?
190
+ return false if @amount.nil?
191
+ return false if @fee.nil?
192
+ return false if @cashout_time.nil?
193
+ return false if @notes.nil?
194
+ return false if @type.nil?
195
+ type_validator = EnumAttributeValidator.new('String', ["CASHOUT", "DEBIT", "REBATE"])
196
+ return false unless type_validator.valid?(@type)
197
+ return false if @method.nil?
198
+ method_validator = EnumAttributeValidator.new('String', ["ACH", "CHECK", "WIRE", "PAYPAL"])
199
+ return false unless method_validator.valid?(@method)
200
+ return false if @status.nil?
201
+ status_validator = EnumAttributeValidator.new('String', ["REQUESTED", "PENDING", "COMPLETED", "REJECTED"])
202
+ return false unless status_validator.valid?(@status)
203
+ return false if @transmit_time.nil?
204
+ return false if @user.nil?
205
+ return false if @rebate.nil?
206
+ return false if @account.nil?
207
+ return false if @incomes.nil?
208
+ return true
209
+ end
210
+
211
+ # Custom attribute writer method checking allowed values (enum).
212
+ # @param [Object] type Object to be assigned
213
+ def type=(type)
214
+ validator = EnumAttributeValidator.new('String', ["CASHOUT", "DEBIT", "REBATE"])
215
+ unless validator.valid?(type)
216
+ fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
217
+ end
218
+ @type = type
219
+ end
220
+
221
+ # Custom attribute writer method checking allowed values (enum).
222
+ # @param [Object] method Object to be assigned
223
+ def method=(method)
224
+ validator = EnumAttributeValidator.new('String', ["ACH", "CHECK", "WIRE", "PAYPAL"])
225
+ unless validator.valid?(method)
226
+ fail ArgumentError, "invalid value for 'method', must be one of #{validator.allowable_values}."
227
+ end
228
+ @method = method
229
+ end
230
+
231
+ # Custom attribute writer method checking allowed values (enum).
232
+ # @param [Object] status Object to be assigned
233
+ def status=(status)
234
+ validator = EnumAttributeValidator.new('String', ["REQUESTED", "PENDING", "COMPLETED", "REJECTED"])
235
+ unless validator.valid?(status)
236
+ fail ArgumentError, "invalid value for 'status', must be one of #{validator.allowable_values}."
237
+ end
238
+ @status = status
239
+ end
240
+
241
+ # Checks equality by comparing each attribute.
242
+ # @param [Object] Object to be compared
243
+ def ==(o)
244
+ return true if self.equal?(o)
245
+ self.class == o.class &&
246
+ url == o.url &&
247
+ amount == o.amount &&
248
+ fee == o.fee &&
249
+ cashout_time == o.cashout_time &&
250
+ notes == o.notes &&
251
+ type == o.type &&
252
+ method == o.method &&
253
+ status == o.status &&
254
+ transmit_time == o.transmit_time &&
255
+ user == o.user &&
256
+ rebate == o.rebate &&
257
+ account == o.account &&
258
+ incomes == o.incomes
259
+ end
260
+
261
+ # @see the `==` method
262
+ # @param [Object] Object to be compared
263
+ def eql?(o)
264
+ self == o
265
+ end
266
+
267
+ # Calculates hash code according to all attributes.
268
+ # @return [Fixnum] Hash code
269
+ def hash
270
+ [url, amount, fee, cashout_time, notes, type, method, status, transmit_time, user, rebate, account, incomes].hash
271
+ end
272
+
273
+ # Builds the object from hash
274
+ # @param [Hash] attributes Model attributes in the form of hash
275
+ # @return [Object] Returns the model itself
276
+ def build_from_hash(attributes)
277
+ return nil unless attributes.is_a?(Hash)
278
+ self.class.swagger_types.each_pair do |key, type|
279
+ if type =~ /^Array<(.*)>/i
280
+ # check to ensure the input is an array given that the the attribute
281
+ # is documented as an array but the input is not
282
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
283
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
284
+ end
285
+ elsif !attributes[self.class.attribute_map[key]].nil?
286
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
287
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
288
+ end
289
+
290
+ self
291
+ end
292
+
293
+ # Deserializes the data based on type
294
+ # @param string type Data type
295
+ # @param string value Value to be deserialized
296
+ # @return [Object] Deserialized data
297
+ def _deserialize(type, value)
298
+ case type.to_sym
299
+ when :DateTime
300
+ DateTime.parse(value)
301
+ when :Date
302
+ Date.parse(value)
303
+ when :String
304
+ value.to_s
305
+ when :Integer
306
+ value.to_i
307
+ when :Float
308
+ value.to_f
309
+ when :BOOLEAN
310
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
311
+ true
312
+ else
313
+ false
314
+ end
315
+ when :Object
316
+ # generic object (usually a Hash), return directly
317
+ value
318
+ when /\AArray<(?<inner_type>.+)>\z/
319
+ inner_type = Regexp.last_match[:inner_type]
320
+ value.map { |v| _deserialize(inner_type, v) }
321
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
322
+ k_type = Regexp.last_match[:k_type]
323
+ v_type = Regexp.last_match[:v_type]
324
+ {}.tap do |hash|
325
+ value.each do |k, v|
326
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
327
+ end
328
+ end
329
+ else # model
330
+ temp_model = QwilAPI.const_get(type).new
331
+ temp_model.build_from_hash(value)
332
+ end
333
+ end
334
+
335
+ # Returns the string representation of the object
336
+ # @return [String] String presentation of the object
337
+ def to_s
338
+ to_hash.to_s
339
+ end
340
+
341
+ # to_body is an alias to to_hash (backward compatibility)
342
+ # @return [Hash] Returns the object in the form of hash
343
+ def to_body
344
+ to_hash
345
+ end
346
+
347
+ # Returns the object in the form of hash
348
+ # @return [Hash] Returns the object in the form of hash
349
+ def to_hash
350
+ hash = {}
351
+ self.class.attribute_map.each_pair do |attr, param|
352
+ value = self.send(attr)
353
+ next if value.nil?
354
+ hash[param] = _to_hash(value)
355
+ end
356
+ hash
357
+ end
358
+
359
+ # Outputs non-array value in the form of hash
360
+ # For object, use to_hash. Otherwise, just return the value
361
+ # @param [Object] value Any valid value
362
+ # @return [Hash] Returns the value in the form of hash
363
+ def _to_hash(value)
364
+ if value.is_a?(Array)
365
+ value.compact.map{ |v| _to_hash(v) }
366
+ elsif value.is_a?(Hash)
367
+ {}.tap do |hash|
368
+ value.each { |k, v| hash[k] = _to_hash(v) }
369
+ end
370
+ elsif value.respond_to? :to_hash
371
+ value.to_hash
372
+ else
373
+ value
374
+ end
375
+ end
376
+
377
+ end
378
+
379
+ end
@@ -0,0 +1,307 @@
1
+ =begin
2
+ #No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
3
+
4
+ OpenAPI spec version:
5
+
6
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
7
+
8
+ Licensed under the Apache License, Version 2.0 (the "License");
9
+ you may not use this file except in compliance with the License.
10
+ You may obtain a copy of the License at
11
+
12
+ http://www.apache.org/licenses/LICENSE-2.0
13
+
14
+ Unless required by applicable law or agreed to in writing, software
15
+ distributed under the License is distributed on an "AS IS" BASIS,
16
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ See the License for the specific language governing permissions and
18
+ limitations under the License.
19
+
20
+ =end
21
+
22
+ require 'date'
23
+
24
+ module QwilAPI
25
+
26
+ class UserIncomeRequestSerializer
27
+ attr_accessor :url
28
+
29
+ attr_accessor :actions
30
+
31
+ # The status of the income request.
32
+ attr_accessor :status
33
+
34
+ # The dollar value of income requested by the User
35
+ attr_accessor :amount
36
+
37
+ # Text visible to the Platform and User describing the Income Request
38
+ attr_accessor :note
39
+
40
+ # The time the IncomeRequest was submitted by the User
41
+ attr_accessor :request_time
42
+
43
+ # The platform that the User is requesting Income from.
44
+ attr_accessor :platform
45
+
46
+ # The resulting Income
47
+ attr_accessor :income
48
+
49
+ class EnumAttributeValidator
50
+ attr_reader :datatype
51
+ attr_reader :allowable_values
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
65
+
66
+ def valid?(value)
67
+ !value || allowable_values.include?(value)
68
+ end
69
+ end
70
+
71
+ # Attribute mapping from ruby-style variable name to JSON key.
72
+ def self.attribute_map
73
+ {
74
+ :'url' => :'url',
75
+ :'actions' => :'actions',
76
+ :'status' => :'status',
77
+ :'amount' => :'amount',
78
+ :'note' => :'note',
79
+ :'request_time' => :'request_time',
80
+ :'platform' => :'platform',
81
+ :'income' => :'income'
82
+ }
83
+ end
84
+
85
+ # Attribute type mapping.
86
+ def self.swagger_types
87
+ {
88
+ :'url' => :'String',
89
+ :'actions' => :'String',
90
+ :'status' => :'String',
91
+ :'amount' => :'String',
92
+ :'note' => :'String',
93
+ :'request_time' => :'DateTime',
94
+ :'platform' => :'String',
95
+ :'income' => :'String'
96
+ }
97
+ end
98
+
99
+ # Initializes the object
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ def initialize(attributes = {})
102
+ return unless attributes.is_a?(Hash)
103
+
104
+ # convert string to symbol for hash key
105
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
106
+
107
+ if attributes.has_key?(:'url')
108
+ self.url = attributes[:'url']
109
+ end
110
+
111
+ if attributes.has_key?(:'actions')
112
+ self.actions = attributes[:'actions']
113
+ end
114
+
115
+ if attributes.has_key?(:'status')
116
+ self.status = attributes[:'status']
117
+ end
118
+
119
+ if attributes.has_key?(:'amount')
120
+ self.amount = attributes[:'amount']
121
+ end
122
+
123
+ if attributes.has_key?(:'note')
124
+ self.note = attributes[:'note']
125
+ end
126
+
127
+ if attributes.has_key?(:'request_time')
128
+ self.request_time = attributes[:'request_time']
129
+ end
130
+
131
+ if attributes.has_key?(:'platform')
132
+ self.platform = attributes[:'platform']
133
+ end
134
+
135
+ if attributes.has_key?(:'income')
136
+ self.income = attributes[:'income']
137
+ end
138
+
139
+ end
140
+
141
+ # Show invalid properties with the reasons. Usually used together with valid?
142
+ # @return Array for valid properies with the reasons
143
+ def list_invalid_properties
144
+ invalid_properties = Array.new
145
+ return invalid_properties
146
+ end
147
+
148
+ # Check to see if the all the properties in the model are valid
149
+ # @return true if the model is valid
150
+ def valid?
151
+ return false if @url.nil?
152
+ return false if @actions.nil?
153
+ return false if @status.nil?
154
+ status_validator = EnumAttributeValidator.new('String', ["PENDING", "ACCEPTED", "DENIED", "CANCELLED"])
155
+ return false unless status_validator.valid?(@status)
156
+ return false if @amount.nil?
157
+ return false if @note.nil?
158
+ return false if @request_time.nil?
159
+ return false if @platform.nil?
160
+ return false if @income.nil?
161
+ return true
162
+ end
163
+
164
+ # Custom attribute writer method checking allowed values (enum).
165
+ # @param [Object] status Object to be assigned
166
+ def status=(status)
167
+ validator = EnumAttributeValidator.new('String', ["PENDING", "ACCEPTED", "DENIED", "CANCELLED"])
168
+ unless validator.valid?(status)
169
+ fail ArgumentError, "invalid value for 'status', must be one of #{validator.allowable_values}."
170
+ end
171
+ @status = status
172
+ end
173
+
174
+ # Checks equality by comparing each attribute.
175
+ # @param [Object] Object to be compared
176
+ def ==(o)
177
+ return true if self.equal?(o)
178
+ self.class == o.class &&
179
+ url == o.url &&
180
+ actions == o.actions &&
181
+ status == o.status &&
182
+ amount == o.amount &&
183
+ note == o.note &&
184
+ request_time == o.request_time &&
185
+ platform == o.platform &&
186
+ income == o.income
187
+ end
188
+
189
+ # @see the `==` method
190
+ # @param [Object] Object to be compared
191
+ def eql?(o)
192
+ self == o
193
+ end
194
+
195
+ # Calculates hash code according to all attributes.
196
+ # @return [Fixnum] Hash code
197
+ def hash
198
+ [url, actions, status, amount, note, request_time, platform, income].hash
199
+ end
200
+
201
+ # Builds the object from hash
202
+ # @param [Hash] attributes Model attributes in the form of hash
203
+ # @return [Object] Returns the model itself
204
+ def build_from_hash(attributes)
205
+ return nil unless attributes.is_a?(Hash)
206
+ self.class.swagger_types.each_pair do |key, type|
207
+ if type =~ /^Array<(.*)>/i
208
+ # check to ensure the input is an array given that the the attribute
209
+ # is documented as an array but the input is not
210
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
211
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
212
+ end
213
+ elsif !attributes[self.class.attribute_map[key]].nil?
214
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
215
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
216
+ end
217
+
218
+ self
219
+ end
220
+
221
+ # Deserializes the data based on type
222
+ # @param string type Data type
223
+ # @param string value Value to be deserialized
224
+ # @return [Object] Deserialized data
225
+ def _deserialize(type, value)
226
+ case type.to_sym
227
+ when :DateTime
228
+ DateTime.parse(value)
229
+ when :Date
230
+ Date.parse(value)
231
+ when :String
232
+ value.to_s
233
+ when :Integer
234
+ value.to_i
235
+ when :Float
236
+ value.to_f
237
+ when :BOOLEAN
238
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
239
+ true
240
+ else
241
+ false
242
+ end
243
+ when :Object
244
+ # generic object (usually a Hash), return directly
245
+ value
246
+ when /\AArray<(?<inner_type>.+)>\z/
247
+ inner_type = Regexp.last_match[:inner_type]
248
+ value.map { |v| _deserialize(inner_type, v) }
249
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
250
+ k_type = Regexp.last_match[:k_type]
251
+ v_type = Regexp.last_match[:v_type]
252
+ {}.tap do |hash|
253
+ value.each do |k, v|
254
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
255
+ end
256
+ end
257
+ else # model
258
+ temp_model = QwilAPI.const_get(type).new
259
+ temp_model.build_from_hash(value)
260
+ end
261
+ end
262
+
263
+ # Returns the string representation of the object
264
+ # @return [String] String presentation of the object
265
+ def to_s
266
+ to_hash.to_s
267
+ end
268
+
269
+ # to_body is an alias to to_hash (backward compatibility)
270
+ # @return [Hash] Returns the object in the form of hash
271
+ def to_body
272
+ to_hash
273
+ end
274
+
275
+ # Returns the object in the form of hash
276
+ # @return [Hash] Returns the object in the form of hash
277
+ def to_hash
278
+ hash = {}
279
+ self.class.attribute_map.each_pair do |attr, param|
280
+ value = self.send(attr)
281
+ next if value.nil?
282
+ hash[param] = _to_hash(value)
283
+ end
284
+ hash
285
+ end
286
+
287
+ # Outputs non-array value in the form of hash
288
+ # For object, use to_hash. Otherwise, just return the value
289
+ # @param [Object] value Any valid value
290
+ # @return [Hash] Returns the value in the form of hash
291
+ def _to_hash(value)
292
+ if value.is_a?(Array)
293
+ value.compact.map{ |v| _to_hash(v) }
294
+ elsif value.is_a?(Hash)
295
+ {}.tap do |hash|
296
+ value.each { |k, v| hash[k] = _to_hash(v) }
297
+ end
298
+ elsif value.respond_to? :to_hash
299
+ value.to_hash
300
+ else
301
+ value
302
+ end
303
+ end
304
+
305
+ end
306
+
307
+ end