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,391 @@
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 ManagerPlatformSerializer
27
+ attr_accessor :url
28
+
29
+ attr_accessor :name
30
+
31
+ attr_accessor :contact_information
32
+
33
+ attr_accessor :company_information
34
+
35
+ attr_accessor :contractors
36
+
37
+ # The ISO 4217 currency code for which all payments for this Platform are handled. Note: Immutable after Platform is created.
38
+ attr_accessor :currency
39
+
40
+ attr_accessor :income
41
+
42
+ attr_accessor :invoices
43
+
44
+ attr_accessor :create_invoice
45
+
46
+ # The frequency of contractor rebates on this platform.
47
+ attr_accessor :payment_schedule
48
+
49
+ # The date that the first payment is due for the platform's pay cycle.
50
+ attr_accessor :payment_date
51
+
52
+ # The accounts configured for billing on this Platform.
53
+ attr_accessor :accounts
54
+
55
+ # The account to use for billing purposes.
56
+ attr_accessor :default_account
57
+
58
+ attr_accessor :manager
59
+
60
+ # URL of the list of Platform Memberships.
61
+ attr_accessor :memberships
62
+
63
+ class EnumAttributeValidator
64
+ attr_reader :datatype
65
+ attr_reader :allowable_values
66
+
67
+ def initialize(datatype, allowable_values)
68
+ @allowable_values = allowable_values.map do |value|
69
+ case datatype.to_s
70
+ when /Integer/i
71
+ value.to_i
72
+ when /Float/i
73
+ value.to_f
74
+ else
75
+ value
76
+ end
77
+ end
78
+ end
79
+
80
+ def valid?(value)
81
+ !value || allowable_values.include?(value)
82
+ end
83
+ end
84
+
85
+ # Attribute mapping from ruby-style variable name to JSON key.
86
+ def self.attribute_map
87
+ {
88
+ :'url' => :'url',
89
+ :'name' => :'name',
90
+ :'contact_information' => :'contact_information',
91
+ :'company_information' => :'company_information',
92
+ :'contractors' => :'contractors',
93
+ :'currency' => :'currency',
94
+ :'income' => :'income',
95
+ :'invoices' => :'invoices',
96
+ :'create_invoice' => :'create_invoice',
97
+ :'payment_schedule' => :'payment_schedule',
98
+ :'payment_date' => :'payment_date',
99
+ :'accounts' => :'accounts',
100
+ :'default_account' => :'default_account',
101
+ :'manager' => :'manager',
102
+ :'memberships' => :'memberships'
103
+ }
104
+ end
105
+
106
+ # Attribute type mapping.
107
+ def self.swagger_types
108
+ {
109
+ :'url' => :'String',
110
+ :'name' => :'String',
111
+ :'contact_information' => :'ContactInformationSerializer',
112
+ :'company_information' => :'CompanyInformationSerializer',
113
+ :'contractors' => :'String',
114
+ :'currency' => :'String',
115
+ :'income' => :'String',
116
+ :'invoices' => :'String',
117
+ :'create_invoice' => :'String',
118
+ :'payment_schedule' => :'String',
119
+ :'payment_date' => :'Date',
120
+ :'accounts' => :'Array<String>',
121
+ :'default_account' => :'String',
122
+ :'manager' => :'String',
123
+ :'memberships' => :'String'
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?(:'url')
136
+ self.url = attributes[:'url']
137
+ end
138
+
139
+ if attributes.has_key?(:'name')
140
+ self.name = attributes[:'name']
141
+ end
142
+
143
+ if attributes.has_key?(:'contact_information')
144
+ self.contact_information = attributes[:'contact_information']
145
+ end
146
+
147
+ if attributes.has_key?(:'company_information')
148
+ self.company_information = attributes[:'company_information']
149
+ end
150
+
151
+ if attributes.has_key?(:'contractors')
152
+ self.contractors = attributes[:'contractors']
153
+ end
154
+
155
+ if attributes.has_key?(:'currency')
156
+ self.currency = attributes[:'currency']
157
+ end
158
+
159
+ if attributes.has_key?(:'income')
160
+ self.income = attributes[:'income']
161
+ end
162
+
163
+ if attributes.has_key?(:'invoices')
164
+ self.invoices = attributes[:'invoices']
165
+ end
166
+
167
+ if attributes.has_key?(:'create_invoice')
168
+ self.create_invoice = attributes[:'create_invoice']
169
+ end
170
+
171
+ if attributes.has_key?(:'payment_schedule')
172
+ self.payment_schedule = attributes[:'payment_schedule']
173
+ end
174
+
175
+ if attributes.has_key?(:'payment_date')
176
+ self.payment_date = attributes[:'payment_date']
177
+ end
178
+
179
+ if attributes.has_key?(:'accounts')
180
+ if (value = attributes[:'accounts']).is_a?(Array)
181
+ self.accounts = value
182
+ end
183
+ end
184
+
185
+ if attributes.has_key?(:'default_account')
186
+ self.default_account = attributes[:'default_account']
187
+ end
188
+
189
+ if attributes.has_key?(:'manager')
190
+ self.manager = attributes[:'manager']
191
+ end
192
+
193
+ if attributes.has_key?(:'memberships')
194
+ self.memberships = attributes[:'memberships']
195
+ end
196
+
197
+ end
198
+
199
+ # Show invalid properties with the reasons. Usually used together with valid?
200
+ # @return Array for valid properies with the reasons
201
+ def list_invalid_properties
202
+ invalid_properties = Array.new
203
+ return invalid_properties
204
+ end
205
+
206
+ # Check to see if the all the properties in the model are valid
207
+ # @return true if the model is valid
208
+ def valid?
209
+ return false if @url.nil?
210
+ return false if @name.nil?
211
+ return false if @contact_information.nil?
212
+ return false if @company_information.nil?
213
+ return false if @contractors.nil?
214
+ return false if @currency.nil?
215
+ currency_validator = EnumAttributeValidator.new('String', ["USD", "GBP"])
216
+ return false unless currency_validator.valid?(@currency)
217
+ return false if @income.nil?
218
+ return false if @invoices.nil?
219
+ return false if @create_invoice.nil?
220
+ return false if @payment_schedule.nil?
221
+ payment_schedule_validator = EnumAttributeValidator.new('String', ["WEEKLY", "FORTNIGHT", "MONTHLY", "DAILY"])
222
+ return false unless payment_schedule_validator.valid?(@payment_schedule)
223
+ return false if @payment_date.nil?
224
+ return false if @accounts.nil?
225
+ return false if @default_account.nil?
226
+ return false if @manager.nil?
227
+ return false if @memberships.nil?
228
+ return true
229
+ end
230
+
231
+ # Custom attribute writer method checking allowed values (enum).
232
+ # @param [Object] currency Object to be assigned
233
+ def currency=(currency)
234
+ validator = EnumAttributeValidator.new('String', ["USD", "GBP"])
235
+ unless validator.valid?(currency)
236
+ fail ArgumentError, "invalid value for 'currency', must be one of #{validator.allowable_values}."
237
+ end
238
+ @currency = currency
239
+ end
240
+
241
+ # Custom attribute writer method checking allowed values (enum).
242
+ # @param [Object] payment_schedule Object to be assigned
243
+ def payment_schedule=(payment_schedule)
244
+ validator = EnumAttributeValidator.new('String', ["WEEKLY", "FORTNIGHT", "MONTHLY", "DAILY"])
245
+ unless validator.valid?(payment_schedule)
246
+ fail ArgumentError, "invalid value for 'payment_schedule', must be one of #{validator.allowable_values}."
247
+ end
248
+ @payment_schedule = payment_schedule
249
+ end
250
+
251
+ # Checks equality by comparing each attribute.
252
+ # @param [Object] Object to be compared
253
+ def ==(o)
254
+ return true if self.equal?(o)
255
+ self.class == o.class &&
256
+ url == o.url &&
257
+ name == o.name &&
258
+ contact_information == o.contact_information &&
259
+ company_information == o.company_information &&
260
+ contractors == o.contractors &&
261
+ currency == o.currency &&
262
+ income == o.income &&
263
+ invoices == o.invoices &&
264
+ create_invoice == o.create_invoice &&
265
+ payment_schedule == o.payment_schedule &&
266
+ payment_date == o.payment_date &&
267
+ accounts == o.accounts &&
268
+ default_account == o.default_account &&
269
+ manager == o.manager &&
270
+ memberships == o.memberships
271
+ end
272
+
273
+ # @see the `==` method
274
+ # @param [Object] Object to be compared
275
+ def eql?(o)
276
+ self == o
277
+ end
278
+
279
+ # Calculates hash code according to all attributes.
280
+ # @return [Fixnum] Hash code
281
+ def hash
282
+ [url, name, contact_information, company_information, contractors, currency, income, invoices, create_invoice, payment_schedule, payment_date, accounts, default_account, manager, memberships].hash
283
+ end
284
+
285
+ # Builds the object from hash
286
+ # @param [Hash] attributes Model attributes in the form of hash
287
+ # @return [Object] Returns the model itself
288
+ def build_from_hash(attributes)
289
+ return nil unless attributes.is_a?(Hash)
290
+ self.class.swagger_types.each_pair do |key, type|
291
+ if type =~ /^Array<(.*)>/i
292
+ # check to ensure the input is an array given that the the attribute
293
+ # is documented as an array but the input is not
294
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
295
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
296
+ end
297
+ elsif !attributes[self.class.attribute_map[key]].nil?
298
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
299
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
300
+ end
301
+
302
+ self
303
+ end
304
+
305
+ # Deserializes the data based on type
306
+ # @param string type Data type
307
+ # @param string value Value to be deserialized
308
+ # @return [Object] Deserialized data
309
+ def _deserialize(type, value)
310
+ case type.to_sym
311
+ when :DateTime
312
+ DateTime.parse(value)
313
+ when :Date
314
+ Date.parse(value)
315
+ when :String
316
+ value.to_s
317
+ when :Integer
318
+ value.to_i
319
+ when :Float
320
+ value.to_f
321
+ when :BOOLEAN
322
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
323
+ true
324
+ else
325
+ false
326
+ end
327
+ when :Object
328
+ # generic object (usually a Hash), return directly
329
+ value
330
+ when /\AArray<(?<inner_type>.+)>\z/
331
+ inner_type = Regexp.last_match[:inner_type]
332
+ value.map { |v| _deserialize(inner_type, v) }
333
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
334
+ k_type = Regexp.last_match[:k_type]
335
+ v_type = Regexp.last_match[:v_type]
336
+ {}.tap do |hash|
337
+ value.each do |k, v|
338
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
339
+ end
340
+ end
341
+ else # model
342
+ temp_model = QwilAPI.const_get(type).new
343
+ temp_model.build_from_hash(value)
344
+ end
345
+ end
346
+
347
+ # Returns the string representation of the object
348
+ # @return [String] String presentation of the object
349
+ def to_s
350
+ to_hash.to_s
351
+ end
352
+
353
+ # to_body is an alias to to_hash (backward compatibility)
354
+ # @return [Hash] Returns the object in the form of hash
355
+ def to_body
356
+ to_hash
357
+ end
358
+
359
+ # Returns the object in the form of hash
360
+ # @return [Hash] Returns the object in the form of hash
361
+ def to_hash
362
+ hash = {}
363
+ self.class.attribute_map.each_pair do |attr, param|
364
+ value = self.send(attr)
365
+ next if value.nil?
366
+ hash[param] = _to_hash(value)
367
+ end
368
+ hash
369
+ end
370
+
371
+ # Outputs non-array value in the form of hash
372
+ # For object, use to_hash. Otherwise, just return the value
373
+ # @param [Object] value Any valid value
374
+ # @return [Hash] Returns the value in the form of hash
375
+ def _to_hash(value)
376
+ if value.is_a?(Array)
377
+ value.compact.map{ |v| _to_hash(v) }
378
+ elsif value.is_a?(Hash)
379
+ {}.tap do |hash|
380
+ value.each { |k, v| hash[k] = _to_hash(v) }
381
+ end
382
+ elsif value.respond_to? :to_hash
383
+ value.to_hash
384
+ else
385
+ value
386
+ end
387
+ end
388
+
389
+ end
390
+
391
+ end
@@ -0,0 +1,218 @@
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 ManagerSerializer
27
+ attr_accessor :url
28
+
29
+ attr_accessor :name
30
+
31
+ attr_accessor :platforms
32
+
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'url' => :'url',
38
+ :'name' => :'name',
39
+ :'platforms' => :'platforms'
40
+ }
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.swagger_types
45
+ {
46
+ :'url' => :'String',
47
+ :'name' => :'String',
48
+ :'platforms' => :'String'
49
+ }
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ return unless attributes.is_a?(Hash)
56
+
57
+ # convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
59
+
60
+ if attributes.has_key?(:'url')
61
+ self.url = attributes[:'url']
62
+ end
63
+
64
+ if attributes.has_key?(:'name')
65
+ self.name = attributes[:'name']
66
+ end
67
+
68
+ if attributes.has_key?(:'platforms')
69
+ self.platforms = attributes[:'platforms']
70
+ end
71
+
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properies with the reasons
76
+ def list_invalid_properties
77
+ invalid_properties = Array.new
78
+ return invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ return false if @url.nil?
85
+ return false if @name.nil?
86
+ return false if @platforms.nil?
87
+ return true
88
+ end
89
+
90
+ # Checks equality by comparing each attribute.
91
+ # @param [Object] Object to be compared
92
+ def ==(o)
93
+ return true if self.equal?(o)
94
+ self.class == o.class &&
95
+ url == o.url &&
96
+ name == o.name &&
97
+ platforms == o.platforms
98
+ end
99
+
100
+ # @see the `==` method
101
+ # @param [Object] Object to be compared
102
+ def eql?(o)
103
+ self == o
104
+ end
105
+
106
+ # Calculates hash code according to all attributes.
107
+ # @return [Fixnum] Hash code
108
+ def hash
109
+ [url, name, platforms].hash
110
+ end
111
+
112
+ # Builds the object from hash
113
+ # @param [Hash] attributes Model attributes in the form of hash
114
+ # @return [Object] Returns the model itself
115
+ def build_from_hash(attributes)
116
+ return nil unless attributes.is_a?(Hash)
117
+ self.class.swagger_types.each_pair do |key, type|
118
+ if type =~ /^Array<(.*)>/i
119
+ # check to ensure the input is an array given that the the attribute
120
+ # is documented as an array but the input is not
121
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
122
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
123
+ end
124
+ elsif !attributes[self.class.attribute_map[key]].nil?
125
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
126
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
127
+ end
128
+
129
+ self
130
+ end
131
+
132
+ # Deserializes the data based on type
133
+ # @param string type Data type
134
+ # @param string value Value to be deserialized
135
+ # @return [Object] Deserialized data
136
+ def _deserialize(type, value)
137
+ case type.to_sym
138
+ when :DateTime
139
+ DateTime.parse(value)
140
+ when :Date
141
+ Date.parse(value)
142
+ when :String
143
+ value.to_s
144
+ when :Integer
145
+ value.to_i
146
+ when :Float
147
+ value.to_f
148
+ when :BOOLEAN
149
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
150
+ true
151
+ else
152
+ false
153
+ end
154
+ when :Object
155
+ # generic object (usually a Hash), return directly
156
+ value
157
+ when /\AArray<(?<inner_type>.+)>\z/
158
+ inner_type = Regexp.last_match[:inner_type]
159
+ value.map { |v| _deserialize(inner_type, v) }
160
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
161
+ k_type = Regexp.last_match[:k_type]
162
+ v_type = Regexp.last_match[:v_type]
163
+ {}.tap do |hash|
164
+ value.each do |k, v|
165
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166
+ end
167
+ end
168
+ else # model
169
+ temp_model = QwilAPI.const_get(type).new
170
+ temp_model.build_from_hash(value)
171
+ end
172
+ end
173
+
174
+ # Returns the string representation of the object
175
+ # @return [String] String presentation of the object
176
+ def to_s
177
+ to_hash.to_s
178
+ end
179
+
180
+ # to_body is an alias to to_hash (backward compatibility)
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_body
183
+ to_hash
184
+ end
185
+
186
+ # Returns the object in the form of hash
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_hash
189
+ hash = {}
190
+ self.class.attribute_map.each_pair do |attr, param|
191
+ value = self.send(attr)
192
+ next if value.nil?
193
+ hash[param] = _to_hash(value)
194
+ end
195
+ hash
196
+ end
197
+
198
+ # Outputs non-array value in the form of hash
199
+ # For object, use to_hash. Otherwise, just return the value
200
+ # @param [Object] value Any valid value
201
+ # @return [Hash] Returns the value in the form of hash
202
+ def _to_hash(value)
203
+ if value.is_a?(Array)
204
+ value.compact.map{ |v| _to_hash(v) }
205
+ elsif value.is_a?(Hash)
206
+ {}.tap do |hash|
207
+ value.each { |k, v| hash[k] = _to_hash(v) }
208
+ end
209
+ elsif value.respond_to? :to_hash
210
+ value.to_hash
211
+ else
212
+ value
213
+ end
214
+ end
215
+
216
+ end
217
+
218
+ end