Class: FtcApiV3Client::ApiV3ItdAchievementsDetail

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb

Defined Under Namespace

Classes: EnumAttributeValidator

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 = {}) ⇒ ApiV3ItdAchievementsDetail

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 138

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#auto_sample_highObject

Returns the value of attribute auto_sample_high.



26
27
28
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 26

def auto_sample_high
  @auto_sample_high
end

#auto_sample_lowObject

Returns the value of attribute auto_sample_low.



24
25
26
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 24

def auto_sample_low
  @auto_sample_low
end

#auto_sample_netObject

Returns the value of attribute auto_sample_net.



22
23
24
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 22

def auto_sample_net
  @auto_sample_net
end

#auto_specimen_highObject

Returns the value of attribute auto_specimen_high.



30
31
32
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 30

def auto_specimen_high
  @auto_specimen_high
end

#auto_specimen_lowObject

Returns the value of attribute auto_specimen_low.



28
29
30
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 28

def auto_specimen_low
  @auto_specimen_low
end

#major_foulsObject

Returns the value of attribute major_fouls.



48
49
50
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 48

def major_fouls
  @major_fouls
end

#minor_foulsObject

Returns the value of attribute minor_fouls.



46
47
48
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 46

def minor_fouls
  @minor_fouls
end

#robot1_autoObject

Returns the value of attribute robot1_auto.



18
19
20
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 18

def robot1_auto
  @robot1_auto
end

#robot1_teleopObject

Returns the value of attribute robot1_teleop.



42
43
44
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 42

def robot1_teleop
  @robot1_teleop
end

#robot2_autoObject

Returns the value of attribute robot2_auto.



20
21
22
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 20

def robot2_auto
  @robot2_auto
end

#robot2_teleopObject

Returns the value of attribute robot2_teleop.



44
45
46
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 44

def robot2_teleop
  @robot2_teleop
end

#teleop_sample_highObject

Returns the value of attribute teleop_sample_high.



36
37
38
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 36

def teleop_sample_high
  @teleop_sample_high
end

#teleop_sample_lowObject

Returns the value of attribute teleop_sample_low.



34
35
36
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 34

def teleop_sample_low
  @teleop_sample_low
end

#teleop_sample_netObject

Returns the value of attribute teleop_sample_net.



32
33
34
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 32

def teleop_sample_net
  @teleop_sample_net
end

#teleop_specimen_highObject

Returns the value of attribute teleop_specimen_high.



40
41
42
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 40

def teleop_specimen_high
  @teleop_specimen_high
end

#teleop_specimen_lowObject

Returns the value of attribute teleop_specimen_low.



38
39
40
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 38

def teleop_specimen_low
  @teleop_specimen_low
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



95
96
97
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 95

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



100
101
102
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 100

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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
88
89
90
91
92
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 73

def self.attribute_map
  {
    :'robot1_auto' => :'robot1Auto',
    :'robot2_auto' => :'robot2Auto',
    :'auto_sample_net' => :'autoSampleNet',
    :'auto_sample_low' => :'autoSampleLow',
    :'auto_sample_high' => :'autoSampleHigh',
    :'auto_specimen_low' => :'autoSpecimenLow',
    :'auto_specimen_high' => :'autoSpecimenHigh',
    :'teleop_sample_net' => :'teleopSampleNet',
    :'teleop_sample_low' => :'teleopSampleLow',
    :'teleop_sample_high' => :'teleopSampleHigh',
    :'teleop_specimen_low' => :'teleopSpecimenLow',
    :'teleop_specimen_high' => :'teleopSpecimenHigh',
    :'robot1_teleop' => :'robot1Teleop',
    :'robot2_teleop' => :'robot2Teleop',
    :'minor_fouls' => :'minorFouls',
    :'major_fouls' => :'majorFouls'
  }
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



482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 482

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



127
128
129
130
131
132
133
134
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 127

def self.openapi_nullable
  Set.new([
    :'robot1_auto',
    :'robot2_auto',
    :'robot1_teleop',
    :'robot2_teleop',
  ])
end

.openapi_typesObject

Attribute type mapping.



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 105

def self.openapi_types
  {
    :'robot1_auto' => :'ApiV3ItdAutoLocation',
    :'robot2_auto' => :'ApiV3ItdAutoLocation',
    :'auto_sample_net' => :'Integer',
    :'auto_sample_low' => :'Integer',
    :'auto_sample_high' => :'Integer',
    :'auto_specimen_low' => :'Integer',
    :'auto_specimen_high' => :'Integer',
    :'teleop_sample_net' => :'Integer',
    :'teleop_sample_low' => :'Integer',
    :'teleop_sample_high' => :'Integer',
    :'teleop_specimen_low' => :'Integer',
    :'teleop_specimen_high' => :'Integer',
    :'robot1_teleop' => :'ApiV3ItdTeleopLocation',
    :'robot2_teleop' => :'ApiV3ItdTeleopLocation',
    :'minor_fouls' => :'Integer',
    :'major_fouls' => :'Integer'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 446

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      robot1_auto == o.robot1_auto &&
      robot2_auto == o.robot2_auto &&
      auto_sample_net == o.auto_sample_net &&
      auto_sample_low == o.auto_sample_low &&
      auto_sample_high == o.auto_sample_high &&
      auto_specimen_low == o.auto_specimen_low &&
      auto_specimen_high == o.auto_specimen_high &&
      teleop_sample_net == o.teleop_sample_net &&
      teleop_sample_low == o.teleop_sample_low &&
      teleop_sample_high == o.teleop_sample_high &&
      teleop_specimen_low == o.teleop_specimen_low &&
      teleop_specimen_high == o.teleop_specimen_high &&
      robot1_teleop == o.robot1_teleop &&
      robot2_teleop == o.robot2_teleop &&
      minor_fouls == o.minor_fouls &&
      major_fouls == o.major_fouls
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


469
470
471
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 469

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



475
476
477
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 475

def hash
  [robot1_auto, robot2_auto, auto_sample_net, auto_sample_low, auto_sample_high, auto_specimen_low, auto_specimen_high, teleop_sample_net, teleop_sample_low, teleop_sample_high, teleop_specimen_low, teleop_specimen_high, robot1_teleop, robot2_teleop, minor_fouls, major_fouls].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 251

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

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

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

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

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

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

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

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

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

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

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

  if @major_fouls.nil?
    invalid_properties.push('invalid value for "major_fouls", major_fouls 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



504
505
506
507
508
509
510
511
512
513
514
515
516
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 504

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



307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
# File 'lib/ftc_api_v3_client/models/api_v3_itd_achievements_detail.rb', line 307

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @auto_sample_net.nil?
  return false if @auto_sample_low.nil?
  return false if @auto_sample_high.nil?
  return false if @auto_specimen_low.nil?
  return false if @auto_specimen_high.nil?
  return false if @teleop_sample_net.nil?
  return false if @teleop_sample_low.nil?
  return false if @teleop_sample_high.nil?
  return false if @teleop_specimen_low.nil?
  return false if @teleop_specimen_high.nil?
  return false if @minor_fouls.nil?
  return false if @major_fouls.nil?
  true
end