taxamo 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/LICENSE +11 -0
- data/README.md +120 -0
- data/Rakefile +7 -0
- data/lib/monkey.rb +90 -0
- data/lib/swagger.rb +93 -0
- data/lib/swagger/configuration.rb +21 -0
- data/lib/swagger/request.rb +198 -0
- data/lib/swagger/response.rb +87 -0
- data/lib/taxamo.rb +999 -0
- data/lib/taxamo/models/additionalcurrencies.rb +62 -0
- data/lib/taxamo/models/additionalcurrency.rb +82 -0
- data/lib/taxamo/models/bycountry.rb +77 -0
- data/lib/taxamo/models/bystatus.rb +69 -0
- data/lib/taxamo/models/bytaxationtype.rb +82 -0
- data/lib/taxamo/models/c.rb +77 -0
- data/lib/taxamo/models/calculatesimpletaxout.rb +62 -0
- data/lib/taxamo/models/calculatetaxin.rb +62 -0
- data/lib/taxamo/models/calculatetaxlocationout.rb +97 -0
- data/lib/taxamo/models/calculatetaxout.rb +62 -0
- data/lib/taxamo/models/canceltransactionout.rb +62 -0
- data/lib/taxamo/models/capturepaymentout.rb +62 -0
- data/lib/taxamo/models/confirmtransactionin.rb +62 -0
- data/lib/taxamo/models/confirmtransactionout.rb +62 -0
- data/lib/taxamo/models/countries.rb +112 -0
- data/lib/taxamo/models/country.rb +114 -0
- data/lib/taxamo/models/countryschema.rb +114 -0
- data/lib/taxamo/models/createpaymentin.rb +72 -0
- data/lib/taxamo/models/createpaymentout.rb +62 -0
- data/lib/taxamo/models/createrefundin.rb +77 -0
- data/lib/taxamo/models/createrefundout.rb +77 -0
- data/lib/taxamo/models/createsmstokenin.rb +67 -0
- data/lib/taxamo/models/createsmstokenout.rb +62 -0
- data/lib/taxamo/models/createtransactionin.rb +67 -0
- data/lib/taxamo/models/createtransactionout.rb +62 -0
- data/lib/taxamo/models/currencyschema.rb +82 -0
- data/lib/taxamo/models/customfields.rb +67 -0
- data/lib/taxamo/models/emailinvoicein.rb +62 -0
- data/lib/taxamo/models/emailinvoiceout.rb +62 -0
- data/lib/taxamo/models/evidence.rb +112 -0
- data/lib/taxamo/models/evidenceschema.rb +77 -0
- data/lib/taxamo/models/getcountriesdictout.rb +63 -0
- data/lib/taxamo/models/getcurrenciesdictout.rb +63 -0
- data/lib/taxamo/models/getdailysettlementstatsout.rb +63 -0
- data/lib/taxamo/models/getproducttypesdictout.rb +63 -0
- data/lib/taxamo/models/getrefundsout.rb +63 -0
- data/lib/taxamo/models/getsettlementout.rb +83 -0
- data/lib/taxamo/models/getsettlementstatsbycountryout.rb +63 -0
- data/lib/taxamo/models/getsettlementstatsbytaxationtypeout.rb +62 -0
- data/lib/taxamo/models/getsettlementsummaryout.rb +62 -0
- data/lib/taxamo/models/gettransactionout.rb +62 -0
- data/lib/taxamo/models/gettransactionsstatsout.rb +62 -0
- data/lib/taxamo/models/inputtransaction.rb +184 -0
- data/lib/taxamo/models/inputtransactionline.rb +133 -0
- data/lib/taxamo/models/inputtransactionupdate.rb +184 -0
- data/lib/taxamo/models/invoiceaddress.rb +97 -0
- data/lib/taxamo/models/listpaymentsout.rb +63 -0
- data/lib/taxamo/models/listtransactionsout.rb +63 -0
- data/lib/taxamo/models/locategivenipout.rb +72 -0
- data/lib/taxamo/models/locatemyipout.rb +72 -0
- data/lib/taxamo/models/n.rb +77 -0
- data/lib/taxamo/models/payments.rb +72 -0
- data/lib/taxamo/models/producttypeschema.rb +62 -0
- data/lib/taxamo/models/report.rb +92 -0
- data/lib/taxamo/models/settlementdailystatsschema.rb +102 -0
- data/lib/taxamo/models/summary.rb +87 -0
- data/lib/taxamo/models/transaction.rb +279 -0
- data/lib/taxamo/models/transactionlines.rb +163 -0
- data/lib/taxamo/models/transactions.rb +279 -0
- data/lib/taxamo/models/unconfirmtransactionin.rb +62 -0
- data/lib/taxamo/models/unconfirmtransactionout.rb +62 -0
- data/lib/taxamo/models/updatetransactionin.rb +62 -0
- data/lib/taxamo/models/updatetransactionout.rb +62 -0
- data/lib/taxamo/models/validatetaxnumberout.rb +77 -0
- data/lib/taxamo/models/verifysmstokenout.rb +62 -0
- data/lib/taxamo/version.rb +17 -0
- data/taxamo.gemspec +31 -0
- data/test/taxamo/connectivity_test.rb +55 -0
- data/test/taxamo/tax_test.rb +147 -0
- data/test/taxamo/transactions_api_test.rb +308 -0
- metadata +226 -0
@@ -0,0 +1,184 @@
|
|
1
|
+
# Copyright 2014-2015 Taxamo, Ltd.
|
2
|
+
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
|
6
|
+
#
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10
|
+
# See the License for the specific language governing permissions and
|
11
|
+
# limitations under the License.
|
12
|
+
|
13
|
+
class InputTransactionUpdate
|
14
|
+
attr_accessor :buyer_credit_card_prefix, :custom_data, :buyer_name, :invoice_date, :currency_code, :supply_date, :invoice_address, :verification_token, :transaction_lines, :buyer_tax_number, :custom_fields, :force_country_code, :invoice_number, :order_date, :buyer_ip, :buyer_email, :original_transaction_key, :billing_country_code, :custom_id, :additional_currencies, :invoice_place, :evidence, :description, :tax_deducted, :tax_country_code
|
15
|
+
|
16
|
+
# :internal => :external
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:buyer_credit_card_prefix => :buyer_credit_card_prefix,
|
20
|
+
:custom_data => :custom_data,
|
21
|
+
:buyer_name => :buyer_name,
|
22
|
+
:invoice_date => :invoice_date,
|
23
|
+
:currency_code => :currency_code,
|
24
|
+
:supply_date => :supply_date,
|
25
|
+
:invoice_address => :invoice_address,
|
26
|
+
:verification_token => :verification_token,
|
27
|
+
:transaction_lines => :transaction_lines,
|
28
|
+
:buyer_tax_number => :buyer_tax_number,
|
29
|
+
:custom_fields => :custom_fields,
|
30
|
+
:force_country_code => :force_country_code,
|
31
|
+
:invoice_number => :invoice_number,
|
32
|
+
:order_date => :order_date,
|
33
|
+
:buyer_ip => :buyer_ip,
|
34
|
+
:buyer_email => :buyer_email,
|
35
|
+
:original_transaction_key => :original_transaction_key,
|
36
|
+
:billing_country_code => :billing_country_code,
|
37
|
+
:custom_id => :custom_id,
|
38
|
+
:additional_currencies => :additional_currencies,
|
39
|
+
:invoice_place => :invoice_place,
|
40
|
+
:evidence => :evidence,
|
41
|
+
:description => :description,
|
42
|
+
:tax_deducted => :tax_deducted,
|
43
|
+
:tax_country_code => :tax_country_code
|
44
|
+
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
def initialize(attributes = {})
|
49
|
+
return if attributes.empty?
|
50
|
+
# Morph attribute keys into undescored rubyish style
|
51
|
+
if attributes["buyer_credit_card_prefix"]
|
52
|
+
@buyer_credit_card_prefix = attributes["buyer_credit_card_prefix"]
|
53
|
+
|
54
|
+
end
|
55
|
+
if attributes["custom_data"]
|
56
|
+
@custom_data = attributes["custom_data"]
|
57
|
+
|
58
|
+
end
|
59
|
+
if attributes["buyer_name"]
|
60
|
+
@buyer_name = attributes["buyer_name"]
|
61
|
+
|
62
|
+
end
|
63
|
+
if attributes["invoice_date"]
|
64
|
+
@invoice_date = attributes["invoice_date"]
|
65
|
+
|
66
|
+
end
|
67
|
+
if attributes["currency_code"]
|
68
|
+
@currency_code = attributes["currency_code"]
|
69
|
+
|
70
|
+
end
|
71
|
+
if attributes["supply_date"]
|
72
|
+
@supply_date = attributes["supply_date"]
|
73
|
+
|
74
|
+
end
|
75
|
+
if attributes["invoice_address"]
|
76
|
+
@invoice_address = InvoiceAddress.new(attributes["invoice_address"])
|
77
|
+
|
78
|
+
end
|
79
|
+
if attributes["verification_token"]
|
80
|
+
@verification_token = attributes["verification_token"]
|
81
|
+
|
82
|
+
end
|
83
|
+
if attributes["transaction_lines"]
|
84
|
+
if (value = attributes["transaction_lines"]).is_a?(Array)
|
85
|
+
@transaction_lines = value.map{ |v| InputTransactionLine.new(v) }
|
86
|
+
end
|
87
|
+
end
|
88
|
+
if attributes["buyer_tax_number"]
|
89
|
+
@buyer_tax_number = attributes["buyer_tax_number"]
|
90
|
+
|
91
|
+
end
|
92
|
+
if attributes["custom_fields"]
|
93
|
+
if (value = attributes["custom_fields"]).is_a?(Array)
|
94
|
+
@custom_fields = value.map{ |v| CustomFields.new(v) }
|
95
|
+
end
|
96
|
+
end
|
97
|
+
if attributes["force_country_code"]
|
98
|
+
@force_country_code = attributes["force_country_code"]
|
99
|
+
|
100
|
+
end
|
101
|
+
if attributes["invoice_number"]
|
102
|
+
@invoice_number = attributes["invoice_number"]
|
103
|
+
|
104
|
+
end
|
105
|
+
if attributes["order_date"]
|
106
|
+
@order_date = attributes["order_date"]
|
107
|
+
|
108
|
+
end
|
109
|
+
if attributes["buyer_ip"]
|
110
|
+
@buyer_ip = attributes["buyer_ip"]
|
111
|
+
|
112
|
+
end
|
113
|
+
if attributes["buyer_email"]
|
114
|
+
@buyer_email = attributes["buyer_email"]
|
115
|
+
|
116
|
+
end
|
117
|
+
if attributes["original_transaction_key"]
|
118
|
+
@original_transaction_key = attributes["original_transaction_key"]
|
119
|
+
|
120
|
+
end
|
121
|
+
if attributes["billing_country_code"]
|
122
|
+
@billing_country_code = attributes["billing_country_code"]
|
123
|
+
|
124
|
+
end
|
125
|
+
if attributes["custom_id"]
|
126
|
+
@custom_id = attributes["custom_id"]
|
127
|
+
|
128
|
+
end
|
129
|
+
if attributes["additional_currencies"]
|
130
|
+
@additional_currencies = AdditionalCurrencies.new(attributes["additional_currencies"])
|
131
|
+
|
132
|
+
end
|
133
|
+
if attributes["invoice_place"]
|
134
|
+
@invoice_place = attributes["invoice_place"]
|
135
|
+
|
136
|
+
end
|
137
|
+
if attributes["evidence"]
|
138
|
+
@evidence = Evidence.new(attributes["evidence"])
|
139
|
+
|
140
|
+
end
|
141
|
+
if attributes["description"]
|
142
|
+
@description = attributes["description"]
|
143
|
+
|
144
|
+
end
|
145
|
+
if attributes["tax_deducted"]
|
146
|
+
@tax_deducted = attributes["tax_deducted"]
|
147
|
+
|
148
|
+
end
|
149
|
+
if attributes["tax_country_code"]
|
150
|
+
@tax_country_code = attributes["tax_country_code"]
|
151
|
+
|
152
|
+
end
|
153
|
+
|
154
|
+
|
155
|
+
end
|
156
|
+
|
157
|
+
def to_body
|
158
|
+
body = {}
|
159
|
+
self.class.attribute_map.each_pair do |key, value|
|
160
|
+
v = self.send(key)
|
161
|
+
unless v.nil?
|
162
|
+
if v.is_a?(Array)
|
163
|
+
array = Array.new
|
164
|
+
v.each do |item|
|
165
|
+
if item.respond_to?("to_body".to_sym)
|
166
|
+
array.push item.to_body
|
167
|
+
else
|
168
|
+
array.push item
|
169
|
+
end
|
170
|
+
end
|
171
|
+
body[value] = array
|
172
|
+
else
|
173
|
+
if v.respond_to?("to_body".to_sym)
|
174
|
+
body[value] = v.to_body
|
175
|
+
else
|
176
|
+
body[value] = v
|
177
|
+
end
|
178
|
+
end
|
179
|
+
end
|
180
|
+
end
|
181
|
+
body
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
@@ -0,0 +1,97 @@
|
|
1
|
+
# Copyright 2014-2015 Taxamo, Ltd.
|
2
|
+
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
|
6
|
+
#
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10
|
+
# See the License for the specific language governing permissions and
|
11
|
+
# limitations under the License.
|
12
|
+
|
13
|
+
class InvoiceAddress
|
14
|
+
attr_accessor :freeform_address, :building_number, :street_name, :address_detail, :city, :postal_code, :region, :country
|
15
|
+
|
16
|
+
# :internal => :external
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:freeform_address => :freeform_address,
|
20
|
+
:building_number => :building_number,
|
21
|
+
:street_name => :street_name,
|
22
|
+
:address_detail => :address_detail,
|
23
|
+
:city => :city,
|
24
|
+
:postal_code => :postal_code,
|
25
|
+
:region => :region,
|
26
|
+
:country => :country
|
27
|
+
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
def initialize(attributes = {})
|
32
|
+
return if attributes.empty?
|
33
|
+
# Morph attribute keys into undescored rubyish style
|
34
|
+
if attributes["freeform_address"]
|
35
|
+
@freeform_address = attributes["freeform_address"]
|
36
|
+
|
37
|
+
end
|
38
|
+
if attributes["building_number"]
|
39
|
+
@building_number = attributes["building_number"]
|
40
|
+
|
41
|
+
end
|
42
|
+
if attributes["street_name"]
|
43
|
+
@street_name = attributes["street_name"]
|
44
|
+
|
45
|
+
end
|
46
|
+
if attributes["address_detail"]
|
47
|
+
@address_detail = attributes["address_detail"]
|
48
|
+
|
49
|
+
end
|
50
|
+
if attributes["city"]
|
51
|
+
@city = attributes["city"]
|
52
|
+
|
53
|
+
end
|
54
|
+
if attributes["postal_code"]
|
55
|
+
@postal_code = attributes["postal_code"]
|
56
|
+
|
57
|
+
end
|
58
|
+
if attributes["region"]
|
59
|
+
@region = attributes["region"]
|
60
|
+
|
61
|
+
end
|
62
|
+
if attributes["country"]
|
63
|
+
@country = attributes["country"]
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
def to_body
|
71
|
+
body = {}
|
72
|
+
self.class.attribute_map.each_pair do |key, value|
|
73
|
+
v = self.send(key)
|
74
|
+
unless v.nil?
|
75
|
+
if v.is_a?(Array)
|
76
|
+
array = Array.new
|
77
|
+
v.each do |item|
|
78
|
+
if item.respond_to?("to_body".to_sym)
|
79
|
+
array.push item.to_body
|
80
|
+
else
|
81
|
+
array.push item
|
82
|
+
end
|
83
|
+
end
|
84
|
+
body[value] = array
|
85
|
+
else
|
86
|
+
if v.respond_to?("to_body".to_sym)
|
87
|
+
body[value] = v.to_body
|
88
|
+
else
|
89
|
+
body[value] = v
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
body
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# Copyright 2014-2015 Taxamo, Ltd.
|
2
|
+
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
|
6
|
+
#
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10
|
+
# See the License for the specific language governing permissions and
|
11
|
+
# limitations under the License.
|
12
|
+
|
13
|
+
class ListPaymentsOut
|
14
|
+
attr_accessor :payments
|
15
|
+
|
16
|
+
# :internal => :external
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:payments => :payments
|
20
|
+
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
def initialize(attributes = {})
|
25
|
+
return if attributes.empty?
|
26
|
+
# Morph attribute keys into undescored rubyish style
|
27
|
+
if attributes["payments"]
|
28
|
+
if (value = attributes["payments"]).is_a?(Array)
|
29
|
+
@payments = value.map{ |v| Payments.new(v) }
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
def to_body
|
37
|
+
body = {}
|
38
|
+
self.class.attribute_map.each_pair do |key, value|
|
39
|
+
v = self.send(key)
|
40
|
+
unless v.nil?
|
41
|
+
if v.is_a?(Array)
|
42
|
+
array = Array.new
|
43
|
+
v.each do |item|
|
44
|
+
if item.respond_to?("to_body".to_sym)
|
45
|
+
array.push item.to_body
|
46
|
+
else
|
47
|
+
array.push item
|
48
|
+
end
|
49
|
+
end
|
50
|
+
body[value] = array
|
51
|
+
else
|
52
|
+
if v.respond_to?("to_body".to_sym)
|
53
|
+
body[value] = v.to_body
|
54
|
+
else
|
55
|
+
body[value] = v
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
body
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# Copyright 2014-2015 Taxamo, Ltd.
|
2
|
+
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
|
6
|
+
#
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10
|
+
# See the License for the specific language governing permissions and
|
11
|
+
# limitations under the License.
|
12
|
+
|
13
|
+
class ListTransactionsOut
|
14
|
+
attr_accessor :transactions
|
15
|
+
|
16
|
+
# :internal => :external
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:transactions => :transactions
|
20
|
+
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
def initialize(attributes = {})
|
25
|
+
return if attributes.empty?
|
26
|
+
# Morph attribute keys into undescored rubyish style
|
27
|
+
if attributes["transactions"]
|
28
|
+
if (value = attributes["transactions"]).is_a?(Array)
|
29
|
+
@transactions = value.map{ |v| Transactions.new(v) }
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
def to_body
|
37
|
+
body = {}
|
38
|
+
self.class.attribute_map.each_pair do |key, value|
|
39
|
+
v = self.send(key)
|
40
|
+
unless v.nil?
|
41
|
+
if v.is_a?(Array)
|
42
|
+
array = Array.new
|
43
|
+
v.each do |item|
|
44
|
+
if item.respond_to?("to_body".to_sym)
|
45
|
+
array.push item.to_body
|
46
|
+
else
|
47
|
+
array.push item
|
48
|
+
end
|
49
|
+
end
|
50
|
+
body[value] = array
|
51
|
+
else
|
52
|
+
if v.respond_to?("to_body".to_sym)
|
53
|
+
body[value] = v.to_body
|
54
|
+
else
|
55
|
+
body[value] = v
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
body
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# Copyright 2014-2015 Taxamo, Ltd.
|
2
|
+
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
|
6
|
+
#
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10
|
+
# See the License for the specific language governing permissions and
|
11
|
+
# limitations under the License.
|
12
|
+
|
13
|
+
class LocateGivenIPOut
|
14
|
+
attr_accessor :remote_addr, :country_code, :country
|
15
|
+
|
16
|
+
# :internal => :external
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:remote_addr => :remote_addr,
|
20
|
+
:country_code => :country_code,
|
21
|
+
:country => :country
|
22
|
+
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
def initialize(attributes = {})
|
27
|
+
return if attributes.empty?
|
28
|
+
# Morph attribute keys into undescored rubyish style
|
29
|
+
if attributes["remote_addr"]
|
30
|
+
@remote_addr = attributes["remote_addr"]
|
31
|
+
|
32
|
+
end
|
33
|
+
if attributes["country_code"]
|
34
|
+
@country_code = attributes["country_code"]
|
35
|
+
|
36
|
+
end
|
37
|
+
if attributes["country"]
|
38
|
+
@country = Country.new(attributes["country"])
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
end
|
44
|
+
|
45
|
+
def to_body
|
46
|
+
body = {}
|
47
|
+
self.class.attribute_map.each_pair do |key, value|
|
48
|
+
v = self.send(key)
|
49
|
+
unless v.nil?
|
50
|
+
if v.is_a?(Array)
|
51
|
+
array = Array.new
|
52
|
+
v.each do |item|
|
53
|
+
if item.respond_to?("to_body".to_sym)
|
54
|
+
array.push item.to_body
|
55
|
+
else
|
56
|
+
array.push item
|
57
|
+
end
|
58
|
+
end
|
59
|
+
body[value] = array
|
60
|
+
else
|
61
|
+
if v.respond_to?("to_body".to_sym)
|
62
|
+
body[value] = v.to_body
|
63
|
+
else
|
64
|
+
body[value] = v
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
body
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|