-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathsdkconfiguration.py
48 lines (38 loc) · 1.35 KB
/
sdkconfiguration.py
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""
import requests as requests_http
from ._hooks import SDKHooks
from .utils import utils
from .utils.retries import RetryConfig
from dataclasses import dataclass
from typing import Callable, Dict, Tuple, Union
from unstructured_client.models import shared
SERVER_PROD = 'prod'
r"""Hosted API"""
SERVER_LOCAL = 'local'
r"""Development server"""
SERVERS = {
SERVER_PROD: 'https://api.unstructured.io',
SERVER_LOCAL: 'http://localhost:8000',
}
"""Contains the list of servers available to the SDK"""
@dataclass
class SDKConfiguration:
client: requests_http.Session
security: Union[shared.Security,Callable[[], shared.Security]] = None
server_url: str = ''
server: str = ''
language: str = 'python'
openapi_doc_version: str = '0.0.1'
sdk_version: str = '0.21.0'
gen_version: str = '2.277.0'
user_agent: str = 'speakeasy-sdk/python 0.21.0 2.277.0 0.0.1 unstructured-client'
retry_config: RetryConfig = None
_hooks: SDKHooks = None
def get_server_details(self) -> Tuple[str, Dict[str, str]]:
if self.server_url:
return utils.remove_suffix(self.server_url, '/'), {}
if not self.server:
self.server = SERVER_PROD
return SERVERS[self.server], {}
def get_hooks(self) -> SDKHooks:
return self._hooks