Class: FtcEventsClient::AllianceSelectionApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AllianceSelectionApi

Returns a new instance of AllianceSelectionApi.



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

def api_client
  @api_client
end

Instance Method Details

#v20_season_alliances_event_code_get(season, event_code, opts = {}) ⇒ AllianceSelectionModelVersion2

Event Alliances The alliances API returns details about alliance selection at a particular event in a particular season.

Parameters:

  • season

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

  • event_code

    Case insensitive alphanumeric `eventCode` of the event from which the alliance selection results are requested. Must be at least 3 characters.

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

    the optional parameters

Returns:



25
26
27
28
# File 'lib/ftc_events_client/api/alliance_selection_api.rb', line 25

def v20_season_alliances_event_code_get(season, event_code, opts = {})
  data, _status_code, _headers = v20_season_alliances_event_code_get_with_http_info(season, event_code, opts)
  data
end

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

Event Alliances The alliances API returns details about alliance selection at a particular event in a particular season.

Parameters:

  • season

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

  • event_code

    Case insensitive alphanumeric &#x60;eventCode&#x60; of the event from which the alliance selection results are requested. Must be at least 3 characters.

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

    the optional parameters

Returns:



36
37
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
# File 'lib/ftc_events_client/api/alliance_selection_api.rb', line 36

def v20_season_alliances_event_code_get_with_http_info(season, event_code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AllianceSelectionApi.v20_season_alliances_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 AllianceSelectionApi.v20_season_alliances_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 AllianceSelectionApi.v20_season_alliances_event_code_get"
  end
  # resource path
  local_var_path = '/v2.0/{season}/alliances/{eventCode}'.sub('{' + 'season' + '}', season.to_s).sub('{' + 'eventCode' + '}', event_code.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] || 'AllianceSelectionModelVersion2' 

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

#v20_season_alliances_event_code_selection_get(season, event_code, opts = {}) ⇒ AllianceSelectionDetailModel

Alliance Selection Details This returns the in-order details of each step through the alliance selection process for a particular event.

Parameters:

  • season

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

  • event_code

    Case insensitive alphanumeric &#x60;eventCode&#x60; of the event from which the alliance selection results are requested. Must be at least 3 characters.

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

    the optional parameters

Returns:



87
88
89
90
# File 'lib/ftc_events_client/api/alliance_selection_api.rb', line 87

def v20_season_alliances_event_code_selection_get(season, event_code, opts = {})
  data, _status_code, _headers = v20_season_alliances_event_code_selection_get_with_http_info(season, event_code, opts)
  data
end

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

Alliance Selection Details This returns the in-order details of each step through the alliance selection process for a particular event.

Parameters:

  • season

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

  • event_code

    Case insensitive alphanumeric &#x60;eventCode&#x60; of the event from which the alliance selection results are requested. Must be at least 3 characters.

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

    the optional parameters

Returns:



98
99
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_events_client/api/alliance_selection_api.rb', line 98

def v20_season_alliances_event_code_selection_get_with_http_info(season, event_code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AllianceSelectionApi.v20_season_alliances_event_code_selection_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 AllianceSelectionApi.v20_season_alliances_event_code_selection_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 AllianceSelectionApi.v20_season_alliances_event_code_selection_get"
  end
  # resource path
  local_var_path = '/v2.0/{season}/alliances/{eventCode}/selection'.sub('{' + 'season' + '}', season.to_s).sub('{' + 'eventCode' + '}', event_code.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] || 'AllianceSelectionDetailModel' 

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