qwil_api 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +91 -0
- data/docs/AccountSerializer.md +18 -0
- data/docs/AccountsApi.md +243 -0
- data/docs/ApitokenauthApi.md +57 -0
- data/docs/CashoutCalculationSerializer.md +10 -0
- data/docs/CashoutSerializer.md +20 -0
- data/docs/CashoutSliceSerializer.md +11 -0
- data/docs/CashoutsApi.md +56 -0
- data/docs/CompanyInformationSerializer.md +18 -0
- data/docs/ContactInfoSerializer.md +10 -0
- data/docs/ContactInformationSerializer.md +16 -0
- data/docs/ContractorSerializer.md +20 -0
- data/docs/IncomeApi.md +98 -0
- data/docs/IncomeNestedSerializer.md +18 -0
- data/docs/IncomeSerializer.md +18 -0
- data/docs/IncomeSerializerFixedSource.md +18 -0
- data/docs/InvoiceSerializer.md +17 -0
- data/docs/InvoiceSerializerFixedSourceCreate.md +17 -0
- data/docs/InvoicesApi.md +98 -0
- data/docs/JSONWebTokenSerializer.md +7 -0
- data/docs/ManagerPlatformSerializer.md +22 -0
- data/docs/ManagerSerializer.md +10 -0
- data/docs/ManagersApi.md +172 -0
- data/docs/MembershipSerializer.md +9 -0
- data/docs/MembershipsApi.md +56 -0
- data/docs/PersonalInformationSerializer.md +16 -0
- data/docs/PlaidPublicTokenSerializer.md +8 -0
- data/docs/PlatformIncomeRequestSerializer.md +15 -0
- data/docs/PlatformMembershipRequestSerializer.md +11 -0
- data/docs/PlatformSerializer.md +30 -0
- data/docs/PlatformSummarySerializer.md +10 -0
- data/docs/PlatformsApi.md +1369 -0
- data/docs/RebateSerializer.md +15 -0
- data/docs/RebatesApi.md +98 -0
- data/docs/ReceivablesSerializer.md +9 -0
- data/docs/TaxSavingsSerializer.md +10 -0
- data/docs/UserAccountSerializer.md +17 -0
- data/docs/UserCashoutSerializer.md +20 -0
- data/docs/UserIncomeRequestSerializer.md +15 -0
- data/docs/UserPlatformMembershipRequestSerializer.md +13 -0
- data/docs/UserSerializer.md +40 -0
- data/docs/UsersApi.md +2173 -0
- data/docs/WriteAccountSerializer.md +16 -0
- data/docs/WriteCashoutCalculationSerializer.md +8 -0
- data/docs/WriteCashoutSerializer.md +16 -0
- data/docs/WriteCashoutSliceSerializer.md +11 -0
- data/docs/WriteCompanyInformationSerializer.md +17 -0
- data/docs/WriteContactInfoSerializer.md +10 -0
- data/docs/WriteContactInformationSerializer.md +15 -0
- data/docs/WriteContractorSerializer.md +14 -0
- data/docs/WriteIncomeNestedSerializer.md +12 -0
- data/docs/WriteIncomeSerializer.md +13 -0
- data/docs/WriteIncomeSerializerFixedSource.md +12 -0
- data/docs/WriteInvoiceSerializer.md +13 -0
- data/docs/WriteInvoiceSerializerFixedSourceCreate.md +9 -0
- data/docs/WriteJSONWebTokenSerializer.md +7 -0
- data/docs/WriteManagerPlatformSerializer.md +15 -0
- data/docs/WriteManagerSerializer.md +8 -0
- data/docs/WriteMembershipSerializer.md +8 -0
- data/docs/WritePersonalInformationSerializer.md +16 -0
- data/docs/WritePlaidPublicTokenSerializer.md +8 -0
- data/docs/WritePlatformIncomeRequestSerializer.md +10 -0
- data/docs/WritePlatformMembershipRequestSerializer.md +7 -0
- data/docs/WritePlatformSerializer.md +19 -0
- data/docs/WritePlatformSummarySerializer.md +8 -0
- data/docs/WriteRebateSerializer.md +9 -0
- data/docs/WriteReceivablesSerializer.md +8 -0
- data/docs/WriteTaxSavingsSerializer.md +8 -0
- data/docs/WriteUserAccountSerializer.md +14 -0
- data/docs/WriteUserCashoutSerializer.md +15 -0
- data/docs/WriteUserIncomeRequestSerializer.md +10 -0
- data/docs/WriteUserPlatformMembershipRequestSerializer.md +9 -0
- data/docs/WriteUserSerializer.md +21 -0
- data/generate-client.sh +6 -0
- data/lib/qwil_api/api/accounts_api.rb +320 -0
- data/lib/qwil_api/api/apitokenauth_api.rb +87 -0
- data/lib/qwil_api/api/cashouts_api.rb +89 -0
- data/lib/qwil_api/api/income_api.rb +142 -0
- data/lib/qwil_api/api/invoices_api.rb +142 -0
- data/lib/qwil_api/api/managers_api.rb +237 -0
- data/lib/qwil_api/api/memberships_api.rb +89 -0
- data/lib/qwil_api/api/platforms_api.rb +1674 -0
- data/lib/qwil_api/api/rebates_api.rb +142 -0
- data/lib/qwil_api/api/users_api.rb +2672 -0
- data/lib/qwil_api/api_client.rb +376 -0
- data/lib/qwil_api/api_error.rb +45 -0
- data/lib/qwil_api/configuration.rb +205 -0
- data/lib/qwil_api/models/account_serializer.rb +370 -0
- data/lib/qwil_api/models/cashout_calculation_serializer.rb +221 -0
- data/lib/qwil_api/models/cashout_serializer.rb +379 -0
- data/lib/qwil_api/models/cashout_slice_serializer.rb +232 -0
- data/lib/qwil_api/models/company_information_serializer.rb +299 -0
- data/lib/qwil_api/models/contact_info_serializer.rb +218 -0
- data/lib/qwil_api/models/contact_information_serializer.rb +280 -0
- data/lib/qwil_api/models/contractor_serializer.rb +361 -0
- data/lib/qwil_api/models/income_nested_serializer.rb +302 -0
- data/lib/qwil_api/models/income_serializer.rb +302 -0
- data/lib/qwil_api/models/income_serializer_fixed_source.rb +302 -0
- data/lib/qwil_api/models/invoice_serializer.rb +299 -0
- data/lib/qwil_api/models/invoice_serializer_fixed_source_create.rb +299 -0
- data/lib/qwil_api/models/json_web_token_serializer.rb +188 -0
- data/lib/qwil_api/models/manager_platform_serializer.rb +391 -0
- data/lib/qwil_api/models/manager_serializer.rb +218 -0
- data/lib/qwil_api/models/membership_serializer.rb +208 -0
- data/lib/qwil_api/models/personal_information_serializer.rb +279 -0
- data/lib/qwil_api/models/plaid_public_token_serializer.rb +199 -0
- data/lib/qwil_api/models/platform_income_request_serializer.rb +307 -0
- data/lib/qwil_api/models/platform_membership_request_serializer.rb +262 -0
- data/lib/qwil_api/models/platform_serializer.rb +480 -0
- data/lib/qwil_api/models/platform_summary_serializer.rb +218 -0
- data/lib/qwil_api/models/rebate_serializer.rb +276 -0
- data/lib/qwil_api/models/receivables_serializer.rb +208 -0
- data/lib/qwil_api/models/tax_savings_serializer.rb +219 -0
- data/lib/qwil_api/models/user_account_serializer.rb +359 -0
- data/lib/qwil_api/models/user_cashout_serializer.rb +379 -0
- data/lib/qwil_api/models/user_income_request_serializer.rb +307 -0
- data/lib/qwil_api/models/user_platform_membership_request_serializer.rb +283 -0
- data/lib/qwil_api/models/user_serializer.rb +592 -0
- data/lib/qwil_api/models/write_account_serializer.rb +331 -0
- data/lib/qwil_api/models/write_cashout_calculation_serializer.rb +198 -0
- data/lib/qwil_api/models/write_cashout_serializer.rb +316 -0
- data/lib/qwil_api/models/write_cashout_slice_serializer.rb +232 -0
- data/lib/qwil_api/models/write_company_information_serializer.rb +280 -0
- data/lib/qwil_api/models/write_contact_info_serializer.rb +218 -0
- data/lib/qwil_api/models/write_contact_information_serializer.rb +262 -0
- data/lib/qwil_api/models/write_contractor_serializer.rb +289 -0
- data/lib/qwil_api/models/write_income_nested_serializer.rb +236 -0
- data/lib/qwil_api/models/write_income_serializer.rb +247 -0
- data/lib/qwil_api/models/write_income_serializer_fixed_source.rb +236 -0
- data/lib/qwil_api/models/write_invoice_serializer.rb +252 -0
- data/lib/qwil_api/models/write_invoice_serializer_fixed_source_create.rb +210 -0
- data/lib/qwil_api/models/write_json_web_token_serializer.rb +188 -0
- data/lib/qwil_api/models/write_manager_platform_serializer.rb +314 -0
- data/lib/qwil_api/models/write_manager_serializer.rb +198 -0
- data/lib/qwil_api/models/write_membership_serializer.rb +198 -0
- data/lib/qwil_api/models/write_personal_information_serializer.rb +270 -0
- data/lib/qwil_api/models/write_plaid_public_token_serializer.rb +199 -0
- data/lib/qwil_api/models/write_platform_income_request_serializer.rb +220 -0
- data/lib/qwil_api/models/write_platform_membership_request_serializer.rb +188 -0
- data/lib/qwil_api/models/write_platform_serializer.rb +309 -0
- data/lib/qwil_api/models/write_platform_summary_serializer.rb +198 -0
- data/lib/qwil_api/models/write_rebate_serializer.rb +209 -0
- data/lib/qwil_api/models/write_receivables_serializer.rb +198 -0
- data/lib/qwil_api/models/write_tax_savings_serializer.rb +198 -0
- data/lib/qwil_api/models/write_user_account_serializer.rb +312 -0
- data/lib/qwil_api/models/write_user_cashout_serializer.rb +307 -0
- data/lib/qwil_api/models/write_user_income_request_serializer.rb +220 -0
- data/lib/qwil_api/models/write_user_platform_membership_request_serializer.rb +208 -0
- data/lib/qwil_api/models/write_user_serializer.rb +358 -0
- data/lib/qwil_api/version.rb +24 -0
- data/lib/qwil_api.rb +51 -0
- data/qwil_api.gemspec +53 -0
- data/spec/api/accounts_api_spec.rb +110 -0
- data/spec/api/apitokenauth_api_spec.rb +56 -0
- data/spec/api/cashouts_api_spec.rb +56 -0
- data/spec/api/income_api_spec.rb +67 -0
- data/spec/api/invoices_api_spec.rb +67 -0
- data/spec/api/managers_api_spec.rb +88 -0
- data/spec/api/memberships_api_spec.rb +56 -0
- data/spec/api/platforms_api_spec.rb +398 -0
- data/spec/api/rebates_api_spec.rb +67 -0
- data/spec/api/users_api_spec.rb +625 -0
- data/spec/api_client_spec.rb +235 -0
- data/spec/configuration_spec.rb +51 -0
- data/spec/models/account_serializer_spec.rb +111 -0
- data/spec/models/cashout_calculation_serializer_spec.rb +63 -0
- data/spec/models/cashout_serializer_spec.rb +135 -0
- data/spec/models/cashout_slice_serializer_spec.rb +69 -0
- data/spec/models/company_information_serializer_spec.rb +111 -0
- data/spec/models/contact_info_serializer_spec.rb +63 -0
- data/spec/models/contact_information_serializer_spec.rb +99 -0
- data/spec/models/contractor_serializer_spec.rb +127 -0
- data/spec/models/income_nested_serializer_spec.rb +111 -0
- data/spec/models/income_serializer_fixed_source_spec.rb +111 -0
- data/spec/models/income_serializer_spec.rb +111 -0
- data/spec/models/invoice_serializer_fixed_source_create_spec.rb +105 -0
- data/spec/models/invoice_serializer_spec.rb +105 -0
- data/spec/models/json_web_token_serializer_spec.rb +45 -0
- data/spec/models/manager_platform_serializer_spec.rb +143 -0
- data/spec/models/manager_serializer_spec.rb +63 -0
- data/spec/models/membership_serializer_spec.rb +57 -0
- data/spec/models/personal_information_serializer_spec.rb +99 -0
- data/spec/models/plaid_public_token_serializer_spec.rb +51 -0
- data/spec/models/platform_income_request_serializer_spec.rb +97 -0
- data/spec/models/platform_membership_request_serializer_spec.rb +73 -0
- data/spec/models/platform_serializer_spec.rb +191 -0
- data/spec/models/platform_summary_serializer_spec.rb +63 -0
- data/spec/models/rebate_serializer_spec.rb +93 -0
- data/spec/models/receivables_serializer_spec.rb +57 -0
- data/spec/models/tax_savings_serializer_spec.rb +63 -0
- data/spec/models/user_account_serializer_spec.rb +105 -0
- data/spec/models/user_cashout_serializer_spec.rb +135 -0
- data/spec/models/user_income_request_serializer_spec.rb +97 -0
- data/spec/models/user_platform_membership_request_serializer_spec.rb +85 -0
- data/spec/models/user_serializer_spec.rb +251 -0
- data/spec/models/write_account_serializer_spec.rb +99 -0
- data/spec/models/write_cashout_calculation_serializer_spec.rb +51 -0
- data/spec/models/write_cashout_serializer_spec.rb +107 -0
- data/spec/models/write_cashout_slice_serializer_spec.rb +69 -0
- data/spec/models/write_company_information_serializer_spec.rb +105 -0
- data/spec/models/write_contact_info_serializer_spec.rb +63 -0
- data/spec/models/write_contact_information_serializer_spec.rb +93 -0
- data/spec/models/write_contractor_serializer_spec.rb +91 -0
- data/spec/models/write_income_nested_serializer_spec.rb +75 -0
- data/spec/models/write_income_serializer_fixed_source_spec.rb +75 -0
- data/spec/models/write_income_serializer_spec.rb +81 -0
- data/spec/models/write_invoice_serializer_fixed_source_create_spec.rb +57 -0
- data/spec/models/write_invoice_serializer_spec.rb +81 -0
- data/spec/models/write_json_web_token_serializer_spec.rb +45 -0
- data/spec/models/write_manager_platform_serializer_spec.rb +101 -0
- data/spec/models/write_manager_serializer_spec.rb +51 -0
- data/spec/models/write_membership_serializer_spec.rb +51 -0
- data/spec/models/write_personal_information_serializer_spec.rb +99 -0
- data/spec/models/write_plaid_public_token_serializer_spec.rb +51 -0
- data/spec/models/write_platform_income_request_serializer_spec.rb +63 -0
- data/spec/models/write_platform_membership_request_serializer_spec.rb +45 -0
- data/spec/models/write_platform_serializer_spec.rb +117 -0
- data/spec/models/write_platform_summary_serializer_spec.rb +51 -0
- data/spec/models/write_rebate_serializer_spec.rb +57 -0
- data/spec/models/write_receivables_serializer_spec.rb +51 -0
- data/spec/models/write_tax_savings_serializer_spec.rb +51 -0
- data/spec/models/write_user_account_serializer_spec.rb +87 -0
- data/spec/models/write_user_cashout_serializer_spec.rb +101 -0
- data/spec/models/write_user_income_request_serializer_spec.rb +63 -0
- data/spec/models/write_user_platform_membership_request_serializer_spec.rb +57 -0
- data/spec/models/write_user_serializer_spec.rb +133 -0
- data/spec/spec_helper.rb +120 -0
- data/swagger-codegen-config.json +9 -0
- metadata +527 -0
@@ -0,0 +1,188 @@
|
|
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 WritePlatformMembershipRequestSerializer
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# Attribute type mapping.
|
35
|
+
def self.swagger_types
|
36
|
+
{
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# Initializes the object
|
41
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
42
|
+
def initialize(attributes = {})
|
43
|
+
return unless attributes.is_a?(Hash)
|
44
|
+
|
45
|
+
# convert string to symbol for hash key
|
46
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
51
|
+
# @return Array for valid properies with the reasons
|
52
|
+
def list_invalid_properties
|
53
|
+
invalid_properties = Array.new
|
54
|
+
return invalid_properties
|
55
|
+
end
|
56
|
+
|
57
|
+
# Check to see if the all the properties in the model are valid
|
58
|
+
# @return true if the model is valid
|
59
|
+
def valid?
|
60
|
+
return true
|
61
|
+
end
|
62
|
+
|
63
|
+
# Checks equality by comparing each attribute.
|
64
|
+
# @param [Object] Object to be compared
|
65
|
+
def ==(o)
|
66
|
+
return true if self.equal?(o)
|
67
|
+
self.class == o.class
|
68
|
+
end
|
69
|
+
|
70
|
+
# @see the `==` method
|
71
|
+
# @param [Object] Object to be compared
|
72
|
+
def eql?(o)
|
73
|
+
self == o
|
74
|
+
end
|
75
|
+
|
76
|
+
# Calculates hash code according to all attributes.
|
77
|
+
# @return [Fixnum] Hash code
|
78
|
+
def hash
|
79
|
+
[].hash
|
80
|
+
end
|
81
|
+
|
82
|
+
# Builds the object from hash
|
83
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
84
|
+
# @return [Object] Returns the model itself
|
85
|
+
def build_from_hash(attributes)
|
86
|
+
return nil unless attributes.is_a?(Hash)
|
87
|
+
self.class.swagger_types.each_pair do |key, type|
|
88
|
+
if type =~ /^Array<(.*)>/i
|
89
|
+
# check to ensure the input is an array given that the the attribute
|
90
|
+
# is documented as an array but the input is not
|
91
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
92
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
93
|
+
end
|
94
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
95
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
96
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
97
|
+
end
|
98
|
+
|
99
|
+
self
|
100
|
+
end
|
101
|
+
|
102
|
+
# Deserializes the data based on type
|
103
|
+
# @param string type Data type
|
104
|
+
# @param string value Value to be deserialized
|
105
|
+
# @return [Object] Deserialized data
|
106
|
+
def _deserialize(type, value)
|
107
|
+
case type.to_sym
|
108
|
+
when :DateTime
|
109
|
+
DateTime.parse(value)
|
110
|
+
when :Date
|
111
|
+
Date.parse(value)
|
112
|
+
when :String
|
113
|
+
value.to_s
|
114
|
+
when :Integer
|
115
|
+
value.to_i
|
116
|
+
when :Float
|
117
|
+
value.to_f
|
118
|
+
when :BOOLEAN
|
119
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
120
|
+
true
|
121
|
+
else
|
122
|
+
false
|
123
|
+
end
|
124
|
+
when :Object
|
125
|
+
# generic object (usually a Hash), return directly
|
126
|
+
value
|
127
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
128
|
+
inner_type = Regexp.last_match[:inner_type]
|
129
|
+
value.map { |v| _deserialize(inner_type, v) }
|
130
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
131
|
+
k_type = Regexp.last_match[:k_type]
|
132
|
+
v_type = Regexp.last_match[:v_type]
|
133
|
+
{}.tap do |hash|
|
134
|
+
value.each do |k, v|
|
135
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
136
|
+
end
|
137
|
+
end
|
138
|
+
else # model
|
139
|
+
temp_model = QwilAPI.const_get(type).new
|
140
|
+
temp_model.build_from_hash(value)
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
# Returns the string representation of the object
|
145
|
+
# @return [String] String presentation of the object
|
146
|
+
def to_s
|
147
|
+
to_hash.to_s
|
148
|
+
end
|
149
|
+
|
150
|
+
# to_body is an alias to to_hash (backward compatibility)
|
151
|
+
# @return [Hash] Returns the object in the form of hash
|
152
|
+
def to_body
|
153
|
+
to_hash
|
154
|
+
end
|
155
|
+
|
156
|
+
# Returns the object in the form of hash
|
157
|
+
# @return [Hash] Returns the object in the form of hash
|
158
|
+
def to_hash
|
159
|
+
hash = {}
|
160
|
+
self.class.attribute_map.each_pair do |attr, param|
|
161
|
+
value = self.send(attr)
|
162
|
+
next if value.nil?
|
163
|
+
hash[param] = _to_hash(value)
|
164
|
+
end
|
165
|
+
hash
|
166
|
+
end
|
167
|
+
|
168
|
+
# Outputs non-array value in the form of hash
|
169
|
+
# For object, use to_hash. Otherwise, just return the value
|
170
|
+
# @param [Object] value Any valid value
|
171
|
+
# @return [Hash] Returns the value in the form of hash
|
172
|
+
def _to_hash(value)
|
173
|
+
if value.is_a?(Array)
|
174
|
+
value.compact.map{ |v| _to_hash(v) }
|
175
|
+
elsif value.is_a?(Hash)
|
176
|
+
{}.tap do |hash|
|
177
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
178
|
+
end
|
179
|
+
elsif value.respond_to? :to_hash
|
180
|
+
value.to_hash
|
181
|
+
else
|
182
|
+
value
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
end
|
187
|
+
|
188
|
+
end
|
@@ -0,0 +1,309 @@
|
|
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 WritePlatformSerializer
|
27
|
+
attr_accessor :name
|
28
|
+
|
29
|
+
# The date that the first payment is due for the platform's pay cycle.
|
30
|
+
attr_accessor :payment_date
|
31
|
+
|
32
|
+
# Flag specifying if the Platform's Invoices should be debited automatically.
|
33
|
+
attr_accessor :automatic_debit
|
34
|
+
|
35
|
+
attr_accessor :thumbnail_url
|
36
|
+
|
37
|
+
# If True, this platform is has been validated as a real company.
|
38
|
+
attr_accessor :validated
|
39
|
+
|
40
|
+
# If True, this platform is featured in the search list.
|
41
|
+
attr_accessor :featured
|
42
|
+
|
43
|
+
# If True, all users on this platform are demo users, and no payments will be debited/credited.
|
44
|
+
attr_accessor :is_demo_platform
|
45
|
+
|
46
|
+
# If True, this platform can enable the Xero integration.
|
47
|
+
attr_accessor :xero_enabled
|
48
|
+
|
49
|
+
# If True, enable experimental IncomeRequest UI for this User.
|
50
|
+
attr_accessor :use_income_requests
|
51
|
+
|
52
|
+
# Flag indicating if we should send any emails to Users on this Platform. If not set, email checks fall through to global defaults.
|
53
|
+
attr_accessor :enable_emails
|
54
|
+
|
55
|
+
# The account to use for billing purposes.
|
56
|
+
attr_accessor :default_account
|
57
|
+
|
58
|
+
# The accounts configured for billing on this Platform.
|
59
|
+
attr_accessor :accounts
|
60
|
+
|
61
|
+
|
62
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
63
|
+
def self.attribute_map
|
64
|
+
{
|
65
|
+
:'name' => :'name',
|
66
|
+
:'payment_date' => :'payment_date',
|
67
|
+
:'automatic_debit' => :'automatic_debit',
|
68
|
+
:'thumbnail_url' => :'thumbnail_url',
|
69
|
+
:'validated' => :'validated',
|
70
|
+
:'featured' => :'featured',
|
71
|
+
:'is_demo_platform' => :'is_demo_platform',
|
72
|
+
:'xero_enabled' => :'xero_enabled',
|
73
|
+
:'use_income_requests' => :'use_income_requests',
|
74
|
+
:'enable_emails' => :'enable_emails',
|
75
|
+
:'default_account' => :'default_account',
|
76
|
+
:'accounts' => :'accounts'
|
77
|
+
}
|
78
|
+
end
|
79
|
+
|
80
|
+
# Attribute type mapping.
|
81
|
+
def self.swagger_types
|
82
|
+
{
|
83
|
+
:'name' => :'String',
|
84
|
+
:'payment_date' => :'Date',
|
85
|
+
:'automatic_debit' => :'BOOLEAN',
|
86
|
+
:'thumbnail_url' => :'String',
|
87
|
+
:'validated' => :'BOOLEAN',
|
88
|
+
:'featured' => :'BOOLEAN',
|
89
|
+
:'is_demo_platform' => :'BOOLEAN',
|
90
|
+
:'xero_enabled' => :'BOOLEAN',
|
91
|
+
:'use_income_requests' => :'BOOLEAN',
|
92
|
+
:'enable_emails' => :'BOOLEAN',
|
93
|
+
:'default_account' => :'String',
|
94
|
+
:'accounts' => :'Array<String>'
|
95
|
+
}
|
96
|
+
end
|
97
|
+
|
98
|
+
# Initializes the object
|
99
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
100
|
+
def initialize(attributes = {})
|
101
|
+
return unless attributes.is_a?(Hash)
|
102
|
+
|
103
|
+
# convert string to symbol for hash key
|
104
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
105
|
+
|
106
|
+
if attributes.has_key?(:'name')
|
107
|
+
self.name = attributes[:'name']
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.has_key?(:'payment_date')
|
111
|
+
self.payment_date = attributes[:'payment_date']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.has_key?(:'automatic_debit')
|
115
|
+
self.automatic_debit = attributes[:'automatic_debit']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.has_key?(:'thumbnail_url')
|
119
|
+
self.thumbnail_url = attributes[:'thumbnail_url']
|
120
|
+
end
|
121
|
+
|
122
|
+
if attributes.has_key?(:'validated')
|
123
|
+
self.validated = attributes[:'validated']
|
124
|
+
end
|
125
|
+
|
126
|
+
if attributes.has_key?(:'featured')
|
127
|
+
self.featured = attributes[:'featured']
|
128
|
+
end
|
129
|
+
|
130
|
+
if attributes.has_key?(:'is_demo_platform')
|
131
|
+
self.is_demo_platform = attributes[:'is_demo_platform']
|
132
|
+
end
|
133
|
+
|
134
|
+
if attributes.has_key?(:'xero_enabled')
|
135
|
+
self.xero_enabled = attributes[:'xero_enabled']
|
136
|
+
end
|
137
|
+
|
138
|
+
if attributes.has_key?(:'use_income_requests')
|
139
|
+
self.use_income_requests = attributes[:'use_income_requests']
|
140
|
+
end
|
141
|
+
|
142
|
+
if attributes.has_key?(:'enable_emails')
|
143
|
+
self.enable_emails = attributes[:'enable_emails']
|
144
|
+
end
|
145
|
+
|
146
|
+
if attributes.has_key?(:'default_account')
|
147
|
+
self.default_account = attributes[:'default_account']
|
148
|
+
end
|
149
|
+
|
150
|
+
if attributes.has_key?(:'accounts')
|
151
|
+
if (value = attributes[:'accounts']).is_a?(Array)
|
152
|
+
self.accounts = value
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
end
|
157
|
+
|
158
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
159
|
+
# @return Array for valid properies with the reasons
|
160
|
+
def list_invalid_properties
|
161
|
+
invalid_properties = Array.new
|
162
|
+
return invalid_properties
|
163
|
+
end
|
164
|
+
|
165
|
+
# Check to see if the all the properties in the model are valid
|
166
|
+
# @return true if the model is valid
|
167
|
+
def valid?
|
168
|
+
return false if @name.nil?
|
169
|
+
return true
|
170
|
+
end
|
171
|
+
|
172
|
+
# Checks equality by comparing each attribute.
|
173
|
+
# @param [Object] Object to be compared
|
174
|
+
def ==(o)
|
175
|
+
return true if self.equal?(o)
|
176
|
+
self.class == o.class &&
|
177
|
+
name == o.name &&
|
178
|
+
payment_date == o.payment_date &&
|
179
|
+
automatic_debit == o.automatic_debit &&
|
180
|
+
thumbnail_url == o.thumbnail_url &&
|
181
|
+
validated == o.validated &&
|
182
|
+
featured == o.featured &&
|
183
|
+
is_demo_platform == o.is_demo_platform &&
|
184
|
+
xero_enabled == o.xero_enabled &&
|
185
|
+
use_income_requests == o.use_income_requests &&
|
186
|
+
enable_emails == o.enable_emails &&
|
187
|
+
default_account == o.default_account &&
|
188
|
+
accounts == o.accounts
|
189
|
+
end
|
190
|
+
|
191
|
+
# @see the `==` method
|
192
|
+
# @param [Object] Object to be compared
|
193
|
+
def eql?(o)
|
194
|
+
self == o
|
195
|
+
end
|
196
|
+
|
197
|
+
# Calculates hash code according to all attributes.
|
198
|
+
# @return [Fixnum] Hash code
|
199
|
+
def hash
|
200
|
+
[name, payment_date, automatic_debit, thumbnail_url, validated, featured, is_demo_platform, xero_enabled, use_income_requests, enable_emails, default_account, accounts].hash
|
201
|
+
end
|
202
|
+
|
203
|
+
# Builds the object from hash
|
204
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
205
|
+
# @return [Object] Returns the model itself
|
206
|
+
def build_from_hash(attributes)
|
207
|
+
return nil unless attributes.is_a?(Hash)
|
208
|
+
self.class.swagger_types.each_pair do |key, type|
|
209
|
+
if type =~ /^Array<(.*)>/i
|
210
|
+
# check to ensure the input is an array given that the the attribute
|
211
|
+
# is documented as an array but the input is not
|
212
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
213
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
214
|
+
end
|
215
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
216
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
217
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
218
|
+
end
|
219
|
+
|
220
|
+
self
|
221
|
+
end
|
222
|
+
|
223
|
+
# Deserializes the data based on type
|
224
|
+
# @param string type Data type
|
225
|
+
# @param string value Value to be deserialized
|
226
|
+
# @return [Object] Deserialized data
|
227
|
+
def _deserialize(type, value)
|
228
|
+
case type.to_sym
|
229
|
+
when :DateTime
|
230
|
+
DateTime.parse(value)
|
231
|
+
when :Date
|
232
|
+
Date.parse(value)
|
233
|
+
when :String
|
234
|
+
value.to_s
|
235
|
+
when :Integer
|
236
|
+
value.to_i
|
237
|
+
when :Float
|
238
|
+
value.to_f
|
239
|
+
when :BOOLEAN
|
240
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
241
|
+
true
|
242
|
+
else
|
243
|
+
false
|
244
|
+
end
|
245
|
+
when :Object
|
246
|
+
# generic object (usually a Hash), return directly
|
247
|
+
value
|
248
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
249
|
+
inner_type = Regexp.last_match[:inner_type]
|
250
|
+
value.map { |v| _deserialize(inner_type, v) }
|
251
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
252
|
+
k_type = Regexp.last_match[:k_type]
|
253
|
+
v_type = Regexp.last_match[:v_type]
|
254
|
+
{}.tap do |hash|
|
255
|
+
value.each do |k, v|
|
256
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
257
|
+
end
|
258
|
+
end
|
259
|
+
else # model
|
260
|
+
temp_model = QwilAPI.const_get(type).new
|
261
|
+
temp_model.build_from_hash(value)
|
262
|
+
end
|
263
|
+
end
|
264
|
+
|
265
|
+
# Returns the string representation of the object
|
266
|
+
# @return [String] String presentation of the object
|
267
|
+
def to_s
|
268
|
+
to_hash.to_s
|
269
|
+
end
|
270
|
+
|
271
|
+
# to_body is an alias to to_hash (backward compatibility)
|
272
|
+
# @return [Hash] Returns the object in the form of hash
|
273
|
+
def to_body
|
274
|
+
to_hash
|
275
|
+
end
|
276
|
+
|
277
|
+
# Returns the object in the form of hash
|
278
|
+
# @return [Hash] Returns the object in the form of hash
|
279
|
+
def to_hash
|
280
|
+
hash = {}
|
281
|
+
self.class.attribute_map.each_pair do |attr, param|
|
282
|
+
value = self.send(attr)
|
283
|
+
next if value.nil?
|
284
|
+
hash[param] = _to_hash(value)
|
285
|
+
end
|
286
|
+
hash
|
287
|
+
end
|
288
|
+
|
289
|
+
# Outputs non-array value in the form of hash
|
290
|
+
# For object, use to_hash. Otherwise, just return the value
|
291
|
+
# @param [Object] value Any valid value
|
292
|
+
# @return [Hash] Returns the value in the form of hash
|
293
|
+
def _to_hash(value)
|
294
|
+
if value.is_a?(Array)
|
295
|
+
value.compact.map{ |v| _to_hash(v) }
|
296
|
+
elsif value.is_a?(Hash)
|
297
|
+
{}.tap do |hash|
|
298
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
299
|
+
end
|
300
|
+
elsif value.respond_to? :to_hash
|
301
|
+
value.to_hash
|
302
|
+
else
|
303
|
+
value
|
304
|
+
end
|
305
|
+
end
|
306
|
+
|
307
|
+
end
|
308
|
+
|
309
|
+
end
|
@@ -0,0 +1,198 @@
|
|
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 WritePlatformSummarySerializer
|
27
|
+
attr_accessor :name
|
28
|
+
|
29
|
+
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
31
|
+
def self.attribute_map
|
32
|
+
{
|
33
|
+
:'name' => :'name'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Attribute type mapping.
|
38
|
+
def self.swagger_types
|
39
|
+
{
|
40
|
+
:'name' => :'String'
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
# Initializes the object
|
45
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
46
|
+
def initialize(attributes = {})
|
47
|
+
return unless attributes.is_a?(Hash)
|
48
|
+
|
49
|
+
# convert string to symbol for hash key
|
50
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
51
|
+
|
52
|
+
if attributes.has_key?(:'name')
|
53
|
+
self.name = attributes[:'name']
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
|
58
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
59
|
+
# @return Array for valid properies with the reasons
|
60
|
+
def list_invalid_properties
|
61
|
+
invalid_properties = Array.new
|
62
|
+
return invalid_properties
|
63
|
+
end
|
64
|
+
|
65
|
+
# Check to see if the all the properties in the model are valid
|
66
|
+
# @return true if the model is valid
|
67
|
+
def valid?
|
68
|
+
return false if @name.nil?
|
69
|
+
return true
|
70
|
+
end
|
71
|
+
|
72
|
+
# Checks equality by comparing each attribute.
|
73
|
+
# @param [Object] Object to be compared
|
74
|
+
def ==(o)
|
75
|
+
return true if self.equal?(o)
|
76
|
+
self.class == o.class &&
|
77
|
+
name == o.name
|
78
|
+
end
|
79
|
+
|
80
|
+
# @see the `==` method
|
81
|
+
# @param [Object] Object to be compared
|
82
|
+
def eql?(o)
|
83
|
+
self == o
|
84
|
+
end
|
85
|
+
|
86
|
+
# Calculates hash code according to all attributes.
|
87
|
+
# @return [Fixnum] Hash code
|
88
|
+
def hash
|
89
|
+
[name].hash
|
90
|
+
end
|
91
|
+
|
92
|
+
# Builds the object from hash
|
93
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
94
|
+
# @return [Object] Returns the model itself
|
95
|
+
def build_from_hash(attributes)
|
96
|
+
return nil unless attributes.is_a?(Hash)
|
97
|
+
self.class.swagger_types.each_pair do |key, type|
|
98
|
+
if type =~ /^Array<(.*)>/i
|
99
|
+
# check to ensure the input is an array given that the the attribute
|
100
|
+
# is documented as an array but the input is not
|
101
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
102
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
103
|
+
end
|
104
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
105
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
106
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
107
|
+
end
|
108
|
+
|
109
|
+
self
|
110
|
+
end
|
111
|
+
|
112
|
+
# Deserializes the data based on type
|
113
|
+
# @param string type Data type
|
114
|
+
# @param string value Value to be deserialized
|
115
|
+
# @return [Object] Deserialized data
|
116
|
+
def _deserialize(type, value)
|
117
|
+
case type.to_sym
|
118
|
+
when :DateTime
|
119
|
+
DateTime.parse(value)
|
120
|
+
when :Date
|
121
|
+
Date.parse(value)
|
122
|
+
when :String
|
123
|
+
value.to_s
|
124
|
+
when :Integer
|
125
|
+
value.to_i
|
126
|
+
when :Float
|
127
|
+
value.to_f
|
128
|
+
when :BOOLEAN
|
129
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
130
|
+
true
|
131
|
+
else
|
132
|
+
false
|
133
|
+
end
|
134
|
+
when :Object
|
135
|
+
# generic object (usually a Hash), return directly
|
136
|
+
value
|
137
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
138
|
+
inner_type = Regexp.last_match[:inner_type]
|
139
|
+
value.map { |v| _deserialize(inner_type, v) }
|
140
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
141
|
+
k_type = Regexp.last_match[:k_type]
|
142
|
+
v_type = Regexp.last_match[:v_type]
|
143
|
+
{}.tap do |hash|
|
144
|
+
value.each do |k, v|
|
145
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
146
|
+
end
|
147
|
+
end
|
148
|
+
else # model
|
149
|
+
temp_model = QwilAPI.const_get(type).new
|
150
|
+
temp_model.build_from_hash(value)
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
# Returns the string representation of the object
|
155
|
+
# @return [String] String presentation of the object
|
156
|
+
def to_s
|
157
|
+
to_hash.to_s
|
158
|
+
end
|
159
|
+
|
160
|
+
# to_body is an alias to to_hash (backward compatibility)
|
161
|
+
# @return [Hash] Returns the object in the form of hash
|
162
|
+
def to_body
|
163
|
+
to_hash
|
164
|
+
end
|
165
|
+
|
166
|
+
# Returns the object in the form of hash
|
167
|
+
# @return [Hash] Returns the object in the form of hash
|
168
|
+
def to_hash
|
169
|
+
hash = {}
|
170
|
+
self.class.attribute_map.each_pair do |attr, param|
|
171
|
+
value = self.send(attr)
|
172
|
+
next if value.nil?
|
173
|
+
hash[param] = _to_hash(value)
|
174
|
+
end
|
175
|
+
hash
|
176
|
+
end
|
177
|
+
|
178
|
+
# Outputs non-array value in the form of hash
|
179
|
+
# For object, use to_hash. Otherwise, just return the value
|
180
|
+
# @param [Object] value Any valid value
|
181
|
+
# @return [Hash] Returns the value in the form of hash
|
182
|
+
def _to_hash(value)
|
183
|
+
if value.is_a?(Array)
|
184
|
+
value.compact.map{ |v| _to_hash(v) }
|
185
|
+
elsif value.is_a?(Hash)
|
186
|
+
{}.tap do |hash|
|
187
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
188
|
+
end
|
189
|
+
elsif value.respond_to? :to_hash
|
190
|
+
value.to_hash
|
191
|
+
else
|
192
|
+
value
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
end
|
197
|
+
|
198
|
+
end
|