1
1
"""Configuration is a base class that has default values that you can change
2
2
during the instance of the client class"""
3
3
4
- from typing import Callable
4
+ from typing import Any , Callable , Dict
5
5
6
6
from .interface import Cache
7
7
from .lru_cache import LRUCache
@@ -28,7 +28,8 @@ def __init__(
28
28
enable_stream : bool = True ,
29
29
enable_analytics : bool = True ,
30
30
max_auth_retries : int = 10 ,
31
- tls_trusted_cas_file : str = None
31
+ tls_trusted_cas_file : str = None ,
32
+ httpx_args : Dict [str , Any ] = None ,
32
33
):
33
34
self .base_url = base_url
34
35
self .events_url = events_url
@@ -49,6 +50,9 @@ def __init__(
49
50
self .enable_analytics = enable_analytics
50
51
self .max_auth_retries = max_auth_retries
51
52
self .tls_trusted_cas_file = tls_trusted_cas_file
53
+ self .httpx_args = httpx_args
54
+ if self .httpx_args is None :
55
+ self .httpx_args = {}
52
56
53
57
54
58
default_config = Config ()
@@ -106,3 +110,10 @@ def func(config: Config) -> None:
106
110
config .tls_trusted_cas_file = value
107
111
108
112
return func
113
+
114
+
115
+ def with_httpx_args (args : Dict [str , Any ]) -> Callable :
116
+ def func (config : Config ) -> None :
117
+ config .httpx_args .update (args )
118
+
119
+ return func
0 commit comments