1111from io import BufferedReader , BytesIO
1212from pathlib import Path
1313from typing import Any , Dict , List , Optional , Tuple , Union
14- from urllib3 .response import HTTPResponse
1514
1615import requests
17- from groundlight .internalapi import _generate_request_id
1816from groundlight_openapi_client .api .actions_api import ActionsApi
1917from groundlight_openapi_client .api .detector_groups_api import DetectorGroupsApi
2018from groundlight_openapi_client .api .detector_reset_api import DetectorResetApi
4947 Rule ,
5048 WebhookAction ,
5149)
50+ from urllib3 .response import HTTPResponse
5251
5352from groundlight .images import parse_supported_image_types
53+ from groundlight .internalapi import _generate_request_id
5454from groundlight .optional_imports import Image , np
5555
5656from .client import DEFAULT_REQUEST_TIMEOUT , Groundlight , GroundlightClientError , logger
@@ -1061,7 +1061,7 @@ def get_raw_headers(self) -> dict:
10611061 # We generate a unique request ID client-side for each request
10621062 headers ["X-Request-Id" ] = _generate_request_id ()
10631063 headers ["User-Agent" ] = self .api_client .default_headers ["User-Agent" ]
1064- headers [' Accept' ] = ' application/json'
1064+ headers [" Accept" ] = " application/json"
10651065 return headers
10661066
10671067 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
10811081 return response .json ()
10821082
10831083 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 :
10911091 """
10921092 Make a generic API request to the specified endpoint, utilizing many of the provided tools from the generated api client
10931093
@@ -1104,11 +1104,11 @@ def make_generic_api_request(
11041104 return self .api_client .call_api (
11051105 endpoint ,
11061106 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
11141114 )
0 commit comments