Class: FtcEventsClient::ScheduleApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ScheduleApi



16
17
18
# File 'lib/ftc_events_client/api/schedule_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/schedule_api.rb', line 14

def api_client
  @api_client
end

Instance Method Details

#v20_season_schedule_event_code_get(season, event_code, opts = {}) ⇒ EventScheduleModelVersion2

Event Schedule The schedule API returns the match schedule for the desired tournament level of a particular event in a particular season. You must also specify a ‘tournamentLevel` from which to return the results. Alternately, you can specify a `teamNumber` to filter the results to only those in which a particular team is participating. There is no validation that the `teamNumber` you request is actually competing at the event, if they are not, the response will be empty. You can also specify the parameters together, but cannot make a request without at least one of the two.

Options Hash (opts):

  • :tournament_level (String)

    Required tournamentLevel of desired score details. (default to 0)

  • :team_number (Integer)

    `teamNumber` to search for within the schedule. Only returns matches in which the requested team participated. (default to 0)

  • :start (Integer)

    `start` match number for subset of results to return (inclusive). (default to 0)

  • :_end (Integer)

    `end` match number for subset of results to return (inclusive). (default to 999)



29
30
31
32
# File 'lib/ftc_events_client/api/schedule_api.rb', line 29

def v20_season_schedule_event_code_get(season, event_code, opts = {})
  data, _status_code, _headers = v20_season_schedule_event_code_get_with_http_info(season, event_code, opts)
  data
end

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

Event Schedule The schedule API returns the match schedule for the desired tournament level of a particular event in a particular season. You must also specify a &#x60;tournamentLevel&#x60; from which to return the results. Alternately, you can specify a &#x60;teamNumber&#x60; to filter the results to only those in which a particular team is participating. There is no validation that the &#x60;teamNumber&#x60; you request is actually competing at the event, if they are not, the response will be empty. You can also specify the parameters together, but cannot make a request without at least one of the two.

Options Hash (opts):

  • :tournament_level (String)

    Required tournamentLevel of desired score details.

  • :team_number (Integer)

    &#x60;teamNumber&#x60; to search for within the schedule. Only returns matches in which the requested team participated.

  • :start (Integer)

    &#x60;start&#x60; match number for subset of results to return (inclusive).

  • :_end (Integer)

    &#x60;end&#x60; match number for subset of results to return (inclusive).



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
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/ftc_events_client/api/schedule_api.rb', line 44

def v20_season_schedule_event_code_get_with_http_info(season, event_code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ScheduleApi.v20_season_schedule_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 ScheduleApi.v20_season_schedule_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 ScheduleApi.v20_season_schedule_event_code_get"
  end
  if @api_client.config.client_side_validation && opts[:'tournament_level'] && !['qual', 'playoff'].include?(opts[:'tournament_level'])
    fail ArgumentError, 'invalid value for "tournament_level", must be one of qual, playoff'
  end
  # resource path
  local_var_path = '/v2.0/{season}/schedule/{eventCode}'.sub('{' + 'season' + '}', season.to_s).sub('{' + 'eventCode' + '}', event_code.to_s)

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'tournamentLevel'] = opts[:'tournament_level'] if !opts[:'tournament_level'].nil?
  query_params[:'teamNumber'] = opts[:'team_number'] if !opts[:'team_number'].nil?
  query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
  query_params[:'end'] = opts[:'_end'] if !opts[:'_end'].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] || 'EventScheduleModelVersion2' 

  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: ScheduleApi#v20_season_schedule_event_code_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#v20_season_schedule_event_code_tournament_level_hybrid_get(season, event_code, tournament_level, opts = {}) ⇒ EventScheduleHybridModelVersion2

Hybrid Schedule The schedule API returns the match schedule for the desired tournament level of a particular event in a particular season in the hybrid format. When a match has been played, the match result related details will be filled. When a match has not yet happened, match result related fields will be null. All parameters, except start and end, are required for the hybrid schedule.

Options Hash (opts):

  • :start (Integer)

    &#x60;start&#x60; match number for subset of results to return (inclusive). (default to 0)

  • :_end (Integer)

    &#x60;end&#x60; match number for subset of results to return (inclusive). (default to 999)



105
106
107
108
# File 'lib/ftc_events_client/api/schedule_api.rb', line 105

def v20_season_schedule_event_code_tournament_level_hybrid_get(season, event_code, tournament_level, opts = {})
  data, _status_code, _headers = v20_season_schedule_event_code_tournament_level_hybrid_get_with_http_info(season, event_code, tournament_level, opts)
  data
end

#v20_season_schedule_event_code_tournament_level_hybrid_get_with_http_info(season, event_code, tournament_level, opts = {}) ⇒ Array<(EventScheduleHybridModelVersion2, Integer, Hash)>

Hybrid Schedule The schedule API returns the match schedule for the desired tournament level of a particular event in a particular season in the hybrid format. When a match has been played, the match result related details will be filled. When a match has not yet happened, match result related fields will be null. All parameters, except start and end, are required for the hybrid schedule.

Options Hash (opts):

  • :start (Integer)

    &#x60;start&#x60; match number for subset of results to return (inclusive).

  • :_end (Integer)

    &#x60;end&#x60; match number for subset of results to return (inclusive).



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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/ftc_events_client/api/schedule_api.rb', line 119

def v20_season_schedule_event_code_tournament_level_hybrid_get_with_http_info(season, event_code, tournament_level, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ScheduleApi.v20_season_schedule_event_code_tournament_level_hybrid_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 ScheduleApi.v20_season_schedule_event_code_tournament_level_hybrid_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 ScheduleApi.v20_season_schedule_event_code_tournament_level_hybrid_get"
  end
  # verify the required parameter 'tournament_level' is set
  if @api_client.config.client_side_validation && tournament_level.nil?
    fail ArgumentError, "Missing the required parameter 'tournament_level' when calling ScheduleApi.v20_season_schedule_event_code_tournament_level_hybrid_get"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['qual', 'playoff'].include?(tournament_level)
    fail ArgumentError, "invalid value for 'tournament_level', must be one of qual, playoff"
  end
  # resource path
  local_var_path = '/v2.0/{season}/schedule/{eventCode}/{tournamentLevel}/hybrid'.sub('{' + 'season' + '}', season.to_s).sub('{' + 'eventCode' + '}', event_code.to_s).sub('{' + 'tournamentLevel' + '}', tournament_level.to_s)

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
  query_params[:'end'] = opts[:'_end'] if !opts[:'_end'].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] || 'EventScheduleHybridModelVersion2' 

  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: ScheduleApi#v20_season_schedule_event_code_tournament_level_hybrid_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end