qwil_api 0.1.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 (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,358 @@
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 WriteUserSerializer
27
+ attr_accessor :email
28
+
29
+ # First name, if the user is an individual. Leave blank if this user is a company.
30
+ attr_accessor :first_name
31
+
32
+ # Last name, if the user is an individual. Leave blank if this user is a company.
33
+ attr_accessor :last_name
34
+
35
+ # Business name. Only use this field if this user is a business entity.
36
+ attr_accessor :business_name
37
+
38
+ attr_accessor :contractor_type
39
+
40
+ # Default account to use for payment of unpaid income.
41
+ attr_accessor :default_account
42
+
43
+ # Account to use for tax savings.
44
+ attr_accessor :tax_savings_account
45
+
46
+ # The percent of income to be withheld for tax savings purposes.
47
+ attr_accessor :tax_savings_percent
48
+
49
+ # Feature flag specifying if Plaid integration should be used.
50
+ attr_accessor :use_plaid
51
+
52
+ # Feature flag specifying if IncomeRequests should be enabled for this user.
53
+ attr_accessor :use_income_requests
54
+
55
+ # Feature flag specifying if tax savings should be enabled.
56
+ attr_accessor :use_tax_savings
57
+
58
+ # Whether or not all income should be immediately cashed out for this user.
59
+ attr_accessor :is_auto_cashout_enabled
60
+
61
+ attr_accessor :password
62
+
63
+ attr_accessor :personal_information
64
+
65
+ class EnumAttributeValidator
66
+ attr_reader :datatype
67
+ attr_reader :allowable_values
68
+
69
+ def initialize(datatype, allowable_values)
70
+ @allowable_values = allowable_values.map do |value|
71
+ case datatype.to_s
72
+ when /Integer/i
73
+ value.to_i
74
+ when /Float/i
75
+ value.to_f
76
+ else
77
+ value
78
+ end
79
+ end
80
+ end
81
+
82
+ def valid?(value)
83
+ !value || allowable_values.include?(value)
84
+ end
85
+ end
86
+
87
+ # Attribute mapping from ruby-style variable name to JSON key.
88
+ def self.attribute_map
89
+ {
90
+ :'email' => :'email',
91
+ :'first_name' => :'first_name',
92
+ :'last_name' => :'last_name',
93
+ :'business_name' => :'business_name',
94
+ :'contractor_type' => :'contractor_type',
95
+ :'default_account' => :'default_account',
96
+ :'tax_savings_account' => :'tax_savings_account',
97
+ :'tax_savings_percent' => :'tax_savings_percent',
98
+ :'use_plaid' => :'use_plaid',
99
+ :'use_income_requests' => :'use_income_requests',
100
+ :'use_tax_savings' => :'use_tax_savings',
101
+ :'is_auto_cashout_enabled' => :'is_auto_cashout_enabled',
102
+ :'password' => :'password',
103
+ :'personal_information' => :'personal_information'
104
+ }
105
+ end
106
+
107
+ # Attribute type mapping.
108
+ def self.swagger_types
109
+ {
110
+ :'email' => :'String',
111
+ :'first_name' => :'String',
112
+ :'last_name' => :'String',
113
+ :'business_name' => :'String',
114
+ :'contractor_type' => :'String',
115
+ :'default_account' => :'String',
116
+ :'tax_savings_account' => :'String',
117
+ :'tax_savings_percent' => :'String',
118
+ :'use_plaid' => :'BOOLEAN',
119
+ :'use_income_requests' => :'BOOLEAN',
120
+ :'use_tax_savings' => :'BOOLEAN',
121
+ :'is_auto_cashout_enabled' => :'BOOLEAN',
122
+ :'password' => :'String',
123
+ :'personal_information' => :'PersonalInformationSerializer'
124
+ }
125
+ end
126
+
127
+ # Initializes the object
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ def initialize(attributes = {})
130
+ return unless attributes.is_a?(Hash)
131
+
132
+ # convert string to symbol for hash key
133
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
134
+
135
+ if attributes.has_key?(:'email')
136
+ self.email = attributes[:'email']
137
+ end
138
+
139
+ if attributes.has_key?(:'first_name')
140
+ self.first_name = attributes[:'first_name']
141
+ end
142
+
143
+ if attributes.has_key?(:'last_name')
144
+ self.last_name = attributes[:'last_name']
145
+ end
146
+
147
+ if attributes.has_key?(:'business_name')
148
+ self.business_name = attributes[:'business_name']
149
+ end
150
+
151
+ if attributes.has_key?(:'contractor_type')
152
+ self.contractor_type = attributes[:'contractor_type']
153
+ end
154
+
155
+ if attributes.has_key?(:'default_account')
156
+ self.default_account = attributes[:'default_account']
157
+ end
158
+
159
+ if attributes.has_key?(:'tax_savings_account')
160
+ self.tax_savings_account = attributes[:'tax_savings_account']
161
+ end
162
+
163
+ if attributes.has_key?(:'tax_savings_percent')
164
+ self.tax_savings_percent = attributes[:'tax_savings_percent']
165
+ end
166
+
167
+ if attributes.has_key?(:'use_plaid')
168
+ self.use_plaid = attributes[:'use_plaid']
169
+ end
170
+
171
+ if attributes.has_key?(:'use_income_requests')
172
+ self.use_income_requests = attributes[:'use_income_requests']
173
+ end
174
+
175
+ if attributes.has_key?(:'use_tax_savings')
176
+ self.use_tax_savings = attributes[:'use_tax_savings']
177
+ end
178
+
179
+ if attributes.has_key?(:'is_auto_cashout_enabled')
180
+ self.is_auto_cashout_enabled = attributes[:'is_auto_cashout_enabled']
181
+ end
182
+
183
+ if attributes.has_key?(:'password')
184
+ self.password = attributes[:'password']
185
+ end
186
+
187
+ if attributes.has_key?(:'personal_information')
188
+ self.personal_information = attributes[:'personal_information']
189
+ end
190
+
191
+ end
192
+
193
+ # Show invalid properties with the reasons. Usually used together with valid?
194
+ # @return Array for valid properies with the reasons
195
+ def list_invalid_properties
196
+ invalid_properties = Array.new
197
+ return invalid_properties
198
+ end
199
+
200
+ # Check to see if the all the properties in the model are valid
201
+ # @return true if the model is valid
202
+ def valid?
203
+ return false if @email.nil?
204
+ contractor_type_validator = EnumAttributeValidator.new('String', ["INDIVIDUAL", "BUSINESS"])
205
+ return false unless contractor_type_validator.valid?(@contractor_type)
206
+ return true
207
+ end
208
+
209
+ # Custom attribute writer method checking allowed values (enum).
210
+ # @param [Object] contractor_type Object to be assigned
211
+ def contractor_type=(contractor_type)
212
+ validator = EnumAttributeValidator.new('String', ["INDIVIDUAL", "BUSINESS"])
213
+ unless validator.valid?(contractor_type)
214
+ fail ArgumentError, "invalid value for 'contractor_type', must be one of #{validator.allowable_values}."
215
+ end
216
+ @contractor_type = contractor_type
217
+ end
218
+
219
+ # Checks equality by comparing each attribute.
220
+ # @param [Object] Object to be compared
221
+ def ==(o)
222
+ return true if self.equal?(o)
223
+ self.class == o.class &&
224
+ email == o.email &&
225
+ first_name == o.first_name &&
226
+ last_name == o.last_name &&
227
+ business_name == o.business_name &&
228
+ contractor_type == o.contractor_type &&
229
+ default_account == o.default_account &&
230
+ tax_savings_account == o.tax_savings_account &&
231
+ tax_savings_percent == o.tax_savings_percent &&
232
+ use_plaid == o.use_plaid &&
233
+ use_income_requests == o.use_income_requests &&
234
+ use_tax_savings == o.use_tax_savings &&
235
+ is_auto_cashout_enabled == o.is_auto_cashout_enabled &&
236
+ password == o.password &&
237
+ personal_information == o.personal_information
238
+ end
239
+
240
+ # @see the `==` method
241
+ # @param [Object] Object to be compared
242
+ def eql?(o)
243
+ self == o
244
+ end
245
+
246
+ # Calculates hash code according to all attributes.
247
+ # @return [Fixnum] Hash code
248
+ def hash
249
+ [email, first_name, last_name, business_name, contractor_type, default_account, tax_savings_account, tax_savings_percent, use_plaid, use_income_requests, use_tax_savings, is_auto_cashout_enabled, password, personal_information].hash
250
+ end
251
+
252
+ # Builds the object from hash
253
+ # @param [Hash] attributes Model attributes in the form of hash
254
+ # @return [Object] Returns the model itself
255
+ def build_from_hash(attributes)
256
+ return nil unless attributes.is_a?(Hash)
257
+ self.class.swagger_types.each_pair do |key, type|
258
+ if type =~ /^Array<(.*)>/i
259
+ # check to ensure the input is an array given that the the attribute
260
+ # is documented as an array but the input is not
261
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
262
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
263
+ end
264
+ elsif !attributes[self.class.attribute_map[key]].nil?
265
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
266
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
267
+ end
268
+
269
+ self
270
+ end
271
+
272
+ # Deserializes the data based on type
273
+ # @param string type Data type
274
+ # @param string value Value to be deserialized
275
+ # @return [Object] Deserialized data
276
+ def _deserialize(type, value)
277
+ case type.to_sym
278
+ when :DateTime
279
+ DateTime.parse(value)
280
+ when :Date
281
+ Date.parse(value)
282
+ when :String
283
+ value.to_s
284
+ when :Integer
285
+ value.to_i
286
+ when :Float
287
+ value.to_f
288
+ when :BOOLEAN
289
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
290
+ true
291
+ else
292
+ false
293
+ end
294
+ when :Object
295
+ # generic object (usually a Hash), return directly
296
+ value
297
+ when /\AArray<(?<inner_type>.+)>\z/
298
+ inner_type = Regexp.last_match[:inner_type]
299
+ value.map { |v| _deserialize(inner_type, v) }
300
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
301
+ k_type = Regexp.last_match[:k_type]
302
+ v_type = Regexp.last_match[:v_type]
303
+ {}.tap do |hash|
304
+ value.each do |k, v|
305
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
306
+ end
307
+ end
308
+ else # model
309
+ temp_model = QwilAPI.const_get(type).new
310
+ temp_model.build_from_hash(value)
311
+ end
312
+ end
313
+
314
+ # Returns the string representation of the object
315
+ # @return [String] String presentation of the object
316
+ def to_s
317
+ to_hash.to_s
318
+ end
319
+
320
+ # to_body is an alias to to_hash (backward compatibility)
321
+ # @return [Hash] Returns the object in the form of hash
322
+ def to_body
323
+ to_hash
324
+ end
325
+
326
+ # Returns the object in the form of hash
327
+ # @return [Hash] Returns the object in the form of hash
328
+ def to_hash
329
+ hash = {}
330
+ self.class.attribute_map.each_pair do |attr, param|
331
+ value = self.send(attr)
332
+ next if value.nil?
333
+ hash[param] = _to_hash(value)
334
+ end
335
+ hash
336
+ end
337
+
338
+ # Outputs non-array value in the form of hash
339
+ # For object, use to_hash. Otherwise, just return the value
340
+ # @param [Object] value Any valid value
341
+ # @return [Hash] Returns the value in the form of hash
342
+ def _to_hash(value)
343
+ if value.is_a?(Array)
344
+ value.compact.map{ |v| _to_hash(v) }
345
+ elsif value.is_a?(Hash)
346
+ {}.tap do |hash|
347
+ value.each { |k, v| hash[k] = _to_hash(v) }
348
+ end
349
+ elsif value.respond_to? :to_hash
350
+ value.to_hash
351
+ else
352
+ value
353
+ end
354
+ end
355
+
356
+ end
357
+
358
+ end
@@ -0,0 +1,24 @@
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
+ module QwilAPI
23
+ VERSION = "0.1.0"
24
+ end
data/lib/qwil_api.rb ADDED
@@ -0,0 +1,51 @@
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
+ # Common files
23
+ require 'qwil_api/api_client'
24
+ require 'qwil_api/api_error'
25
+ require 'qwil_api/version'
26
+ require 'qwil_api/configuration'
27
+
28
+ # Models
29
+ require 'qwil_api/models/membership_serializer'
30
+ require 'qwil_api/models/write_membership_serializer'
31
+
32
+ # APIs
33
+ require 'qwil_api/api/memberships_api'
34
+
35
+ module QwilAPI
36
+ class << self
37
+ # Customize default settings for the SDK using block.
38
+ # QwilAPI.configure do |config|
39
+ # config.username = "xxx"
40
+ # config.password = "xxx"
41
+ # end
42
+ # If no block given, return the default Configuration object.
43
+ def configure
44
+ if block_given?
45
+ yield(Configuration.default)
46
+ else
47
+ Configuration.default
48
+ end
49
+ end
50
+ end
51
+ end
data/qwil_api.gemspec ADDED
@@ -0,0 +1,53 @@
1
+ # -*- encoding: utf-8 -*-
2
+ #
3
+ =begin
4
+ #No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version:
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ =end
23
+
24
+ $:.push File.expand_path("../lib", __FILE__)
25
+ require "qwil_api/version"
26
+
27
+ Gem::Specification.new do |s|
28
+ s.name = "qwil_api"
29
+ s.version = QwilAPI::VERSION
30
+ s.platform = Gem::Platform::RUBY
31
+ s.authors = ["Paul Tiplady"]
32
+ s.email = ["paul@qwil.co"]
33
+ s.homepage = "https://github.com/qwil/ruby-api-client"
34
+ s.summary = " Ruby Gem"
35
+ s.description = "API client for the Qwil API."
36
+ s.license = "None"
37
+
38
+ s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
39
+ s.add_runtime_dependency 'json', '~> 1.8', '>= 1.8.3'
40
+
41
+ s.add_development_dependency 'rspec', '~> 3.4', '>= 3.4.0'
42
+ s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1'
43
+ s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3'
44
+ s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6'
45
+ s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2'
46
+ s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16'
47
+ s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.11'
48
+
49
+ s.files = `find *`.split("\n").uniq.sort.select{|f| !f.empty? }
50
+ s.test_files = `find spec/*`.split("\n")
51
+ s.executables = []
52
+ s.require_paths = ["lib"]
53
+ end
@@ -0,0 +1,110 @@
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 'spec_helper'
23
+ require 'json'
24
+
25
+ # Unit tests for QwilAPI::AccountsApi
26
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
27
+ # Please update as you see appropriate
28
+ describe 'AccountsApi' do
29
+ before do
30
+ # run before each test
31
+ @instance = QwilAPI::AccountsApi.new
32
+ end
33
+
34
+ after do
35
+ # run after each test
36
+ end
37
+
38
+ describe 'test an instance of AccountsApi' do
39
+ it 'should create an instact of AccountsApi' do
40
+ expect(@instance).to be_instance_of(QwilAPI::AccountsApi)
41
+ end
42
+ end
43
+
44
+ # unit tests for account_destroy
45
+ # The bank accounts for all Users
46
+ # The bank accounts for all Users. Enables retrieve, update (PUT/PATCH), and destroy.&lt;br/&gt;Note that the Account API objects are immutable, but the DELETE API method is still offered to allow users to remove Accounts.&lt;br/&gt;Note that the Account DB models are immutable, but the PUT/PATCH/DELETE API methods are still offered to allow users to modify/remove Accounts.&lt;br/&gt;The PUT/PATCH HTTP methods will create a new Account with the same data as the old one, and then apply the update to that new account. The old Account will be marked as deleted.&lt;br/&gt;NOTE: if you update an Account, it will get a new primary key, and therefore a new URL. You will need to extract the new URL from the body of the HTTP response to the update request.&lt;br/&gt;e.g.&lt;br/&gt;&#x3D;&gt; PATCH https://api.qwil.co/accounts/1/ {...}&lt;br/&gt;&lt;&#x3D; 200 OK { \&quot;url\&quot;: \&quot;https://api.qwil.co/accounts/2/\&quot;, ... }&lt;br/&gt;The DELETE HTTP method will cause Accounts to have the Account.deleted flag set to True, but deleted Accounts will still be displayed in the /accounts/ list.
47
+ # @param pk
48
+ # @param [Hash] opts the optional parameters
49
+ # @return [AccountSerializer]
50
+ describe 'account_destroy test' do
51
+ it "should work" do
52
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
53
+ end
54
+ end
55
+
56
+ # unit tests for account_partial_update
57
+ # The bank accounts for all Users
58
+ # The bank accounts for all Users. Enables retrieve, update (PUT/PATCH), and destroy.&lt;br/&gt;Note that the Account API objects are immutable, but the DELETE API method is still offered to allow users to remove Accounts.&lt;br/&gt;Note that the Account DB models are immutable, but the PUT/PATCH/DELETE API methods are still offered to allow users to modify/remove Accounts.&lt;br/&gt;The PUT/PATCH HTTP methods will create a new Account with the same data as the old one, and then apply the update to that new account. The old Account will be marked as deleted.&lt;br/&gt;NOTE: if you update an Account, it will get a new primary key, and therefore a new URL. You will need to extract the new URL from the body of the HTTP response to the update request.&lt;br/&gt;e.g.&lt;br/&gt;&#x3D;&gt; PATCH https://api.qwil.co/accounts/1/ {...}&lt;br/&gt;&lt;&#x3D; 200 OK { \&quot;url\&quot;: \&quot;https://api.qwil.co/accounts/2/\&quot;, ... }&lt;br/&gt;The DELETE HTTP method will cause Accounts to have the Account.deleted flag set to True, but deleted Accounts will still be displayed in the /accounts/ list.
59
+ # @param pk
60
+ # @param [Hash] opts the optional parameters
61
+ # @option opts [String] :account_number
62
+ # @option opts [String] :name The user&#39;s label for this Account.
63
+ # @option opts [String] :routing_number The inter-bank routing nubmer for this Account. 8 or 9 digits in length.
64
+ # @option opts [BOOLEAN] :is_tax_savings Flag specifying if the Account is used for tax savings.
65
+ # @option opts [BOOLEAN] :is_paypal Flag specifying if the Account is a Paypal account.
66
+ # @option opts [BOOLEAN] :is_mychoice Flag specifying if the Account is a MyChoice card. If it is, the mychoice_user_id and mychoice_card_id must be filled in.
67
+ # @option opts [Integer] :mychoice_user_id For MyChoice Accounts. Populated from the MyChoice API.
68
+ # @option opts [Integer] :mychoice_card_id For MyChoice Accounts. Populated from the MyChoice API.
69
+ # @option opts [String] :user
70
+ # @return [AccountSerializer]
71
+ describe 'account_partial_update test' do
72
+ it "should work" do
73
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
74
+ end
75
+ end
76
+
77
+ # unit tests for account_retrieve
78
+ # The bank accounts for all Users
79
+ # The bank accounts for all Users. Enables retrieve, update (PUT/PATCH), and destroy.&lt;br/&gt;Note that the Account API objects are immutable, but the DELETE API method is still offered to allow users to remove Accounts.&lt;br/&gt;Note that the Account DB models are immutable, but the PUT/PATCH/DELETE API methods are still offered to allow users to modify/remove Accounts.&lt;br/&gt;The PUT/PATCH HTTP methods will create a new Account with the same data as the old one, and then apply the update to that new account. The old Account will be marked as deleted.&lt;br/&gt;NOTE: if you update an Account, it will get a new primary key, and therefore a new URL. You will need to extract the new URL from the body of the HTTP response to the update request.&lt;br/&gt;e.g.&lt;br/&gt;&#x3D;&gt; PATCH https://api.qwil.co/accounts/1/ {...}&lt;br/&gt;&lt;&#x3D; 200 OK { \&quot;url\&quot;: \&quot;https://api.qwil.co/accounts/2/\&quot;, ... }&lt;br/&gt;The DELETE HTTP method will cause Accounts to have the Account.deleted flag set to True, but deleted Accounts will still be displayed in the /accounts/ list.
80
+ # @param pk
81
+ # @param [Hash] opts the optional parameters
82
+ # @return [AccountSerializer]
83
+ describe 'account_retrieve test' do
84
+ it "should work" do
85
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
86
+ end
87
+ end
88
+
89
+ # unit tests for account_update
90
+ # The bank accounts for all Users
91
+ # The bank accounts for all Users. Enables retrieve, update (PUT/PATCH), and destroy.&lt;br/&gt;Note that the Account API objects are immutable, but the DELETE API method is still offered to allow users to remove Accounts.&lt;br/&gt;Note that the Account DB models are immutable, but the PUT/PATCH/DELETE API methods are still offered to allow users to modify/remove Accounts.&lt;br/&gt;The PUT/PATCH HTTP methods will create a new Account with the same data as the old one, and then apply the update to that new account. The old Account will be marked as deleted.&lt;br/&gt;NOTE: if you update an Account, it will get a new primary key, and therefore a new URL. You will need to extract the new URL from the body of the HTTP response to the update request.&lt;br/&gt;e.g.&lt;br/&gt;&#x3D;&gt; PATCH https://api.qwil.co/accounts/1/ {...}&lt;br/&gt;&lt;&#x3D; 200 OK { \&quot;url\&quot;: \&quot;https://api.qwil.co/accounts/2/\&quot;, ... }&lt;br/&gt;The DELETE HTTP method will cause Accounts to have the Account.deleted flag set to True, but deleted Accounts will still be displayed in the /accounts/ list.
92
+ # @param pk
93
+ # @param account_number
94
+ # @param name The user&#39;s label for this Account.
95
+ # @param routing_number The inter-bank routing nubmer for this Account. 8 or 9 digits in length.
96
+ # @param [Hash] opts the optional parameters
97
+ # @option opts [BOOLEAN] :is_tax_savings Flag specifying if the Account is used for tax savings.
98
+ # @option opts [BOOLEAN] :is_paypal Flag specifying if the Account is a Paypal account.
99
+ # @option opts [BOOLEAN] :is_mychoice Flag specifying if the Account is a MyChoice card. If it is, the mychoice_user_id and mychoice_card_id must be filled in.
100
+ # @option opts [Integer] :mychoice_user_id For MyChoice Accounts. Populated from the MyChoice API.
101
+ # @option opts [Integer] :mychoice_card_id For MyChoice Accounts. Populated from the MyChoice API.
102
+ # @option opts [String] :user
103
+ # @return [AccountSerializer]
104
+ describe 'account_update test' do
105
+ it "should work" do
106
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
107
+ end
108
+ end
109
+
110
+ end
@@ -0,0 +1,56 @@
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 'spec_helper'
23
+ require 'json'
24
+
25
+ # Unit tests for QwilAPI::ApitokenauthApi
26
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
27
+ # Please update as you see appropriate
28
+ describe 'ApitokenauthApi' do
29
+ before do
30
+ # run before each test
31
+ @instance = QwilAPI::ApitokenauthApi.new
32
+ end
33
+
34
+ after do
35
+ # run after each test
36
+ end
37
+
38
+ describe 'test an instance of ApitokenauthApi' do
39
+ it 'should create an instact of ApitokenauthApi' do
40
+ expect(@instance).to be_instance_of(QwilAPI::ApitokenauthApi)
41
+ end
42
+ end
43
+
44
+ # unit tests for obtain_json_web_token_post
45
+ # API View that receives a POST with a user&#39;s username and password
46
+ # API View that receives a POST with a user&#39;s username and password.&lt;br/&gt;Returns a JSON Web Token that can be used for authenticated requests.
47
+ # @param [Hash] opts the optional parameters
48
+ # @option opts [JSONWebTokenSerializer] :json_web_token_serializer
49
+ # @return [JSONWebTokenSerializer]
50
+ describe 'obtain_json_web_token_post test' do
51
+ it "should work" do
52
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
53
+ end
54
+ end
55
+
56
+ end