403Webshell
Server IP : 66.29.132.122  /  Your IP : 18.191.235.176
Web Server : LiteSpeed
System : Linux business142.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : admazpex ( 531)
PHP Version : 7.2.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/self/root/opt/cloudlinux/venv/lib64/python3.11/site-packages/hc_json_rpc_client/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/opt/cloudlinux/venv/lib64/python3.11/site-packages/hc_json_rpc_client/payload.py
from typing import Dict, Optional, TypedDict, Union

from pydantic import BaseModel
from typing_extensions import NotRequired

MetadataType = TypedDict(
    "MetadataType",
    {
        "entityId": str,
        "entityName": str,
        "eventName": str,
        "publisherName": NotRequired[str],
        "publishDate": NotRequired[str],
        "authorization": NotRequired[str],
        "traceparent": NotRequired[str],
        "tracestate": NotRequired[str],
        "containsPersonalData": NotRequired[bool],
        "token": NotRequired[str],
    },
)
ParamsType = TypedDict(
    "ParamsType", {"metadata": MetadataType, "payload": Dict[str, str]}
)


class Metadata(BaseModel):
    entityId: str
    entityName: str
    eventName: str
    publisherName: str = ""
    publishDate: str = ""
    authorization: Optional[str] = None
    traceparent: str = ""
    tracestate: str = ""
    containsPersonalData: bool = False
    token: str = ""


class Params(BaseModel):
    metadata: Metadata
    payload: dict = {}

    @staticmethod
    def from_dict(data: Union[dict, ParamsType]):
        return Params(
            metadata=Metadata(**data.get("metadata", {})),
            payload=data.get("payload", {}),
        )


class Payload(BaseModel):
    method: str
    params: Params
    jsonrpc: str
    id: int

Youez - 2016 - github.com/yon3zu
LinuXploit