
    5j4                     >    S r SrSSKJr  SSKJrJr   " S S\5      r	g)	a  
This type of session is used to connect directly to the Data Platform or through a Real-Time Distribution
System. If you would like to connect directly to RDP, you require a Refinitiv Data account (either a user account or
a machine account). In both instances, you need to provide Refinitiv data credentials to create the session. If you
would like to work through a Real-Time Distribution System, you need the IP of the local platform and a username (in
other words, a DACS username).
)
DefinitionGrantPasswordClientCredentials    )Union   )r   r   c                       \ rS rSrSr          SS\S\S\\\4   S\	S\S	\S
\S\S\\\
4   S\SS4S jjrS rSrg)r      aG  
Platform session.
Can be defined indirectly using the name of a session defined
in the configuration file or directly by specifying the other Definition parameters.

Parameters
----------
name: str, default "default"
    Session name
app_key: str, optional
    Application key
grant: GrantPassword or ClientCredentials object, optional
    Grants objects containing the credentials used to authenticate the user
    (or the machine) when connecting to the data platform.
    Several kind of grant objects can be used, GrantPassword is for STS and ClientCredentials is for Ping.
signon_control: bool, default False
    Controls the exclusive sign-on behavior when the user account
    (or computer account) for this session is concurrently used by another
    application. When this parameter is set to True, opening this session
    automatically disconnects the other application. When this parameter is set to
    False, the opening of this session fails preserving the other application.
deployed_platform_host: str, optional
    Host name (or IP) and port to be used to connect to Real-Time Distribution
    System.
deployed_platform_username: str, optional
    DACS username identifying the user when to connect
    to a Real-Time Distribution System
dacs_position: str, optional
    DACS position identifying the terminal when connecting to a Real-Time
    Distribution System.
dacs_application_id: str, optional
    Must contain the user's Data Access Control System application ID.
    For more information, refer to the DACS documentation on my.refinitiv.com
proxies: str or dict, optional
    Proxies configuration. If string, should be the URL of the proxy
    (e.g. 'https://proxy.com:8080'). If a dict, the keys are the protocol
    name (e.g. 'http', 'https') and the values are the proxy URLs.
app_name: str, optional
    Application name

Raises
----------
Exception
    If app-key is not found in the config file and in arguments.

Examples
--------
>>> import lseg.data as ld
>>> definition = ld.session.platform.Definition(name="custom-session-name")
>>> platform_session = definition.get_session()
Nnameapp_keygrantsignon_controldeployed_platform_hostdeployed_platform_usernamedacs_positiondacs_application_idproxiesapp_namereturnc                 x    SSK Jn  [        U[        5      (       d  [	        S5      eU" UUUUUUUUU	U
S9
U l        g )Nr   ),_make_platform_session_provider_by_argumentsz1Invalid session name type, please provide string.)
session_namer   r   r   r   r   r   r   r   r   )_core.session._session_providerr   
isinstancestr
ValueError_create_session)selfr
   r   r   r   r   r   r   r   r   r   r   s               Y/root/lseg-credit/backend/venv/lib/python3.13/site-packages/lseg/data/session/platform.py__init__Definition.__init__E   sL     	c$$$PQQK)#9'A' 3 
    c                 &    U R                  5       nU$ )zR
Creates and returns the session.

Returns
-------
The platform session instance.
r   )r   sessions     r   get_sessionDefinition.get_sessiond   s     &&(r!   r#   )
defaultNNFNNNNNN)__name__
__module____qualname____firstlineno____doc__r   _Unionr   r   booldictr   r%   __static_attributes__ r!   r   r   r      s    2l :>$&**.!#'%)

 
 m%667	

 
 !$
 %(
 
 !
 T	"
 
 

>	r!   r   N)
r,   __all__typingr   r-   _core.session.authr   r   objectr   r1   r!   r   <module>r6      s%    ? " A] ]r!   