mirror of
https://github.com/LukeHagar/plexpy.git
synced 2025-12-07 12:47:45 +00:00
Regenerated with pythonv2 and newest spec
This commit is contained in:
60
src/plex_api_client/sdkconfiguration.py
Normal file
60
src/plex_api_client/sdkconfiguration.py
Normal file
@@ -0,0 +1,60 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from ._hooks import SDKHooks
|
||||
from .httpclient import AsyncHttpClient, HttpClient
|
||||
from .utils import Logger, RetryConfig, remove_suffix
|
||||
from dataclasses import dataclass, field
|
||||
from enum import Enum
|
||||
from plex_api_client.models import components, internal
|
||||
from plex_api_client.types import OptionalNullable, UNSET
|
||||
from pydantic import Field
|
||||
from typing import Callable, Dict, List, Optional, Tuple, Union
|
||||
|
||||
|
||||
SERVERS = [
|
||||
"{protocol}://{ip}:{port}",
|
||||
# The full address of your Plex Server
|
||||
]
|
||||
"""Contains the list of servers available to the SDK"""
|
||||
|
||||
|
||||
class ServerProtocol(str, Enum):
|
||||
r"""The protocol to use for the server connection"""
|
||||
|
||||
HTTP = "http"
|
||||
HTTPS = "https"
|
||||
|
||||
|
||||
@dataclass
|
||||
class SDKConfiguration:
|
||||
client: HttpClient
|
||||
async_client: AsyncHttpClient
|
||||
debug_logger: Logger
|
||||
globals: internal.Globals
|
||||
security: Optional[
|
||||
Union[components.Security, Callable[[], components.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 = "0.0.3"
|
||||
sdk_version: str = "0.11.0"
|
||||
gen_version: str = "2.413.0"
|
||||
user_agent: str = "speakeasy-sdk/python 0.11.0 2.413.0 0.0.3 plex-api-client"
|
||||
retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET)
|
||||
timeout_ms: Optional[int] = None
|
||||
|
||||
def __post_init__(self):
|
||||
self._hooks = SDKHooks()
|
||||
|
||||
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]
|
||||
|
||||
def get_hooks(self) -> SDKHooks:
|
||||
return self._hooks
|
||||
Reference in New Issue
Block a user