Class: FtcApiV3Client::ApiV3CsAchievementsDetail

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/ftc_api_v3_client/models/api_v3_cs_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 = {}) ⇒ ApiV3CsAchievementsDetail

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
248
249
250
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
# File 'lib/ftc_api_v3_client/models/api_v3_cs_achievements_detail.rb', line 152

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

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

  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?(:'spike_mark_pixel1')
    self.spike_mark_pixel1 = attributes[:'spike_mark_pixel1']
  else
    self.spike_mark_pixel1 = nil
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#auto_backdropObject

Returns the value of attribute auto_backdrop.



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

def auto_backdrop
  @auto_backdrop
end

#auto_backstageObject

Returns the value of attribute auto_backstage.



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

def auto_backstage
  @auto_backstage
end

#dc_backdropObject

Returns the value of attribute dc_backdrop.



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

def dc_backdrop
  @dc_backdrop
end

#dc_backstageObject

Returns the value of attribute dc_backstage.



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

def dc_backstage
  @dc_backstage
end

#drone1Object

Returns the value of attribute drone1.



50
51
52
# File 'lib/ftc_api_v3_client/models/api_v3_cs_achievements_detail.rb', line 50

def drone1
  @drone1
end

#drone2Object

Returns the value of attribute drone2.



52
53
54
# File 'lib/ftc_api_v3_client/models/api_v3_cs_achievements_detail.rb', line 52

def drone2
  @drone2
end

#eg_robot1Object

Returns the value of attribute eg_robot1.



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

def eg_robot1
  @eg_robot1
end

#eg_robot2Object

Returns the value of attribute eg_robot2.



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

def eg_robot2
  @eg_robot2
end

#init_team_prop1Object

Returns the value of attribute init_team_prop1.



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

def init_team_prop1
  @init_team_prop1
end

#init_team_prop2Object

Returns the value of attribute init_team_prop2.



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

def init_team_prop2
  @init_team_prop2
end

#major_penaltiesObject

Returns the value of attribute major_penalties.



56
57
58
# File 'lib/ftc_api_v3_client/models/api_v3_cs_achievements_detail.rb', line 56

def major_penalties
  @major_penalties
end

#max_set_lineObject

Returns the value of attribute max_set_line.



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

def max_set_line
  @max_set_line
end

#minor_penaltiesObject

Returns the value of attribute minor_penalties.



54
55
56
# File 'lib/ftc_api_v3_client/models/api_v3_cs_achievements_detail.rb', line 54

def minor_penalties
  @minor_penalties
end

#mosaicsObject

Returns the value of attribute mosaics.



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

def mosaics
  @mosaics
end

#robot1_autoObject

Returns the value of attribute robot1_auto.



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

def robot1_auto
  @robot1_auto
end

#robot2_autoObject

Returns the value of attribute robot2_auto.



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

def robot2_auto
  @robot2_auto
end

#spike_mark_pixel1Object

Returns the value of attribute spike_mark_pixel1.



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

def spike_mark_pixel1
  @spike_mark_pixel1
end

#spike_mark_pixel2Object

Returns the value of attribute spike_mark_pixel2.



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

def spike_mark_pixel2
  @spike_mark_pixel2
end

#target_backdrop_pixel1Object

Returns the value of attribute target_backdrop_pixel1.



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

def target_backdrop_pixel1
  @target_backdrop_pixel1
end

#target_backdrop_pixel2Object

Returns the value of attribute target_backdrop_pixel2.



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

def target_backdrop_pixel2
  @target_backdrop_pixel2
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



107
108
109
# File 'lib/ftc_api_v3_client/models/api_v3_cs_achievements_detail.rb', line 107

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



112
113
114
# File 'lib/ftc_api_v3_client/models/api_v3_cs_achievements_detail.rb', line 112

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/ftc_api_v3_client/models/api_v3_cs_achievements_detail.rb', line 81

def self.attribute_map
  {
    :'init_team_prop1' => :'initTeamProp1',
    :'init_team_prop2' => :'initTeamProp2',
    :'robot1_auto' => :'robot1Auto',
    :'robot2_auto' => :'robot2Auto',
    :'spike_mark_pixel1' => :'spikeMarkPixel1',
    :'spike_mark_pixel2' => :'spikeMarkPixel2',
    :'target_backdrop_pixel1' => :'targetBackdropPixel1',
    :'target_backdrop_pixel2' => :'targetBackdropPixel2',
    :'auto_backdrop' => :'autoBackdrop',
    :'auto_backstage' => :'autoBackstage',
    :'dc_backdrop' => :'dcBackdrop',
    :'dc_backstage' => :'dcBackstage',
    :'mosaics' => :'mosaics',
    :'max_set_line' => :'maxSetLine',
    :'eg_robot1' => :'egRobot1',
    :'eg_robot2' => :'egRobot2',
    :'drone1' => :'drone1',
    :'drone2' => :'drone2',
    :'minor_penalties' => :'minorPenalties',
    :'major_penalties' => :'majorPenalties'
  }
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



614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
# File 'lib/ftc_api_v3_client/models/api_v3_cs_achievements_detail.rb', line 614

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



143
144
145
146
147
148
# File 'lib/ftc_api_v3_client/models/api_v3_cs_achievements_detail.rb', line 143

def self.openapi_nullable
  Set.new([
    :'eg_robot1',
    :'eg_robot2',
  ])
end

.openapi_typesObject

Attribute type mapping.



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/ftc_api_v3_client/models/api_v3_cs_achievements_detail.rb', line 117

def self.openapi_types
  {
    :'init_team_prop1' => :'Boolean',
    :'init_team_prop2' => :'Boolean',
    :'robot1_auto' => :'Boolean',
    :'robot2_auto' => :'Boolean',
    :'spike_mark_pixel1' => :'Boolean',
    :'spike_mark_pixel2' => :'Boolean',
    :'target_backdrop_pixel1' => :'Boolean',
    :'target_backdrop_pixel2' => :'Boolean',
    :'auto_backdrop' => :'Integer',
    :'auto_backstage' => :'Integer',
    :'dc_backdrop' => :'Integer',
    :'dc_backstage' => :'Integer',
    :'mosaics' => :'Integer',
    :'max_set_line' => :'Integer',
    :'eg_robot1' => :'ApiV3CsEndLocation',
    :'eg_robot2' => :'ApiV3CsEndLocation',
    :'drone1' => :'Integer',
    :'drone2' => :'Integer',
    :'minor_penalties' => :'Integer',
    :'major_penalties' => :'Integer'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
# File 'lib/ftc_api_v3_client/models/api_v3_cs_achievements_detail.rb', line 574

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      init_team_prop1 == o.init_team_prop1 &&
      init_team_prop2 == o.init_team_prop2 &&
      robot1_auto == o.robot1_auto &&
      robot2_auto == o.robot2_auto &&
      spike_mark_pixel1 == o.spike_mark_pixel1 &&
      spike_mark_pixel2 == o.spike_mark_pixel2 &&
      target_backdrop_pixel1 == o.target_backdrop_pixel1 &&
      target_backdrop_pixel2 == o.target_backdrop_pixel2 &&
      auto_backdrop == o.auto_backdrop &&
      auto_backstage == o.auto_backstage &&
      dc_backdrop == o.dc_backdrop &&
      dc_backstage == o.dc_backstage &&
      mosaics == o.mosaics &&
      max_set_line == o.max_set_line &&
      eg_robot1 == o.eg_robot1 &&
      eg_robot2 == o.eg_robot2 &&
      drone1 == o.drone1 &&
      drone2 == o.drone2 &&
      minor_penalties == o.minor_penalties &&
      major_penalties == o.major_penalties
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


601
602
603
# File 'lib/ftc_api_v3_client/models/api_v3_cs_achievements_detail.rb', line 601

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



607
608
609
# File 'lib/ftc_api_v3_client/models/api_v3_cs_achievements_detail.rb', line 607

def hash
  [init_team_prop1, init_team_prop2, robot1_auto, robot2_auto, spike_mark_pixel1, spike_mark_pixel2, target_backdrop_pixel1, target_backdrop_pixel2, auto_backdrop, auto_backstage, dc_backdrop, dc_backstage, mosaics, max_set_line, eg_robot1, eg_robot2, drone1, drone2, minor_penalties, major_penalties].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
# File 'lib/ftc_api_v3_client/models/api_v3_cs_achievements_detail.rb', line 289

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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



636
637
638
639
640
641
642
643
644
645
646
647
648
# File 'lib/ftc_api_v3_client/models/api_v3_cs_achievements_detail.rb', line 636

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



369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
# File 'lib/ftc_api_v3_client/models/api_v3_cs_achievements_detail.rb', line 369

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @init_team_prop1.nil?
  return false if @init_team_prop2.nil?
  return false if @robot1_auto.nil?
  return false if @robot2_auto.nil?
  return false if @spike_mark_pixel1.nil?
  return false if @spike_mark_pixel2.nil?
  return false if @target_backdrop_pixel1.nil?
  return false if @target_backdrop_pixel2.nil?
  return false if @auto_backdrop.nil?
  return false if @auto_backstage.nil?
  return false if @dc_backdrop.nil?
  return false if @dc_backstage.nil?
  return false if @mosaics.nil?
  return false if @max_set_line.nil?
  return false if @drone1.nil?
  return false if @drone2.nil?
  return false if @minor_penalties.nil?
  return false if @major_penalties.nil?
  true
end