Class: FtcApiV3Client::ApiV3CsRemoteAchievementsDetail

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

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/ftc_api_v3_client/models/api_v3_cs_remote_achievements_detail.rb', line 127

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

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

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

  if attributes.key?(:'target_backdrop_pixel')
    self.target_backdrop_pixel = attributes[:'target_backdrop_pixel']
  else
    self.target_backdrop_pixel = 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_robot')
    self.eg_robot = attributes[:'eg_robot']
  else
    self.eg_robot = nil
  end

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



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

def auto_backdrop
  @auto_backdrop
end

#auto_backstageObject

Returns the value of attribute auto_backstage.



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

def auto_backstage
  @auto_backstage
end

#dc_backdropObject

Returns the value of attribute dc_backdrop.



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

def dc_backdrop
  @dc_backdrop
end

#dc_backstageObject

Returns the value of attribute dc_backstage.



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

def dc_backstage
  @dc_backstage
end

#droneObject

Returns the value of attribute drone.



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

def drone
  @drone
end

#eg_robotObject

Returns the value of attribute eg_robot.



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

def eg_robot
  @eg_robot
end

#init_team_propObject

Returns the value of attribute init_team_prop.



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

def init_team_prop
  @init_team_prop
end

#major_penaltiesObject

Returns the value of attribute major_penalties.



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

def major_penalties
  @major_penalties
end

#max_set_lineObject

Returns the value of attribute max_set_line.



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

def max_set_line
  @max_set_line
end

#minor_penaltiesObject

Returns the value of attribute minor_penalties.



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

def minor_penalties
  @minor_penalties
end

#mosaicsObject

Returns the value of attribute mosaics.



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

def mosaics
  @mosaics
end

#robot_autoObject

Returns the value of attribute robot_auto.



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

def robot_auto
  @robot_auto
end

#spike_mark_pixelObject

Returns the value of attribute spike_mark_pixel.



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

def spike_mark_pixel
  @spike_mark_pixel
end

#target_backdrop_pixelObject

Returns the value of attribute target_backdrop_pixel.



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

def target_backdrop_pixel
  @target_backdrop_pixel
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



89
90
91
# File 'lib/ftc_api_v3_client/models/api_v3_cs_remote_achievements_detail.rb', line 89

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



94
95
96
# File 'lib/ftc_api_v3_client/models/api_v3_cs_remote_achievements_detail.rb', line 94

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/ftc_api_v3_client/models/api_v3_cs_remote_achievements_detail.rb', line 69

def self.attribute_map
  {
    :'init_team_prop' => :'initTeamProp',
    :'robot_auto' => :'robotAuto',
    :'spike_mark_pixel' => :'spikeMarkPixel',
    :'target_backdrop_pixel' => :'targetBackdropPixel',
    :'auto_backdrop' => :'autoBackdrop',
    :'auto_backstage' => :'autoBackstage',
    :'dc_backdrop' => :'dcBackdrop',
    :'dc_backstage' => :'dcBackstage',
    :'mosaics' => :'mosaics',
    :'max_set_line' => :'maxSetLine',
    :'eg_robot' => :'egRobot',
    :'drone' => :'drone',
    :'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



472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
# File 'lib/ftc_api_v3_client/models/api_v3_cs_remote_achievements_detail.rb', line 472

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



119
120
121
122
123
# File 'lib/ftc_api_v3_client/models/api_v3_cs_remote_achievements_detail.rb', line 119

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

.openapi_typesObject

Attribute type mapping.



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/ftc_api_v3_client/models/api_v3_cs_remote_achievements_detail.rb', line 99

def self.openapi_types
  {
    :'init_team_prop' => :'Boolean',
    :'robot_auto' => :'Boolean',
    :'spike_mark_pixel' => :'Boolean',
    :'target_backdrop_pixel' => :'Boolean',
    :'auto_backdrop' => :'Integer',
    :'auto_backstage' => :'Integer',
    :'dc_backdrop' => :'Integer',
    :'dc_backstage' => :'Integer',
    :'mosaics' => :'Integer',
    :'max_set_line' => :'Integer',
    :'eg_robot' => :'ApiV3CsEndLocation',
    :'drone' => :'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



438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
# File 'lib/ftc_api_v3_client/models/api_v3_cs_remote_achievements_detail.rb', line 438

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      init_team_prop == o.init_team_prop &&
      robot_auto == o.robot_auto &&
      spike_mark_pixel == o.spike_mark_pixel &&
      target_backdrop_pixel == o.target_backdrop_pixel &&
      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_robot == o.eg_robot &&
      drone == o.drone &&
      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


459
460
461
# File 'lib/ftc_api_v3_client/models/api_v3_cs_remote_achievements_detail.rb', line 459

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



465
466
467
# File 'lib/ftc_api_v3_client/models/api_v3_cs_remote_achievements_detail.rb', line 465

def hash
  [init_team_prop, robot_auto, spike_mark_pixel, target_backdrop_pixel, auto_backdrop, auto_backstage, dc_backdrop, dc_backstage, mosaics, max_set_line, eg_robot, drone, 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



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

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

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

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

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



494
495
496
497
498
499
500
501
502
503
504
505
506
# File 'lib/ftc_api_v3_client/models/api_v3_cs_remote_achievements_detail.rb', line 494

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



288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
# File 'lib/ftc_api_v3_client/models/api_v3_cs_remote_achievements_detail.rb', line 288

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @init_team_prop.nil?
  return false if @robot_auto.nil?
  return false if @spike_mark_pixel.nil?
  return false if @target_backdrop_pixel.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 @drone.nil?
  return false if @minor_penalties.nil?
  return false if @major_penalties.nil?
  true
end