Class: ConnectWise::WarehouseBin
- Inherits:
-
Object
- Object
- ConnectWise::WarehouseBin
- Defined in:
- lib/connect_wise/models/warehouse_bin.rb
Instance Attribute Summary collapse
-
#_info ⇒ Object
Returns the value of attribute _info.
-
#company ⇒ Object
Returns the value of attribute company.
-
#default_flag ⇒ Object
Returns the value of attribute default_flag.
-
#department ⇒ Object
Returns the value of attribute department.
-
#height ⇒ Object
Returns the value of attribute height.
-
#id ⇒ Object
Returns the value of attribute id.
-
#inactive_flag ⇒ Object
Returns the value of attribute inactive_flag.
-
#length ⇒ Object
Returns the value of attribute length.
-
#location ⇒ Object
Returns the value of attribute location.
-
#manager ⇒ Object
Returns the value of attribute manager.
-
#max_quantity ⇒ Object
Returns the value of attribute max_quantity.
-
#min_quantity ⇒ Object
Returns the value of attribute min_quantity.
-
#name ⇒ Object
Max length: 50;.
-
#overflow_bin ⇒ Object
Returns the value of attribute overflow_bin.
-
#quantity_on_hand ⇒ Object
Returns the value of attribute quantity_on_hand.
-
#transfer_bin ⇒ Object
Returns the value of attribute transfer_bin.
-
#warehouse ⇒ Object
Returns the value of attribute warehouse.
-
#weight ⇒ Object
Returns the value of attribute weight.
-
#width ⇒ Object
Returns the value of attribute width.
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
-
#==(other) ⇒ 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?(other) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ WarehouseBin
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 = {}) ⇒ WarehouseBin
Initializes the object
93 94 95 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 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 93 def initialize(attributes = {}) raise ArgumentError, 'The input argument (attributes) must be a hash in `ConnectWise::WarehouseBin` initialize method' unless attributes.is_a?(Hash) # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) do |(k, v), h| raise ArgumentError, "`#{k}` is not a valid attribute in `ConnectWise::WarehouseBin`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect unless self.class.attribute_map.key?(k.to_sym) h[k.to_sym] = v end self.name = attributes[:name] if attributes.key?(:name) self.id = attributes[:id] if attributes.key?(:id) self.warehouse = attributes[:warehouse] if attributes.key?(:warehouse) self.location = attributes[:location] if attributes.key?(:location) self.department = attributes[:department] if attributes.key?(:department) self.min_quantity = attributes[:min_quantity] if attributes.key?(:min_quantity) self.max_quantity = attributes[:max_quantity] if attributes.key?(:max_quantity) self.overflow_bin = attributes[:overflow_bin] if attributes.key?(:overflow_bin) self.manager = attributes[:manager] if attributes.key?(:manager) self.length = attributes[:length] if attributes.key?(:length) self.width = attributes[:width] if attributes.key?(:width) self.height = attributes[:height] if attributes.key?(:height) self.weight = attributes[:weight] if attributes.key?(:weight) self.default_flag = attributes[:default_flag] if attributes.key?(:default_flag) self.inactive_flag = attributes[:inactive_flag] if attributes.key?(:inactive_flag) self.quantity_on_hand = attributes[:quantity_on_hand] if attributes.key?(:quantity_on_hand) self.company = attributes[:company] if attributes.key?(:company) self.transfer_bin = attributes[:transfer_bin] if attributes.key?(:transfer_bin) return unless attributes.key?(:_info) return unless (value = attributes[:_info]).is_a?(Hash) self._info = value end |
Instance Attribute Details
#_info ⇒ Object
Returns the value of attribute _info.
19 20 21 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 19 def _info @_info end |
#company ⇒ Object
Returns the value of attribute company.
19 20 21 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 19 def company @company end |
#default_flag ⇒ Object
Returns the value of attribute default_flag.
19 20 21 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 19 def default_flag @default_flag end |
#department ⇒ Object
Returns the value of attribute department.
19 20 21 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 19 def department @department end |
#height ⇒ Object
Returns the value of attribute height.
19 20 21 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 19 def height @height end |
#id ⇒ Object
Returns the value of attribute id.
19 20 21 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 19 def id @id end |
#inactive_flag ⇒ Object
Returns the value of attribute inactive_flag.
19 20 21 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 19 def inactive_flag @inactive_flag end |
#length ⇒ Object
Returns the value of attribute length.
19 20 21 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 19 def length @length end |
#location ⇒ Object
Returns the value of attribute location.
19 20 21 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 19 def location @location end |
#manager ⇒ Object
Returns the value of attribute manager.
19 20 21 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 19 def manager @manager end |
#max_quantity ⇒ Object
Returns the value of attribute max_quantity.
19 20 21 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 19 def max_quantity @max_quantity end |
#min_quantity ⇒ Object
Returns the value of attribute min_quantity.
19 20 21 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 19 def min_quantity @min_quantity end |
#name ⇒ Object
Max length: 50;
17 18 19 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 17 def name @name end |
#overflow_bin ⇒ Object
Returns the value of attribute overflow_bin.
19 20 21 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 19 def overflow_bin @overflow_bin end |
#quantity_on_hand ⇒ Object
Returns the value of attribute quantity_on_hand.
19 20 21 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 19 def quantity_on_hand @quantity_on_hand end |
#transfer_bin ⇒ Object
Returns the value of attribute transfer_bin.
19 20 21 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 19 def transfer_bin @transfer_bin end |
#warehouse ⇒ Object
Returns the value of attribute warehouse.
19 20 21 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 19 def warehouse @warehouse end |
#weight ⇒ Object
Returns the value of attribute weight.
19 20 21 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 19 def weight @weight end |
#width ⇒ Object
Returns the value of attribute width.
19 20 21 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 19 def width @width end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
47 48 49 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 47 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 22 def self.attribute_map { name: :name, id: :id, warehouse: :warehouse, location: :location, department: :department, min_quantity: :minQuantity, max_quantity: :maxQuantity, overflow_bin: :overflowBin, manager: :manager, length: :length, width: :width, height: :height, weight: :weight, default_flag: :defaultFlag, inactive_flag: :inactiveFlag, quantity_on_hand: :quantityOnHand, company: :company, transfer_bin: :transferBin, _info: :_info } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
204 205 206 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 204 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 77 def self.openapi_nullable Set.new(%i[ min_quantity max_quantity length width height weight default_flag inactive_flag quantity_on_hand ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 52 def self.openapi_types { name: :String, id: :Integer, warehouse: :WarehouseReference, location: :SystemLocationReference, department: :SystemDepartmentReference, min_quantity: :Float, max_quantity: :Float, overflow_bin: :WarehouseBinReference, manager: :MemberReference, length: :Float, width: :Float, height: :Float, weight: :Float, default_flag: :Boolean, inactive_flag: :Boolean, quantity_on_hand: :Integer, company: :CompanyReference, transfer_bin: :WarehouseBinReference, _info: :'Hash<String, String>' } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
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/connect_wise/models/warehouse_bin.rb', line 164 def ==(other) return true if equal?(other) self.class == other.class && name == other.name && id == other.id && warehouse == other.warehouse && location == other.location && department == other.department && min_quantity == other.min_quantity && max_quantity == other.max_quantity && overflow_bin == other.overflow_bin && manager == other.manager && length == other.length && width == other.width && height == other.height && weight == other.weight && default_flag == other.default_flag && inactive_flag == other.inactive_flag && quantity_on_hand == other.quantity_on_hand && company == other.company && transfer_bin == other.transfer_bin && _info == other._info end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
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 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 234 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 = ConnectWise.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
305 306 307 308 309 310 311 312 313 314 315 316 317 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 305 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
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 211 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) 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 send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }) if attributes[self.class.attribute_map[key]].is_a?(Array) elsif !attributes[self.class.attribute_map[key]].nil? send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end end self end |
#eql?(other) ⇒ Boolean
191 192 193 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 191 def eql?(other) self == other end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
197 198 199 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 197 def hash [name, id, warehouse, location, department, min_quantity, max_quantity, overflow_bin, manager, length, width, height, weight, default_flag, inactive_flag, quantity_on_hand, company, transfer_bin, _info].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
147 148 149 150 151 152 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 147 def list_invalid_properties invalid_properties = [] invalid_properties.push('invalid value for "name", name cannot be nil.') if @name.nil? invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
281 282 283 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 281 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
287 288 289 290 291 292 293 294 295 296 297 298 299 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 287 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = 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
275 276 277 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 275 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
156 157 158 159 160 |
# File 'lib/connect_wise/models/warehouse_bin.rb', line 156 def valid? return false if @name.nil? true end |