Class: FtcApiV3Client::ApiV3PowerPlayAchievementsDetail

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

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
# File 'lib/ftc_api_v3_client/models/api_v3_power_play_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::ApiV3PowerPlayAchievementsDetail` 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::ApiV3PowerPlayAchievementsDetail`. 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']
  end

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

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

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

  if attributes.key?(:'eg_navigated2')
    self.eg_navigated2 = attributes[:'eg_navigated2']
  else
    self.eg_navigated2 = 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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#auto_junction_conesObject

Array of 4 cone counts scored by this alliance on ground, low, medium, and high junctions respectively, scored in autonomous. E.g. red.autoJunctionCones is the total number of cones scored by red on medium-height junctions.



57
58
59
# File 'lib/ftc_api_v3_client/models/api_v3_power_play_achievements_detail.rb', line 57

def auto_junction_cones
  @auto_junction_cones
end

#auto_junctionsObject

Two dimensional array of lists of items scored on junctions in autonomous. [0,0] is the upper-left corner of the field as viewed from the audience side of the field (V5). The array is indexed by row, then column. (e.g [0,4] is in the upper right corner of the field (Z5).) Each junction is stored bottom up (index 0 is the bottom-most element on the field). MY_* elements belong to the alliance whose score object the element appears in, OTHER_* elements belong to the opposing alliance. (e.g in a set of scores for the red alliance, MY_CONE is a red cone and OTHER_CONE is a blue cone.) For a complete example, if red.autoJunctions[0][1] is OTHER_CONE, there is a blue cone in the bottom left cornerof the field (V1) on top of one other cone.



45
46
47
# File 'lib/ftc_api_v3_client/models/api_v3_power_play_achievements_detail.rb', line 45

def auto_junctions
  @auto_junctions
end

#auto_terminalObject

Returns the value of attribute auto_terminal.



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

def auto_terminal
  @auto_terminal
end

#beaconsObject

Returns the value of attribute beacons.



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

def beacons
  @beacons
end

#circuitObject

Returns the value of attribute circuit.



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

def circuit
  @circuit
end

#dc_junction_conesObject

Array of 4 cone counts scored by this alliance on ground, low, medium, and high junctions respectively, scored in driver-controlled. E.g. red.dcJunctionCones is the total number of cones scored by red on medium-height junctions.



60
61
62
# File 'lib/ftc_api_v3_client/models/api_v3_power_play_achievements_detail.rb', line 60

def dc_junction_cones
  @dc_junction_cones
end

#dc_junctionsObject

Two dimensional array of lists of items scored on junctions in driver-controlled. [0,0] is the upper-left corner of the field as viewed from the audience side of the field (V5). The array is indexed by crow, then column. (e.g [0,4] is in the upper right corner of the field (Z5).) Each junction is stored bottom up (index 0 is the bottom-most element on the field). MY_* elements belong to the alliance whose score object the element appears in, OTHER_* elements belong to the opposing alliance. (e.g in a set of scores for the red alliance, MY_CONE is a red cone and OTHER_CONE is a blue cone.) *_R1_BEACON means the beacon scored by robot 1 on the corresponding alliance. For a complete example, if red.dcJunctions[0][1] is OTHER_CONE, there is a blue cone in the bottom left cornerof the field (V1) on top of one other cone.



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

def dc_junctions
  @dc_junctions
end

#dc_terminal_farObject

Number of Scored cones in the alliance-colored terminal on the side of the field opposite the alliance station.



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

def dc_terminal_far
  @dc_terminal_far
end

#dc_terminal_nearObject

Number of Scored cones in the alliance-colored terminal on the side of the field closest to the alliance station.



51
52
53
# File 'lib/ftc_api_v3_client/models/api_v3_power_play_achievements_detail.rb', line 51

def dc_terminal_near
  @dc_terminal_near
end

#eg_navigated1Object

Returns the value of attribute eg_navigated1.



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

def eg_navigated1
  @eg_navigated1
end

#eg_navigated2Object

Returns the value of attribute eg_navigated2.



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

def eg_navigated2
  @eg_navigated2
end

#init_signal_sleeve1Object

Indicates if team 1 used a team-supplied signal sleave



39
40
41
# File 'lib/ftc_api_v3_client/models/api_v3_power_play_achievements_detail.rb', line 39

def init_signal_sleeve1
  @init_signal_sleeve1
end

#init_signal_sleeve2Object

Indicates if team 2 used a team-supplied signal sleave



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

def init_signal_sleeve2
  @init_signal_sleeve2
end

#major_penaltiesObject

Returns the value of attribute major_penalties.



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

def major_penalties
  @major_penalties
end

#minor_penaltiesObject

Returns the value of attribute minor_penalties.



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

def minor_penalties
  @minor_penalties
end

#owned_junctionsObject

Returns the value of attribute owned_junctions.



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

def owned_junctions
  @owned_junctions
end

#robot1_autoObject

Returns the value of attribute robot1_auto.



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

def robot1_auto
  @robot1_auto
end

#robot2_autoObject

Returns the value of attribute robot2_auto.



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

def robot2_auto
  @robot2_auto
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



109
110
111
# File 'lib/ftc_api_v3_client/models/api_v3_power_play_achievements_detail.rb', line 109

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



114
115
116
# File 'lib/ftc_api_v3_client/models/api_v3_power_play_achievements_detail.rb', line 114

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/ftc_api_v3_client/models/api_v3_power_play_achievements_detail.rb', line 85

def self.attribute_map
  {
    :'robot1_auto' => :'robot1Auto',
    :'robot2_auto' => :'robot2Auto',
    :'auto_terminal' => :'autoTerminal',
    :'eg_navigated1' => :'egNavigated1',
    :'eg_navigated2' => :'egNavigated2',
    :'minor_penalties' => :'minorPenalties',
    :'major_penalties' => :'majorPenalties',
    :'beacons' => :'beacons',
    :'owned_junctions' => :'ownedJunctions',
    :'circuit' => :'circuit',
    :'init_signal_sleeve1' => :'initSignalSleeve1',
    :'init_signal_sleeve2' => :'initSignalSleeve2',
    :'auto_junctions' => :'autoJunctions',
    :'dc_junctions' => :'dcJunctions',
    :'dc_terminal_near' => :'dcTerminalNear',
    :'dc_terminal_far' => :'dcTerminalFar',
    :'auto_junction_cones' => :'autoJunctionCones',
    :'dc_junction_cones' => :'dcJunctionCones'
  }
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



540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
# File 'lib/ftc_api_v3_client/models/api_v3_power_play_achievements_detail.rb', line 540

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_power_play_achievements_detail.rb', line 143

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

.openapi_typesObject

Attribute type mapping.



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_power_play_achievements_detail.rb', line 119

def self.openapi_types
  {
    :'robot1_auto' => :'ApiV3PowerPlayAutoLocation',
    :'robot2_auto' => :'ApiV3PowerPlayAutoLocation',
    :'auto_terminal' => :'Integer',
    :'eg_navigated1' => :'Boolean',
    :'eg_navigated2' => :'Boolean',
    :'minor_penalties' => :'Integer',
    :'major_penalties' => :'Integer',
    :'beacons' => :'Integer',
    :'owned_junctions' => :'Integer',
    :'circuit' => :'Boolean',
    :'init_signal_sleeve1' => :'Boolean',
    :'init_signal_sleeve2' => :'Boolean',
    :'auto_junctions' => :'Array<ApiV3JunctionElement>',
    :'dc_junctions' => :'Array<ApiV3JunctionElement>',
    :'dc_terminal_near' => :'Integer',
    :'dc_terminal_far' => :'Integer',
    :'auto_junction_cones' => :'Array<Integer>',
    :'dc_junction_cones' => :'Array<Integer>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
# File 'lib/ftc_api_v3_client/models/api_v3_power_play_achievements_detail.rb', line 502

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      robot1_auto == o.robot1_auto &&
      robot2_auto == o.robot2_auto &&
      auto_terminal == o.auto_terminal &&
      eg_navigated1 == o.eg_navigated1 &&
      eg_navigated2 == o.eg_navigated2 &&
      minor_penalties == o.minor_penalties &&
      major_penalties == o.major_penalties &&
      beacons == o.beacons &&
      owned_junctions == o.owned_junctions &&
      circuit == o.circuit &&
      init_signal_sleeve1 == o.init_signal_sleeve1 &&
      init_signal_sleeve2 == o.init_signal_sleeve2 &&
      auto_junctions == o.auto_junctions &&
      dc_junctions == o.dc_junctions &&
      dc_terminal_near == o.dc_terminal_near &&
      dc_terminal_far == o.dc_terminal_far &&
      auto_junction_cones == o.auto_junction_cones &&
      dc_junction_cones == o.dc_junction_cones
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


527
528
529
# File 'lib/ftc_api_v3_client/models/api_v3_power_play_achievements_detail.rb', line 527

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



533
534
535
# File 'lib/ftc_api_v3_client/models/api_v3_power_play_achievements_detail.rb', line 533

def hash
  [robot1_auto, robot2_auto, auto_terminal, eg_navigated1, eg_navigated2, minor_penalties, major_penalties, beacons, owned_junctions, circuit, init_signal_sleeve1, init_signal_sleeve2, auto_junctions, dc_junctions, dc_terminal_near, dc_terminal_far, auto_junction_cones, dc_junction_cones].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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

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

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

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

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

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

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

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

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

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

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

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

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



562
563
564
565
566
567
568
569
570
571
572
573
574
# File 'lib/ftc_api_v3_client/models/api_v3_power_play_achievements_detail.rb', line 562

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



341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
# File 'lib/ftc_api_v3_client/models/api_v3_power_play_achievements_detail.rb', line 341

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @auto_terminal.nil?
  return false if @eg_navigated1.nil?
  return false if @eg_navigated2.nil?
  return false if @minor_penalties.nil?
  return false if @major_penalties.nil?
  return false if @beacons.nil?
  return false if @owned_junctions.nil?
  return false if @circuit.nil?
  return false if @init_signal_sleeve1.nil?
  return false if @init_signal_sleeve2.nil?
  return false if @auto_junctions.nil?
  return false if @dc_junctions.nil?
  return false if @dc_terminal_near.nil?
  return false if @dc_terminal_far.nil?
  true
end