1414from speakeasy import utils
1515from speakeasy ._hooks import SDKHooks
1616from speakeasy .models import shared
17- from typing import Callable , Dict , Union
17+ from typing import Callable , Dict , Optional , Union
1818
1919class Speakeasy :
2020 r"""Speakeasy API: The Speakeasy API allows teams to manage common operations with their APIs
@@ -43,14 +43,14 @@ class Speakeasy:
4343 def __init__ (self ,
4444 security : Union [shared .Security ,Callable [[], shared .Security ]] = None ,
4545 workspace_id : str = None ,
46- server : str = None ,
47- server_url : str = None ,
48- url_params : Dict [str , str ] = None ,
49- client : requests_http .Session = None ,
50- retry_config : utils .RetryConfig = None
46+ server : Optional [ str ] = None ,
47+ server_url : Optional [ str ] = None ,
48+ url_params : Optional [ Dict [str , str ] ] = None ,
49+ client : Optional [ requests_http .Session ] = None ,
50+ retry_config : Optional [ utils .RetryConfig ] = None
5151 ) -> None :
5252 """Instantiates the SDK configuring it with the provided parameters.
53-
53+
5454 :param security: The security details required for authentication
5555 :type security: Union[shared.Security,Callable[[], shared.Security]]
5656 :param workspace_id: Configures the workspace_id parameter for all supported operations
@@ -68,20 +68,28 @@ def __init__(self,
6868 """
6969 if client is None :
7070 client = requests_http .Session ()
71-
71+
7272 if server_url is not None :
7373 if url_params is not None :
7474 server_url = utils .template_url (server_url , url_params )
75-
76- self .sdk_configuration = SDKConfiguration (client , security , server_url , server , {
75+ global_params = {
7776 'parameters' : {
7877 'queryParam' : {
7978 },
8079 'pathParam' : {
8180 'workspace_id' : workspace_id ,
8281 },
8382 },
84- }, retry_config = retry_config )
83+ }
84+
85+ self .sdk_configuration = SDKConfiguration (
86+ client ,
87+ security ,
88+ server_url ,
89+ server ,
90+ global_params ,
91+ retry_config = retry_config
92+ )
8593
8694 hooks = SDKHooks ()
8795
@@ -91,10 +99,11 @@ def __init__(self,
9199 self .sdk_configuration .server_url = server_url
92100
93101 # pylint: disable=protected-access
94- self .sdk_configuration ._hooks = hooks
95-
102+ self .sdk_configuration ._hooks = hooks
103+
96104 self ._init_sdks ()
97-
105+
106+
98107 def _init_sdks (self ):
99108 self .apis = Apis (self .sdk_configuration )
100109 self .api_endpoints = APIEndpoints (self .sdk_configuration )
@@ -105,4 +114,3 @@ def _init_sdks(self):
105114 self .organizations = Organizations (self .sdk_configuration )
106115 self .embeds = Embeds (self .sdk_configuration )
107116 self .events = Events (self .sdk_configuration )
108-
0 commit comments