Class: FtcApiV3Client::TeamsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/ftc_api_v3_client/api/teams_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TeamsApi

Returns a new instance of TeamsApi.



19
20
21
# File 'lib/ftc_api_v3_client/api/teams_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/ftc_api_v3_client/api/teams_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_team(cmp_year, number, opts = {}) ⇒ ApiV3Team

Get teams information Get information for a specific team. If a team's number changed during the season, this endpoint can be called with the old number and it will return the new one.

Parameters:

  • cmp_year (String)

    The year of the FIRST Championship for the requested season

  • number (String)

    The team's number

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

    the optional parameters

Returns:



28
29
30
31
# File 'lib/ftc_api_v3_client/api/teams_api.rb', line 28

def get_team(cmp_year, number, opts = {})
  data, _status_code, _headers = get_team_with_http_info(cmp_year, number, opts)
  data
end

#get_team_details(cmp_year, number, opts = {}) ⇒ ApiV3TeamDetails

Get detailed team information Get detailed information for a specific team. Includes all awards, events, matches, and leagues. If a team's number changed during the season, this endpoint can be called with the old number and it will return the new one.

Parameters:

  • cmp_year (String)

    The year of the FIRST Championship for the requested season

  • number (String)

    The team's number

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

    the optional parameters

Returns:



89
90
91
92
# File 'lib/ftc_api_v3_client/api/teams_api.rb', line 89

def get_team_details(cmp_year, number, opts = {})
  data, _status_code, _headers = get_team_details_with_http_info(cmp_year, number, opts)
  data
end

#get_team_details_with_http_info(cmp_year, number, opts = {}) ⇒ Array<(ApiV3TeamDetails, Integer, Hash)>

Get detailed team information Get detailed information for a specific team. Includes all awards, events, matches, and leagues. If a team's number changed during the season, this endpoint can be called with the old number and it will return the new one.

Parameters:

  • cmp_year (String)

    The year of the FIRST Championship for the requested season

  • number (String)

    The team's number

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

    the optional parameters

Returns:

  • (Array<(ApiV3TeamDetails, Integer, Hash)>)

    ApiV3TeamDetails data, response status code and response headers



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/ftc_api_v3_client/api/teams_api.rb', line 100

def get_team_details_with_http_info(cmp_year, number, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsApi.get_team_details ...'
  end
  # resource path
  local_var_path = '/api/v3/seasons/{cmpYear}/teams/{number}/details'.sub('{' + 'cmpYear' + '}', CGI.escape(cmp_year.to_s)).sub('{' + 'number' + '}', CGI.escape(number.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ApiV3TeamDetails'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"TeamsApi.get_team_details",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TeamsApi#get_team_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_team_history(number, opts = {}) ⇒ ApiV3TeamHistory

Get team history Get cross-season history for a specific team number. General information will be from the last season the team competed in.

Parameters:

  • number (String)

    The team's number

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

    the optional parameters

Returns:



149
150
151
152
# File 'lib/ftc_api_v3_client/api/teams_api.rb', line 149

def get_team_history(number, opts = {})
  data, _status_code, _headers = get_team_history_with_http_info(number, opts)
  data
end

#get_team_history_with_http_info(number, opts = {}) ⇒ Array<(ApiV3TeamHistory, Integer, Hash)>

Get team history Get cross-season history for a specific team number. General information will be from the last season the team competed in.

Parameters:

  • number (String)

    The team's number

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

    the optional parameters

Returns:

  • (Array<(ApiV3TeamHistory, Integer, Hash)>)

    ApiV3TeamHistory data, response status code and response headers



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
# File 'lib/ftc_api_v3_client/api/teams_api.rb', line 159

def get_team_history_with_http_info(number, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsApi.get_team_history ...'
  end
  # resource path
  local_var_path = '/api/v3/teams/{number}'.sub('{' + 'number' + '}', CGI.escape(number.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ApiV3TeamHistory'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"TeamsApi.get_team_history",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TeamsApi#get_team_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_team_with_http_info(cmp_year, number, opts = {}) ⇒ Array<(ApiV3Team, Integer, Hash)>

Get teams information Get information for a specific team. If a team's number changed during the season, this endpoint can be called with the old number and it will return the new one.

Parameters:

  • cmp_year (String)

    The year of the FIRST Championship for the requested season

  • number (String)

    The team's number

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

    the optional parameters

Returns:

  • (Array<(ApiV3Team, Integer, Hash)>)

    ApiV3Team data, response status code and response headers



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/ftc_api_v3_client/api/teams_api.rb', line 39

def get_team_with_http_info(cmp_year, number, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsApi.get_team ...'
  end
  # resource path
  local_var_path = '/api/v3/seasons/{cmpYear}/teams/{number}'.sub('{' + 'cmpYear' + '}', CGI.escape(cmp_year.to_s)).sub('{' + 'number' + '}', CGI.escape(number.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ApiV3Team'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"TeamsApi.get_team",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TeamsApi#get_team\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_team_avatars(cmp_year, opts = {}) ⇒ ApiV3TeamAvatars

List team avatars for a season Lists all current team avatars for a season. If all you need is to display avatars with the standard FIRST fallback and scaling, directly link /avatars/composed/{cmpYear}.css instead of using this endpoint. Use a div with the classes team-avatar and team-{number} to display the avatar. Use the css variable --avatar-size to control the size of the avatar in px (defaults to 40).

Parameters:

  • cmp_year (String)

    The year of the FIRST Championship for the requested season

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

    the optional parameters

Returns:



208
209
210
211
# File 'lib/ftc_api_v3_client/api/teams_api.rb', line 208

def list_team_avatars(cmp_year, opts = {})
  data, _status_code, _headers = list_team_avatars_with_http_info(cmp_year, opts)
  data
end

#list_team_avatars_with_http_info(cmp_year, opts = {}) ⇒ Array<(ApiV3TeamAvatars, Integer, Hash)>

List team avatars for a season Lists all current team avatars for a season. If all you need is to display avatars with the standard FIRST fallback and scaling, directly link `/avatars/composed/cmpYear.css` instead of using this endpoint. Use a div with the classes `team-avatar` and `team-number` to display the avatar. Use the css variable `--avatar-size` to control the size of the avatar in px (defaults to 40).

Parameters:

  • cmp_year (String)

    The year of the FIRST Championship for the requested season

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

    the optional parameters

Returns:

  • (Array<(ApiV3TeamAvatars, Integer, Hash)>)

    ApiV3TeamAvatars data, response status code and response headers



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
# File 'lib/ftc_api_v3_client/api/teams_api.rb', line 218

def list_team_avatars_with_http_info(cmp_year, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsApi.list_team_avatars ...'
  end
  # resource path
  local_var_path = '/api/v3/seasons/{cmpYear}/avatars'.sub('{' + 'cmpYear' + '}', CGI.escape(cmp_year.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ApiV3TeamAvatars'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"TeamsApi.list_team_avatars",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TeamsApi#list_team_avatars\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_teams(cmp_year, opts = {}) ⇒ ApiV3Teams

List teams for a season Lists all registered teams for the given FTC season. In some cases, teams with incomplete registrations may be included in event results but not returned in this list. Use the event's team list for that information if necessary.

Parameters:

  • cmp_year (String)

    The year of the FIRST Championship for the requested season

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

    the optional parameters

Returns:



267
268
269
270
# File 'lib/ftc_api_v3_client/api/teams_api.rb', line 267

def list_teams(cmp_year, opts = {})
  data, _status_code, _headers = list_teams_with_http_info(cmp_year, opts)
  data
end

#list_teams_with_http_info(cmp_year, opts = {}) ⇒ Array<(ApiV3Teams, Integer, Hash)>

List teams for a season Lists all registered teams for the given FTC season. In some cases, teams with incomplete registrations may be included in event results but not returned in this list. Use the event's team list for that information if necessary.

Parameters:

  • cmp_year (String)

    The year of the FIRST Championship for the requested season

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

    the optional parameters

Returns:

  • (Array<(ApiV3Teams, Integer, Hash)>)

    ApiV3Teams data, response status code and response headers



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

def list_teams_with_http_info(cmp_year, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsApi.list_teams ...'
  end
  # resource path
  local_var_path = '/api/v3/seasons/{cmpYear}/teams'.sub('{' + 'cmpYear' + '}', CGI.escape(cmp_year.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ApiV3Teams'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"TeamsApi.list_teams",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TeamsApi#list_teams\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end