Class: FtcEventsClient::AwardsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/ftc_events_client/api/awards_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AwardsApi

Returns a new instance of AwardsApi.



16
17
18
# File 'lib/ftc_events_client/api/awards_api.rb', line 16

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



14
15
16
# File 'lib/ftc_events_client/api/awards_api.rb', line 14

def api_client
  @api_client
end

Instance Method Details

#v20_season_awards_event_code_get(season, event_code, opts = {}) ⇒ AwardsModel

Event Awards The event awards API returns details about awards presented at a particular event in a particular season. Return values may contain either ‘teamNumber` or `person` values, and if the winner was a `person`, and that person is from a team, the `teamNumber` value might be set with their `teamNumber`. You must specify either an `eventCode` or a `teamNumber` or both. If you specify the `teamNumber` parameter, you will receive only awards where the team was listed as the winner, regardless of whether or not the `person` field is `null` or empty. If you specify only the `eventCode` field, you will receive all award listings for the requested event. If you specify both, you will receive all awards won by the `teamNumber` at the `eventCode`.

Parameters:

  • season

    Numeric year of the event from which the award listings are requested. Must be 4 digits

  • event_code

    Case insensitive alphanumeric `eventCode` of the event from which the awards are requested.

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

    the optional parameters

Options Hash (opts):

  • :team_number (Integer)

    `teamNumber` to search for within the results. (default to 0)

Returns:



26
27
28
29
# File 'lib/ftc_events_client/api/awards_api.rb', line 26

def v20_season_awards_event_code_get(season, event_code, opts = {})
  data, _status_code, _headers = v20_season_awards_event_code_get_with_http_info(season, event_code, opts)
  data
end

#v20_season_awards_event_code_get_with_http_info(season, event_code, opts = {}) ⇒ Array<(AwardsModel, Integer, Hash)>

Event Awards The event awards API returns details about awards presented at a particular event in a particular season. Return values may contain either &#x60;teamNumber&#x60; or &#x60;person&#x60; values, and if the winner was a &#x60;person&#x60;, and that person is from a team, the &#x60;teamNumber&#x60; value might be set with their &#x60;teamNumber&#x60;. You must specify either an &#x60;eventCode&#x60; or a &#x60;teamNumber&#x60; or both. If you specify the &#x60;teamNumber&#x60; parameter, you will receive only awards where the team was listed as the winner, regardless of whether or not the &#x60;person&#x60; field is &#x60;null&#x60; or empty. If you specify only the &#x60;eventCode&#x60; field, you will receive all award listings for the requested event. If you specify both, you will receive all awards won by the &#x60;teamNumber&#x60; at the &#x60;eventCode&#x60;.

Parameters:

  • season

    Numeric year of the event from which the award listings are requested. Must be 4 digits

  • event_code

    Case insensitive alphanumeric &#x60;eventCode&#x60; of the event from which the awards are requested.

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

    the optional parameters

Options Hash (opts):

  • :team_number (Integer)

    &#x60;teamNumber&#x60; to search for within the results.

Returns:

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

    AwardsModel data, response status code and response headers



38
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
82
83
# File 'lib/ftc_events_client/api/awards_api.rb', line 38

def v20_season_awards_event_code_get_with_http_info(season, event_code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AwardsApi.v20_season_awards_event_code_get ...'
  end
  # verify the required parameter 'season' is set
  if @api_client.config.client_side_validation && season.nil?
    fail ArgumentError, "Missing the required parameter 'season' when calling AwardsApi.v20_season_awards_event_code_get"
  end
  # verify the required parameter 'event_code' is set
  if @api_client.config.client_side_validation && event_code.nil?
    fail ArgumentError, "Missing the required parameter 'event_code' when calling AwardsApi.v20_season_awards_event_code_get"
  end
  # resource path
  local_var_path = '/v2.0/{season}/awards/{eventCode}'.sub('{' + 'season' + '}', season.to_s).sub('{' + 'eventCode' + '}', event_code.to_s)

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'teamNumber'] = opts[:'team_number'] if !opts[:'team_number'].nil?

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

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

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

  return_type = opts[:return_type] || 'AwardsModel' 

  auth_names = opts[:auth_names] || ['basic']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AwardsApi#v20_season_awards_event_code_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#v20_season_awards_event_code_team_number_get(season, event_code, team_number, opts = {}) ⇒ AwardsModel

Event Awards The event awards API returns details about awards presented at a particular event in a particular season. Return values may contain either ‘teamNumber` or `person` values, and if the winner was a `person`, and that person is from a team, the `teamNumber` value might be set with their `teamNumber`. You must specify either an `eventCode` or a `teamNumber` or both. If you specify the `teamNumber` parameter, you will receive only awards where the team was listed as the winner, regardless of whether or not the `person` field is `null` or empty. If you specify only the `eventCode` field, you will receive all award listings for the requested event. If you specify both, you will receive all awards won by the `teamNumber` at the `eventCode`.

Parameters:

  • season

    Numeric year of the event from which the award listings are requested. Must be 4 digits

  • event_code

    Case insensitive alphanumeric &#x60;eventCode&#x60; of the event from which the awards are requested.

  • team_number

    &#x60;teamNumber&#x60; to search for within the results.

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

    the optional parameters

Returns:



91
92
93
94
# File 'lib/ftc_events_client/api/awards_api.rb', line 91

def v20_season_awards_event_code_team_number_get(season, event_code, team_number, opts = {})
  data, _status_code, _headers = v20_season_awards_event_code_team_number_get_with_http_info(season, event_code, team_number, opts)
  data
end

#v20_season_awards_event_code_team_number_get_with_http_info(season, event_code, team_number, opts = {}) ⇒ Array<(AwardsModel, Integer, Hash)>

Event Awards The event awards API returns details about awards presented at a particular event in a particular season. Return values may contain either &#x60;teamNumber&#x60; or &#x60;person&#x60; values, and if the winner was a &#x60;person&#x60;, and that person is from a team, the &#x60;teamNumber&#x60; value might be set with their &#x60;teamNumber&#x60;. You must specify either an &#x60;eventCode&#x60; or a &#x60;teamNumber&#x60; or both. If you specify the &#x60;teamNumber&#x60; parameter, you will receive only awards where the team was listed as the winner, regardless of whether or not the &#x60;person&#x60; field is &#x60;null&#x60; or empty. If you specify only the &#x60;eventCode&#x60; field, you will receive all award listings for the requested event. If you specify both, you will receive all awards won by the &#x60;teamNumber&#x60; at the &#x60;eventCode&#x60;.

Parameters:

  • season

    Numeric year of the event from which the award listings are requested. Must be 4 digits

  • event_code

    Case insensitive alphanumeric &#x60;eventCode&#x60; of the event from which the awards are requested.

  • team_number

    &#x60;teamNumber&#x60; to search for within the results.

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

    the optional parameters

Returns:

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

    AwardsModel data, response status code and response headers



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
143
144
145
146
147
148
149
150
151
# File 'lib/ftc_events_client/api/awards_api.rb', line 103

def v20_season_awards_event_code_team_number_get_with_http_info(season, event_code, team_number, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AwardsApi.v20_season_awards_event_code_team_number_get ...'
  end
  # verify the required parameter 'season' is set
  if @api_client.config.client_side_validation && season.nil?
    fail ArgumentError, "Missing the required parameter 'season' when calling AwardsApi.v20_season_awards_event_code_team_number_get"
  end
  # verify the required parameter 'event_code' is set
  if @api_client.config.client_side_validation && event_code.nil?
    fail ArgumentError, "Missing the required parameter 'event_code' when calling AwardsApi.v20_season_awards_event_code_team_number_get"
  end
  # verify the required parameter 'team_number' is set
  if @api_client.config.client_side_validation && team_number.nil?
    fail ArgumentError, "Missing the required parameter 'team_number' when calling AwardsApi.v20_season_awards_event_code_team_number_get"
  end
  # resource path
  local_var_path = '/v2.0/{season}/awards/{eventCode}/{teamNumber}'.sub('{' + 'season' + '}', season.to_s).sub('{' + 'eventCode' + '}', event_code.to_s).sub('{' + 'teamNumber' + '}', team_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'])

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

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

  return_type = opts[:return_type] || 'AwardsModel' 

  auth_names = opts[:auth_names] || ['basic']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AwardsApi#v20_season_awards_event_code_team_number_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#v20_season_awards_list_get(season, opts = {}) ⇒ SeasonAwardListingsModel

Award Listings The award listings API returns a listing of the various awards that can be distributed in the requested season. This is especially useful in order to avoid having to use the name field of the event awards API to know which award was won. Instead the awardId field can be matched between the two APIs.

Parameters:

  • season

    Numeric year of the event from which the award listings are requested. Must be 4 digits

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

    the optional parameters

Returns:



157
158
159
160
# File 'lib/ftc_events_client/api/awards_api.rb', line 157

def v20_season_awards_list_get(season, opts = {})
  data, _status_code, _headers = v20_season_awards_list_get_with_http_info(season, opts)
  data
end

#v20_season_awards_list_get_with_http_info(season, opts = {}) ⇒ Array<(SeasonAwardListingsModel, Integer, Hash)>

Award Listings The award listings API returns a listing of the various awards that can be distributed in the requested season. This is especially useful in order to avoid having to use the name field of the event awards API to know which award was won. Instead the awardId field can be matched between the two APIs.

Parameters:

  • season

    Numeric year of the event from which the award listings are requested. Must be 4 digits

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

    the optional parameters

Returns:

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

    SeasonAwardListingsModel data, response status code and response headers



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
# File 'lib/ftc_events_client/api/awards_api.rb', line 167

def v20_season_awards_list_get_with_http_info(season, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AwardsApi.v20_season_awards_list_get ...'
  end
  # verify the required parameter 'season' is set
  if @api_client.config.client_side_validation && season.nil?
    fail ArgumentError, "Missing the required parameter 'season' when calling AwardsApi.v20_season_awards_list_get"
  end
  # resource path
  local_var_path = '/v2.0/{season}/awards/list'.sub('{' + 'season' + '}', season.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'])

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

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

  return_type = opts[:return_type] || 'SeasonAwardListingsModel' 

  auth_names = opts[:auth_names] || ['basic']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AwardsApi#v20_season_awards_list_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#v20_season_awards_team_number_get(season, team_number, opts = {}) ⇒ AwardsModel

Event Awards The event awards API returns details about awards presented at a particular event in a particular season. Return values may contain either ‘teamNumber` or `person` values, and if the winner was a `person`, and that person is from a team, the `teamNumber` value might be set with their `teamNumber`. You must specify either an `eventCode` or a `teamNumber` or both. If you specify the `teamNumber` parameter, you will receive only awards where the team was listed as the winner, regardless of whether or not the `person` field is `null` or empty. If you specify only the `eventCode` field, you will receive all award listings for the requested event. If you specify both, you will receive all awards won by the `teamNumber` at the `eventCode`.

Parameters:

  • season

    Numeric year of the event from which the award listings are requested. Must be 4 digits

  • team_number

    &#x60;teamNumber&#x60; to search for within the results.

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

    the optional parameters

Options Hash (opts):

  • :event_code (String)

    Case insensitive alphanumeric &#x60;eventCode&#x60; of the event from which the awards are requested.

Returns:



215
216
217
218
# File 'lib/ftc_events_client/api/awards_api.rb', line 215

def v20_season_awards_team_number_get(season, team_number, opts = {})
  data, _status_code, _headers = v20_season_awards_team_number_get_with_http_info(season, team_number, opts)
  data
end

#v20_season_awards_team_number_get_with_http_info(season, team_number, opts = {}) ⇒ Array<(AwardsModel, Integer, Hash)>

Event Awards The event awards API returns details about awards presented at a particular event in a particular season. Return values may contain either &#x60;teamNumber&#x60; or &#x60;person&#x60; values, and if the winner was a &#x60;person&#x60;, and that person is from a team, the &#x60;teamNumber&#x60; value might be set with their &#x60;teamNumber&#x60;. You must specify either an &#x60;eventCode&#x60; or a &#x60;teamNumber&#x60; or both. If you specify the &#x60;teamNumber&#x60; parameter, you will receive only awards where the team was listed as the winner, regardless of whether or not the &#x60;person&#x60; field is &#x60;null&#x60; or empty. If you specify only the &#x60;eventCode&#x60; field, you will receive all award listings for the requested event. If you specify both, you will receive all awards won by the &#x60;teamNumber&#x60; at the &#x60;eventCode&#x60;.

Parameters:

  • season

    Numeric year of the event from which the award listings are requested. Must be 4 digits

  • team_number

    &#x60;teamNumber&#x60; to search for within the results.

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

    the optional parameters

Options Hash (opts):

  • :event_code (String)

    Case insensitive alphanumeric &#x60;eventCode&#x60; of the event from which the awards are requested.

Returns:

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

    AwardsModel data, response status code and response headers



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
# File 'lib/ftc_events_client/api/awards_api.rb', line 227

def v20_season_awards_team_number_get_with_http_info(season, team_number, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AwardsApi.v20_season_awards_team_number_get ...'
  end
  # verify the required parameter 'season' is set
  if @api_client.config.client_side_validation && season.nil?
    fail ArgumentError, "Missing the required parameter 'season' when calling AwardsApi.v20_season_awards_team_number_get"
  end
  # verify the required parameter 'team_number' is set
  if @api_client.config.client_side_validation && team_number.nil?
    fail ArgumentError, "Missing the required parameter 'team_number' when calling AwardsApi.v20_season_awards_team_number_get"
  end
  # resource path
  local_var_path = '/v2.0/{season}/awards/{teamNumber}'.sub('{' + 'season' + '}', season.to_s).sub('{' + 'teamNumber' + '}', team_number.to_s)

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'eventCode'] = opts[:'event_code'] if !opts[:'event_code'].nil?

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

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

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

  return_type = opts[:return_type] || 'AwardsModel' 

  auth_names = opts[:auth_names] || ['basic']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AwardsApi#v20_season_awards_team_number_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end