kuon.bitskins.api.interfaces.inventory   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
wmc 3
eloc 14
dl 0
loc 44
ccs 6
cts 12
cp 0.5
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A IInventory.get_my_inventory() 0 20 2
A IInventory.__init__() 0 7 1
1
#!/usr/bin/python
2
# -*- coding: utf-8 -*-
3 1
from kuon.api_response import APIResponse
4 1
from kuon.bitskins import BitSkins
5 1
from kuon.common import *
6
7
8 1
class IInventory(BitSkins):
9
    """Implementation of the API methods related to the inventory of the user on BitSkins
10
11
    common not self explanatory keys:
12
        app id:
13
            The Steam AppID of the game which owns this item (e.g. 730 for CS:GO, 440 for TF2, 570 for Dota 2)
14
    """
15
16 1
    def __init__(self, *args, **kwargs) -> None:
17
        """Initializing function
18
19
        :type args: list
20
        :type kwargs: dict
21
        """
22
        super().__init__(*args, **kwargs)
23
24 1
    def get_my_inventory(self, app_id: int = CommonSteamGames.APP_ID_CSGO, page: int = None) -> APIResponse:
25
        """GetAccountInventory v1 implementation
26
        https://bitskins.com/api/#get_my_inventory
27
28
        Returns the newest 5000 items, use pages to navigate through more
29
30
        :type app_id: int
31
        :type page: int
32
        :return:
33
        """
34
        api_url = "https://bitskins.com/api/v1/get_my_inventory/"
35
36
        payload = {
37
            'app_id': str(app_id)
38
        }
39
40
        if page:
41
            payload['page'] = int(page)
42
43
        return self.api_request(api_url=api_url, params=payload)
44