Completed
Push — master ( d28616...57afb8 )
by Steffen
02:41
created

kuon.steam.steam.Steam.get_my_inventory()   A

Complexity

Conditions 1

Size

Total Lines 5
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 5
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
nop 1
crap 2
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