Class: Zippendo::ListCarrierProducts200ResponseInner
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Zippendo::ListCarrierProducts200ResponseInner
- Defined in:
- lib/zippendo/models/list_carrier_products200_response_inner.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#additional_parameters ⇒ Object
Extra parameters that can or must be supplied for this product.
-
#available_countries ⇒ Object
Recipient countries supported by this product.
-
#available_sender_countries ⇒ Object
Sender countries supported by this product.
-
#description ⇒ Object
Description of the shipping product.
-
#is_pickup_available ⇒ Object
Whether carrier pickup is available for this product.
-
#is_service_point ⇒ Object
Whether delivery is to a service point/pickup location.
-
#name ⇒ Object
Display name of the shipping product.
-
#product_id ⇒ Object
Unique carrier product identifier.
-
#services ⇒ Object
Additional services available for this product.
-
#type ⇒ Object
Direction of the shipment for this product.
-
#weight_limits ⇒ Object
Returns the value of attribute weight_limits.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.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.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ ListCarrierProducts200ResponseInner
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ ListCarrierProducts200ResponseInner
Initializes the object
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 171 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 198 199 200 201 202 203 |
# File 'lib/zippendo/models/list_carrier_products200_response_inner.rb', line 124 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Zippendo::ListCarrierProducts200ResponseInner` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Zippendo::ListCarrierProducts200ResponseInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'name') self.name = attributes[:'name'] else self.name = nil end if attributes.key?(:'product_id') self.product_id = attributes[:'product_id'] else self.product_id = nil end if attributes.key?(:'type') self.type = attributes[:'type'] else self.type = nil end if attributes.key?(:'description') self.description = attributes[:'description'] end if attributes.key?(:'available_countries') if (value = attributes[:'available_countries']).is_a?(Array) self.available_countries = value end else self.available_countries = nil end if attributes.key?(:'available_sender_countries') if (value = attributes[:'available_sender_countries']).is_a?(Array) self.available_sender_countries = value end else self.available_sender_countries = nil end if attributes.key?(:'is_service_point') self.is_service_point = attributes[:'is_service_point'] else self.is_service_point = false end if attributes.key?(:'is_pickup_available') self.is_pickup_available = attributes[:'is_pickup_available'] else self.is_pickup_available = false end if attributes.key?(:'services') if (value = attributes[:'services']).is_a?(Array) self.services = value end end if attributes.key?(:'additional_parameters') if (value = attributes[:'additional_parameters']).is_a?(Array) self.additional_parameters = value end end if attributes.key?(:'weight_limits') self.weight_limits = attributes[:'weight_limits'] end end |
Instance Attribute Details
#additional_parameters ⇒ Object
Extra parameters that can or must be supplied for this product
46 47 48 |
# File 'lib/zippendo/models/list_carrier_products200_response_inner.rb', line 46 def additional_parameters @additional_parameters end |
#available_countries ⇒ Object
Recipient countries supported by this product
31 32 33 |
# File 'lib/zippendo/models/list_carrier_products200_response_inner.rb', line 31 def available_countries @available_countries end |
#available_sender_countries ⇒ Object
Sender countries supported by this product
34 35 36 |
# File 'lib/zippendo/models/list_carrier_products200_response_inner.rb', line 34 def available_sender_countries @available_sender_countries end |
#description ⇒ Object
Description of the shipping product
28 29 30 |
# File 'lib/zippendo/models/list_carrier_products200_response_inner.rb', line 28 def description @description end |
#is_pickup_available ⇒ Object
Whether carrier pickup is available for this product
40 41 42 |
# File 'lib/zippendo/models/list_carrier_products200_response_inner.rb', line 40 def is_pickup_available @is_pickup_available end |
#is_service_point ⇒ Object
Whether delivery is to a service point/pickup location
37 38 39 |
# File 'lib/zippendo/models/list_carrier_products200_response_inner.rb', line 37 def is_service_point @is_service_point end |
#name ⇒ Object
Display name of the shipping product
19 20 21 |
# File 'lib/zippendo/models/list_carrier_products200_response_inner.rb', line 19 def name @name end |
#product_id ⇒ Object
Unique carrier product identifier
22 23 24 |
# File 'lib/zippendo/models/list_carrier_products200_response_inner.rb', line 22 def product_id @product_id end |
#services ⇒ Object
Additional services available for this product
43 44 45 |
# File 'lib/zippendo/models/list_carrier_products200_response_inner.rb', line 43 def services @services end |
#type ⇒ Object
Direction of the shipment for this product
25 26 27 |
# File 'lib/zippendo/models/list_carrier_products200_response_inner.rb', line 25 def type @type end |
#weight_limits ⇒ Object
Returns the value of attribute weight_limits.
48 49 50 |
# File 'lib/zippendo/models/list_carrier_products200_response_inner.rb', line 48 def weight_limits @weight_limits end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
90 91 92 |
# File 'lib/zippendo/models/list_carrier_products200_response_inner.rb', line 90 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
95 96 97 |
# File 'lib/zippendo/models/list_carrier_products200_response_inner.rb', line 95 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/zippendo/models/list_carrier_products200_response_inner.rb', line 73 def self.attribute_map { :'name' => :'name', :'product_id' => :'productId', :'type' => :'type', :'description' => :'description', :'available_countries' => :'availableCountries', :'available_sender_countries' => :'availableSenderCountries', :'is_service_point' => :'isServicePoint', :'is_pickup_available' => :'isPickupAvailable', :'services' => :'services', :'additional_parameters' => :'additionalParameters', :'weight_limits' => :'weightLimits' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 |
# File 'lib/zippendo/models/list_carrier_products200_response_inner.rb', line 360 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{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[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
117 118 119 120 |
# File 'lib/zippendo/models/list_carrier_products200_response_inner.rb', line 117 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/zippendo/models/list_carrier_products200_response_inner.rb', line 100 def self.openapi_types { :'name' => :'String', :'product_id' => :'String', :'type' => :'String', :'description' => :'String', :'available_countries' => :'Array<String>', :'available_sender_countries' => :'Array<String>', :'is_service_point' => :'Boolean', :'is_pickup_available' => :'Boolean', :'services' => :'Array<ListCarrierProducts200ResponseInnerServicesInner>', :'additional_parameters' => :'Array<ListCarrierProducts200ResponseInnerAdditionalParametersInner>', :'weight_limits' => :'ListCarrierProducts200ResponseInnerWeightLimits' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 |
# File 'lib/zippendo/models/list_carrier_products200_response_inner.rb', line 329 def ==(o) return true if self.equal?(o) self.class == o.class && name == o.name && product_id == o.product_id && type == o.type && description == o.description && available_countries == o.available_countries && available_sender_countries == o.available_sender_countries && is_service_point == o.is_service_point && is_pickup_available == o.is_pickup_available && services == o.services && additional_parameters == o.additional_parameters && weight_limits == o.weight_limits end |
#eql?(o) ⇒ Boolean
347 348 349 |
# File 'lib/zippendo/models/list_carrier_products200_response_inner.rb', line 347 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
353 354 355 |
# File 'lib/zippendo/models/list_carrier_products200_response_inner.rb', line 353 def hash [name, product_id, type, description, available_countries, available_sender_countries, is_service_point, is_pickup_available, services, additional_parameters, weight_limits].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 |
# File 'lib/zippendo/models/list_carrier_products200_response_inner.rb', line 207 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end if @product_id.nil? invalid_properties.push('invalid value for "product_id", product_id cannot be nil.') end if @type.nil? invalid_properties.push('invalid value for "type", type cannot be nil.') end if @available_countries.nil? invalid_properties.push('invalid value for "available_countries", available_countries cannot be nil.') end if @available_sender_countries.nil? invalid_properties.push('invalid value for "available_sender_countries", available_sender_countries cannot be nil.') end if @is_service_point.nil? invalid_properties.push('invalid value for "is_service_point", is_service_point cannot be nil.') end if @is_pickup_available.nil? invalid_properties.push('invalid value for "is_pickup_available", is_pickup_available cannot be nil.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
382 383 384 385 386 387 388 389 390 391 392 393 394 |
# File 'lib/zippendo/models/list_carrier_products200_response_inner.rb', line 382 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 |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
243 244 245 246 247 248 249 250 251 252 253 254 255 |
# File 'lib/zippendo/models/list_carrier_products200_response_inner.rb', line 243 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @name.nil? return false if @product_id.nil? return false if @type.nil? type_validator = EnumAttributeValidator.new('String', ["outbound", "inbound"]) return false unless type_validator.valid?(@type) return false if @available_countries.nil? return false if @available_sender_countries.nil? return false if @is_service_point.nil? return false if @is_pickup_available.nil? true end |