Class: UltracartClient::Order
- Inherits:
-
Object
- Object
- UltracartClient::Order
- Defined in:
- lib/ultracart_api/models/order.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#affiliates ⇒ Object
Affiliates if any were associated with the order.
-
#auto_order ⇒ Object
Returns the value of attribute auto_order.
-
#billing ⇒ Object
Returns the value of attribute billing.
-
#buysafe ⇒ Object
Returns the value of attribute buysafe.
-
#channel_partner ⇒ Object
Returns the value of attribute channel_partner.
-
#checkout ⇒ Object
Returns the value of attribute checkout.
-
#coupons ⇒ Object
Coupons.
-
#creation_dts ⇒ Object
Date/time that the order was created.
-
#currency_code ⇒ Object
Currency code that the customer used if different than the merchant's base currency code.
-
#current_stage ⇒ Object
Current stage that the order is in.
-
#current_stage_histories ⇒ Object
History of the changes to the current_stage field.
-
#customer_profile ⇒ Object
Returns the value of attribute customer_profile.
-
#digital_order ⇒ Object
Returns the value of attribute digital_order.
-
#edi ⇒ Object
Returns the value of attribute edi.
-
#emails ⇒ Object
Email delivery records associated with this order.
-
#exchange_rate ⇒ Object
Exchange rate at the time the order was placed if currency code is different than the base currency.
-
#fraud_score ⇒ Object
Returns the value of attribute fraud_score.
-
#gift ⇒ Object
Returns the value of attribute gift.
-
#gift_certificate ⇒ Object
Returns the value of attribute gift_certificate.
-
#internal ⇒ Object
Returns the value of attribute internal.
-
#items ⇒ Object
Items.
-
#language_iso_code ⇒ Object
Three letter ISO-639 language code used by the customer during the checkout if different than the default language.
-
#linked_shipment ⇒ Object
Returns the value of attribute linked_shipment.
-
#marketing ⇒ Object
Returns the value of attribute marketing.
-
#merchant_id ⇒ Object
UltraCart merchant ID owning this order.
-
#order_id ⇒ Object
Order ID.
-
#payment ⇒ Object
Returns the value of attribute payment.
-
#point_of_sale ⇒ Object
Returns the value of attribute point_of_sale.
-
#properties ⇒ Object
Properties associated with the order.
-
#quote ⇒ Object
Returns the value of attribute quote.
-
#refund_dts ⇒ Object
If the order was refunded, the date/time that the last refund occurred.
-
#refund_reason ⇒ Object
Refund reason code.
-
#reject_dts ⇒ Object
If the order was rejected, the date/time that the rejection occurred.
-
#reject_reason ⇒ Object
Reject reason code.
-
#salesforce ⇒ Object
Returns the value of attribute salesforce.
-
#shipping ⇒ Object
Returns the value of attribute shipping.
-
#summary ⇒ Object
Returns the value of attribute summary.
-
#tags ⇒ Object
tags, available only through update, not through insert due to the nature of how tags are handled internally.
-
#taxes ⇒ Object
Returns the value of attribute taxes.
-
#utms ⇒ Object
UTM clicks.
Class Method Summary collapse
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.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 = {}) ⇒ Order
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 = {}) ⇒ Order
Initializes the object
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 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 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 |
# File 'lib/ultracart_api/models/order.rb', line 244 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::Order` 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 `UltracartClient::Order`. 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?(:'affiliates') if (value = attributes[:'affiliates']).is_a?(Array) self.affiliates = value end end if attributes.key?(:'auto_order') self.auto_order = attributes[:'auto_order'] end if attributes.key?(:'billing') self.billing = attributes[:'billing'] end if attributes.key?(:'buysafe') self.buysafe = attributes[:'buysafe'] end if attributes.key?(:'channel_partner') self.channel_partner = attributes[:'channel_partner'] end if attributes.key?(:'checkout') self.checkout = attributes[:'checkout'] end if attributes.key?(:'coupons') if (value = attributes[:'coupons']).is_a?(Array) self.coupons = value end end if attributes.key?(:'creation_dts') self.creation_dts = attributes[:'creation_dts'] end if attributes.key?(:'currency_code') self.currency_code = attributes[:'currency_code'] end if attributes.key?(:'current_stage') self.current_stage = attributes[:'current_stage'] end if attributes.key?(:'current_stage_histories') if (value = attributes[:'current_stage_histories']).is_a?(Array) self.current_stage_histories = value end end if attributes.key?(:'customer_profile') self.customer_profile = attributes[:'customer_profile'] end if attributes.key?(:'digital_order') self.digital_order = attributes[:'digital_order'] end if attributes.key?(:'edi') self.edi = attributes[:'edi'] end if attributes.key?(:'emails') if (value = attributes[:'emails']).is_a?(Array) self.emails = value end end if attributes.key?(:'exchange_rate') self.exchange_rate = attributes[:'exchange_rate'] end if attributes.key?(:'fraud_score') self.fraud_score = attributes[:'fraud_score'] end if attributes.key?(:'gift') self.gift = attributes[:'gift'] end if attributes.key?(:'gift_certificate') self.gift_certificate = attributes[:'gift_certificate'] end if attributes.key?(:'internal') self.internal = attributes[:'internal'] end if attributes.key?(:'items') if (value = attributes[:'items']).is_a?(Array) self.items = value end end if attributes.key?(:'language_iso_code') self.language_iso_code = attributes[:'language_iso_code'] end if attributes.key?(:'linked_shipment') self.linked_shipment = attributes[:'linked_shipment'] end if attributes.key?(:'marketing') self.marketing = attributes[:'marketing'] end if attributes.key?(:'merchant_id') self.merchant_id = attributes[:'merchant_id'] end if attributes.key?(:'order_id') self.order_id = attributes[:'order_id'] end if attributes.key?(:'payment') self.payment = attributes[:'payment'] end if attributes.key?(:'point_of_sale') self.point_of_sale = attributes[:'point_of_sale'] end if attributes.key?(:'properties') if (value = attributes[:'properties']).is_a?(Array) self.properties = value end end if attributes.key?(:'quote') self.quote = attributes[:'quote'] end if attributes.key?(:'refund_dts') self.refund_dts = attributes[:'refund_dts'] end if attributes.key?(:'refund_reason') self.refund_reason = attributes[:'refund_reason'] end if attributes.key?(:'reject_dts') self.reject_dts = attributes[:'reject_dts'] end if attributes.key?(:'reject_reason') self.reject_reason = attributes[:'reject_reason'] end if attributes.key?(:'salesforce') self.salesforce = attributes[:'salesforce'] end if attributes.key?(:'shipping') self.shipping = attributes[:'shipping'] end if attributes.key?(:'summary') self.summary = attributes[:'summary'] end if attributes.key?(:'tags') if (value = attributes[:'tags']).is_a?(Array) self. = value end end if attributes.key?(:'taxes') self.taxes = attributes[:'taxes'] end if attributes.key?(:'utms') if (value = attributes[:'utms']).is_a?(Array) self.utms = value end end end |
Instance Attribute Details
#affiliates ⇒ Object
Affiliates if any were associated with the order. The first one in the array sent the order and each subsequent affiliate is the recruiter that earns a downline commission.
19 20 21 |
# File 'lib/ultracart_api/models/order.rb', line 19 def affiliates @affiliates end |
#auto_order ⇒ Object
Returns the value of attribute auto_order.
21 22 23 |
# File 'lib/ultracart_api/models/order.rb', line 21 def auto_order @auto_order end |
#billing ⇒ Object
Returns the value of attribute billing.
23 24 25 |
# File 'lib/ultracart_api/models/order.rb', line 23 def billing @billing end |
#buysafe ⇒ Object
Returns the value of attribute buysafe.
25 26 27 |
# File 'lib/ultracart_api/models/order.rb', line 25 def buysafe @buysafe end |
#channel_partner ⇒ Object
Returns the value of attribute channel_partner.
27 28 29 |
# File 'lib/ultracart_api/models/order.rb', line 27 def channel_partner @channel_partner end |
#checkout ⇒ Object
Returns the value of attribute checkout.
29 30 31 |
# File 'lib/ultracart_api/models/order.rb', line 29 def checkout @checkout end |
#coupons ⇒ Object
Coupons
32 33 34 |
# File 'lib/ultracart_api/models/order.rb', line 32 def coupons @coupons end |
#creation_dts ⇒ Object
Date/time that the order was created
35 36 37 |
# File 'lib/ultracart_api/models/order.rb', line 35 def creation_dts @creation_dts end |
#currency_code ⇒ Object
Currency code that the customer used if different than the merchant's base currency code
38 39 40 |
# File 'lib/ultracart_api/models/order.rb', line 38 def currency_code @currency_code end |
#current_stage ⇒ Object
Current stage that the order is in.
41 42 43 |
# File 'lib/ultracart_api/models/order.rb', line 41 def current_stage @current_stage end |
#current_stage_histories ⇒ Object
History of the changes to the current_stage field
44 45 46 |
# File 'lib/ultracart_api/models/order.rb', line 44 def current_stage_histories @current_stage_histories end |
#customer_profile ⇒ Object
Returns the value of attribute customer_profile.
46 47 48 |
# File 'lib/ultracart_api/models/order.rb', line 46 def customer_profile @customer_profile end |
#digital_order ⇒ Object
Returns the value of attribute digital_order.
48 49 50 |
# File 'lib/ultracart_api/models/order.rb', line 48 def digital_order @digital_order end |
#edi ⇒ Object
Returns the value of attribute edi.
50 51 52 |
# File 'lib/ultracart_api/models/order.rb', line 50 def edi @edi end |
#emails ⇒ Object
Email delivery records associated with this order.
53 54 55 |
# File 'lib/ultracart_api/models/order.rb', line 53 def emails @emails end |
#exchange_rate ⇒ Object
Exchange rate at the time the order was placed if currency code is different than the base currency
56 57 58 |
# File 'lib/ultracart_api/models/order.rb', line 56 def exchange_rate @exchange_rate end |
#fraud_score ⇒ Object
Returns the value of attribute fraud_score.
58 59 60 |
# File 'lib/ultracart_api/models/order.rb', line 58 def fraud_score @fraud_score end |
#gift ⇒ Object
Returns the value of attribute gift.
60 61 62 |
# File 'lib/ultracart_api/models/order.rb', line 60 def gift @gift end |
#gift_certificate ⇒ Object
Returns the value of attribute gift_certificate.
62 63 64 |
# File 'lib/ultracart_api/models/order.rb', line 62 def gift_certificate @gift_certificate end |
#internal ⇒ Object
Returns the value of attribute internal.
64 65 66 |
# File 'lib/ultracart_api/models/order.rb', line 64 def internal @internal end |
#items ⇒ Object
Items
67 68 69 |
# File 'lib/ultracart_api/models/order.rb', line 67 def items @items end |
#language_iso_code ⇒ Object
Three letter ISO-639 language code used by the customer during the checkout if different than the default language
70 71 72 |
# File 'lib/ultracart_api/models/order.rb', line 70 def language_iso_code @language_iso_code end |
#linked_shipment ⇒ Object
Returns the value of attribute linked_shipment.
72 73 74 |
# File 'lib/ultracart_api/models/order.rb', line 72 def linked_shipment @linked_shipment end |
#marketing ⇒ Object
Returns the value of attribute marketing.
74 75 76 |
# File 'lib/ultracart_api/models/order.rb', line 74 def marketing @marketing end |
#merchant_id ⇒ Object
UltraCart merchant ID owning this order
77 78 79 |
# File 'lib/ultracart_api/models/order.rb', line 77 def merchant_id @merchant_id end |
#order_id ⇒ Object
Order ID
80 81 82 |
# File 'lib/ultracart_api/models/order.rb', line 80 def order_id @order_id end |
#payment ⇒ Object
Returns the value of attribute payment.
82 83 84 |
# File 'lib/ultracart_api/models/order.rb', line 82 def payment @payment end |
#point_of_sale ⇒ Object
Returns the value of attribute point_of_sale.
84 85 86 |
# File 'lib/ultracart_api/models/order.rb', line 84 def point_of_sale @point_of_sale end |
#properties ⇒ Object
Properties associated with the order
87 88 89 |
# File 'lib/ultracart_api/models/order.rb', line 87 def properties @properties end |
#quote ⇒ Object
Returns the value of attribute quote.
89 90 91 |
# File 'lib/ultracart_api/models/order.rb', line 89 def quote @quote end |
#refund_dts ⇒ Object
If the order was refunded, the date/time that the last refund occurred
92 93 94 |
# File 'lib/ultracart_api/models/order.rb', line 92 def refund_dts @refund_dts end |
#refund_reason ⇒ Object
Refund reason code. This can only be written during a refund operation otherwise this field is read only.
95 96 97 |
# File 'lib/ultracart_api/models/order.rb', line 95 def refund_reason @refund_reason end |
#reject_dts ⇒ Object
If the order was rejected, the date/time that the rejection occurred
98 99 100 |
# File 'lib/ultracart_api/models/order.rb', line 98 def reject_dts @reject_dts end |
#reject_reason ⇒ Object
Reject reason code. This can only be written during a reject operation otherwise this field is read only.
101 102 103 |
# File 'lib/ultracart_api/models/order.rb', line 101 def reject_reason @reject_reason end |
#salesforce ⇒ Object
Returns the value of attribute salesforce.
103 104 105 |
# File 'lib/ultracart_api/models/order.rb', line 103 def salesforce @salesforce end |
#shipping ⇒ Object
Returns the value of attribute shipping.
105 106 107 |
# File 'lib/ultracart_api/models/order.rb', line 105 def shipping @shipping end |
#summary ⇒ Object
Returns the value of attribute summary.
107 108 109 |
# File 'lib/ultracart_api/models/order.rb', line 107 def summary @summary end |
#tags ⇒ Object
tags, available only through update, not through insert due to the nature of how tags are handled internally
110 111 112 |
# File 'lib/ultracart_api/models/order.rb', line 110 def end |
#taxes ⇒ Object
Returns the value of attribute taxes.
112 113 114 |
# File 'lib/ultracart_api/models/order.rb', line 112 def taxes @taxes end |
#utms ⇒ Object
UTM clicks. The zero index is the most recent (last) UTM click
115 116 117 |
# File 'lib/ultracart_api/models/order.rb', line 115 def utms @utms end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
186 187 188 |
# File 'lib/ultracart_api/models/order.rb', line 186 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 171 172 173 174 175 176 177 178 179 180 181 182 183 |
# File 'lib/ultracart_api/models/order.rb', line 140 def self.attribute_map { :'affiliates' => :'affiliates', :'auto_order' => :'auto_order', :'billing' => :'billing', :'buysafe' => :'buysafe', :'channel_partner' => :'channel_partner', :'checkout' => :'checkout', :'coupons' => :'coupons', :'creation_dts' => :'creation_dts', :'currency_code' => :'currency_code', :'current_stage' => :'current_stage', :'current_stage_histories' => :'current_stage_histories', :'customer_profile' => :'customer_profile', :'digital_order' => :'digital_order', :'edi' => :'edi', :'emails' => :'emails', :'exchange_rate' => :'exchange_rate', :'fraud_score' => :'fraud_score', :'gift' => :'gift', :'gift_certificate' => :'gift_certificate', :'internal' => :'internal', :'items' => :'items', :'language_iso_code' => :'language_iso_code', :'linked_shipment' => :'linked_shipment', :'marketing' => :'marketing', :'merchant_id' => :'merchant_id', :'order_id' => :'order_id', :'payment' => :'payment', :'point_of_sale' => :'point_of_sale', :'properties' => :'properties', :'quote' => :'quote', :'refund_dts' => :'refund_dts', :'refund_reason' => :'refund_reason', :'reject_dts' => :'reject_dts', :'reject_reason' => :'reject_reason', :'salesforce' => :'salesforce', :'shipping' => :'shipping', :'summary' => :'summary', :'tags' => :'Tags', :'taxes' => :'taxes', :'utms' => :'utms' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
551 552 553 |
# File 'lib/ultracart_api/models/order.rb', line 551 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
237 238 239 240 |
# File 'lib/ultracart_api/models/order.rb', line 237 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
# File 'lib/ultracart_api/models/order.rb', line 191 def self.openapi_types { :'affiliates' => :'Array<OrderAffiliate>', :'auto_order' => :'OrderAutoOrder', :'billing' => :'OrderBilling', :'buysafe' => :'OrderBuysafe', :'channel_partner' => :'OrderChannelPartner', :'checkout' => :'OrderCheckout', :'coupons' => :'Array<OrderCoupon>', :'creation_dts' => :'String', :'currency_code' => :'String', :'current_stage' => :'String', :'current_stage_histories' => :'Array<OrderCurrentStageHistory>', :'customer_profile' => :'Customer', :'digital_order' => :'OrderDigitalOrder', :'edi' => :'OrderEdi', :'emails' => :'Array<OrderEmail>', :'exchange_rate' => :'Float', :'fraud_score' => :'OrderFraudScore', :'gift' => :'OrderGift', :'gift_certificate' => :'OrderGiftCertificate', :'internal' => :'OrderInternal', :'items' => :'Array<OrderItem>', :'language_iso_code' => :'String', :'linked_shipment' => :'OrderLinkedShipment', :'marketing' => :'OrderMarketing', :'merchant_id' => :'String', :'order_id' => :'String', :'payment' => :'OrderPayment', :'point_of_sale' => :'OrderPointOfSale', :'properties' => :'Array<OrderProperty>', :'quote' => :'OrderQuote', :'refund_dts' => :'String', :'refund_reason' => :'String', :'reject_dts' => :'String', :'reject_reason' => :'String', :'salesforce' => :'OrderSalesforce', :'shipping' => :'OrderShipping', :'summary' => :'OrderSummary', :'tags' => :'Array<OrderTag>', :'taxes' => :'OrderTaxes', :'utms' => :'Array<OrderUtm>' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 |
# File 'lib/ultracart_api/models/order.rb', line 491 def ==(o) return true if self.equal?(o) self.class == o.class && affiliates == o.affiliates && auto_order == o.auto_order && billing == o.billing && buysafe == o.buysafe && channel_partner == o.channel_partner && checkout == o.checkout && coupons == o.coupons && creation_dts == o.creation_dts && currency_code == o.currency_code && current_stage == o.current_stage && current_stage_histories == o.current_stage_histories && customer_profile == o.customer_profile && digital_order == o.digital_order && edi == o.edi && emails == o.emails && exchange_rate == o.exchange_rate && fraud_score == o.fraud_score && gift == o.gift && gift_certificate == o.gift_certificate && internal == o.internal && items == o.items && language_iso_code == o.language_iso_code && linked_shipment == o.linked_shipment && marketing == o.marketing && merchant_id == o.merchant_id && order_id == o.order_id && payment == o.payment && point_of_sale == o.point_of_sale && properties == o.properties && quote == o.quote && refund_dts == o.refund_dts && refund_reason == o.refund_reason && reject_dts == o.reject_dts && reject_reason == o.reject_reason && salesforce == o.salesforce && shipping == o.shipping && summary == o.summary && == o. && taxes == o.taxes && utms == o.utms end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 |
# File 'lib/ultracart_api/models/order.rb', line 582 def _deserialize(type, value) case type.to_sym when :Time Time.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 # models (e.g. Pet) or oneOf klass = UltracartClient.const_get(type) klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.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
653 654 655 656 657 658 659 660 661 662 663 664 665 |
# File 'lib/ultracart_api/models/order.rb', line 653 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
558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 |
# File 'lib/ultracart_api/models/order.rb', line 558 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) elsif 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]])) end end self end |
#eql?(o) ⇒ Boolean
538 539 540 |
# File 'lib/ultracart_api/models/order.rb', line 538 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
544 545 546 |
# File 'lib/ultracart_api/models/order.rb', line 544 def hash [affiliates, auto_order, billing, buysafe, channel_partner, checkout, coupons, creation_dts, currency_code, current_stage, current_stage_histories, customer_profile, digital_order, edi, emails, exchange_rate, fraud_score, gift, gift_certificate, internal, items, language_iso_code, linked_shipment, marketing, merchant_id, order_id, payment, point_of_sale, properties, quote, refund_dts, refund_reason, reject_dts, reject_reason, salesforce, shipping, summary, , taxes, utms].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
436 437 438 439 440 441 442 443 444 445 446 447 |
# File 'lib/ultracart_api/models/order.rb', line 436 def list_invalid_properties invalid_properties = Array.new if !@currency_code.nil? && @currency_code.to_s.length > 3 invalid_properties.push('invalid value for "currency_code", the character length must be smaller than or equal to 3.') end if !@language_iso_code.nil? && @language_iso_code.to_s.length > 3 invalid_properties.push('invalid value for "language_iso_code", the character length must be smaller than or equal to 3.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
629 630 631 |
# File 'lib/ultracart_api/models/order.rb', line 629 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
635 636 637 638 639 640 641 642 643 644 645 646 647 |
# File 'lib/ultracart_api/models/order.rb', line 635 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
623 624 625 |
# File 'lib/ultracart_api/models/order.rb', line 623 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
451 452 453 454 455 456 457 |
# File 'lib/ultracart_api/models/order.rb', line 451 def valid? return false if !@currency_code.nil? && @currency_code.to_s.length > 3 current_stage_validator = EnumAttributeValidator.new('String', ["Accounts Receivable", "Pending Clearance", "Fraud Review", "Rejected", "Shipping Department", "Completed Order", "Quote Request", "Quote Sent", "Least Cost Routing", "Unknown", "Pre-ordered", "Advanced Order Routing", "Hold"]) return false unless current_stage_validator.valid?(@current_stage) return false if !@language_iso_code.nil? && @language_iso_code.to_s.length > 3 true end |