Class: UltracartClient::CartSettingsShippingEstimate
- Inherits:
-
Object
- Object
- UltracartClient::CartSettingsShippingEstimate
- Defined in:
- lib/ultracart_api/models/cart_settings_shipping_estimate.rb
Instance Attribute Summary collapse
-
#allow_3rd_party_billing ⇒ Object
True if this method allows the customer to use their own shipper account number.
-
#comment ⇒ Object
Comment to display to the customer about this method.
-
#cost ⇒ Object
Returns the value of attribute cost.
-
#cost_before_discount ⇒ Object
Returns the value of attribute cost_before_discount.
-
#default_method ⇒ Object
True if this is the default method.
-
#discount ⇒ Object
Returns the value of attribute discount.
-
#discounted ⇒ Object
True if this method is discounted because of a coupon.
-
#display_name ⇒ Object
The name to display to the customer.
-
#estimated_delivery ⇒ Object
Date of the estimated delivery (or range).
-
#lift_gate_option ⇒ Object
True if a lift gate option for this method should be offered to the customer.
-
#name ⇒ Object
Shipping method name.
-
#pickup ⇒ Object
True if this shipping method requires customers to physically pickup product themselves.
-
#tax ⇒ Object
Returns the value of attribute tax.
-
#total_tax ⇒ Object
Returns the value of attribute total_tax.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_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 ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ CartSettingsShippingEstimate
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 = {}) ⇒ CartSettingsShippingEstimate
Initializes the object
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 |
# File 'lib/ultracart_api/models/cart_settings_shipping_estimate.rb', line 96 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'allow_3rd_party_billing') self.allow_3rd_party_billing = attributes[:'allow_3rd_party_billing'] end if attributes.has_key?(:'comment') self.comment = attributes[:'comment'] end if attributes.has_key?(:'cost') self.cost = attributes[:'cost'] end if attributes.has_key?(:'cost_before_discount') self.cost_before_discount = attributes[:'cost_before_discount'] end if attributes.has_key?(:'default_method') self.default_method = attributes[:'default_method'] end if attributes.has_key?(:'discount') self.discount = attributes[:'discount'] end if attributes.has_key?(:'discounted') self.discounted = attributes[:'discounted'] end if attributes.has_key?(:'display_name') self.display_name = attributes[:'display_name'] end if attributes.has_key?(:'estimated_delivery') self.estimated_delivery = attributes[:'estimated_delivery'] end if attributes.has_key?(:'lift_gate_option') self.lift_gate_option = attributes[:'lift_gate_option'] end if attributes.has_key?(:'name') self.name = attributes[:'name'] end if attributes.has_key?(:'pickup') self.pickup = attributes[:'pickup'] end if attributes.has_key?(:'tax') self.tax = attributes[:'tax'] end if attributes.has_key?(:'total_tax') self.total_tax = attributes[:'total_tax'] end end |
Instance Attribute Details
#allow_3rd_party_billing ⇒ Object
True if this method allows the customer to use their own shipper account number
18 19 20 |
# File 'lib/ultracart_api/models/cart_settings_shipping_estimate.rb', line 18 def allow_3rd_party_billing @allow_3rd_party_billing end |
#comment ⇒ Object
Comment to display to the customer about this method
21 22 23 |
# File 'lib/ultracart_api/models/cart_settings_shipping_estimate.rb', line 21 def comment @comment end |
#cost ⇒ Object
Returns the value of attribute cost.
23 24 25 |
# File 'lib/ultracart_api/models/cart_settings_shipping_estimate.rb', line 23 def cost @cost end |
#cost_before_discount ⇒ Object
Returns the value of attribute cost_before_discount.
25 26 27 |
# File 'lib/ultracart_api/models/cart_settings_shipping_estimate.rb', line 25 def cost_before_discount @cost_before_discount end |
#default_method ⇒ Object
True if this is the default method
28 29 30 |
# File 'lib/ultracart_api/models/cart_settings_shipping_estimate.rb', line 28 def default_method @default_method end |
#discount ⇒ Object
Returns the value of attribute discount.
30 31 32 |
# File 'lib/ultracart_api/models/cart_settings_shipping_estimate.rb', line 30 def discount @discount end |
#discounted ⇒ Object
True if this method is discounted because of a coupon
33 34 35 |
# File 'lib/ultracart_api/models/cart_settings_shipping_estimate.rb', line 33 def discounted @discounted end |
#display_name ⇒ Object
The name to display to the customer
36 37 38 |
# File 'lib/ultracart_api/models/cart_settings_shipping_estimate.rb', line 36 def display_name @display_name end |
#estimated_delivery ⇒ Object
Date of the estimated delivery (or range)
39 40 41 |
# File 'lib/ultracart_api/models/cart_settings_shipping_estimate.rb', line 39 def estimated_delivery @estimated_delivery end |
#lift_gate_option ⇒ Object
True if a lift gate option for this method should be offered to the customer
42 43 44 |
# File 'lib/ultracart_api/models/cart_settings_shipping_estimate.rb', line 42 def lift_gate_option @lift_gate_option end |
#name ⇒ Object
Shipping method name
45 46 47 |
# File 'lib/ultracart_api/models/cart_settings_shipping_estimate.rb', line 45 def name @name end |
#pickup ⇒ Object
True if this shipping method requires customers to physically pickup product themselves
48 49 50 |
# File 'lib/ultracart_api/models/cart_settings_shipping_estimate.rb', line 48 def pickup @pickup end |
#tax ⇒ Object
Returns the value of attribute tax.
50 51 52 |
# File 'lib/ultracart_api/models/cart_settings_shipping_estimate.rb', line 50 def tax @tax end |
#total_tax ⇒ Object
Returns the value of attribute total_tax.
52 53 54 |
# File 'lib/ultracart_api/models/cart_settings_shipping_estimate.rb', line 52 def total_tax @total_tax end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/ultracart_api/models/cart_settings_shipping_estimate.rb', line 55 def self.attribute_map { :'allow_3rd_party_billing' => :'allow_3rd_party_billing', :'comment' => :'comment', :'cost' => :'cost', :'cost_before_discount' => :'cost_before_discount', :'default_method' => :'default_method', :'discount' => :'discount', :'discounted' => :'discounted', :'display_name' => :'display_name', :'estimated_delivery' => :'estimated_delivery', :'lift_gate_option' => :'lift_gate_option', :'name' => :'name', :'pickup' => :'pickup', :'tax' => :'tax', :'total_tax' => :'total_tax' } end |
.swagger_types ⇒ Object
Attribute type mapping.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/ultracart_api/models/cart_settings_shipping_estimate.rb', line 75 def self.swagger_types { :'allow_3rd_party_billing' => :'BOOLEAN', :'comment' => :'String', :'cost' => :'Currency', :'cost_before_discount' => :'Currency', :'default_method' => :'BOOLEAN', :'discount' => :'Currency', :'discounted' => :'BOOLEAN', :'display_name' => :'String', :'estimated_delivery' => :'String', :'lift_gate_option' => :'BOOLEAN', :'name' => :'String', :'pickup' => :'BOOLEAN', :'tax' => :'Currency', :'total_tax' => :'Currency' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
# File 'lib/ultracart_api/models/cart_settings_shipping_estimate.rb', line 174 def ==(o) return true if self.equal?(o) self.class == o.class && allow_3rd_party_billing == o.allow_3rd_party_billing && comment == o.comment && cost == o.cost && cost_before_discount == o.cost_before_discount && default_method == o.default_method && discount == o.discount && discounted == o.discounted && display_name == o.display_name && estimated_delivery == o.estimated_delivery && lift_gate_option == o.lift_gate_option && name == o.name && pickup == o.pickup && tax == o.tax && total_tax == o.total_tax end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
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 |
# File 'lib/ultracart_api/models/cart_settings_shipping_estimate.rb', line 229 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 temp_model = UltracartClient.const_get(type).new temp_model.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
295 296 297 298 299 300 301 302 303 304 305 306 307 |
# File 'lib/ultracart_api/models/cart_settings_shipping_estimate.rb', line 295 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
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
# File 'lib/ultracart_api/models/cart_settings_shipping_estimate.rb', line 208 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_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]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(o) ⇒ Boolean
195 196 197 |
# File 'lib/ultracart_api/models/cart_settings_shipping_estimate.rb', line 195 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
201 202 203 |
# File 'lib/ultracart_api/models/cart_settings_shipping_estimate.rb', line 201 def hash [allow_3rd_party_billing, comment, cost, cost_before_discount, default_method, discount, discounted, display_name, estimated_delivery, lift_gate_option, name, pickup, tax, total_tax].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
161 162 163 164 |
# File 'lib/ultracart_api/models/cart_settings_shipping_estimate.rb', line 161 def list_invalid_properties invalid_properties = Array.new invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
275 276 277 |
# File 'lib/ultracart_api/models/cart_settings_shipping_estimate.rb', line 275 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
281 282 283 284 285 286 287 288 289 |
# File 'lib/ultracart_api/models/cart_settings_shipping_estimate.rb', line 281 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
269 270 271 |
# File 'lib/ultracart_api/models/cart_settings_shipping_estimate.rb', line 269 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
168 169 170 |
# File 'lib/ultracart_api/models/cart_settings_shipping_estimate.rb', line 168 def valid? true end |