Class: FtcApiV3Client::ApiV3SingleTeamMatchDetails

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

Overview

Match details for a remote event

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

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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_single_team_match_details.rb', line 135

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#commit_time ⇒ Object

The time the match was last committed. This can change after initial commit/post and can be used to determine if match details are stale.



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

def commit_time
  @commit_time
end

#display_name ⇒ Object

For display purposes. May include event-specific customization and therefore may not match for equivalent matches between events.



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

def display_name
  @display_name
end

#field ⇒ Object

Returns the value of attribute field.



23
24
25
# File 'lib/ftc_api_v3_client/models/api_v3_single_team_match_details.rb', line 23

def field
  @field
end

#match_results ⇒ Object

Returns the value of attribute match_results.



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

def match_results
  @match_results
end

#match_results_details ⇒ Object

Returns the value of attribute match_results_details.



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

def match_results_details
  @match_results_details
end

#number ⇒ Object

For practice and qualification matches, the number of the match as shown on the schedule. For playoff matches, the number within the series (almost always 1 for double-elimination).



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

def number
  @number
end

#post_time ⇒ Object

Returns the value of attribute post_time.



31
32
33
# File 'lib/ftc_api_v3_client/models/api_v3_single_team_match_details.rb', line 31

def post_time
  @post_time
end

#random ⇒ Object

Returns the value of attribute random.



33
34
35
# File 'lib/ftc_api_v3_client/models/api_v3_single_team_match_details.rb', line 33

def random
  @random
end

#scheduled_start_time ⇒ Object

Returns the value of attribute scheduled_start_time.



27
28
29
# File 'lib/ftc_api_v3_client/models/api_v3_single_team_match_details.rb', line 27

def scheduled_start_time
  @scheduled_start_time
end

#series ⇒ Object

For practice and qualification matches, this is always 0. For playoff matches, the series number as described in the playoff structure object.



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

def series
  @series
end

#short_name ⇒ Object

Returns the value of attribute short_name.



21
22
23
# File 'lib/ftc_api_v3_client/models/api_v3_single_team_match_details.rb', line 21

def short_name
  @short_name
end

#start_time ⇒ Object

Returns the value of attribute start_time.



29
30
31
# File 'lib/ftc_api_v3_client/models/api_v3_single_team_match_details.rb', line 29

def start_time
  @start_time
end

#teams ⇒ Object

Returns the value of attribute teams.



49
50
51
# File 'lib/ftc_api_v3_client/models/api_v3_single_team_match_details.rb', line 49

def teams
  @teams
end

#tournament_level ⇒ Object

Returns the value of attribute tournament_level.



25
26
27
# File 'lib/ftc_api_v3_client/models/api_v3_single_team_match_details.rb', line 25

def tournament_level
  @tournament_level
end

#type ⇒ Object

Returns the value of attribute type.



19
20
21
# File 'lib/ftc_api_v3_client/models/api_v3_single_team_match_details.rb', line 19

def type
  @type
end

Class Method Details

.acceptable_attribute_map ⇒ Object

Returns attribute mapping this model knows about



97
98
99
# File 'lib/ftc_api_v3_client/models/api_v3_single_team_match_details.rb', line 97

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributes ⇒ Object

Returns all the JSON keys this model knows about



102
103
104
# File 'lib/ftc_api_v3_client/models/api_v3_single_team_match_details.rb', line 102

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_map ⇒ Object

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



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

def self.attribute_map
  {
    :'type' => :'type',
    :'short_name' => :'shortName',
    :'field' => :'field',
    :'tournament_level' => :'tournamentLevel',
    :'scheduled_start_time' => :'scheduledStartTime',
    :'start_time' => :'startTime',
    :'post_time' => :'postTime',
    :'random' => :'random',
    :'display_name' => :'displayName',
    :'series' => :'series',
    :'number' => :'number',
    :'commit_time' => :'commitTime',
    :'match_results' => :'matchResults',
    :'teams' => :'teams',
    :'match_results_details' => :'matchResultsDetails'
  }
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



398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
# File 'lib/ftc_api_v3_client/models/api_v3_single_team_match_details.rb', line 398

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_nullable ⇒ Object

List of attributes with nullable: true



128
129
130
131
# File 'lib/ftc_api_v3_client/models/api_v3_single_team_match_details.rb', line 128

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_types ⇒ Object

Attribute type mapping.



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

def self.openapi_types
  {
    :'type' => :'String',
    :'short_name' => :'String',
    :'field' => :'Integer',
    :'tournament_level' => :'ApiV3TournamentLevel',
    :'scheduled_start_time' => :'Time',
    :'start_time' => :'Time',
    :'post_time' => :'Time',
    :'random' => :'Integer',
    :'display_name' => :'String',
    :'series' => :'Integer',
    :'number' => :'Integer',
    :'commit_time' => :'Time',
    :'match_results' => :'ApiV3SingleTeamMatchResults',
    :'teams' => :'ApiV3SingleTeamMatchParticipants',
    :'match_results_details' => :'ApiV3SingleTeamMatchResultsDetails'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object) —

    to be compared



363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
# File 'lib/ftc_api_v3_client/models/api_v3_single_team_match_details.rb', line 363

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      type == o.type &&
      short_name == o.short_name &&
      field == o.field &&
      tournament_level == o.tournament_level &&
      scheduled_start_time == o.scheduled_start_time &&
      start_time == o.start_time &&
      post_time == o.post_time &&
      random == o.random &&
      display_name == o.display_name &&
      series == o.series &&
      number == o.number &&
      commit_time == o.commit_time &&
      match_results == o.match_results &&
      teams == o.teams &&
      match_results_details == o.match_results_details
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object) —

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


385
386
387
# File 'lib/ftc_api_v3_client/models/api_v3_single_team_match_details.rb', line 385

def eql?(o)
  self == o
end

#hash ⇒ Integer

Calculates hash code according to all attributes.

Returns:

  • (Integer) —

    Hash code



391
392
393
# File 'lib/ftc_api_v3_client/models/api_v3_single_team_match_details.rb', line 391

def hash
  [type, short_name, field, tournament_level, scheduled_start_time, start_time, post_time, random, display_name, series, number, commit_time, match_results, teams, match_results_details].hash
end

#list_invalid_properties ⇒ Object

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

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

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

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

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

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

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

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

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

  invalid_properties
end

#to_hash ⇒ Hash

Returns the object in the form of hash

Returns:

  • (Hash) —

    Returns the object in the form of hash



420
421
422
423
424
425
426
427
428
429
430
431
432
# File 'lib/ftc_api_v3_client/models/api_v3_single_team_match_details.rb', line 420

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



268
269
270
271
272
273
274
275
276
277
278
279
# File 'lib/ftc_api_v3_client/models/api_v3_single_team_match_details.rb', line 268

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @type.nil?
  return false if @short_name.nil?
  return false if @field.nil?
  return false if @tournament_level.nil?
  return false if @display_name.nil?
  return false if @series.nil?
  return false if @number.nil?
  return false if @teams.nil?
  true
end