Passed
Branch master (4fbfcc)
by Steffen
01:26 queued 11s
created

IPricing.get_all_item_prices()   A

Complexity

Conditions 1

Size

Total Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
c 1
b 0
f 1
dl 0
loc 16
rs 9.4285
1
#!/usr/bin/python
2
# -*- coding: utf-8 -*-
3
4
from kuon.bitskins import BitSkins
5
from kuon.bitskins.api.exceptions import *
6
from kuon.common import *
7
8
9
class IPricing(BitSkins):
10
    """Implementation of the API methods related to the pricing of items on BitSkins
11
12
    common not self explanatory keys:
13
        app id:
14
            The Steam AppID of the game which owns this item (e.g. 730 for CS:GO, 440 for TF2, 570 for Dota 2)
15
    """
16
17
    def __init__(self, *args, **kwargs):
18
        """Initializing function"""
19
        super().__init__(*args, **kwargs)
20
21
    def get_all_item_prices(self, app_id=CommonSteamGames.APP_ID_CSGO):
22
        """GetAllItemPrices v1 implementation
23
        https://bitskins.com/api/#get_all_item_prices
24
25
        Returns the suggested prices for every item on the market
26
27
        :param app_id:
28
        :return:
29
        """
30
        api_url = "https://bitskins.com/api/v1/get_all_item_prices/"
31
32
        payload = {
33
            'app_id': str(app_id)
34
        }
35
36
        return self.api_request(api_url=api_url, params=payload)
37
38
    def get_price_data_for_items_on_sale(self, app_id=CommonSteamGames.APP_ID_CSGO):
39
        """GetMarketData v1 implementation
40
        https://bitskins.com/api/#get_price_data_for_items_on_sale
41
42
        Returns market data regarding how many items are on the market and highest/lowest price for every item
43
44
        :param app_id:
45
        :return:
46
        """
47
        api_url = "https://bitskins.com/api/v1/get_price_data_for_items_on_sale/"
48
49
        payload = {
50
            'app_id': str(app_id)
51
        }
52
53
        return self.api_request(api_url=api_url, params=payload)
54