-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path__init__.py
More file actions
33 lines (24 loc) · 856 Bytes
/
__init__.py
File metadata and controls
33 lines (24 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import logging
from urllib.parse import urlencode
log = logging.getLogger("socketdev")
class Fixes:
def __init__(self, api):
self.api = api
def get(self, org_slug: str, **query_params) -> dict:
"""
Get available fixes for an organization.
Args:
org_slug: Organization slug
**query_params: Optional query parameters for filtering
Returns:
dict containing available fixes
"""
path = f"orgs/{org_slug}/fixes"
if query_params:
path += "?" + urlencode(query_params)
response = self.api.do_request(path=path)
if response.status_code == 200:
return response.json()
log.error(f"Error getting fixes: {response.status_code}")
log.error(response.text)
return {}