Class: ESI::UniverseTypesTypeIdGet

Inherits:
ApiModelBase show all
Defined in:
lib/ruby-esi/models/universe_types_type_id_get.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ UniverseTypesTypeIdGet

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



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
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
204
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 113

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `ESI::UniverseTypesTypeIdGet` 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 `ESI::UniverseTypesTypeIdGet`. 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?(:'capacity')
    self.capacity = attributes[:'capacity']
  end

  if attributes.key?(:'description')
    self.description = attributes[:'description']
  else
    self.description = nil
  end

  if attributes.key?(:'dogma_attributes')
    if (value = attributes[:'dogma_attributes']).is_a?(Array)
      self.dogma_attributes = value
    end
  end

  if attributes.key?(:'dogma_effects')
    if (value = attributes[:'dogma_effects']).is_a?(Array)
      self.dogma_effects = value
    end
  end

  if attributes.key?(:'graphic_id')
    self.graphic_id = attributes[:'graphic_id']
  end

  if attributes.key?(:'group_id')
    self.group_id = attributes[:'group_id']
  else
    self.group_id = nil
  end

  if attributes.key?(:'icon_id')
    self.icon_id = attributes[:'icon_id']
  end

  if attributes.key?(:'market_group_id')
    self.market_group_id = attributes[:'market_group_id']
  end

  if attributes.key?(:'mass')
    self.mass = attributes[:'mass']
  end

  if attributes.key?(:'name')
    self.name = attributes[:'name']
  else
    self.name = nil
  end

  if attributes.key?(:'packaged_volume')
    self.packaged_volume = attributes[:'packaged_volume']
  end

  if attributes.key?(:'portion_size')
    self.portion_size = attributes[:'portion_size']
  end

  if attributes.key?(:'published')
    self.published = attributes[:'published']
  else
    self.published = nil
  end

  if attributes.key?(:'radius')
    self.radius = attributes[:'radius']
  end

  if attributes.key?(:'type_id')
    self.type_id = attributes[:'type_id']
  else
    self.type_id = nil
  end

  if attributes.key?(:'volume')
    self.volume = attributes[:'volume']
  end
end

Instance Attribute Details

#capacityObject

Returns the value of attribute capacity.



18
19
20
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 18

def capacity
  @capacity
end

#descriptionObject

Returns the value of attribute description.



20
21
22
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 20

def description
  @description
end

#dogma_attributesObject

Returns the value of attribute dogma_attributes.



22
23
24
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 22

def dogma_attributes
  @dogma_attributes
end

#dogma_effectsObject

Returns the value of attribute dogma_effects.



24
25
26
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 24

def dogma_effects
  @dogma_effects
end

#graphic_idObject

Returns the value of attribute graphic_id.



26
27
28
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 26

def graphic_id
  @graphic_id
end

#group_idObject

Returns the value of attribute group_id.



28
29
30
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 28

def group_id
  @group_id
end

#icon_idObject

Returns the value of attribute icon_id.



30
31
32
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 30

def icon_id
  @icon_id
end

#market_group_idObject

This only exists for types that can be put on the market



33
34
35
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 33

def market_group_id
  @market_group_id
end

#massObject

Returns the value of attribute mass.



35
36
37
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 35

def mass
  @mass
end

#nameObject

Returns the value of attribute name.



37
38
39
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 37

def name
  @name
end

#packaged_volumeObject

Returns the value of attribute packaged_volume.



39
40
41
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 39

def packaged_volume
  @packaged_volume
end

#portion_sizeObject

Returns the value of attribute portion_size.



41
42
43
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 41

def portion_size
  @portion_size
end

#publishedObject

Returns the value of attribute published.



43
44
45
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 43

def published
  @published
end

#radiusObject

Returns the value of attribute radius.



45
46
47
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 45

def radius
  @radius
end

#type_idObject

Returns the value of attribute type_id.



47
48
49
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 47

def type_id
  @type_id
end

#volumeObject

Returns the value of attribute volume.



49
50
51
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 49

def volume
  @volume
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



74
75
76
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 74

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



79
80
81
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 79

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 52

def self.attribute_map
  {
    :'capacity' => :'capacity',
    :'description' => :'description',
    :'dogma_attributes' => :'dogma_attributes',
    :'dogma_effects' => :'dogma_effects',
    :'graphic_id' => :'graphic_id',
    :'group_id' => :'group_id',
    :'icon_id' => :'icon_id',
    :'market_group_id' => :'market_group_id',
    :'mass' => :'mass',
    :'name' => :'name',
    :'packaged_volume' => :'packaged_volume',
    :'portion_size' => :'portion_size',
    :'published' => :'published',
    :'radius' => :'radius',
    :'type_id' => :'type_id',
    :'volume' => :'volume'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 334

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_nullableObject

List of attributes with nullable: true



106
107
108
109
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 106

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 84

def self.openapi_types
  {
    :'capacity' => :'Float',
    :'description' => :'String',
    :'dogma_attributes' => :'Array<DogmaDynamicItemsTypeIdItemIdGetDogmaAttributesInner>',
    :'dogma_effects' => :'Array<DogmaDynamicItemsTypeIdItemIdGetDogmaEffectsInner>',
    :'graphic_id' => :'Integer',
    :'group_id' => :'Integer',
    :'icon_id' => :'Integer',
    :'market_group_id' => :'Integer',
    :'mass' => :'Float',
    :'name' => :'String',
    :'packaged_volume' => :'Float',
    :'portion_size' => :'Integer',
    :'published' => :'Boolean',
    :'radius' => :'Float',
    :'type_id' => :'Integer',
    :'volume' => :'Float'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 298

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      capacity == o.capacity &&
      description == o.description &&
      dogma_attributes == o.dogma_attributes &&
      dogma_effects == o.dogma_effects &&
      graphic_id == o.graphic_id &&
      group_id == o.group_id &&
      icon_id == o.icon_id &&
      market_group_id == o.market_group_id &&
      mass == o.mass &&
      name == o.name &&
      packaged_volume == o.packaged_volume &&
      portion_size == o.portion_size &&
      published == o.published &&
      radius == o.radius &&
      type_id == o.type_id &&
      volume == o.volume
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


321
322
323
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 321

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



327
328
329
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 327

def hash
  [capacity, description, dogma_attributes, dogma_effects, graphic_id, group_id, icon_id, market_group_id, mass, name, packaged_volume, portion_size, published, radius, type_id, volume].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



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
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 208

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @description.nil?
    invalid_properties.push('invalid value for "description", description cannot be nil.')
  end

  if @group_id.nil?
    invalid_properties.push('invalid value for "group_id", group_id cannot be nil.')
  end

  if @name.nil?
    invalid_properties.push('invalid value for "name", name cannot be nil.')
  end

  if @published.nil?
    invalid_properties.push('invalid value for "published", published cannot be nil.')
  end

  if @type_id.nil?
    invalid_properties.push('invalid value for "type_id", type_id cannot be nil.')
  end

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



356
357
358
359
360
361
362
363
364
365
366
367
368
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 356

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

Returns:

  • (Boolean)

    true if the model is valid



236
237
238
239
240
241
242
243
244
# File 'lib/ruby-esi/models/universe_types_type_id_get.rb', line 236

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @description.nil?
  return false if @group_id.nil?
  return false if @name.nil?
  return false if @published.nil?
  return false if @type_id.nil?
  true
end