11
11
from io import BufferedReader , BytesIO
12
12
from pathlib import Path
13
13
from typing import Any , Dict , List , Optional , Tuple , Union
14
- from urllib3 .response import HTTPResponse
15
14
16
15
import requests
17
- from groundlight .internalapi import _generate_request_id
18
16
from groundlight_openapi_client .api .actions_api import ActionsApi
19
17
from groundlight_openapi_client .api .detector_groups_api import DetectorGroupsApi
20
18
from groundlight_openapi_client .api .detector_reset_api import DetectorResetApi
49
47
Rule ,
50
48
WebhookAction ,
51
49
)
50
+ from urllib3 .response import HTTPResponse
52
51
53
52
from groundlight .images import parse_supported_image_types
53
+ from groundlight .internalapi import _generate_request_id
54
54
from groundlight .optional_imports import Image , np
55
55
56
56
from .client import DEFAULT_REQUEST_TIMEOUT , Groundlight , GroundlightClientError , logger
@@ -1061,7 +1061,7 @@ def get_raw_headers(self) -> dict:
1061
1061
# We generate a unique request ID client-side for each request
1062
1062
headers ["X-Request-Id" ] = _generate_request_id ()
1063
1063
headers ["User-Agent" ] = self .api_client .default_headers ["User-Agent" ]
1064
- headers [' Accept' ] = ' application/json'
1064
+ headers [" Accept" ] = " application/json"
1065
1065
return headers
1066
1066
1067
1067
def make_raw_rest_request (self , method : str , endpoint : str , body : Union [dict , None ] = None ) -> dict :
@@ -1081,13 +1081,13 @@ def make_raw_rest_request(self, method: str, endpoint: str, body: Union[dict, No
1081
1081
return response .json ()
1082
1082
1083
1083
def make_generic_api_request (
1084
- self ,
1085
- endpoint : str ,
1086
- method : str ,
1087
- headers : dict = None ,
1088
- body : Union [dict , None ] = None ,
1089
- files = None ,
1090
- ) -> HTTPResponse :
1084
+ self ,
1085
+ endpoint : str ,
1086
+ method : str ,
1087
+ headers : dict = None ,
1088
+ body : Union [dict , None ] = None ,
1089
+ files = None ,
1090
+ ) -> HTTPResponse :
1091
1091
"""
1092
1092
Make a generic API request to the specified endpoint, utilizing many of the provided tools from the generated api client
1093
1093
@@ -1104,11 +1104,11 @@ def make_generic_api_request(
1104
1104
return self .api_client .call_api (
1105
1105
endpoint ,
1106
1106
method ,
1107
- None , # Path Params
1108
- None , # Query params
1109
- headers , # header params
1110
- body = body , # body
1111
- files = files , # files
1112
- auth_settings = [ ' ApiToken' ],
1113
- _preload_content = False , # This returns the urllib3 response rather than trying any type of processing
1107
+ None , # Path Params
1108
+ None , # Query params
1109
+ headers , # header params
1110
+ body = body , # body
1111
+ files = files , # files
1112
+ auth_settings = [ " ApiToken" ],
1113
+ _preload_content = False , # This returns the urllib3 response rather than trying any type of processing
1114
1114
)
0 commit comments