Class: AmzSpApi::VendorDirectFulfillmentPaymentsApiModel::InvoiceDetail
- Inherits:
-
Object
- Object
- AmzSpApi::VendorDirectFulfillmentPaymentsApiModel::InvoiceDetail
- Defined in:
- lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb
Instance Attribute Summary collapse
-
#additional_details ⇒ Object
Additional details provided by the selling party, for tax related or other purposes.
-
#bill_to_party ⇒ Object
Returns the value of attribute bill_to_party.
-
#charge_details ⇒ Object
Total charge amount details for all line items.
-
#invoice_date ⇒ Object
Invoice date.
-
#invoice_number ⇒ Object
The unique invoice number.
-
#invoice_total ⇒ Object
Returns the value of attribute invoice_total.
-
#items ⇒ Object
Provides the details of the items in this invoice.
-
#payment_terms_code ⇒ Object
The payment terms for the invoice.
-
#reference_number ⇒ Object
An additional unique reference number used for regulatory or other purposes.
-
#remit_to_party ⇒ Object
Returns the value of attribute remit_to_party.
-
#ship_from_party ⇒ Object
Returns the value of attribute ship_from_party.
-
#ship_to_country_code ⇒ Object
Ship-to country code.
-
#tax_totals ⇒ Object
Individual tax details per line item.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ InvoiceDetail
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ InvoiceDetail
Initializes the object
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 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 97 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `AmzSpApi::VendorDirectFulfillmentPaymentsApiModel::InvoiceDetail` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `AmzSpApi::VendorDirectFulfillmentPaymentsApiModel::InvoiceDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'invoice_number') self.invoice_number = attributes[:'invoice_number'] end if attributes.key?(:'invoice_date') self.invoice_date = attributes[:'invoice_date'] end if attributes.key?(:'reference_number') self.reference_number = attributes[:'reference_number'] end if attributes.key?(:'remit_to_party') self.remit_to_party = attributes[:'remit_to_party'] end if attributes.key?(:'ship_from_party') self.ship_from_party = attributes[:'ship_from_party'] end if attributes.key?(:'bill_to_party') self.bill_to_party = attributes[:'bill_to_party'] end if attributes.key?(:'ship_to_country_code') self.ship_to_country_code = attributes[:'ship_to_country_code'] end if attributes.key?(:'payment_terms_code') self.payment_terms_code = attributes[:'payment_terms_code'] end if attributes.key?(:'invoice_total') self.invoice_total = attributes[:'invoice_total'] end if attributes.key?(:'tax_totals') if (value = attributes[:'tax_totals']).is_a?(Array) self.tax_totals = value end end if attributes.key?(:'additional_details') if (value = attributes[:'additional_details']).is_a?(Array) self.additional_details = value end end if attributes.key?(:'charge_details') if (value = attributes[:'charge_details']).is_a?(Array) self.charge_details = value end end if attributes.key?(:'items') if (value = attributes[:'items']).is_a?(Array) self.items = value end end end |
Instance Attribute Details
#additional_details ⇒ Object
Additional details provided by the selling party, for tax related or other purposes.
43 44 45 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 43 def additional_details @additional_details end |
#bill_to_party ⇒ Object
Returns the value of attribute bill_to_party.
29 30 31 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 29 def bill_to_party @bill_to_party end |
#charge_details ⇒ Object
Total charge amount details for all line items.
46 47 48 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 46 def charge_details @charge_details end |
#invoice_date ⇒ Object
Invoice date.
20 21 22 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 20 def invoice_date @invoice_date end |
#invoice_number ⇒ Object
The unique invoice number.
17 18 19 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 17 def invoice_number @invoice_number end |
#invoice_total ⇒ Object
Returns the value of attribute invoice_total.
37 38 39 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 37 def invoice_total @invoice_total end |
#items ⇒ Object
Provides the details of the items in this invoice.
49 50 51 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 49 def items @items end |
#payment_terms_code ⇒ Object
The payment terms for the invoice.
35 36 37 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 35 def payment_terms_code @payment_terms_code end |
#reference_number ⇒ Object
An additional unique reference number used for regulatory or other purposes.
23 24 25 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 23 def reference_number @reference_number end |
#remit_to_party ⇒ Object
Returns the value of attribute remit_to_party.
25 26 27 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 25 def remit_to_party @remit_to_party end |
#ship_from_party ⇒ Object
Returns the value of attribute ship_from_party.
27 28 29 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 27 def ship_from_party @ship_from_party end |
#ship_to_country_code ⇒ Object
Ship-to country code.
32 33 34 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 32 def ship_to_country_code @ship_to_country_code end |
#tax_totals ⇒ Object
Individual tax details per line item.
40 41 42 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 40 def tax_totals @tax_totals end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 52 def self.attribute_map { :'invoice_number' => :'invoiceNumber', :'invoice_date' => :'invoiceDate', :'reference_number' => :'referenceNumber', :'remit_to_party' => :'remitToParty', :'ship_from_party' => :'shipFromParty', :'bill_to_party' => :'billToParty', :'ship_to_country_code' => :'shipToCountryCode', :'payment_terms_code' => :'paymentTermsCode', :'invoice_total' => :'invoiceTotal', :'tax_totals' => :'taxTotals', :'additional_details' => :'additionalDetails', :'charge_details' => :'chargeDetails', :'items' => :'items' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
249 250 251 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 249 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
90 91 92 93 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 90 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 71 def self.openapi_types { :'invoice_number' => :'Object', :'invoice_date' => :'Object', :'reference_number' => :'Object', :'remit_to_party' => :'Object', :'ship_from_party' => :'Object', :'bill_to_party' => :'Object', :'ship_to_country_code' => :'Object', :'payment_terms_code' => :'Object', :'invoice_total' => :'Object', :'tax_totals' => :'Object', :'additional_details' => :'Object', :'charge_details' => :'Object', :'items' => :'Object' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 216 def ==(o) return true if self.equal?(o) self.class == o.class && invoice_number == o.invoice_number && invoice_date == o.invoice_date && reference_number == o.reference_number && remit_to_party == o.remit_to_party && ship_from_party == o.ship_from_party && bill_to_party == o.bill_to_party && ship_to_country_code == o.ship_to_country_code && payment_terms_code == o.payment_terms_code && invoice_total == o.invoice_total && tax_totals == o.tax_totals && additional_details == o.additional_details && charge_details == o.charge_details && items == o.items end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 279 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model AmzSpApi::VendorDirectFulfillmentPaymentsApiModel.const_get(type).build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
348 349 350 351 352 353 354 355 356 357 358 359 360 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 348 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 256 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) end end self end |
#eql?(o) ⇒ Boolean
236 237 238 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 236 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
242 243 244 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 242 def hash [invoice_number, invoice_date, reference_number, remit_to_party, ship_from_party, bill_to_party, ship_to_country_code, payment_terms_code, invoice_total, tax_totals, additional_details, charge_details, items].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 198 199 200 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 173 def list_invalid_properties invalid_properties = Array.new if @invoice_number.nil? invalid_properties.push('invalid value for "invoice_number", invoice_number cannot be nil.') end if @invoice_date.nil? invalid_properties.push('invalid value for "invoice_date", invoice_date cannot be nil.') end if @remit_to_party.nil? invalid_properties.push('invalid value for "remit_to_party", remit_to_party cannot be nil.') end if @ship_from_party.nil? invalid_properties.push('invalid value for "ship_from_party", ship_from_party cannot be nil.') end if @invoice_total.nil? invalid_properties.push('invalid value for "invoice_total", invoice_total cannot be nil.') end if @items.nil? invalid_properties.push('invalid value for "items", items cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
324 325 326 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 324 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
330 331 332 333 334 335 336 337 338 339 340 341 342 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 330 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
318 319 320 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 318 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
204 205 206 207 208 209 210 211 212 |
# File 'lib/vendor-direct-fulfillment-payments-api-model/models/invoice_detail.rb', line 204 def valid? return false if @invoice_number.nil? return false if @invoice_date.nil? return false if @remit_to_party.nil? return false if @ship_from_party.nil? return false if @invoice_total.nil? return false if @items.nil? true end |