a
    $ñ»j  ã                   @  sÚ   d dl mZ d dlZd dlmZ ddlmZmZ eG dd„ dƒƒZd dd	d
œdd„Z	d	dœdd„Z
dd	dœdd„Zdd	dœdd„Zdd	dœdd„Zdd	dœdd„ZedƒeG dd„ dƒƒƒZedƒeG dd„ dƒƒƒZdS )!é    )ÚannotationsN)Ú	dataclassé   )Úevent_classÚT_JSON_DICTc                   @  sL   e Zd ZU ded< ded< dZded< ddœd	d
„Zedd dœdd„ƒZdS )ÚSinkÚstrÚnameÚid_Nútyping.Optional[str]Úsessionr   ©Úreturnc                 C  s2   t ƒ }| j|d< | j|d< | jd ur.| j|d< |S )Nr	   Úidr   )Údictr	   r
   r   )ÚselfÚjson© r   ú0E:\soccer\ml_env\Lib\site-packages\mycdp/cast.pyÚto_json   s    



zSink.to_json©r   r   c                 C  s:   | t |d ƒt |d ƒ| dd ¡d ur2t |d ƒnd d�S )Nr	   r   r   )r	   r
   r   )r   Úget©Úclsr   r   r   r   Ú	from_json   s    

ÿúzSink.from_json)Ú__name__Ú
__module__Ú__qualname__Ú__annotations__r   r   Úclassmethodr   r   r   r   r   r      s   
r   r   z0typing.Generator[T_JSON_DICT, T_JSON_DICT, None])Úpresentation_urlr   c                 c  s*   t ƒ }| dur| |d< d|dœ}|V }dS )ae  
    Starts observing for sinks that can be used for tab mirroring, and if set,
    sinks compatible with `presentationUrl` as well. When sinks are found, a
    `sinksUpdated` event is fired.
    Also starts observing for issue messages.
    When an issue is added or removed, an `issueUpdated` event is fired.
    :param presentation_url: *(Optional)*
    NZpresentationUrlzCast.enable©ÚmethodÚparams©r   )r    r#   Úcmd_dictr   r   r   r   Úenable+   s    þr&   r   c                  c  s   ddi} | V }dS )z%Stops observing for sinks and issues.r"   zCast.disableNr   )r%   r   r   r   r   Údisable@   s    ÿr'   r   )Ú	sink_namer   c                 c  s"   t ƒ }| |d< d|dœ}|V }dS )zª
    Sets a sink to be used when the web page requests the browser to choose a
    sink via Presentation API, Remote Playback API, or Cast SDK.
    :param sink_name:
    ÚsinkNamezCast.setSinkToUser!   Nr$   ©r(   r#   r%   r   r   r   r   Úset_sink_to_useH   s    þr+   c                 c  s"   t ƒ }| |d< d|dœ}|V }dS )zI
    Starts mirroring the desktop to the sink.
    :param sink_name:
    r)   zCast.startDesktopMirroringr!   Nr$   r*   r   r   r   Ústart_desktop_mirroringY   s    þr,   c                 c  s"   t ƒ }| |d< d|dœ}|V }dS )zE
    Starts mirroring the tab to the sink.
    :param sink_name:
    r)   zCast.startTabMirroringr!   Nr$   r*   r   r   r   Ústart_tab_mirroringi   s    þr-   c                 c  s"   t ƒ }| |d< d|dœ}|V }dS )zJ
    Stops the active Cast session on the sink.
    :param sink_name:
    r)   zCast.stopCastingr!   Nr$   r*   r   r   r   Ústop_castingy   s    þr.   zCast.sinksUpdatedc                   @  s.   e Zd ZU dZded< edd dœdd„ƒZdS )	ÚSinksUpdatedzˆ
    This is fired whenever the list of available sinks changes. A sink is a
    device or a software surface that you can cast to.
    ztyping.List[Sink]Úsinksr   r   c                 C  s   | dd„ |d D ƒd�S )Nc                 S  s   g | ]}t  |¡‘qS r   )r   r   )Ú.0Úir   r   r   Ú
<listcomp>”   ó    z*SinksUpdated.from_json.<locals>.<listcomp>r0   )r0   r   r   r   r   r   r   ’   s    zSinksUpdated.from_jsonN©r   r   r   Ú__doc__r   r   r   r   r   r   r   r/   ‰   s   
r/   zCast.issueUpdatedc                   @  s.   e Zd ZU dZded< edd dœdd„ƒZdS )	ÚIssueUpdatedz
    This is fired whenever the outstanding issue/error message changes.
    `issueMessage` is empty if there is no issue.
    r   Úissue_messager   r   c                 C  s   | t |d ƒd�S )NZissueMessage)r8   )r   r   r   r   r   r       s    zIssueUpdated.from_jsonNr5   r   r   r   r   r7   —   s   
r7   )N)Ú
__future__r   ÚtypingÚdataclassesr   Úutilr   r   r   r&   r'   r+   r,   r-   r.   r/   r7   r   r   r   r   Ú<module>   s$    ÿ