guardcoreapi 0.2.2.dev20251025224637__py3-none-any.whl → 0.2.2.dev20251025231248__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of guardcoreapi might be problematic. Click here for more details.

guardcoreapi/manager.py CHANGED
@@ -18,6 +18,7 @@ from .types import (
18
18
  ServiceCreate,
19
19
  ServiceResponse,
20
20
  ServiceUpdate,
21
+ StatsResponse,
21
22
  )
22
23
 
23
24
 
@@ -379,3 +380,24 @@ class GuardCoreApi:
379
380
  return await RequestCore.get(
380
381
  f"/api/guards/{secret}",
381
382
  )
383
+
384
+ @staticmethod
385
+ async def get_guard_info(secret: str) -> SubscriptionResponse:
386
+ return await RequestCore.get(
387
+ f"/api/guards/{secret}/info",
388
+ )
389
+
390
+ @staticmethod
391
+ async def get_guard_usage_logs(secret: str) -> SubscriptionUsageLogsResponse:
392
+ return await RequestCore.get(
393
+ f"/api/guards/{secret}/usages",
394
+ response_model=SubscriptionUsageLogsResponse,
395
+ )
396
+
397
+ @staticmethod
398
+ async def get_stats(api_key: str) -> StatsResponse:
399
+ return await RequestCore.get(
400
+ "/api/stats",
401
+ headers=RequestCore.generate_headers(api_key),
402
+ response_model=StatsResponse,
403
+ )
@@ -27,7 +27,7 @@ from .nodes import (
27
27
  NodeStatsResponse,
28
28
  )
29
29
  from .services import ServiceResponse, ServiceCreate, ServiceUpdate
30
-
30
+ from .stats import StatsResponse
31
31
 
32
32
  __all__ = [
33
33
  "AdminPlaceHolderCategory",
@@ -55,4 +55,5 @@ __all__ = [
55
55
  "ServiceResponse",
56
56
  "ServiceCreate",
57
57
  "ServiceUpdate",
58
+ "StatsResponse",
58
59
  ]
@@ -0,0 +1,12 @@
1
+ from pydantic import BaseModel
2
+
3
+
4
+ class StatsResponse(BaseModel):
5
+ total_subscription: int
6
+ active_subscription: int
7
+ inactive_subscription: int
8
+
9
+ hour_usages: int
10
+ today_usages: int
11
+ yesterday_usages: int
12
+ total_usages: int
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: guardcoreapi
3
- Version: 0.2.2.dev20251025224637
3
+ Version: 0.2.2.dev20251025231248
4
4
  Summary: Guard Management Core Api Python lib
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -1,15 +1,16 @@
1
1
  guardcoreapi/__init__.py,sha256=GohrmPFFH_Bfa5Ex3n0u-c4RjU47KbmoBYi38k8S_NI,62
2
- guardcoreapi/manager.py,sha256=TWmfxZx2zlWQrH0vKQ5WqJox-_gybAM37ZE992MLSOE,12886
2
+ guardcoreapi/manager.py,sha256=TdxYPO3gE-uXESuDWXRofFqnVtj83-rmN7PUQ3jh9bA,13582
3
3
  guardcoreapi/core/__init__.py,sha256=QJhZCPZui7zDpnQJbmWZsEijiAAP3rglUZb_w6E61_M,381
4
4
  guardcoreapi/core/exceptions.py,sha256=KbmdV8p31gSlKXjmJoW3lR9wGOQSvaaZKl9oGb7qlFI,555
5
5
  guardcoreapi/core/request.py,sha256=jDz2DXgFvJFTUhd_ykcNFsIYTxcKawR24qGKrbrrq40,4297
6
- guardcoreapi/types/__init__.py,sha256=AtHWIIQoso_L5jb6nozhNBs6_0Tm2Zvvj8VvaH5eKwg,1275
6
+ guardcoreapi/types/__init__.py,sha256=t07YOFdjubkHZqHrn_nlaEvCPdhiJUFxyFyZt8DNwJU,1328
7
7
  guardcoreapi/types/admins.py,sha256=YaA0dxIkcTm_a0LfaQ7gVYedhFQVI6hbHK6WIXAIAVE,2851
8
8
  guardcoreapi/types/nodes.py,sha256=U4uCTm2TYETysceN_5ap4dP2if6sIUyEnavCvzlNpUo,1075
9
9
  guardcoreapi/types/services.py,sha256=3lpP76Q9iij2zSEXutDg1IatIslLokQ-DNPvSdckRCQ,369
10
+ guardcoreapi/types/stats.py,sha256=yzSeJU39S-2djs6mNoLkSf3K2RDE994buu7T04-wDXQ,245
10
11
  guardcoreapi/types/subscriptions.py,sha256=HS8z3zhmS8RYa-D4CEGEt5WJ_SDSJ_dIW41uxwgdZ6I,1388
11
- guardcoreapi-0.2.2.dev20251025224637.dist-info/licenses/LICENSE,sha256=BPTJfvegcaek6E2PQ2rViLbxbfB1AbjIauxVQWo5Od4,1062
12
- guardcoreapi-0.2.2.dev20251025224637.dist-info/METADATA,sha256=yk8oWh-SnHm-k7nYx5VnOuVllfK3A-xZ_77XMIjlr2A,291
13
- guardcoreapi-0.2.2.dev20251025224637.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
- guardcoreapi-0.2.2.dev20251025224637.dist-info/top_level.txt,sha256=ArZR_iOVG8XvUCTMHioVgKI8CkJOX_yH8t7898OXBF8,13
15
- guardcoreapi-0.2.2.dev20251025224637.dist-info/RECORD,,
12
+ guardcoreapi-0.2.2.dev20251025231248.dist-info/licenses/LICENSE,sha256=BPTJfvegcaek6E2PQ2rViLbxbfB1AbjIauxVQWo5Od4,1062
13
+ guardcoreapi-0.2.2.dev20251025231248.dist-info/METADATA,sha256=rrZ2As498ODKmofXvhuzEAA3a3VxE0IfYhmxhaRw3eM,291
14
+ guardcoreapi-0.2.2.dev20251025231248.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
+ guardcoreapi-0.2.2.dev20251025231248.dist-info/top_level.txt,sha256=ArZR_iOVG8XvUCTMHioVgKI8CkJOX_yH8t7898OXBF8,13
16
+ guardcoreapi-0.2.2.dev20251025231248.dist-info/RECORD,,