Adapter
The Adapter Class is responsible for handling the HTTP requests to the Valorant API.
- class valopy.adapter.Adapter(api_key, redact_header=True)[source]
Bases:
objectAdapter for making HTTP requests to the Valorant API.
This adapter provides automatic model typing and elegant error handling for all Valorant API endpoints.
- async get(endpoint_path, model_class, params=None)[source]
Make a GET request to the Valorant API.
- Parameters:
endpoint_path (class:str) – The formatted API endpoint path to call.
model_class (Type[
ValoPyModel]) – The dataclass type to deserialize the response intoparams (Optional[class:dict]) – Query parameters to include in the request, by default None
- Returns:
The result of the GET request.
- Return type:
Result
- async post(endpoint_path, model_class, params=None)[source]
Make a POST request to the Valorant API.
- Parameters:
endpoint_path (class:str) – The formatted API endpoint path to call.
model_class (Type[
ValoPyModel]) – The dataclass type to deserialize the response intoparams (Optional[class:dict]) – Query parameters to include in the request, by default None
- Returns:
The result of the POST request.
- Return type:
Result