// This file is generated by TypeBuilder_h.template.

// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef content_protocol_Debugger_h
#define content_protocol_Debugger_h

#include "content/common/content_export.h"
#include "content/browser/devtools/protocol/protocol.h"
// For each imported domain we generate a ValueConversions struct instead of a full domain definition
// and include Domain::API version from there.
#include "content/browser/devtools/protocol/runtime.h"

namespace content {
namespace protocol {
namespace Debugger {
using BreakpointId = String;
using CallFrameId = String;
class Location;
class CallFrame;
class Scope;
using ScriptLanguage = String;
class DebugSymbols;
class ResolvedBreakpoint;

// ------------- Forward and enum declarations.

namespace ScriptLanguageEnum {
inline constexpr char JavaScript[] = "JavaScript";
inline constexpr char WebAssembly[] = "WebAssembly";
} // namespace ScriptLanguageEnum

namespace ContinueToLocation {
namespace TargetCallFramesEnum {
inline constexpr char Any[] = "any";
inline constexpr char Current[] = "current";
} // TargetCallFramesEnum
} // ContinueToLocation

namespace RestartFrame {
namespace ModeEnum {
inline constexpr char StepInto[] = "StepInto";
} // ModeEnum
} // RestartFrame

namespace SetInstrumentationBreakpoint {
namespace InstrumentationEnum {
inline constexpr char BeforeScriptExecution[] = "beforeScriptExecution";
inline constexpr char BeforeScriptWithSourceMapExecution[] = "beforeScriptWithSourceMapExecution";
} // InstrumentationEnum
} // SetInstrumentationBreakpoint

namespace SetPauseOnExceptions {
namespace StateEnum {
inline constexpr char None[] = "none";
inline constexpr char Caught[] = "caught";
inline constexpr char Uncaught[] = "uncaught";
inline constexpr char All[] = "all";
} // StateEnum
} // SetPauseOnExceptions

namespace SetScriptSource {
namespace StatusEnum {
inline constexpr char Ok[] = "Ok";
inline constexpr char CompileError[] = "CompileError";
inline constexpr char BlockedByActiveGenerator[] = "BlockedByActiveGenerator";
inline constexpr char BlockedByActiveFunction[] = "BlockedByActiveFunction";
inline constexpr char BlockedByTopLevelEsModuleChange[] = "BlockedByTopLevelEsModuleChange";
} // StatusEnum
} // SetScriptSource

namespace Paused {
namespace ReasonEnum {
inline constexpr char Ambiguous[] = "ambiguous";
inline constexpr char Assert[] = "assert";
inline constexpr char CSPViolation[] = "CSPViolation";
inline constexpr char DebugCommand[] = "debugCommand";
inline constexpr char DOM[] = "DOM";
inline constexpr char EventListener[] = "EventListener";
inline constexpr char Exception[] = "exception";
inline constexpr char Instrumentation[] = "instrumentation";
inline constexpr char OOM[] = "OOM";
inline constexpr char Other[] = "other";
inline constexpr char PromiseRejection[] = "promiseRejection";
inline constexpr char XHR[] = "XHR";
inline constexpr char Step[] = "step";
} // ReasonEnum
} // Paused

// ------------- Type and builder declarations.

class CONTENT_EXPORT Location : public ::crdtp::ProtocolObject<Location> {
public:
    ~Location() override;  // Defined below

    String GetScriptId() { return m_scriptId; }
    void SetScriptId(const String& value);  // Defined below

    int GetLineNumber() { return m_lineNumber; }
    void SetLineNumber(int value);  // Defined below

    bool HasColumnNumber() { return !!m_columnNumber; }
    int GetColumnNumber(int defaultValue) const {
       return m_columnNumber.value_or(defaultValue);
    }
    const std::optional<int>& GetColumnNumber() const {
       return m_columnNumber;
    }
    void SetColumnNumber(int value);  // Defined below

    template<int STATE>
    class LocationBuilder {
    public:
        enum {
            NoFieldsSet = 0,
            ScriptIdSet = 1 << 1,
            LineNumberSet = 1 << 2,
            AllFieldsSet = (ScriptIdSet | LineNumberSet | 0)};


        LocationBuilder<STATE | ScriptIdSet>& SetScriptId(const String& value);  // Defined below

        LocationBuilder<STATE | LineNumberSet>& SetLineNumber(int value);  // Defined below

        LocationBuilder<STATE>& SetColumnNumber(int value);  // Defined below

        std::unique_ptr<Location> Build()
        {
            static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
            return std::move(m_result);
        }

    private:
        friend class Location;
        LocationBuilder() : m_result(new Location()) { }

        template<int STEP> LocationBuilder<STATE | STEP>& castState()
        {
            return *reinterpret_cast<LocationBuilder<STATE | STEP>*>(this);
        }

        std::unique_ptr<protocol::Debugger::Location> m_result;
    };

    static LocationBuilder<0> Create()
    {
        return LocationBuilder<0>();
    }

private:
    DECLARE_SERIALIZATION_SUPPORT();

    Location();  // Defined below

    String m_scriptId;
    int m_lineNumber;
    std::optional<int> m_columnNumber;
};


class CONTENT_EXPORT CallFrame : public ::crdtp::ProtocolObject<CallFrame> {
public:
    ~CallFrame() override;  // Defined below

    String GetCallFrameId() { return m_callFrameId; }
    void SetCallFrameId(const String& value);  // Defined below

    String GetFunctionName() { return m_functionName; }
    void SetFunctionName(const String& value);  // Defined below

    bool HasFunctionLocation() { return !!m_functionLocation; }
    protocol::Debugger::Location* GetFunctionLocation(protocol::Debugger::Location* defaultValue) {
       return m_functionLocation ? m_functionLocation.get() : defaultValue;
    }
    const std::unique_ptr<protocol::Debugger::Location>& GetFunctionLocation() const {
       return m_functionLocation;
    }
    void SetFunctionLocation(std::unique_ptr<protocol::Debugger::Location> value);  // Defined below

    protocol::Debugger::Location* GetLocation() { return m_location.get(); }
    void SetLocation(std::unique_ptr<protocol::Debugger::Location> value);  // Defined below

    String GetUrl() { return m_url; }
    void SetUrl(const String& value);  // Defined below

    protocol::Array<protocol::Debugger::Scope>* GetScopeChain() { return m_scopeChain.get(); }
    void SetScopeChain(std::unique_ptr<protocol::Array<protocol::Debugger::Scope>> value);  // Defined below

    protocol::Runtime::RemoteObject* GetThis() { return m_this.get(); }
    void SetThis(std::unique_ptr<protocol::Runtime::RemoteObject> value);  // Defined below

    bool HasReturnValue() { return !!m_returnValue; }
    protocol::Runtime::RemoteObject* GetReturnValue(protocol::Runtime::RemoteObject* defaultValue) {
       return m_returnValue ? m_returnValue.get() : defaultValue;
    }
    const std::unique_ptr<protocol::Runtime::RemoteObject>& GetReturnValue() const {
       return m_returnValue;
    }
    void SetReturnValue(std::unique_ptr<protocol::Runtime::RemoteObject> value);  // Defined below

    bool HasCanBeRestarted() { return !!m_canBeRestarted; }
    bool GetCanBeRestarted(bool defaultValue) const {
       return m_canBeRestarted.value_or(defaultValue);
    }
    const std::optional<bool>& GetCanBeRestarted() const {
       return m_canBeRestarted;
    }
    void SetCanBeRestarted(bool value);  // Defined below

    template<int STATE>
    class CallFrameBuilder {
    public:
        enum {
            NoFieldsSet = 0,
            CallFrameIdSet = 1 << 1,
            FunctionNameSet = 1 << 2,
            LocationSet = 1 << 3,
            UrlSet = 1 << 4,
            ScopeChainSet = 1 << 5,
            ThisSet = 1 << 6,
            AllFieldsSet = (CallFrameIdSet | FunctionNameSet | LocationSet | UrlSet | ScopeChainSet | ThisSet | 0)};


        CallFrameBuilder<STATE | CallFrameIdSet>& SetCallFrameId(const String& value);  // Defined below

        CallFrameBuilder<STATE | FunctionNameSet>& SetFunctionName(const String& value);  // Defined below

        CallFrameBuilder<STATE>& SetFunctionLocation(std::unique_ptr<protocol::Debugger::Location> value);  // Defined below

        CallFrameBuilder<STATE | LocationSet>& SetLocation(std::unique_ptr<protocol::Debugger::Location> value);  // Defined below

        CallFrameBuilder<STATE | UrlSet>& SetUrl(const String& value);  // Defined below

        CallFrameBuilder<STATE | ScopeChainSet>& SetScopeChain(std::unique_ptr<protocol::Array<protocol::Debugger::Scope>> value);  // Defined below

        CallFrameBuilder<STATE | ThisSet>& SetThis(std::unique_ptr<protocol::Runtime::RemoteObject> value);  // Defined below

        CallFrameBuilder<STATE>& SetReturnValue(std::unique_ptr<protocol::Runtime::RemoteObject> value);  // Defined below

        CallFrameBuilder<STATE>& SetCanBeRestarted(bool value);  // Defined below

        std::unique_ptr<CallFrame> Build()
        {
            static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
            return std::move(m_result);
        }

    private:
        friend class CallFrame;
        CallFrameBuilder() : m_result(new CallFrame()) { }

        template<int STEP> CallFrameBuilder<STATE | STEP>& castState()
        {
            return *reinterpret_cast<CallFrameBuilder<STATE | STEP>*>(this);
        }

        std::unique_ptr<protocol::Debugger::CallFrame> m_result;
    };

    static CallFrameBuilder<0> Create()
    {
        return CallFrameBuilder<0>();
    }

private:
    DECLARE_SERIALIZATION_SUPPORT();

    CallFrame();  // Defined below

    String m_callFrameId;
    String m_functionName;
    std::unique_ptr<protocol::Debugger::Location> m_functionLocation;
    std::unique_ptr<protocol::Debugger::Location> m_location;
    String m_url;
    std::unique_ptr<protocol::Array<protocol::Debugger::Scope>> m_scopeChain;
    std::unique_ptr<protocol::Runtime::RemoteObject> m_this;
    std::unique_ptr<protocol::Runtime::RemoteObject> m_returnValue;
    std::optional<bool> m_canBeRestarted;
};


class CONTENT_EXPORT Scope : public ::crdtp::ProtocolObject<Scope> {
public:
    ~Scope() override;  // Defined below

    struct CONTENT_EXPORT TypeEnum {
        static const char* Global;
        static const char* Local;
        static const char* With;
        static const char* Closure;
        static const char* Catch;
        static const char* Block;
        static const char* Script;
        static const char* Eval;
        static const char* Module;
        static const char* WasmExpressionStack;
    }; // TypeEnum

    String GetType() { return m_type; }
    void SetType(const String& value);  // Defined below

    protocol::Runtime::RemoteObject* GetObject() { return m_object.get(); }
    void SetObject(std::unique_ptr<protocol::Runtime::RemoteObject> value);  // Defined below

    bool HasName() { return !!m_name; }
    String GetName(const String& defaultValue) const {
       return m_name.value_or(defaultValue);
    }
    const std::optional<String>& GetName() const {
       return m_name;
    }
    void SetName(const String& value);  // Defined below

    bool HasStartLocation() { return !!m_startLocation; }
    protocol::Debugger::Location* GetStartLocation(protocol::Debugger::Location* defaultValue) {
       return m_startLocation ? m_startLocation.get() : defaultValue;
    }
    const std::unique_ptr<protocol::Debugger::Location>& GetStartLocation() const {
       return m_startLocation;
    }
    void SetStartLocation(std::unique_ptr<protocol::Debugger::Location> value);  // Defined below

    bool HasEndLocation() { return !!m_endLocation; }
    protocol::Debugger::Location* GetEndLocation(protocol::Debugger::Location* defaultValue) {
       return m_endLocation ? m_endLocation.get() : defaultValue;
    }
    const std::unique_ptr<protocol::Debugger::Location>& GetEndLocation() const {
       return m_endLocation;
    }
    void SetEndLocation(std::unique_ptr<protocol::Debugger::Location> value);  // Defined below

    template<int STATE>
    class ScopeBuilder {
    public:
        enum {
            NoFieldsSet = 0,
            TypeSet = 1 << 1,
            ObjectSet = 1 << 2,
            AllFieldsSet = (TypeSet | ObjectSet | 0)};


        ScopeBuilder<STATE | TypeSet>& SetType(const String& value);  // Defined below

        ScopeBuilder<STATE | ObjectSet>& SetObject(std::unique_ptr<protocol::Runtime::RemoteObject> value);  // Defined below

        ScopeBuilder<STATE>& SetName(const String& value);  // Defined below

        ScopeBuilder<STATE>& SetStartLocation(std::unique_ptr<protocol::Debugger::Location> value);  // Defined below

        ScopeBuilder<STATE>& SetEndLocation(std::unique_ptr<protocol::Debugger::Location> value);  // Defined below

        std::unique_ptr<Scope> Build()
        {
            static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
            return std::move(m_result);
        }

    private:
        friend class Scope;
        ScopeBuilder() : m_result(new Scope()) { }

        template<int STEP> ScopeBuilder<STATE | STEP>& castState()
        {
            return *reinterpret_cast<ScopeBuilder<STATE | STEP>*>(this);
        }

        std::unique_ptr<protocol::Debugger::Scope> m_result;
    };

    static ScopeBuilder<0> Create()
    {
        return ScopeBuilder<0>();
    }

private:
    DECLARE_SERIALIZATION_SUPPORT();

    Scope();  // Defined below

    String m_type;
    std::unique_ptr<protocol::Runtime::RemoteObject> m_object;
    std::optional<String> m_name;
    std::unique_ptr<protocol::Debugger::Location> m_startLocation;
    std::unique_ptr<protocol::Debugger::Location> m_endLocation;
};


class CONTENT_EXPORT DebugSymbols : public ::crdtp::ProtocolObject<DebugSymbols> {
public:
    ~DebugSymbols() override;  // Defined below

    struct CONTENT_EXPORT TypeEnum {
        static const char* SourceMap;
        static const char* EmbeddedDWARF;
        static const char* ExternalDWARF;
    }; // TypeEnum

    String GetType() { return m_type; }
    void SetType(const String& value);  // Defined below

    bool HasExternalURL() { return !!m_externalURL; }
    String GetExternalURL(const String& defaultValue) const {
       return m_externalURL.value_or(defaultValue);
    }
    const std::optional<String>& GetExternalURL() const {
       return m_externalURL;
    }
    void SetExternalURL(const String& value);  // Defined below

    template<int STATE>
    class DebugSymbolsBuilder {
    public:
        enum {
            NoFieldsSet = 0,
            TypeSet = 1 << 1,
            AllFieldsSet = (TypeSet | 0)};


        DebugSymbolsBuilder<STATE | TypeSet>& SetType(const String& value);  // Defined below

        DebugSymbolsBuilder<STATE>& SetExternalURL(const String& value);  // Defined below

        std::unique_ptr<DebugSymbols> Build()
        {
            static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
            return std::move(m_result);
        }

    private:
        friend class DebugSymbols;
        DebugSymbolsBuilder() : m_result(new DebugSymbols()) { }

        template<int STEP> DebugSymbolsBuilder<STATE | STEP>& castState()
        {
            return *reinterpret_cast<DebugSymbolsBuilder<STATE | STEP>*>(this);
        }

        std::unique_ptr<protocol::Debugger::DebugSymbols> m_result;
    };

    static DebugSymbolsBuilder<0> Create()
    {
        return DebugSymbolsBuilder<0>();
    }

private:
    DECLARE_SERIALIZATION_SUPPORT();

    DebugSymbols();  // Defined below

    String m_type;
    std::optional<String> m_externalURL;
};


class CONTENT_EXPORT ResolvedBreakpoint : public ::crdtp::ProtocolObject<ResolvedBreakpoint> {
public:
    ~ResolvedBreakpoint() override;  // Defined below

    String GetBreakpointId() { return m_breakpointId; }
    void SetBreakpointId(const String& value);  // Defined below

    protocol::Debugger::Location* GetLocation() { return m_location.get(); }
    void SetLocation(std::unique_ptr<protocol::Debugger::Location> value);  // Defined below

    template<int STATE>
    class ResolvedBreakpointBuilder {
    public:
        enum {
            NoFieldsSet = 0,
            BreakpointIdSet = 1 << 1,
            LocationSet = 1 << 2,
            AllFieldsSet = (BreakpointIdSet | LocationSet | 0)};


        ResolvedBreakpointBuilder<STATE | BreakpointIdSet>& SetBreakpointId(const String& value);  // Defined below

        ResolvedBreakpointBuilder<STATE | LocationSet>& SetLocation(std::unique_ptr<protocol::Debugger::Location> value);  // Defined below

        std::unique_ptr<ResolvedBreakpoint> Build()
        {
            static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
            return std::move(m_result);
        }

    private:
        friend class ResolvedBreakpoint;
        ResolvedBreakpointBuilder() : m_result(new ResolvedBreakpoint()) { }

        template<int STEP> ResolvedBreakpointBuilder<STATE | STEP>& castState()
        {
            return *reinterpret_cast<ResolvedBreakpointBuilder<STATE | STEP>*>(this);
        }

        std::unique_ptr<protocol::Debugger::ResolvedBreakpoint> m_result;
    };

    static ResolvedBreakpointBuilder<0> Create()
    {
        return ResolvedBreakpointBuilder<0>();
    }

private:
    DECLARE_SERIALIZATION_SUPPORT();

    ResolvedBreakpoint();  // Defined below

    String m_breakpointId;
    std::unique_ptr<protocol::Debugger::Location> m_location;
};


// ------------- Type and builder method definitions.
//
// These methods separate from the type declaration because of
// https://github.com/llvm/llvm-project/issues/59966. The DevTools protocol has
// mutually recursive types, so we cannot simply reorder the types.
inline Location::~Location() = default;
inline void Location::SetScriptId(const String& value) { m_scriptId = value; }
inline void Location::SetLineNumber(int value) { m_lineNumber = value; }
inline void Location::SetColumnNumber(int value) { m_columnNumber = value; }

template<int STATE>
inline Location::LocationBuilder<STATE | Location::LocationBuilder<STATE>::ScriptIdSet>&
Location::LocationBuilder<STATE>::SetScriptId(const String& value) {
  static_assert(!(STATE & ScriptIdSet), "property scriptId should not be set yet");
  m_result->SetScriptId(value);
  return castState<ScriptIdSet>();
}
template<int STATE>
inline Location::LocationBuilder<STATE | Location::LocationBuilder<STATE>::LineNumberSet>&
Location::LocationBuilder<STATE>::SetLineNumber(int value) {
  static_assert(!(STATE & LineNumberSet), "property lineNumber should not be set yet");
  m_result->SetLineNumber(value);
  return castState<LineNumberSet>();
}
template<int STATE>
inline Location::LocationBuilder<STATE>& Location::LocationBuilder<STATE>::SetColumnNumber(int value) {
  m_result->SetColumnNumber(value);
  return *this;
}

inline Location::Location() {
  m_lineNumber = 0;
}
inline CallFrame::~CallFrame() = default;
inline void CallFrame::SetCallFrameId(const String& value) { m_callFrameId = value; }
inline void CallFrame::SetFunctionName(const String& value) { m_functionName = value; }
inline void CallFrame::SetFunctionLocation(std::unique_ptr<protocol::Debugger::Location> value) { m_functionLocation = std::move(value); }
inline void CallFrame::SetLocation(std::unique_ptr<protocol::Debugger::Location> value) { m_location = std::move(value); }
inline void CallFrame::SetUrl(const String& value) { m_url = value; }
inline void CallFrame::SetScopeChain(std::unique_ptr<protocol::Array<protocol::Debugger::Scope>> value) { m_scopeChain = std::move(value); }
inline void CallFrame::SetThis(std::unique_ptr<protocol::Runtime::RemoteObject> value) { m_this = std::move(value); }
inline void CallFrame::SetReturnValue(std::unique_ptr<protocol::Runtime::RemoteObject> value) { m_returnValue = std::move(value); }
inline void CallFrame::SetCanBeRestarted(bool value) { m_canBeRestarted = value; }

template<int STATE>
inline CallFrame::CallFrameBuilder<STATE | CallFrame::CallFrameBuilder<STATE>::CallFrameIdSet>&
CallFrame::CallFrameBuilder<STATE>::SetCallFrameId(const String& value) {
  static_assert(!(STATE & CallFrameIdSet), "property callFrameId should not be set yet");
  m_result->SetCallFrameId(value);
  return castState<CallFrameIdSet>();
}
template<int STATE>
inline CallFrame::CallFrameBuilder<STATE | CallFrame::CallFrameBuilder<STATE>::FunctionNameSet>&
CallFrame::CallFrameBuilder<STATE>::SetFunctionName(const String& value) {
  static_assert(!(STATE & FunctionNameSet), "property functionName should not be set yet");
  m_result->SetFunctionName(value);
  return castState<FunctionNameSet>();
}
template<int STATE>
inline CallFrame::CallFrameBuilder<STATE>& CallFrame::CallFrameBuilder<STATE>::SetFunctionLocation(std::unique_ptr<protocol::Debugger::Location> value) {
  m_result->SetFunctionLocation(std::move(value));
  return *this;
}
template<int STATE>
inline CallFrame::CallFrameBuilder<STATE | CallFrame::CallFrameBuilder<STATE>::LocationSet>&
CallFrame::CallFrameBuilder<STATE>::SetLocation(std::unique_ptr<protocol::Debugger::Location> value) {
  static_assert(!(STATE & LocationSet), "property location should not be set yet");
  m_result->SetLocation(std::move(value));
  return castState<LocationSet>();
}
template<int STATE>
inline CallFrame::CallFrameBuilder<STATE | CallFrame::CallFrameBuilder<STATE>::UrlSet>&
CallFrame::CallFrameBuilder<STATE>::SetUrl(const String& value) {
  static_assert(!(STATE & UrlSet), "property url should not be set yet");
  m_result->SetUrl(value);
  return castState<UrlSet>();
}
template<int STATE>
inline CallFrame::CallFrameBuilder<STATE | CallFrame::CallFrameBuilder<STATE>::ScopeChainSet>&
CallFrame::CallFrameBuilder<STATE>::SetScopeChain(std::unique_ptr<protocol::Array<protocol::Debugger::Scope>> value) {
  static_assert(!(STATE & ScopeChainSet), "property scopeChain should not be set yet");
  m_result->SetScopeChain(std::move(value));
  return castState<ScopeChainSet>();
}
template<int STATE>
inline CallFrame::CallFrameBuilder<STATE | CallFrame::CallFrameBuilder<STATE>::ThisSet>&
CallFrame::CallFrameBuilder<STATE>::SetThis(std::unique_ptr<protocol::Runtime::RemoteObject> value) {
  static_assert(!(STATE & ThisSet), "property this should not be set yet");
  m_result->SetThis(std::move(value));
  return castState<ThisSet>();
}
template<int STATE>
inline CallFrame::CallFrameBuilder<STATE>& CallFrame::CallFrameBuilder<STATE>::SetReturnValue(std::unique_ptr<protocol::Runtime::RemoteObject> value) {
  m_result->SetReturnValue(std::move(value));
  return *this;
}
template<int STATE>
inline CallFrame::CallFrameBuilder<STATE>& CallFrame::CallFrameBuilder<STATE>::SetCanBeRestarted(bool value) {
  m_result->SetCanBeRestarted(value);
  return *this;
}

inline CallFrame::CallFrame() {
}
inline Scope::~Scope() = default;
inline void Scope::SetType(const String& value) { m_type = value; }
inline void Scope::SetObject(std::unique_ptr<protocol::Runtime::RemoteObject> value) { m_object = std::move(value); }
inline void Scope::SetName(const String& value) { m_name = value; }
inline void Scope::SetStartLocation(std::unique_ptr<protocol::Debugger::Location> value) { m_startLocation = std::move(value); }
inline void Scope::SetEndLocation(std::unique_ptr<protocol::Debugger::Location> value) { m_endLocation = std::move(value); }

template<int STATE>
inline Scope::ScopeBuilder<STATE | Scope::ScopeBuilder<STATE>::TypeSet>&
Scope::ScopeBuilder<STATE>::SetType(const String& value) {
  static_assert(!(STATE & TypeSet), "property type should not be set yet");
  m_result->SetType(value);
  return castState<TypeSet>();
}
template<int STATE>
inline Scope::ScopeBuilder<STATE | Scope::ScopeBuilder<STATE>::ObjectSet>&
Scope::ScopeBuilder<STATE>::SetObject(std::unique_ptr<protocol::Runtime::RemoteObject> value) {
  static_assert(!(STATE & ObjectSet), "property object should not be set yet");
  m_result->SetObject(std::move(value));
  return castState<ObjectSet>();
}
template<int STATE>
inline Scope::ScopeBuilder<STATE>& Scope::ScopeBuilder<STATE>::SetName(const String& value) {
  m_result->SetName(value);
  return *this;
}
template<int STATE>
inline Scope::ScopeBuilder<STATE>& Scope::ScopeBuilder<STATE>::SetStartLocation(std::unique_ptr<protocol::Debugger::Location> value) {
  m_result->SetStartLocation(std::move(value));
  return *this;
}
template<int STATE>
inline Scope::ScopeBuilder<STATE>& Scope::ScopeBuilder<STATE>::SetEndLocation(std::unique_ptr<protocol::Debugger::Location> value) {
  m_result->SetEndLocation(std::move(value));
  return *this;
}

inline Scope::Scope() {
}
inline DebugSymbols::~DebugSymbols() = default;
inline void DebugSymbols::SetType(const String& value) { m_type = value; }
inline void DebugSymbols::SetExternalURL(const String& value) { m_externalURL = value; }

template<int STATE>
inline DebugSymbols::DebugSymbolsBuilder<STATE | DebugSymbols::DebugSymbolsBuilder<STATE>::TypeSet>&
DebugSymbols::DebugSymbolsBuilder<STATE>::SetType(const String& value) {
  static_assert(!(STATE & TypeSet), "property type should not be set yet");
  m_result->SetType(value);
  return castState<TypeSet>();
}
template<int STATE>
inline DebugSymbols::DebugSymbolsBuilder<STATE>& DebugSymbols::DebugSymbolsBuilder<STATE>::SetExternalURL(const String& value) {
  m_result->SetExternalURL(value);
  return *this;
}

inline DebugSymbols::DebugSymbols() {
}
inline ResolvedBreakpoint::~ResolvedBreakpoint() = default;
inline void ResolvedBreakpoint::SetBreakpointId(const String& value) { m_breakpointId = value; }
inline void ResolvedBreakpoint::SetLocation(std::unique_ptr<protocol::Debugger::Location> value) { m_location = std::move(value); }

template<int STATE>
inline ResolvedBreakpoint::ResolvedBreakpointBuilder<STATE | ResolvedBreakpoint::ResolvedBreakpointBuilder<STATE>::BreakpointIdSet>&
ResolvedBreakpoint::ResolvedBreakpointBuilder<STATE>::SetBreakpointId(const String& value) {
  static_assert(!(STATE & BreakpointIdSet), "property breakpointId should not be set yet");
  m_result->SetBreakpointId(value);
  return castState<BreakpointIdSet>();
}
template<int STATE>
inline ResolvedBreakpoint::ResolvedBreakpointBuilder<STATE | ResolvedBreakpoint::ResolvedBreakpointBuilder<STATE>::LocationSet>&
ResolvedBreakpoint::ResolvedBreakpointBuilder<STATE>::SetLocation(std::unique_ptr<protocol::Debugger::Location> value) {
  static_assert(!(STATE & LocationSet), "property location should not be set yet");
  m_result->SetLocation(std::move(value));
  return castState<LocationSet>();
}

inline ResolvedBreakpoint::ResolvedBreakpoint() {
}

// ------------- Backend interface.

class CONTENT_EXPORT Backend {
public:
    virtual ~Backend() { }

    virtual DispatchResponse RemoveBreakpoint(const String& in_breakpointId) = 0;
    virtual DispatchResponse SetBreakpointByUrl(int in_lineNumber, std::optional<String> in_url, std::optional<String> in_urlRegex, std::optional<String> in_scriptHash, std::optional<int> in_columnNumber, std::optional<String> in_condition, String* out_breakpointId, std::unique_ptr<protocol::Array<protocol::Debugger::Location>>* out_locations) = 0;

    virtual DispatchResponse Disable()
    {
        return DispatchResponse::Success();
    }
};

// ------------- Frontend interface.

class CONTENT_EXPORT Frontend {
public:
  explicit Frontend(FrontendChannel* frontend_channel) : frontend_channel_(frontend_channel) {}
    void BreakpointResolved(const String& breakpointId, std::unique_ptr<protocol::Debugger::Location> location);
    void Paused(std::unique_ptr<protocol::Array<protocol::Debugger::CallFrame>> callFrames, const String& reason, std::unique_ptr<protocol::DictionaryValue> data = {}, std::unique_ptr<protocol::Array<String>> hitBreakpoints = {}, std::unique_ptr<protocol::Runtime::StackTrace> asyncStackTrace = {}, std::unique_ptr<protocol::Runtime::StackTraceId> asyncStackTraceId = {}, std::unique_ptr<protocol::Runtime::StackTraceId> asyncCallStackTraceId = {});
    void Resumed();
    void ScriptFailedToParse(const String& scriptId, const String& url, int startLine, int startColumn, int endLine, int endColumn, int executionContextId, const String& hash, const String& buildId, std::unique_ptr<protocol::DictionaryValue> executionContextAuxData = {}, std::optional<String> sourceMapURL = {}, std::optional<bool> hasSourceURL = {}, std::optional<bool> isModule = {}, std::optional<int> length = {}, std::unique_ptr<protocol::Runtime::StackTrace> stackTrace = {}, std::optional<int> codeOffset = {}, std::optional<String> scriptLanguage = {}, std::optional<String> embedderName = {});
    void ScriptParsed(const String& scriptId, const String& url, int startLine, int startColumn, int endLine, int endColumn, int executionContextId, const String& hash, const String& buildId, std::unique_ptr<protocol::DictionaryValue> executionContextAuxData = {}, std::optional<bool> isLiveEdit = {}, std::optional<String> sourceMapURL = {}, std::optional<bool> hasSourceURL = {}, std::optional<bool> isModule = {}, std::optional<int> length = {}, std::unique_ptr<protocol::Runtime::StackTrace> stackTrace = {}, std::optional<int> codeOffset = {}, std::optional<String> scriptLanguage = {}, std::unique_ptr<protocol::Array<protocol::Debugger::DebugSymbols>> debugSymbols = {}, std::optional<String> embedderName = {}, std::unique_ptr<protocol::Array<protocol::Debugger::ResolvedBreakpoint>> resolvedBreakpoints = {});

  void flush();
  void sendRawNotification(std::unique_ptr<Serializable>);
 private:
  FrontendChannel* frontend_channel_;
};

// ------------- Dispatcher.

class CONTENT_EXPORT Dispatcher {
public:
    static void wire(UberDispatcher*, Backend*);

private:
    Dispatcher() { }
};

// ------------- Metainfo.

class CONTENT_EXPORT Metainfo {
public:
    using BackendClass = Backend;
    using FrontendClass = Frontend;
    using DispatcherClass = Dispatcher;
    static const char domainName[];
    static const char commandPrefix[];
    static const char version[];
};

} // namespace Debugger
} // namespace content
} // namespace protocol

#endif // !defined(content_protocol_Debugger_h)
