Class: InputTransactionUpdate
- Defined in:
- lib/taxamo/models/inputtransactionupdate.rb
Overview
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](www.apache.org/licenses/LICENSE-2.0)
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Instance Attribute Summary collapse
-
#additional_currencies ⇒ Object
Returns the value of attribute additional_currencies.
-
#billing_country_code ⇒ Object
Returns the value of attribute billing_country_code.
-
#buyer_credit_card_prefix ⇒ Object
Returns the value of attribute buyer_credit_card_prefix.
-
#buyer_email ⇒ Object
Returns the value of attribute buyer_email.
-
#buyer_ip ⇒ Object
Returns the value of attribute buyer_ip.
-
#buyer_name ⇒ Object
Returns the value of attribute buyer_name.
-
#buyer_tax_number ⇒ Object
Returns the value of attribute buyer_tax_number.
-
#currency_code ⇒ Object
Returns the value of attribute currency_code.
-
#custom_data ⇒ Object
Returns the value of attribute custom_data.
-
#custom_fields ⇒ Object
Returns the value of attribute custom_fields.
-
#custom_id ⇒ Object
Returns the value of attribute custom_id.
-
#customer_id ⇒ Object
Returns the value of attribute customer_id.
-
#description ⇒ Object
Returns the value of attribute description.
-
#evidence ⇒ Object
Returns the value of attribute evidence.
-
#force_country_code ⇒ Object
Returns the value of attribute force_country_code.
-
#invoice_address ⇒ Object
Returns the value of attribute invoice_address.
-
#invoice_date ⇒ Object
Returns the value of attribute invoice_date.
-
#invoice_number ⇒ Object
Returns the value of attribute invoice_number.
-
#invoice_place ⇒ Object
Returns the value of attribute invoice_place.
-
#order_date ⇒ Object
Returns the value of attribute order_date.
-
#original_transaction_key ⇒ Object
Returns the value of attribute original_transaction_key.
-
#status ⇒ Object
Returns the value of attribute status.
-
#supply_date ⇒ Object
Returns the value of attribute supply_date.
-
#tax_country_code ⇒ Object
Returns the value of attribute tax_country_code.
-
#tax_data ⇒ Object
Returns the value of attribute tax_data.
-
#tax_deducted ⇒ Object
Returns the value of attribute tax_deducted.
-
#transaction_lines ⇒ Object
Returns the value of attribute transaction_lines.
-
#verification_token ⇒ Object
Returns the value of attribute verification_token.
Class Method Summary collapse
-
.attribute_map ⇒ Object
:internal => :external.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ InputTransactionUpdate
constructor
A new instance of InputTransactionUpdate.
- #to_body ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ InputTransactionUpdate
Returns a new instance of InputTransactionUpdate.
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 51 def initialize(attributes = {}) return if attributes.empty? # Morph attribute keys into undescored rubyish style if attributes["buyer_credit_card_prefix"] @buyer_credit_card_prefix = attributes["buyer_credit_card_prefix"] end if attributes["custom_data"] @custom_data = attributes["custom_data"] end if attributes["buyer_name"] @buyer_name = attributes["buyer_name"] end if attributes["invoice_date"] @invoice_date = attributes["invoice_date"] end if attributes["currency_code"] @currency_code = attributes["currency_code"] end if attributes["supply_date"] @supply_date = attributes["supply_date"] end if attributes["invoice_address"] @invoice_address = InvoiceAddress.new(attributes["invoice_address"]) end if attributes["verification_token"] @verification_token = attributes["verification_token"] end if attributes["tax_data"] @tax_data = TaxDataSchema.new(attributes["tax_data"]) end if attributes["transaction_lines"] if (value = attributes["transaction_lines"]).is_a?(Array) @transaction_lines = value.map{ |v| InputTransactionLine.new(v) } end end if attributes["buyer_tax_number"] @buyer_tax_number = attributes["buyer_tax_number"] end if attributes["status"] @status = attributes["status"] end if attributes["custom_fields"] if (value = attributes["custom_fields"]).is_a?(Array) @custom_fields = value.map{ |v| CustomFields.new(v) } end end if attributes["force_country_code"] @force_country_code = attributes["force_country_code"] end if attributes["invoice_number"] @invoice_number = attributes["invoice_number"] end if attributes["order_date"] @order_date = attributes["order_date"] end if attributes["customer_id"] @customer_id = attributes["customer_id"] end if attributes["buyer_ip"] @buyer_ip = attributes["buyer_ip"] end if attributes["buyer_email"] @buyer_email = attributes["buyer_email"] end if attributes["original_transaction_key"] @original_transaction_key = attributes["original_transaction_key"] end if attributes["billing_country_code"] @billing_country_code = attributes["billing_country_code"] end if attributes["custom_id"] @custom_id = attributes["custom_id"] end if attributes["additional_currencies"] @additional_currencies = AdditionalCurrencies.new(attributes["additional_currencies"]) end if attributes["invoice_place"] @invoice_place = attributes["invoice_place"] end if attributes["evidence"] @evidence = Evidence.new(attributes["evidence"]) end if attributes["description"] @description = attributes["description"] end if attributes["tax_deducted"] @tax_deducted = attributes["tax_deducted"] end if attributes["tax_country_code"] @tax_country_code = attributes["tax_country_code"] end end |
Instance Attribute Details
#additional_currencies ⇒ Object
Returns the value of attribute additional_currencies.
14 15 16 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 14 def additional_currencies @additional_currencies end |
#billing_country_code ⇒ Object
Returns the value of attribute billing_country_code.
14 15 16 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 14 def billing_country_code @billing_country_code end |
#buyer_credit_card_prefix ⇒ Object
Returns the value of attribute buyer_credit_card_prefix.
14 15 16 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 14 def buyer_credit_card_prefix @buyer_credit_card_prefix end |
#buyer_email ⇒ Object
Returns the value of attribute buyer_email.
14 15 16 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 14 def buyer_email @buyer_email end |
#buyer_ip ⇒ Object
Returns the value of attribute buyer_ip.
14 15 16 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 14 def buyer_ip @buyer_ip end |
#buyer_name ⇒ Object
Returns the value of attribute buyer_name.
14 15 16 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 14 def buyer_name @buyer_name end |
#buyer_tax_number ⇒ Object
Returns the value of attribute buyer_tax_number.
14 15 16 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 14 def buyer_tax_number @buyer_tax_number end |
#currency_code ⇒ Object
Returns the value of attribute currency_code.
14 15 16 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 14 def currency_code @currency_code end |
#custom_data ⇒ Object
Returns the value of attribute custom_data.
14 15 16 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 14 def custom_data @custom_data end |
#custom_fields ⇒ Object
Returns the value of attribute custom_fields.
14 15 16 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 14 def custom_fields @custom_fields end |
#custom_id ⇒ Object
Returns the value of attribute custom_id.
14 15 16 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 14 def custom_id @custom_id end |
#customer_id ⇒ Object
Returns the value of attribute customer_id.
14 15 16 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 14 def customer_id @customer_id end |
#description ⇒ Object
Returns the value of attribute description.
14 15 16 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 14 def description @description end |
#evidence ⇒ Object
Returns the value of attribute evidence.
14 15 16 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 14 def evidence @evidence end |
#force_country_code ⇒ Object
Returns the value of attribute force_country_code.
14 15 16 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 14 def force_country_code @force_country_code end |
#invoice_address ⇒ Object
Returns the value of attribute invoice_address.
14 15 16 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 14 def invoice_address @invoice_address end |
#invoice_date ⇒ Object
Returns the value of attribute invoice_date.
14 15 16 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 14 def invoice_date @invoice_date end |
#invoice_number ⇒ Object
Returns the value of attribute invoice_number.
14 15 16 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 14 def invoice_number @invoice_number end |
#invoice_place ⇒ Object
Returns the value of attribute invoice_place.
14 15 16 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 14 def invoice_place @invoice_place end |
#order_date ⇒ Object
Returns the value of attribute order_date.
14 15 16 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 14 def order_date @order_date end |
#original_transaction_key ⇒ Object
Returns the value of attribute original_transaction_key.
14 15 16 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 14 def original_transaction_key @original_transaction_key end |
#status ⇒ Object
Returns the value of attribute status.
14 15 16 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 14 def status @status end |
#supply_date ⇒ Object
Returns the value of attribute supply_date.
14 15 16 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 14 def supply_date @supply_date end |
#tax_country_code ⇒ Object
Returns the value of attribute tax_country_code.
14 15 16 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 14 def tax_country_code @tax_country_code end |
#tax_data ⇒ Object
Returns the value of attribute tax_data.
14 15 16 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 14 def tax_data @tax_data end |
#tax_deducted ⇒ Object
Returns the value of attribute tax_deducted.
14 15 16 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 14 def tax_deducted @tax_deducted end |
#transaction_lines ⇒ Object
Returns the value of attribute transaction_lines.
14 15 16 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 14 def transaction_lines @transaction_lines end |
#verification_token ⇒ Object
Returns the value of attribute verification_token.
14 15 16 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 14 def verification_token @verification_token end |
Class Method Details
.attribute_map ⇒ Object
:internal => :external
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 17 def self.attribute_map { :buyer_credit_card_prefix => :buyer_credit_card_prefix, :custom_data => :custom_data, :buyer_name => :buyer_name, :invoice_date => :invoice_date, :currency_code => :currency_code, :supply_date => :supply_date, :invoice_address => :invoice_address, :verification_token => :verification_token, :tax_data => :tax_data, :transaction_lines => :transaction_lines, :buyer_tax_number => :buyer_tax_number, :status => :status, :custom_fields => :custom_fields, :force_country_code => :force_country_code, :invoice_number => :invoice_number, :order_date => :order_date, :customer_id => :customer_id, :buyer_ip => :buyer_ip, :buyer_email => :buyer_email, :original_transaction_key => :original_transaction_key, :billing_country_code => :billing_country_code, :custom_id => :custom_id, :additional_currencies => :additional_currencies, :invoice_place => :invoice_place, :evidence => :evidence, :description => :description, :tax_deducted => :tax_deducted, :tax_country_code => :tax_country_code } end |
Instance Method Details
#to_body ⇒ Object
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
# File 'lib/taxamo/models/inputtransactionupdate.rb', line 172 def to_body body = {} self.class.attribute_map.each_pair do |key, value| v = self.send(key) unless v.nil? if v.is_a?(Array) array = Array.new v.each do |item| if item.respond_to?("to_body".to_sym) array.push item.to_body else array.push item end end body[value] = array else if v.respond_to?("to_body".to_sym) body[value] = v.to_body else body[value] = v end end end end body end |