Completed
Push — master ( dd2f8f...d34d79 )
by Steffen
03:32
created

IInventory.get_inventory_on_sale()   B

Complexity

Conditions 4

Size

Total Lines 34

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 2
Metric Value
cc 4
c 2
b 0
f 2
dl 0
loc 34
rs 8.5806
1
#!/usr/bin/python
2
# -*- coding: utf-8 -*-
3
from kuon.api_response import APIResponse
4
from kuon.bitskins import BitSkins
5
from kuon.common import *
6
7
8
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
    def __init__(self, *args, **kwargs):
17
        """Initializing function"""
18
        super().__init__(*args, **kwargs)
19
20
    def get_my_inventory(self, app_id=CommonSteamGames.APP_ID_CSGO, page=None) -> APIResponse:
21
        """GetAccountInventory v1 implementation
22
        https://bitskins.com/api/#get_my_inventory
23
24
        Returns the newest 5000 items, use pages to navigate through more
25
26
        :param app_id:
27
        :param page:
28
        :return:
29
        """
30
        api_url = "https://bitskins.com/api/v1/get_my_inventory/"
31
32
        payload = {
33
            'app_id': str(app_id)
34
        }
35
36
        if page:
37
            payload['page'] = int(page)
38
39
        return self.api_request(api_url=api_url, params=payload)
40