Class: FtcApiV3Client::ApiV3PowerPlayRemoteAchievementsDetail

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

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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

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

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

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



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

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. The array is indexed by row, then column. (e.g [0,2] is in the upper right corner of the field.) Each junction is stored bottom up (index 0 is the bottom-most element on the field).



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

def auto_junctions
  @auto_junctions
end

#auto_terminal_farObject

Returns the value of attribute auto_terminal_far.



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

def auto_terminal_far
  @auto_terminal_far
end

#auto_terminal_nearObject

Returns the value of attribute auto_terminal_near.



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

def auto_terminal_near
  @auto_terminal_near
end

#beaconsObject

Returns the value of attribute beacons.



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

def beacons
  @beacons
end

#circuitObject

Returns the value of attribute circuit.



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

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.



53
54
55
# File 'lib/ftc_api_v3_client/models/api_v3_power_play_remote_achievements_detail.rb', line 53

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. The array is indexed by crow, then column. (e.g [0,2] is in the upper right corner of the field.) Each junction is stored bottom up (index 0 is the bottom-most element on the field).



47
48
49
# File 'lib/ftc_api_v3_client/models/api_v3_power_play_remote_achievements_detail.rb', line 47

def dc_junctions
  @dc_junctions
end

#dc_terminal_farObject

Returns the value of attribute dc_terminal_far.



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

def dc_terminal_far
  @dc_terminal_far
end

#dc_terminal_nearObject

Returns the value of attribute dc_terminal_near.



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

def dc_terminal_near
  @dc_terminal_near
end

#eg_navigatedObject

Returns the value of attribute eg_navigated.



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

def eg_navigated
  @eg_navigated
end

#init_signal_sleeveObject

Indicates if team used a team-supplied signal sleave



41
42
43
# File 'lib/ftc_api_v3_client/models/api_v3_power_play_remote_achievements_detail.rb', line 41

def init_signal_sleeve
  @init_signal_sleeve
end

#major_penaltiesObject

Returns the value of attribute major_penalties.



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

def major_penalties
  @major_penalties
end

#minor_penaltiesObject

Returns the value of attribute minor_penalties.



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

def minor_penalties
  @minor_penalties
end

#owned_junctionsObject

Returns the value of attribute owned_junctions.



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

def owned_junctions
  @owned_junctions
end

#robot_autoObject

Returns the value of attribute robot_auto.



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

def robot_auto
  @robot_auto
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



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

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



105
106
107
# File 'lib/ftc_api_v3_client/models/api_v3_power_play_remote_achievements_detail.rb', line 105

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/ftc_api_v3_client/models/api_v3_power_play_remote_achievements_detail.rb', line 78

def self.attribute_map
  {
    :'robot_auto' => :'robotAuto',
    :'auto_terminal_near' => :'autoTerminalNear',
    :'auto_terminal_far' => :'autoTerminalFar',
    :'dc_terminal_near' => :'dcTerminalNear',
    :'dc_terminal_far' => :'dcTerminalFar',
    :'eg_navigated' => :'egNavigated',
    :'minor_penalties' => :'minorPenalties',
    :'major_penalties' => :'majorPenalties',
    :'beacons' => :'beacons',
    :'owned_junctions' => :'ownedJunctions',
    :'circuit' => :'circuit',
    :'init_signal_sleeve' => :'initSignalSleeve',
    :'auto_junctions' => :'autoJunctions',
    :'dc_junctions' => :'dcJunctions',
    :'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



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

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



132
133
134
135
136
# File 'lib/ftc_api_v3_client/models/api_v3_power_play_remote_achievements_detail.rb', line 132

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

.openapi_typesObject

Attribute type mapping.



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/ftc_api_v3_client/models/api_v3_power_play_remote_achievements_detail.rb', line 110

def self.openapi_types
  {
    :'robot_auto' => :'ApiV3PowerPlayAutoLocation',
    :'auto_terminal_near' => :'Integer',
    :'auto_terminal_far' => :'Integer',
    :'dc_terminal_near' => :'Integer',
    :'dc_terminal_far' => :'Integer',
    :'eg_navigated' => :'Boolean',
    :'minor_penalties' => :'Integer',
    :'major_penalties' => :'Integer',
    :'beacons' => :'Integer',
    :'owned_junctions' => :'Integer',
    :'circuit' => :'Boolean',
    :'init_signal_sleeve' => :'Boolean',
    :'auto_junctions' => :'Array<ApiV3RemoteJunctionElement>',
    :'dc_junctions' => :'Array<ApiV3RemoteJunctionElement>',
    :'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



465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
# File 'lib/ftc_api_v3_client/models/api_v3_power_play_remote_achievements_detail.rb', line 465

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      robot_auto == o.robot_auto &&
      auto_terminal_near == o.auto_terminal_near &&
      auto_terminal_far == o.auto_terminal_far &&
      dc_terminal_near == o.dc_terminal_near &&
      dc_terminal_far == o.dc_terminal_far &&
      eg_navigated == o.eg_navigated &&
      minor_penalties == o.minor_penalties &&
      major_penalties == o.major_penalties &&
      beacons == o.beacons &&
      owned_junctions == o.owned_junctions &&
      circuit == o.circuit &&
      init_signal_sleeve == o.init_signal_sleeve &&
      auto_junctions == o.auto_junctions &&
      dc_junctions == o.dc_junctions &&
      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


488
489
490
# File 'lib/ftc_api_v3_client/models/api_v3_power_play_remote_achievements_detail.rb', line 488

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



494
495
496
# File 'lib/ftc_api_v3_client/models/api_v3_power_play_remote_achievements_detail.rb', line 494

def hash
  [robot_auto, auto_terminal_near, auto_terminal_far, dc_terminal_near, dc_terminal_far, eg_navigated, minor_penalties, major_penalties, beacons, owned_junctions, circuit, init_signal_sleeve, auto_junctions, dc_junctions, 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



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
304
305
306
307
308
309
310
311
# File 'lib/ftc_api_v3_client/models/api_v3_power_play_remote_achievements_detail.rb', line 255

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

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

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

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



523
524
525
526
527
528
529
530
531
532
533
534
535
# File 'lib/ftc_api_v3_client/models/api_v3_power_play_remote_achievements_detail.rb', line 523

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



315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
# File 'lib/ftc_api_v3_client/models/api_v3_power_play_remote_achievements_detail.rb', line 315

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @auto_terminal_near.nil?
  return false if @auto_terminal_far.nil?
  return false if @dc_terminal_near.nil?
  return false if @dc_terminal_far.nil?
  return false if @eg_navigated.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_sleeve.nil?
  return false if @auto_junctions.nil?
  return false if @dc_junctions.nil?
  true
end