kuon.steam.steam   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
eloc 13
dl 0
loc 33
ccs 0
cts 12
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A Steam.api_request() 0 16 3
A Steam.__init__() 0 7 1
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