"""
This file is generated by generator/run.py based on the Chrome DevTools Protocol.


https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler/

***************************************************
                    Methods
***************************************************
"""
from __future__ import annotations

from cdpkit.protocol._types import (
    HeapProfiler,
    Runtime,
)
from cdpkit.protocol.base import CDPMethod, InputModel, OutputModel


class AddInspectedHeapObjectInput(InputModel):

    heapObjectId: HeapProfiler.HeapSnapshotObjectId


class AddInspectedHeapObject(CDPMethod[None]):
    """ Enables console to refer to the node with given id via $x (see Command Line API for more details
    $x functions). """

    INPUT_VALIDATOR = AddInspectedHeapObjectInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        heap_object_id: HeapProfiler.HeapSnapshotObjectId
    ):
        super().__init__(
            heapObjectId=heap_object_id
        )


class CollectGarbage(CDPMethod[None]):

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class Disable(CDPMethod[None]):

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class Enable(CDPMethod[None]):

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class GetHeapObjectIdInput(InputModel):

    objectId: Runtime.RemoteObjectId


class GetHeapObjectIdOutput(OutputModel):

    heapSnapshotObjectId: HeapProfiler.HeapSnapshotObjectId


class GetHeapObjectId(CDPMethod[GetHeapObjectIdOutput]):

    INPUT_VALIDATOR = GetHeapObjectIdInput
    OUTPUT_VALIDATOR = GetHeapObjectIdOutput

    def __init__(
        self,
        *,
        object_id: Runtime.RemoteObjectId
    ):
        super().__init__(
            objectId=object_id
        )


class GetObjectByHeapObjectIdInput(InputModel):

    objectId: HeapProfiler.HeapSnapshotObjectId
    objectGroup: str | None = None


class GetObjectByHeapObjectIdOutput(OutputModel):

    result: Runtime.RemoteObject


class GetObjectByHeapObjectId(CDPMethod[GetObjectByHeapObjectIdOutput]):

    INPUT_VALIDATOR = GetObjectByHeapObjectIdInput
    OUTPUT_VALIDATOR = GetObjectByHeapObjectIdOutput

    def __init__(
        self,
        *,
        object_id: HeapProfiler.HeapSnapshotObjectId,
        object_group: str | None = None
    ):
        super().__init__(
            objectId=object_id,
            objectGroup=object_group
        )


class GetSamplingProfileOutput(OutputModel):

    profile: HeapProfiler.SamplingHeapProfile


class GetSamplingProfile(CDPMethod[GetSamplingProfileOutput]):

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = GetSamplingProfileOutput


class StartSamplingInput(InputModel):

    samplingInterval: float | None = None
    stackDepth: float | None = None
    includeObjectsCollectedByMajorGC: bool | None = None
    includeObjectsCollectedByMinorGC: bool | None = None


class StartSampling(CDPMethod[None]):

    INPUT_VALIDATOR = StartSamplingInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        sampling_interval: float | None = None,
        stack_depth: float | None = None,
        include_objects_collected_by_major_gc: bool | None = None,
        include_objects_collected_by_minor_gc: bool | None = None
    ):
        super().__init__(
            samplingInterval=sampling_interval,
            stackDepth=stack_depth,
            includeObjectsCollectedByMajorGC=include_objects_collected_by_major_gc,
            includeObjectsCollectedByMinorGC=include_objects_collected_by_minor_gc
        )


class StartTrackingHeapObjectsInput(InputModel):

    trackAllocations: bool | None = None


class StartTrackingHeapObjects(CDPMethod[None]):

    INPUT_VALIDATOR = StartTrackingHeapObjectsInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        track_allocations: bool | None = None
    ):
        super().__init__(
            trackAllocations=track_allocations
        )


class StopSamplingOutput(OutputModel):

    profile: HeapProfiler.SamplingHeapProfile


class StopSampling(CDPMethod[StopSamplingOutput]):

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = StopSamplingOutput


class StopTrackingHeapObjectsInput(InputModel):

    reportProgress: bool | None = None
    treatGlobalObjectsAsRoots: bool | None = None  # deprecated
    captureNumericValue: bool | None = None
    exposeInternals: bool | None = None  # experimental


class StopTrackingHeapObjects(CDPMethod[None]):

    INPUT_VALIDATOR = StopTrackingHeapObjectsInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        report_progress: bool | None = None,
        treat_global_objects_as_roots: bool | None = None,
        capture_numeric_value: bool | None = None,
        expose_internals: bool | None = None
    ):
        super().__init__(
            reportProgress=report_progress,
            treatGlobalObjectsAsRoots=treat_global_objects_as_roots,
            captureNumericValue=capture_numeric_value,
            exposeInternals=expose_internals
        )


class TakeHeapSnapshotInput(InputModel):

    reportProgress: bool | None = None
    treatGlobalObjectsAsRoots: bool | None = None  # deprecated
    captureNumericValue: bool | None = None
    exposeInternals: bool | None = None  # experimental


class TakeHeapSnapshot(CDPMethod[None]):

    INPUT_VALIDATOR = TakeHeapSnapshotInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        report_progress: bool | None = None,
        treat_global_objects_as_roots: bool | None = None,
        capture_numeric_value: bool | None = None,
        expose_internals: bool | None = None
    ):
        super().__init__(
            reportProgress=report_progress,
            treatGlobalObjectsAsRoots=treat_global_objects_as_roots,
            captureNumericValue=capture_numeric_value,
            exposeInternals=expose_internals
        )
