Total Complexity | 4 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | #!/usr/bin/python |
||
2 | # -*- coding: utf-8 -*- |
||
3 | from kuon.api_response import APIResponse |
||
4 | from kuon.steam.steam_login import SteamLogin |
||
5 | |||
6 | |||
7 | class Steam(SteamLogin): |
||
8 | |||
9 | def __init__(self, *args, **kwargs): |
||
10 | """Initializing function |
||
11 | |||
12 | :param args: |
||
13 | :param kwargs: |
||
14 | """ |
||
15 | super().__init__(*args, **kwargs) |
||
16 | |||
17 | def api_request(self, api_url: str, params: dict = None, headers: dict = None) -> APIResponse: |
||
18 | """Insert API key and OTP code to the payload and return the parsed response |
||
19 | |||
20 | :type api_url: str |
||
21 | :type params: dict |
||
22 | :type headers: dict |
||
23 | :return: |
||
24 | """ |
||
25 | if headers is None: |
||
26 | headers = {} |
||
27 | if params is None: |
||
28 | params = {} |
||
29 | |||
30 | link = self._session.get(url=api_url, params=params, headers=headers) |
||
31 | |||
32 | return APIResponse(link.text) |
||
33 |