-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathsdkconfiguration.py
More file actions
62 lines (54 loc) · 2.18 KB
/
sdkconfiguration.py
File metadata and controls
62 lines (54 loc) · 2.18 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from ._version import (
__gen_version__,
__openapi_doc_version__,
__user_agent__,
__version__,
)
from .httpclient import AsyncHttpClient, HttpClient
from .utils import Logger, RetryConfig, remove_suffix
from dataclasses import dataclass, field
from glean.api_client import models
from glean.api_client.types import OptionalNullable, UNSET
from pydantic import Field
from typing import Callable, Dict, List, Optional, Tuple, Union
SERVERS = [
"https://{instance}-be.glean.com",
]
"""Contains the list of servers available to the SDK"""
@dataclass
class SDKConfiguration:
client: Union[HttpClient, None]
client_supplied: bool
async_client: Union[AsyncHttpClient, None]
async_client_supplied: bool
debug_logger: Logger
security: Optional[Union[models.Security, Callable[[], models.Security]]] = None
server_url: Optional[str] = ""
server_idx: Optional[int] = 0
server_defaults: List[Dict[str, str]] = field(default_factory=List)
language: str = "python"
openapi_doc_version: str = __openapi_doc_version__
sdk_version: str = __version__
gen_version: str = __gen_version__
user_agent: str = __user_agent__
retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET)
timeout_ms: Optional[int] = None
exclude_deprecated_after: Optional[str] = None
"""
Exclude API endpoints that will be deprecated after this date.
Use this to test your integration against upcoming deprecations.
Format: YYYY-MM-DD (e.g., '2026-10-15')
More information: https://developers.glean.com/deprecations/overview
"""
include_experimental: Optional[bool] = None
"""
When True, enables experimental API features that are not yet generally available.
Use this to preview and test new functionality.
"""
def get_server_details(self) -> Tuple[str, Dict[str, str]]:
if self.server_url is not None and self.server_url:
return remove_suffix(self.server_url, "/"), {}
if self.server_idx is None:
self.server_idx = 0
return SERVERS[self.server_idx], self.server_defaults[self.server_idx]