taxamo-ns 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/LICENSE +11 -0
  4. data/README.md +152 -0
  5. data/Rakefile +7 -0
  6. data/lib/monkey.rb +90 -0
  7. data/lib/swagger/configuration.rb +21 -0
  8. data/lib/swagger/request.rb +199 -0
  9. data/lib/swagger/response.rb +87 -0
  10. data/lib/swagger.rb +93 -0
  11. data/lib/taxamo/models/additionalcurrencies.rb +63 -0
  12. data/lib/taxamo/models/additionalcurrency.rb +88 -0
  13. data/lib/taxamo/models/bycountry.rb +78 -0
  14. data/lib/taxamo/models/bystatus.rb +70 -0
  15. data/lib/taxamo/models/bytaxationtype.rb +83 -0
  16. data/lib/taxamo/models/c.rb +78 -0
  17. data/lib/taxamo/models/calculatesimpletaxout.rb +75 -0
  18. data/lib/taxamo/models/calculatetaxin.rb +63 -0
  19. data/lib/taxamo/models/calculatetaxlocationout.rb +98 -0
  20. data/lib/taxamo/models/calculatetaxout.rb +75 -0
  21. data/lib/taxamo/models/canceltransactionout.rb +63 -0
  22. data/lib/taxamo/models/capturepaymentout.rb +63 -0
  23. data/lib/taxamo/models/confirmtransactionin.rb +63 -0
  24. data/lib/taxamo/models/confirmtransactionout.rb +75 -0
  25. data/lib/taxamo/models/countries.rb +113 -0
  26. data/lib/taxamo/models/country.rb +120 -0
  27. data/lib/taxamo/models/countryschema.rb +120 -0
  28. data/lib/taxamo/models/createpaymentin.rb +73 -0
  29. data/lib/taxamo/models/createpaymentout.rb +63 -0
  30. data/lib/taxamo/models/createrefundin.rb +83 -0
  31. data/lib/taxamo/models/createrefundout.rb +78 -0
  32. data/lib/taxamo/models/createsmstokenin.rb +68 -0
  33. data/lib/taxamo/models/createsmstokenout.rb +63 -0
  34. data/lib/taxamo/models/createtransactionin.rb +68 -0
  35. data/lib/taxamo/models/createtransactionout.rb +75 -0
  36. data/lib/taxamo/models/currencyschema.rb +83 -0
  37. data/lib/taxamo/models/customfields.rb +68 -0
  38. data/lib/taxamo/models/emailinvoicein.rb +63 -0
  39. data/lib/taxamo/models/emailinvoiceout.rb +63 -0
  40. data/lib/taxamo/models/emailrefundin.rb +63 -0
  41. data/lib/taxamo/models/emailrefundout.rb +63 -0
  42. data/lib/taxamo/models/evidence.rb +113 -0
  43. data/lib/taxamo/models/evidenceschema.rb +78 -0
  44. data/lib/taxamo/models/getcountriesdictout.rb +64 -0
  45. data/lib/taxamo/models/getcurrenciesdictout.rb +64 -0
  46. data/lib/taxamo/models/getdailysettlementstatsout.rb +64 -0
  47. data/lib/taxamo/models/getdetailedrefundsout.rb +64 -0
  48. data/lib/taxamo/models/getdomesticsummaryreportout.rb +123 -0
  49. data/lib/taxamo/models/geteuviesreportout.rb +79 -0
  50. data/lib/taxamo/models/getproducttypesdictout.rb +64 -0
  51. data/lib/taxamo/models/getrefundsout.rb +64 -0
  52. data/lib/taxamo/models/getsettlementout.rb +84 -0
  53. data/lib/taxamo/models/getsettlementstatsbycountryout.rb +64 -0
  54. data/lib/taxamo/models/getsettlementstatsbytaxationtypeout.rb +63 -0
  55. data/lib/taxamo/models/getsettlementsummaryout.rb +63 -0
  56. data/lib/taxamo/models/gettransactionout.rb +75 -0
  57. data/lib/taxamo/models/gettransactionsstatsbycountryout.rb +64 -0
  58. data/lib/taxamo/models/gettransactionsstatsout.rb +63 -0
  59. data/lib/taxamo/models/inputtransaction.rb +220 -0
  60. data/lib/taxamo/models/inputtransactionline.rb +144 -0
  61. data/lib/taxamo/models/inputtransactionupdate.rb +220 -0
  62. data/lib/taxamo/models/invoiceaddress.rb +98 -0
  63. data/lib/taxamo/models/listpaymentsout.rb +64 -0
  64. data/lib/taxamo/models/listrefundsout.rb +64 -0
  65. data/lib/taxamo/models/listtransactionsout.rb +64 -0
  66. data/lib/taxamo/models/locategivenipout.rb +73 -0
  67. data/lib/taxamo/models/locatemyipout.rb +73 -0
  68. data/lib/taxamo/models/n.rb +78 -0
  69. data/lib/taxamo/models/payments.rb +73 -0
  70. data/lib/taxamo/models/producttypeschema.rb +63 -0
  71. data/lib/taxamo/models/refunds.rb +108 -0
  72. data/lib/taxamo/models/report.rb +103 -0
  73. data/lib/taxamo/models/settlementdailystatsschema.rb +103 -0
  74. data/lib/taxamo/models/storagerequiredfields.rb +63 -0
  75. data/lib/taxamo/models/summary.rb +98 -0
  76. data/lib/taxamo/models/taxdataschema.rb +63 -0
  77. data/lib/taxamo/models/taxrequiredfields.rb +63 -0
  78. data/lib/taxamo/models/transaction.rb +330 -0
  79. data/lib/taxamo/models/transactionlines.rb +174 -0
  80. data/lib/taxamo/models/transactions.rb +330 -0
  81. data/lib/taxamo/models/unconfirmtransactionin.rb +63 -0
  82. data/lib/taxamo/models/unconfirmtransactionout.rb +75 -0
  83. data/lib/taxamo/models/updatetransactionin.rb +63 -0
  84. data/lib/taxamo/models/updatetransactionout.rb +75 -0
  85. data/lib/taxamo/models/ustaxexemptioncertificatedetailsschema.rb +139 -0
  86. data/lib/taxamo/models/ustaxexemptioncertificateschema.rb +68 -0
  87. data/lib/taxamo/models/ustaxexemptstate.rb +73 -0
  88. data/lib/taxamo/models/ustaxid.rb +73 -0
  89. data/lib/taxamo/models/validatetaxnumberout.rb +78 -0
  90. data/lib/taxamo/models/verifysmstokenout.rb +63 -0
  91. data/lib/taxamo/version.rb +17 -0
  92. data/lib/taxamo.rb +1215 -0
  93. data/taxamo.gemspec +28 -0
  94. data/test/taxamo/connectivity_test.rb +55 -0
  95. data/test/taxamo/tax_test.rb +152 -0
  96. data/test/taxamo/transactions_api_test.rb +326 -0
  97. metadata +241 -0
@@ -0,0 +1,78 @@
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
+ module Taxamo
14
+ class N
15
+ attr_accessor :day_raw, :value, :status, :day
16
+
17
+ # :internal => :external
18
+ def self.attribute_map
19
+ {
20
+ :day_raw => :day_raw,
21
+ :value => :value,
22
+ :status => :status,
23
+ :day => :day
24
+
25
+ }
26
+ end
27
+
28
+ def initialize(attributes = {})
29
+ return if attributes.empty?
30
+ # Morph attribute keys into undescored rubyish style
31
+ if attributes["day_raw"]
32
+ @day_raw = attributes["day_raw"]
33
+
34
+ end
35
+ if attributes["value"]
36
+ @value = attributes["value"]
37
+
38
+ end
39
+ if attributes["status"]
40
+ @status = attributes["status"]
41
+
42
+ end
43
+ if attributes["day"]
44
+ @day = attributes["day"]
45
+
46
+ end
47
+
48
+
49
+ end
50
+
51
+ def to_body
52
+ body = {}
53
+ self.class.attribute_map.each_pair do |key, value|
54
+ v = self.send(key)
55
+ unless v.nil?
56
+ if v.is_a?(Array)
57
+ array = Array.new
58
+ v.each do |item|
59
+ if item.respond_to?("to_body".to_sym)
60
+ array.push item.to_body
61
+ else
62
+ array.push item
63
+ end
64
+ end
65
+ body[value] = array
66
+ else
67
+ if v.respond_to?("to_body".to_sym)
68
+ body[value] = v.to_body
69
+ else
70
+ body[value] = v
71
+ end
72
+ end
73
+ end
74
+ end
75
+ body
76
+ end
77
+ end
78
+ end
@@ -0,0 +1,73 @@
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
+ module Taxamo
14
+ class Payments
15
+ attr_accessor :amount, :payment_timestamp, :payment_information
16
+
17
+ # :internal => :external
18
+ def self.attribute_map
19
+ {
20
+ :amount => :amount,
21
+ :payment_timestamp => :payment_timestamp,
22
+ :payment_information => :payment_information
23
+
24
+ }
25
+ end
26
+
27
+ def initialize(attributes = {})
28
+ return if attributes.empty?
29
+ # Morph attribute keys into undescored rubyish style
30
+ if attributes["amount"]
31
+ @amount = attributes["amount"]
32
+
33
+ end
34
+ if attributes["payment_timestamp"]
35
+ @payment_timestamp = attributes["payment_timestamp"]
36
+
37
+ end
38
+ if attributes["payment_information"]
39
+ @payment_information = attributes["payment_information"]
40
+
41
+ end
42
+
43
+
44
+ end
45
+
46
+ def to_body
47
+ body = {}
48
+ self.class.attribute_map.each_pair do |key, value|
49
+ v = self.send(key)
50
+ unless v.nil?
51
+ if v.is_a?(Array)
52
+ array = Array.new
53
+ v.each do |item|
54
+ if item.respond_to?("to_body".to_sym)
55
+ array.push item.to_body
56
+ else
57
+ array.push item
58
+ end
59
+ end
60
+ body[value] = array
61
+ else
62
+ if v.respond_to?("to_body".to_sym)
63
+ body[value] = v.to_body
64
+ else
65
+ body[value] = v
66
+ end
67
+ end
68
+ end
69
+ end
70
+ body
71
+ end
72
+ end
73
+ end
@@ -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
+ module Taxamo
14
+ class ProductTypeSchema
15
+ attr_accessor :code
16
+
17
+ # :internal => :external
18
+ def self.attribute_map
19
+ {
20
+ :code => :code
21
+
22
+ }
23
+ end
24
+
25
+ def initialize(attributes = {})
26
+ return if attributes.empty?
27
+ # Morph attribute keys into undescored rubyish style
28
+ if attributes["code"]
29
+ @code = attributes["code"]
30
+
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
+ end
@@ -0,0 +1,108 @@
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
+ module Taxamo
14
+ class Refunds
15
+ attr_accessor :refund_note_url, :refund_note_number, :line_key, :refund_timestamp, :amount, :informative, :tax_amount, :tax_rate, :total_amount, :refund_reason
16
+
17
+ # :internal => :external
18
+ def self.attribute_map
19
+ {
20
+ :refund_note_url => :refund_note_url,
21
+ :refund_note_number => :refund_note_number,
22
+ :line_key => :line_key,
23
+ :refund_timestamp => :refund_timestamp,
24
+ :amount => :amount,
25
+ :informative => :informative,
26
+ :tax_amount => :tax_amount,
27
+ :tax_rate => :tax_rate,
28
+ :total_amount => :total_amount,
29
+ :refund_reason => :refund_reason
30
+
31
+ }
32
+ end
33
+
34
+ def initialize(attributes = {})
35
+ return if attributes.empty?
36
+ # Morph attribute keys into undescored rubyish style
37
+ if attributes["refund_note_url"]
38
+ @refund_note_url = attributes["refund_note_url"]
39
+
40
+ end
41
+ if attributes["refund_note_number"]
42
+ @refund_note_number = attributes["refund_note_number"]
43
+
44
+ end
45
+ if attributes["line_key"]
46
+ @line_key = attributes["line_key"]
47
+
48
+ end
49
+ if attributes["refund_timestamp"]
50
+ @refund_timestamp = attributes["refund_timestamp"]
51
+
52
+ end
53
+ if attributes["amount"]
54
+ @amount = attributes["amount"]
55
+
56
+ end
57
+ if attributes["informative"]
58
+ @informative = attributes["informative"]
59
+
60
+ end
61
+ if attributes["tax_amount"]
62
+ @tax_amount = attributes["tax_amount"]
63
+
64
+ end
65
+ if attributes["tax_rate"]
66
+ @tax_rate = attributes["tax_rate"]
67
+
68
+ end
69
+ if attributes["total_amount"]
70
+ @total_amount = attributes["total_amount"]
71
+
72
+ end
73
+ if attributes["refund_reason"]
74
+ @refund_reason = attributes["refund_reason"]
75
+
76
+ end
77
+
78
+
79
+ end
80
+
81
+ def to_body
82
+ body = {}
83
+ self.class.attribute_map.each_pair do |key, value|
84
+ v = self.send(key)
85
+ unless v.nil?
86
+ if v.is_a?(Array)
87
+ array = Array.new
88
+ v.each do |item|
89
+ if item.respond_to?("to_body".to_sym)
90
+ array.push item.to_body
91
+ else
92
+ array.push item
93
+ end
94
+ end
95
+ body[value] = array
96
+ else
97
+ if v.respond_to?("to_body".to_sym)
98
+ body[value] = v.to_body
99
+ else
100
+ body[value] = v
101
+ end
102
+ end
103
+ end
104
+ end
105
+ body
106
+ end
107
+ end
108
+ end
@@ -0,0 +1,103 @@
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
+ module Taxamo
14
+ class Report
15
+ attr_accessor :currency_code, :skip_moss, :country_code, :tax_region, :country_subdivision, :amount, :tax_amount, :tax_rate, :country_name
16
+
17
+ # :internal => :external
18
+ def self.attribute_map
19
+ {
20
+ :currency_code => :currency_code,
21
+ :skip_moss => :skip_moss,
22
+ :country_code => :country_code,
23
+ :tax_region => :tax_region,
24
+ :country_subdivision => :country_subdivision,
25
+ :amount => :amount,
26
+ :tax_amount => :tax_amount,
27
+ :tax_rate => :tax_rate,
28
+ :country_name => :country_name
29
+
30
+ }
31
+ end
32
+
33
+ def initialize(attributes = {})
34
+ return if attributes.empty?
35
+ # Morph attribute keys into undescored rubyish style
36
+ if attributes["currency_code"]
37
+ @currency_code = attributes["currency_code"]
38
+
39
+ end
40
+ if attributes["skip_moss"]
41
+ @skip_moss = attributes["skip_moss"]
42
+
43
+ end
44
+ if attributes["country_code"]
45
+ @country_code = attributes["country_code"]
46
+
47
+ end
48
+ if attributes["tax_region"]
49
+ @tax_region = attributes["tax_region"]
50
+
51
+ end
52
+ if attributes["country_subdivision"]
53
+ @country_subdivision = attributes["country_subdivision"]
54
+
55
+ end
56
+ if attributes["amount"]
57
+ @amount = attributes["amount"]
58
+
59
+ end
60
+ if attributes["tax_amount"]
61
+ @tax_amount = attributes["tax_amount"]
62
+
63
+ end
64
+ if attributes["tax_rate"]
65
+ @tax_rate = attributes["tax_rate"]
66
+
67
+ end
68
+ if attributes["country_name"]
69
+ @country_name = attributes["country_name"]
70
+
71
+ end
72
+
73
+
74
+ end
75
+
76
+ def to_body
77
+ body = {}
78
+ self.class.attribute_map.each_pair do |key, value|
79
+ v = self.send(key)
80
+ unless v.nil?
81
+ if v.is_a?(Array)
82
+ array = Array.new
83
+ v.each do |item|
84
+ if item.respond_to?("to_body".to_sym)
85
+ array.push item.to_body
86
+ else
87
+ array.push item
88
+ end
89
+ end
90
+ body[value] = array
91
+ else
92
+ if v.respond_to?("to_body".to_sym)
93
+ body[value] = v.to_body
94
+ else
95
+ body[value] = v
96
+ end
97
+ end
98
+ end
99
+ end
100
+ body
101
+ end
102
+ end
103
+ end
@@ -0,0 +1,103 @@
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
+ module Taxamo
14
+ class SettlementDailyStatsSchema
15
+ attr_accessor :b2c, :untaxed, :eu_taxed, :eu_b2b, :count, :eu_total, :day_raw, :b2b, :day
16
+
17
+ # :internal => :external
18
+ def self.attribute_map
19
+ {
20
+ :b2c => :b2c,
21
+ :untaxed => :untaxed,
22
+ :eu_taxed => :eu_taxed,
23
+ :eu_b2b => :eu_b2b,
24
+ :count => :count,
25
+ :eu_total => :eu_total,
26
+ :day_raw => :day_raw,
27
+ :b2b => :b2b,
28
+ :day => :day
29
+
30
+ }
31
+ end
32
+
33
+ def initialize(attributes = {})
34
+ return if attributes.empty?
35
+ # Morph attribute keys into undescored rubyish style
36
+ if attributes["b2c"]
37
+ @b2c = attributes["b2c"]
38
+
39
+ end
40
+ if attributes["untaxed"]
41
+ @untaxed = attributes["untaxed"]
42
+
43
+ end
44
+ if attributes["eu_taxed"]
45
+ @eu_taxed = attributes["eu_taxed"]
46
+
47
+ end
48
+ if attributes["eu_b2b"]
49
+ @eu_b2b = attributes["eu_b2b"]
50
+
51
+ end
52
+ if attributes["count"]
53
+ @count = attributes["count"]
54
+
55
+ end
56
+ if attributes["eu_total"]
57
+ @eu_total = attributes["eu_total"]
58
+
59
+ end
60
+ if attributes["day_raw"]
61
+ @day_raw = attributes["day_raw"]
62
+
63
+ end
64
+ if attributes["b2b"]
65
+ @b2b = attributes["b2b"]
66
+
67
+ end
68
+ if attributes["day"]
69
+ @day = attributes["day"]
70
+
71
+ end
72
+
73
+
74
+ end
75
+
76
+ def to_body
77
+ body = {}
78
+ self.class.attribute_map.each_pair do |key, value|
79
+ v = self.send(key)
80
+ unless v.nil?
81
+ if v.is_a?(Array)
82
+ array = Array.new
83
+ v.each do |item|
84
+ if item.respond_to?("to_body".to_sym)
85
+ array.push item.to_body
86
+ else
87
+ array.push item
88
+ end
89
+ end
90
+ body[value] = array
91
+ else
92
+ if v.respond_to?("to_body".to_sym)
93
+ body[value] = v.to_body
94
+ else
95
+ body[value] = v
96
+ end
97
+ end
98
+ end
99
+ end
100
+ body
101
+ end
102
+ end
103
+ end
@@ -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
+ module Taxamo
14
+ class StorageRequiredFields
15
+ attr_accessor :field_name
16
+
17
+ # :internal => :external
18
+ def self.attribute_map
19
+ {
20
+ :field_name => :field_name
21
+
22
+ }
23
+ end
24
+
25
+ def initialize(attributes = {})
26
+ return if attributes.empty?
27
+ # Morph attribute keys into undescored rubyish style
28
+ if attributes["field_name"]
29
+ @field_name = attributes["field_name"]
30
+
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
+ end
@@ -0,0 +1,98 @@
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
+ module Taxamo
14
+ class Summary
15
+ attr_accessor :quarter, :tax_amount, :currency_code, :indicative, :fx_rate_date, :start_date, :end_date, :tax_entity_name
16
+
17
+ # :internal => :external
18
+ def self.attribute_map
19
+ {
20
+ :quarter => :quarter,
21
+ :tax_amount => :tax_amount,
22
+ :currency_code => :currency_code,
23
+ :indicative => :indicative,
24
+ :fx_rate_date => :fx_rate_date,
25
+ :start_date => :start_date,
26
+ :end_date => :end_date,
27
+ :tax_entity_name => :tax_entity_name
28
+
29
+ }
30
+ end
31
+
32
+ def initialize(attributes = {})
33
+ return if attributes.empty?
34
+ # Morph attribute keys into undescored rubyish style
35
+ if attributes["quarter"]
36
+ @quarter = attributes["quarter"]
37
+
38
+ end
39
+ if attributes["tax_amount"]
40
+ @tax_amount = attributes["tax_amount"]
41
+
42
+ end
43
+ if attributes["currency_code"]
44
+ @currency_code = attributes["currency_code"]
45
+
46
+ end
47
+ if attributes["indicative"]
48
+ @indicative = attributes["indicative"]
49
+
50
+ end
51
+ if attributes["fx_rate_date"]
52
+ @fx_rate_date = attributes["fx_rate_date"]
53
+
54
+ end
55
+ if attributes["start_date"]
56
+ @start_date = attributes["start_date"]
57
+
58
+ end
59
+ if attributes["end_date"]
60
+ @end_date = attributes["end_date"]
61
+
62
+ end
63
+ if attributes["tax_entity_name"]
64
+ @tax_entity_name = attributes["tax_entity_name"]
65
+
66
+ end
67
+
68
+
69
+ end
70
+
71
+ def to_body
72
+ body = {}
73
+ self.class.attribute_map.each_pair do |key, value|
74
+ v = self.send(key)
75
+ unless v.nil?
76
+ if v.is_a?(Array)
77
+ array = Array.new
78
+ v.each do |item|
79
+ if item.respond_to?("to_body".to_sym)
80
+ array.push item.to_body
81
+ else
82
+ array.push item
83
+ end
84
+ end
85
+ body[value] = array
86
+ else
87
+ if v.respond_to?("to_body".to_sym)
88
+ body[value] = v.to_body
89
+ else
90
+ body[value] = v
91
+ end
92
+ end
93
+ end
94
+ end
95
+ body
96
+ end
97
+ end
98
+ end