Total Complexity | 3 |
Total Lines | 57 |
Duplicated Lines | 0 % |
Coverage | 50% |
Changes | 0 |
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 IPricing(BitSkins): |
|
9 | """Implementation of the API methods related to the pricing of items 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_all_item_prices(self, app_id: int = CommonSteamGames.APP_ID_CSGO) -> APIResponse: |
|
25 | """GetAllItemPrices v1 implementation |
||
26 | https://bitskins.com/api/#get_all_item_prices |
||
27 | |||
28 | Returns the suggested prices for every item on the market |
||
29 | |||
30 | :type app_id: int |
||
31 | :return: |
||
32 | """ |
||
33 | api_url = "https://bitskins.com/api/v1/get_all_item_prices/" |
||
34 | |||
35 | payload = { |
||
36 | 'app_id': str(app_id) |
||
37 | } |
||
38 | |||
39 | return self.api_request(api_url=api_url, params=payload) |
||
40 | |||
41 | 1 | def get_price_data_for_items_on_sale(self, app_id: int = CommonSteamGames.APP_ID_CSGO) -> APIResponse: |
|
42 | """GetMarketData v1 implementation |
||
43 | https://bitskins.com/api/#get_price_data_for_items_on_sale |
||
44 | |||
45 | Returns market data regarding how many items are on the market and highest/lowest price for every item |
||
46 | |||
47 | :type app_id: int |
||
48 | :return: |
||
49 | """ |
||
50 | api_url = "https://bitskins.com/api/v1/get_price_data_for_items_on_sale/" |
||
51 | |||
52 | payload = { |
||
53 | 'app_id': str(app_id) |
||
54 | } |
||
55 | |||
56 | return self.api_request(api_url=api_url, params=payload) |
||
57 |