Class: UltracartClient::OrderShipping
- Inherits:
-
Object
- Object
- UltracartClient::OrderShipping
- Defined in:
- lib/ultracart_api/models/order_shipping.rb
Instance Attribute Summary collapse
-
#address1 ⇒ Object
Address line 1.
-
#address2 ⇒ Object
Address line 2.
-
#city ⇒ Object
City.
-
#company ⇒ Object
Company.
-
#country_code ⇒ Object
ISO-3166 two letter country code.
-
#day_phone ⇒ Object
Day time phone.
-
#day_phone_e164 ⇒ Object
Day time phone (E164 format).
-
#delivery_date ⇒ Object
Date the customer is requesting delivery on.
-
#evening_phone ⇒ Object
Evening phone.
-
#evening_phone_e164 ⇒ Object
Evening phone (E164 format).
-
#first_name ⇒ Object
First name.
-
#last_name ⇒ Object
Last name.
-
#least_cost_route ⇒ Object
If true, instructs UltraCart to apply the cheapest shipping method to this order.
-
#least_cost_route_shipping_methods ⇒ Object
List of shipping methods to consider if least_code_route is true.
-
#lift_gate ⇒ Object
Lift gate requested (LTL shipping methods only).
-
#pickup_dts ⇒ Object
Date/time the order should be picked up locally.
-
#postal_code ⇒ Object
Postal code.
-
#rma ⇒ Object
RMA number.
-
#ship_on_date ⇒ Object
Date the customer is requesting that the order ship on.
-
#ship_to_residential ⇒ Object
True if the shipping address is residential.
-
#shipping_3rd_party_account_number ⇒ Object
Shipping 3rd party account number.
-
#shipping_date ⇒ Object
Date/time the order shipped on.
-
#shipping_department_status ⇒ Object
Shipping department status.
-
#shipping_method ⇒ Object
Shipping method.
-
#shipping_method_accounting_code ⇒ Object
Shipping method accounting code.
-
#special_instructions ⇒ Object
Special instructions from the customer regarding shipping.
-
#state_region ⇒ Object
State.
-
#title ⇒ Object
Title.
-
#tracking_number_details ⇒ Object
Tracking number details.
-
#tracking_numbers ⇒ Object
Tracking numbers.
-
#weight ⇒ Object
Returns the value of attribute weight.
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 = {}) ⇒ OrderShipping
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 = {}) ⇒ OrderShipping
Initializes the object
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 235 236 237 238 239 240 241 242 243 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 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 197 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::OrderShipping` 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::OrderShipping`. 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?(:'address1') self.address1 = attributes[:'address1'] end if attributes.key?(:'address2') self.address2 = attributes[:'address2'] end if attributes.key?(:'city') self.city = attributes[:'city'] end if attributes.key?(:'company') self.company = attributes[:'company'] end if attributes.key?(:'country_code') self.country_code = attributes[:'country_code'] end if attributes.key?(:'day_phone') self.day_phone = attributes[:'day_phone'] end if attributes.key?(:'day_phone_e164') self.day_phone_e164 = attributes[:'day_phone_e164'] end if attributes.key?(:'delivery_date') self.delivery_date = attributes[:'delivery_date'] end if attributes.key?(:'evening_phone') self.evening_phone = attributes[:'evening_phone'] end if attributes.key?(:'evening_phone_e164') self.evening_phone_e164 = attributes[:'evening_phone_e164'] end if attributes.key?(:'first_name') self.first_name = attributes[:'first_name'] end if attributes.key?(:'last_name') self.last_name = attributes[:'last_name'] end if attributes.key?(:'least_cost_route') self.least_cost_route = attributes[:'least_cost_route'] end if attributes.key?(:'least_cost_route_shipping_methods') if (value = attributes[:'least_cost_route_shipping_methods']).is_a?(Array) self.least_cost_route_shipping_methods = value end end if attributes.key?(:'lift_gate') self.lift_gate = attributes[:'lift_gate'] end if attributes.key?(:'pickup_dts') self.pickup_dts = attributes[:'pickup_dts'] end if attributes.key?(:'postal_code') self.postal_code = attributes[:'postal_code'] end if attributes.key?(:'rma') self.rma = attributes[:'rma'] end if attributes.key?(:'ship_on_date') self.ship_on_date = attributes[:'ship_on_date'] end if attributes.key?(:'ship_to_residential') self.ship_to_residential = attributes[:'ship_to_residential'] end if attributes.key?(:'shipping_3rd_party_account_number') self.shipping_3rd_party_account_number = attributes[:'shipping_3rd_party_account_number'] end if attributes.key?(:'shipping_date') self.shipping_date = attributes[:'shipping_date'] end if attributes.key?(:'shipping_department_status') self.shipping_department_status = attributes[:'shipping_department_status'] end if attributes.key?(:'shipping_method') self.shipping_method = attributes[:'shipping_method'] end if attributes.key?(:'shipping_method_accounting_code') self.shipping_method_accounting_code = attributes[:'shipping_method_accounting_code'] end if attributes.key?(:'special_instructions') self.special_instructions = attributes[:'special_instructions'] end if attributes.key?(:'state_region') self.state_region = attributes[:'state_region'] end if attributes.key?(:'title') self.title = attributes[:'title'] end if attributes.key?(:'tracking_number_details') if (value = attributes[:'tracking_number_details']).is_a?(Array) self.tracking_number_details = value end end if attributes.key?(:'tracking_numbers') if (value = attributes[:'tracking_numbers']).is_a?(Array) self.tracking_numbers = value end end if attributes.key?(:'weight') self.weight = attributes[:'weight'] end end |
Instance Attribute Details
#address1 ⇒ Object
Address line 1
19 20 21 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 19 def address1 @address1 end |
#address2 ⇒ Object
Address line 2
22 23 24 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 22 def address2 @address2 end |
#city ⇒ Object
City
25 26 27 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 25 def city @city end |
#company ⇒ Object
Company
28 29 30 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 28 def company @company end |
#country_code ⇒ Object
ISO-3166 two letter country code
31 32 33 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 31 def country_code @country_code end |
#day_phone ⇒ Object
Day time phone
34 35 36 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 34 def day_phone @day_phone end |
#day_phone_e164 ⇒ Object
Day time phone (E164 format)
37 38 39 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 37 def day_phone_e164 @day_phone_e164 end |
#delivery_date ⇒ Object
Date the customer is requesting delivery on. Typically used for perishable product delivery.
40 41 42 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 40 def delivery_date @delivery_date end |
#evening_phone ⇒ Object
Evening phone
43 44 45 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 43 def evening_phone @evening_phone end |
#evening_phone_e164 ⇒ Object
Evening phone (E164 format)
46 47 48 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 46 def evening_phone_e164 @evening_phone_e164 end |
#first_name ⇒ Object
First name
49 50 51 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 49 def first_name @first_name end |
#last_name ⇒ Object
Last name
52 53 54 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 52 def last_name @last_name end |
#least_cost_route ⇒ Object
If true, instructs UltraCart to apply the cheapest shipping method to this order. Used only for channel partner order inserts.
55 56 57 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 55 def least_cost_route @least_cost_route end |
#least_cost_route_shipping_methods ⇒ Object
List of shipping methods to consider if least_code_route is true. Used only for channel parter order inserts.
58 59 60 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 58 def least_cost_route_shipping_methods @least_cost_route_shipping_methods end |
#lift_gate ⇒ Object
Lift gate requested (LTL shipping methods only)
61 62 63 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 61 def lift_gate @lift_gate end |
#pickup_dts ⇒ Object
Date/time the order should be picked up locally.
64 65 66 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 64 def pickup_dts @pickup_dts end |
#postal_code ⇒ Object
Postal code
67 68 69 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 67 def postal_code @postal_code end |
#rma ⇒ Object
RMA number
70 71 72 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 70 def rma @rma end |
#ship_on_date ⇒ Object
Date the customer is requesting that the order ship on. Typically used for perishable product delivery.
73 74 75 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 73 def ship_on_date @ship_on_date end |
#ship_to_residential ⇒ Object
True if the shipping address is residential. Effects the methods that are available to the customer as well as the price of the shipping method.
76 77 78 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 76 def ship_to_residential @ship_to_residential end |
#shipping_3rd_party_account_number ⇒ Object
Shipping 3rd party account number
79 80 81 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 79 def shipping_3rd_party_account_number @shipping_3rd_party_account_number end |
#shipping_date ⇒ Object
Date/time the order shipped on. This date is set once the first shipment is sent to the customer.
82 83 84 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 82 def shipping_date @shipping_date end |
#shipping_department_status ⇒ Object
Shipping department status
85 86 87 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 85 def shipping_department_status @shipping_department_status end |
#shipping_method ⇒ Object
Shipping method
88 89 90 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 88 def shipping_method @shipping_method end |
#shipping_method_accounting_code ⇒ Object
Shipping method accounting code
91 92 93 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 91 def shipping_method_accounting_code @shipping_method_accounting_code end |
#special_instructions ⇒ Object
Special instructions from the customer regarding shipping
94 95 96 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 94 def special_instructions @special_instructions end |
#state_region ⇒ Object
State
97 98 99 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 97 def state_region @state_region end |
#title ⇒ Object
Title
100 101 102 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 100 def title @title end |
#tracking_number_details ⇒ Object
Tracking number details
103 104 105 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 103 def tracking_number_details @tracking_number_details end |
#tracking_numbers ⇒ Object
Tracking numbers
106 107 108 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 106 def tracking_numbers @tracking_numbers end |
#weight ⇒ Object
Returns the value of attribute weight.
108 109 110 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 108 def weight @weight end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
148 149 150 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 148 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 111 def self.attribute_map { :'address1' => :'address1', :'address2' => :'address2', :'city' => :'city', :'company' => :'company', :'country_code' => :'country_code', :'day_phone' => :'day_phone', :'day_phone_e164' => :'day_phone_e164', :'delivery_date' => :'delivery_date', :'evening_phone' => :'evening_phone', :'evening_phone_e164' => :'evening_phone_e164', :'first_name' => :'first_name', :'last_name' => :'last_name', :'least_cost_route' => :'least_cost_route', :'least_cost_route_shipping_methods' => :'least_cost_route_shipping_methods', :'lift_gate' => :'lift_gate', :'pickup_dts' => :'pickup_dts', :'postal_code' => :'postal_code', :'rma' => :'rma', :'ship_on_date' => :'ship_on_date', :'ship_to_residential' => :'ship_to_residential', :'shipping_3rd_party_account_number' => :'shipping_3rd_party_account_number', :'shipping_date' => :'shipping_date', :'shipping_department_status' => :'shipping_department_status', :'shipping_method' => :'shipping_method', :'shipping_method_accounting_code' => :'shipping_method_accounting_code', :'special_instructions' => :'special_instructions', :'state_region' => :'state_region', :'title' => :'title', :'tracking_number_details' => :'tracking_number_details', :'tracking_numbers' => :'tracking_numbers', :'weight' => :'weight' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
662 663 664 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 662 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
190 191 192 193 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 190 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 184 185 186 187 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 153 def self.openapi_types { :'address1' => :'String', :'address2' => :'String', :'city' => :'String', :'company' => :'String', :'country_code' => :'String', :'day_phone' => :'String', :'day_phone_e164' => :'String', :'delivery_date' => :'String', :'evening_phone' => :'String', :'evening_phone_e164' => :'String', :'first_name' => :'String', :'last_name' => :'String', :'least_cost_route' => :'Boolean', :'least_cost_route_shipping_methods' => :'Array<String>', :'lift_gate' => :'Boolean', :'pickup_dts' => :'String', :'postal_code' => :'String', :'rma' => :'String', :'ship_on_date' => :'String', :'ship_to_residential' => :'Boolean', :'shipping_3rd_party_account_number' => :'String', :'shipping_date' => :'String', :'shipping_department_status' => :'String', :'shipping_method' => :'String', :'shipping_method_accounting_code' => :'String', :'special_instructions' => :'String', :'state_region' => :'String', :'title' => :'String', :'tracking_number_details' => :'Array<OrderTrackingNumberDetails>', :'tracking_numbers' => :'Array<String>', :'weight' => :'Weight' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 611 def ==(o) return true if self.equal?(o) self.class == o.class && address1 == o.address1 && address2 == o.address2 && city == o.city && company == o.company && country_code == o.country_code && day_phone == o.day_phone && day_phone_e164 == o.day_phone_e164 && delivery_date == o.delivery_date && evening_phone == o.evening_phone && evening_phone_e164 == o.evening_phone_e164 && first_name == o.first_name && last_name == o.last_name && least_cost_route == o.least_cost_route && least_cost_route_shipping_methods == o.least_cost_route_shipping_methods && lift_gate == o.lift_gate && pickup_dts == o.pickup_dts && postal_code == o.postal_code && rma == o.rma && ship_on_date == o.ship_on_date && ship_to_residential == o.ship_to_residential && shipping_3rd_party_account_number == o.shipping_3rd_party_account_number && shipping_date == o.shipping_date && shipping_department_status == o.shipping_department_status && shipping_method == o.shipping_method && shipping_method_accounting_code == o.shipping_method_accounting_code && special_instructions == o.special_instructions && state_region == o.state_region && title == o.title && tracking_number_details == o.tracking_number_details && tracking_numbers == o.tracking_numbers && weight == o.weight end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 693 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
764 765 766 767 768 769 770 771 772 773 774 775 776 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 764 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
669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 669 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
649 650 651 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 649 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
655 656 657 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 655 def hash [address1, address2, city, company, country_code, day_phone, day_phone_e164, delivery_date, evening_phone, evening_phone_e164, first_name, last_name, least_cost_route, least_cost_route_shipping_methods, lift_gate, pickup_dts, postal_code, rma, ship_on_date, ship_to_residential, shipping_3rd_party_account_number, shipping_date, shipping_department_status, shipping_method, shipping_method_accounting_code, special_instructions, state_region, title, tracking_number_details, tracking_numbers, weight].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 343 def list_invalid_properties invalid_properties = Array.new if !@address1.nil? && @address1.to_s.length > 50 invalid_properties.push('invalid value for "address1", the character length must be smaller than or equal to 50.') end if !@address2.nil? && @address2.to_s.length > 50 invalid_properties.push('invalid value for "address2", the character length must be smaller than or equal to 50.') end if !@city.nil? && @city.to_s.length > 32 invalid_properties.push('invalid value for "city", the character length must be smaller than or equal to 32.') end if !@company.nil? && @company.to_s.length > 50 invalid_properties.push('invalid value for "company", the character length must be smaller than or equal to 50.') end if !@country_code.nil? && @country_code.to_s.length > 2 invalid_properties.push('invalid value for "country_code", the character length must be smaller than or equal to 2.') end if !@day_phone.nil? && @day_phone.to_s.length > 25 invalid_properties.push('invalid value for "day_phone", the character length must be smaller than or equal to 25.') end if !@day_phone_e164.nil? && @day_phone_e164.to_s.length > 25 invalid_properties.push('invalid value for "day_phone_e164", the character length must be smaller than or equal to 25.') end if !@evening_phone.nil? && @evening_phone.to_s.length > 25 invalid_properties.push('invalid value for "evening_phone", the character length must be smaller than or equal to 25.') end if !@evening_phone_e164.nil? && @evening_phone_e164.to_s.length > 25 invalid_properties.push('invalid value for "evening_phone_e164", the character length must be smaller than or equal to 25.') end if !@first_name.nil? && @first_name.to_s.length > 30 invalid_properties.push('invalid value for "first_name", the character length must be smaller than or equal to 30.') end if !@last_name.nil? && @last_name.to_s.length > 30 invalid_properties.push('invalid value for "last_name", the character length must be smaller than or equal to 30.') end if !@postal_code.nil? && @postal_code.to_s.length > 20 invalid_properties.push('invalid value for "postal_code", the character length must be smaller than or equal to 20.') end if !@rma.nil? && @rma.to_s.length > 30 invalid_properties.push('invalid value for "rma", the character length must be smaller than or equal to 30.') end if !@shipping_3rd_party_account_number.nil? && @shipping_3rd_party_account_number.to_s.length > 20 invalid_properties.push('invalid value for "shipping_3rd_party_account_number", the character length must be smaller than or equal to 20.') end if !@shipping_department_status.nil? && @shipping_department_status.to_s.length > 30 invalid_properties.push('invalid value for "shipping_department_status", the character length must be smaller than or equal to 30.') end if !@state_region.nil? && @state_region.to_s.length > 32 invalid_properties.push('invalid value for "state_region", the character length must be smaller than or equal to 32.') end if !@title.nil? && @title.to_s.length > 50 invalid_properties.push('invalid value for "title", the character length must be smaller than or equal to 50.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
740 741 742 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 740 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
746 747 748 749 750 751 752 753 754 755 756 757 758 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 746 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
734 735 736 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 734 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 |
# File 'lib/ultracart_api/models/order_shipping.rb', line 418 def valid? return false if !@address1.nil? && @address1.to_s.length > 50 return false if !@address2.nil? && @address2.to_s.length > 50 return false if !@city.nil? && @city.to_s.length > 32 return false if !@company.nil? && @company.to_s.length > 50 return false if !@country_code.nil? && @country_code.to_s.length > 2 return false if !@day_phone.nil? && @day_phone.to_s.length > 25 return false if !@day_phone_e164.nil? && @day_phone_e164.to_s.length > 25 return false if !@evening_phone.nil? && @evening_phone.to_s.length > 25 return false if !@evening_phone_e164.nil? && @evening_phone_e164.to_s.length > 25 return false if !@first_name.nil? && @first_name.to_s.length > 30 return false if !@last_name.nil? && @last_name.to_s.length > 30 return false if !@postal_code.nil? && @postal_code.to_s.length > 20 return false if !@rma.nil? && @rma.to_s.length > 30 return false if !@shipping_3rd_party_account_number.nil? && @shipping_3rd_party_account_number.to_s.length > 20 return false if !@shipping_department_status.nil? && @shipping_department_status.to_s.length > 30 return false if !@state_region.nil? && @state_region.to_s.length > 32 return false if !@title.nil? && @title.to_s.length > 50 true end |