|
| 1 | +# coding: utf-8 |
| 2 | + |
| 3 | +""" |
| 4 | + College Basketball Data API |
| 5 | +
|
| 6 | + This API is in limited Beta for Patreon subscribers. It may have bugs and is subject to changes. API keys can be acquired from the CollegeFootballData.com website. |
| 7 | +
|
| 8 | + The version of the OpenAPI document: 1.14.0 |
| 9 | + |
| 10 | + Generated by OpenAPI Generator (https://openapi-generator.tech) |
| 11 | +
|
| 12 | + Do not edit the class manually. |
| 13 | +""" # noqa: E501 |
| 14 | + |
| 15 | + |
| 16 | +import re # noqa: F401 |
| 17 | +import io |
| 18 | +import warnings |
| 19 | + |
| 20 | +from pydantic import validate_arguments, ValidationError |
| 21 | + |
| 22 | +from typing_extensions import Annotated |
| 23 | +from pydantic import Field, StrictInt, StrictStr |
| 24 | + |
| 25 | +from typing import List, Optional |
| 26 | + |
| 27 | +from cbbd.models.recruit import Recruit |
| 28 | + |
| 29 | +from cbbd.api_client import ApiClient |
| 30 | +from cbbd.api_response import ApiResponse |
| 31 | +from cbbd.exceptions import ( # noqa: F401 |
| 32 | + ApiTypeError, |
| 33 | + ApiValueError |
| 34 | +) |
| 35 | + |
| 36 | + |
| 37 | +class RecruitingApi: |
| 38 | + """NOTE: This class is auto generated by OpenAPI Generator |
| 39 | + Ref: https://openapi-generator.tech |
| 40 | +
|
| 41 | + Do not edit the class manually. |
| 42 | + """ |
| 43 | + |
| 44 | + def __init__(self, api_client=None) -> None: |
| 45 | + if api_client is None: |
| 46 | + api_client = ApiClient.get_default() |
| 47 | + self.api_client = api_client |
| 48 | + |
| 49 | + @validate_arguments |
| 50 | + def get_recruits(self, year : Annotated[Optional[StrictInt], Field(description="Optional year filter")] = None, team : Annotated[Optional[StrictStr], Field(description="Optional college team filter")] = None, conference : Annotated[Optional[StrictStr], Field(description="Optional college conference filter")] = None, position : Annotated[Optional[StrictStr], Field(description="Optional position filter")] = None, **kwargs) -> List[Recruit]: # noqa: E501 |
| 51 | + """get_recruits # noqa: E501 |
| 52 | +
|
| 53 | + Retrieves historical composite player recruiting ranking and ratings # noqa: E501 |
| 54 | + This method makes a synchronous HTTP request by default. To make an |
| 55 | + asynchronous HTTP request, please pass async_req=True |
| 56 | +
|
| 57 | + >>> thread = api.get_recruits(year, team, conference, position, async_req=True) |
| 58 | + >>> result = thread.get() |
| 59 | +
|
| 60 | + :param year: Optional year filter |
| 61 | + :type year: int |
| 62 | + :param team: Optional college team filter |
| 63 | + :type team: str |
| 64 | + :param conference: Optional college conference filter |
| 65 | + :type conference: str |
| 66 | + :param position: Optional position filter |
| 67 | + :type position: str |
| 68 | + :param async_req: Whether to execute the request asynchronously. |
| 69 | + :type async_req: bool, optional |
| 70 | + :param _request_timeout: timeout setting for this request. |
| 71 | + If one number provided, it will be total request |
| 72 | + timeout. It can also be a pair (tuple) of |
| 73 | + (connection, read) timeouts. |
| 74 | + :return: Returns the result object. |
| 75 | + If the method is called asynchronously, |
| 76 | + returns the request thread. |
| 77 | + :rtype: List[Recruit] |
| 78 | + """ |
| 79 | + kwargs['_return_http_data_only'] = True |
| 80 | + if '_preload_content' in kwargs: |
| 81 | + message = "Error! Please call the get_recruits_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 |
| 82 | + raise ValueError(message) |
| 83 | + return self.get_recruits_with_http_info(year, team, conference, position, **kwargs) # noqa: E501 |
| 84 | + |
| 85 | + @validate_arguments |
| 86 | + def get_recruits_with_http_info(self, year : Annotated[Optional[StrictInt], Field(description="Optional year filter")] = None, team : Annotated[Optional[StrictStr], Field(description="Optional college team filter")] = None, conference : Annotated[Optional[StrictStr], Field(description="Optional college conference filter")] = None, position : Annotated[Optional[StrictStr], Field(description="Optional position filter")] = None, **kwargs) -> ApiResponse: # noqa: E501 |
| 87 | + """get_recruits # noqa: E501 |
| 88 | +
|
| 89 | + Retrieves historical composite player recruiting ranking and ratings # noqa: E501 |
| 90 | + This method makes a synchronous HTTP request by default. To make an |
| 91 | + asynchronous HTTP request, please pass async_req=True |
| 92 | +
|
| 93 | + >>> thread = api.get_recruits_with_http_info(year, team, conference, position, async_req=True) |
| 94 | + >>> result = thread.get() |
| 95 | +
|
| 96 | + :param year: Optional year filter |
| 97 | + :type year: int |
| 98 | + :param team: Optional college team filter |
| 99 | + :type team: str |
| 100 | + :param conference: Optional college conference filter |
| 101 | + :type conference: str |
| 102 | + :param position: Optional position filter |
| 103 | + :type position: str |
| 104 | + :param async_req: Whether to execute the request asynchronously. |
| 105 | + :type async_req: bool, optional |
| 106 | + :param _preload_content: if False, the ApiResponse.data will |
| 107 | + be set to none and raw_data will store the |
| 108 | + HTTP response body without reading/decoding. |
| 109 | + Default is True. |
| 110 | + :type _preload_content: bool, optional |
| 111 | + :param _return_http_data_only: response data instead of ApiResponse |
| 112 | + object with status code, headers, etc |
| 113 | + :type _return_http_data_only: bool, optional |
| 114 | + :param _request_timeout: timeout setting for this request. If one |
| 115 | + number provided, it will be total request |
| 116 | + timeout. It can also be a pair (tuple) of |
| 117 | + (connection, read) timeouts. |
| 118 | + :param _request_auth: set to override the auth_settings for an a single |
| 119 | + request; this effectively ignores the authentication |
| 120 | + in the spec for a single request. |
| 121 | + :type _request_auth: dict, optional |
| 122 | + :type _content_type: string, optional: force content-type for the request |
| 123 | + :return: Returns the result object. |
| 124 | + If the method is called asynchronously, |
| 125 | + returns the request thread. |
| 126 | + :rtype: tuple(List[Recruit], status_code(int), headers(HTTPHeaderDict)) |
| 127 | + """ |
| 128 | + |
| 129 | + _params = locals() |
| 130 | + |
| 131 | + _all_params = [ |
| 132 | + 'year', |
| 133 | + 'team', |
| 134 | + 'conference', |
| 135 | + 'position' |
| 136 | + ] |
| 137 | + _all_params.extend( |
| 138 | + [ |
| 139 | + 'async_req', |
| 140 | + '_return_http_data_only', |
| 141 | + '_preload_content', |
| 142 | + '_request_timeout', |
| 143 | + '_request_auth', |
| 144 | + '_content_type', |
| 145 | + '_headers' |
| 146 | + ] |
| 147 | + ) |
| 148 | + |
| 149 | + # validate the arguments |
| 150 | + for _key, _val in _params['kwargs'].items(): |
| 151 | + if _key not in _all_params: |
| 152 | + raise ApiTypeError( |
| 153 | + "Got an unexpected keyword argument '%s'" |
| 154 | + " to method get_recruits" % _key |
| 155 | + ) |
| 156 | + _params[_key] = _val |
| 157 | + del _params['kwargs'] |
| 158 | + |
| 159 | + _collection_formats = {} |
| 160 | + |
| 161 | + # process the path parameters |
| 162 | + _path_params = {} |
| 163 | + |
| 164 | + # process the query parameters |
| 165 | + _query_params = [] |
| 166 | + if _params.get('year') is not None: # noqa: E501 |
| 167 | + _query_params.append(('year', _params['year'])) |
| 168 | + |
| 169 | + if _params.get('team') is not None: # noqa: E501 |
| 170 | + _query_params.append(('team', _params['team'])) |
| 171 | + |
| 172 | + if _params.get('conference') is not None: # noqa: E501 |
| 173 | + _query_params.append(('conference', _params['conference'])) |
| 174 | + |
| 175 | + if _params.get('position') is not None: # noqa: E501 |
| 176 | + _query_params.append(('position', _params['position'])) |
| 177 | + |
| 178 | + # process the header parameters |
| 179 | + _header_params = dict(_params.get('_headers', {})) |
| 180 | + # process the form parameters |
| 181 | + _form_params = [] |
| 182 | + _files = {} |
| 183 | + # process the body parameter |
| 184 | + _body_params = None |
| 185 | + # set the HTTP header `Accept` |
| 186 | + _header_params['Accept'] = self.api_client.select_header_accept( |
| 187 | + ['application/json']) # noqa: E501 |
| 188 | + |
| 189 | + # authentication setting |
| 190 | + _auth_settings = ['apiKey'] # noqa: E501 |
| 191 | + |
| 192 | + _response_types_map = { |
| 193 | + '200': "List[Recruit]", |
| 194 | + } |
| 195 | + |
| 196 | + return self.api_client.call_api( |
| 197 | + '/recruiting/players', 'GET', |
| 198 | + _path_params, |
| 199 | + _query_params, |
| 200 | + _header_params, |
| 201 | + body=_body_params, |
| 202 | + post_params=_form_params, |
| 203 | + files=_files, |
| 204 | + response_types_map=_response_types_map, |
| 205 | + auth_settings=_auth_settings, |
| 206 | + async_req=_params.get('async_req'), |
| 207 | + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 |
| 208 | + _preload_content=_params.get('_preload_content', True), |
| 209 | + _request_timeout=_params.get('_request_timeout'), |
| 210 | + collection_formats=_collection_formats, |
| 211 | + _request_auth=_params.get('_request_auth')) |
0 commit comments