// This file is autogenerated. Do not edit by hand.
// To regenerate from schema, run `cargo run -p generator`.

use serde::{Deserialize, Serialize};

/// A module identifier.
#[derive(PartialEq, Eq, Debug, Hash, Clone, Deserialize, Serialize)]
#[serde(untagged)]
pub enum ModuleId {
    Number(u32),
    String(String),
}

#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(transparent)]
pub struct AttachRequestArguments {
    pub raw: serde_json::Value,
}

#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(transparent)]
pub struct LaunchRequestArguments {
    pub raw: serde_json::Value,
}

#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(transparent)]
pub struct RestartArguments {
    pub raw: serde_json::Value,
}

/// Information about a breakpoint created in `setBreakpoints`, `setFunctionBreakpoints`, `setInstructionBreakpoints`, or `setDataBreakpoints` requests.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Breakpoint {
    /// Start position of the source range covered by the breakpoint. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub column: Option<u32>,
    /// End position of the source range covered by the breakpoint. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based.
    /// If no end line is given, then the end column is assumed to be in the start line.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub end_column: Option<u32>,
    /// The end line of the actual range covered by the breakpoint.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub end_line: Option<u32>,
    /// The identifier for the breakpoint. It is needed if breakpoint events are used to update or remove breakpoints.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<u64>,
    /// A memory reference to where the breakpoint is set.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub instruction_reference: Option<String>,
    /// The start line of the actual range covered by the breakpoint.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub line: Option<u32>,
    /// A message about the state of the breakpoint.
    /// This is shown to the user and can be used to explain why a breakpoint could not be verified.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub message: Option<String>,
    /// The offset from the instruction reference.
    /// This can be negative.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub offset: Option<u32>,
    /// A machine-readable explanation of why a breakpoint may not be verified. If a breakpoint is verified or a specific reason is not known, the adapter should omit this property. Possible values include:
    ///
    /// - `pending`: Indicates a breakpoint might be verified in the future, but the adapter cannot verify it in the current state.
    ///  - `failed`: Indicates a breakpoint was not able to be verified, and the adapter does not believe it can be verified without intervention.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub reason: Option<BreakpointReason>,
    /// The source where the breakpoint is located.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub source: Option<Source>,
    /// If true, the breakpoint could be set (but not necessarily at the desired location).
    pub verified: bool,
}

/// A machine-readable explanation of why a breakpoint may not be verified. If a breakpoint is verified or a specific reason is not known, the adapter should omit this property. Possible values include:
///
/// - `pending`: Indicates a breakpoint might be verified in the future, but the adapter cannot verify it in the current state.
///  - `failed`: Indicates a breakpoint was not able to be verified, and the adapter does not believe it can be verified without intervention.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub enum BreakpointReason {
    Pending,
    Failed,
}

/// The event indicates that some information about a breakpoint has changed.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct BreakpointEvent {
    /// The `id` attribute is used to find the target breakpoint, the other attributes are used as the new values.
    pub breakpoint: Breakpoint,
    /// The reason for the event.
    pub reason: BreakpointEventReason,
}

/// The reason for the event.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[non_exhaustive]
#[serde(rename_all = "camelCase")]
pub enum BreakpointEventReason {
    Changed,
    New,
    Removed,
    #[default]
    #[serde(other)]
    Unknown,
}

/// Properties of a breakpoint location returned from the `breakpointLocations` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct BreakpointLocation {
    /// The start position of a breakpoint location. Position is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub column: Option<u32>,
    /// The end position of a breakpoint location (if the location covers a range). Position is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub end_column: Option<u32>,
    /// The end line of breakpoint location if the location covers a range.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub end_line: Option<u32>,
    /// Start line of breakpoint location.
    pub line: u32,
}

/// Arguments for `breakpointLocations` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct BreakpointLocationsArguments {
    /// Start position within `line` to search possible breakpoint locations in. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. If no column is given, the first position in the start line is assumed.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub column: Option<u32>,
    /// End position within `endLine` to search possible breakpoint locations in. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. If no end column is given, the last position in the end line is assumed.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub end_column: Option<u32>,
    /// End line of range to search possible breakpoint locations in. If no end line is given, then the end line is assumed to be the start line.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub end_line: Option<u32>,
    /// Start line of range to search possible breakpoint locations in. If only the line is specified, the request returns all possible locations in that line.
    pub line: u32,
    /// The source location of the breakpoints; either `source.path` or `source.sourceReference` must be specified.
    pub source: Source,
}

/// Response to `breakpointLocations` request.
/// Contains possible locations for source breakpoints.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct BreakpointLocationsResponse {
    /// Sorted set of possible breakpoint locations.
    pub breakpoints: Vec<BreakpointLocation>,
}

/// A `BreakpointMode` is provided as a option when setting breakpoints on sources or instructions.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct BreakpointMode {
    /// Describes one or more type of breakpoint this mode applies to.
    pub applies_to: Vec<BreakpointModeApplicability>,
    /// A help text providing additional information about the breakpoint mode. This string is typically shown as a hover and can be translated.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// The name of the breakpoint mode. This is shown in the UI.
    pub label: String,
    /// The internal ID of the mode. This value is passed to the `setBreakpoints` request.
    pub mode: String,
}

/// Describes one or more type of breakpoint a `BreakpointMode` applies to. This is a non-exhaustive enumeration and may expand as future breakpoint types are added.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[non_exhaustive]
#[serde(rename_all = "camelCase")]
pub enum BreakpointModeApplicability {
    /// In `SourceBreakpoint`s
    Source,
    /// In exception breakpoints applied in the `ExceptionFilterOptions`
    Exception,
    /// In data breakpoints requested in the `DataBreakpointInfo` request
    Data,
    /// In `InstructionBreakpoint`s
    Instruction,
    #[default]
    #[serde(other)]
    Unknown,
}

/// Arguments for `cancel` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CancelArguments {
    /// The ID (attribute `progressId`) of the progress to cancel. If missing no progress is cancelled.
    /// Both a `requestId` and a `progressId` can be specified in one request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub progress_id: Option<String>,
    /// The ID (attribute `seq`) of the request to cancel. If missing no request is cancelled.
    /// Both a `requestId` and a `progressId` can be specified in one request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub request_id: Option<u64>,
}

/// Information about the capabilities of a debug adapter.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Capabilities {
    /// The set of additional module information exposed by the debug adapter.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub additional_module_columns: Option<Vec<ColumnDescriptor>>,
    /// Modes of breakpoints supported by the debug adapter, such as 'hardware' or 'software'. If present, the client may allow the user to select a mode and include it in its `setBreakpoints` request.
    ///
    /// Clients may present the first applicable mode in this array as the 'default' mode in gestures that set breakpoints.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub breakpoint_modes: Option<Vec<BreakpointMode>>,
    /// The set of characters that should trigger completion in a REPL. If not specified, the UI should assume the `.` character.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub completion_trigger_characters: Option<Vec<String>>,
    /// Available exception filter options for the `setExceptionBreakpoints` request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub exception_breakpoint_filters: Option<Vec<ExceptionBreakpointsFilter>>,
    /// The debug adapter supports the `suspendDebuggee` attribute on the `disconnect` request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub support_suspend_debuggee: Option<bool>,
    /// The debug adapter supports the `terminateDebuggee` attribute on the `disconnect` request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub support_terminate_debuggee: Option<bool>,
    /// Checksum algorithms supported by the debug adapter.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supported_checksum_algorithms: Option<Vec<ChecksumAlgorithm>>,
    /// The debug adapter supports ANSI escape sequences in styling of `OutputEvent.output` and `Variable.value` fields.
    #[serde(rename = "supportsANSIStyling")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_ansistyling: Option<bool>,
    /// The debug adapter supports the `breakpointLocations` request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_breakpoint_locations_request: Option<bool>,
    /// The debug adapter supports the `cancel` request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_cancel_request: Option<bool>,
    /// The debug adapter supports the `clipboard` context value in the `evaluate` request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_clipboard_context: Option<bool>,
    /// The debug adapter supports the `completions` request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_completions_request: Option<bool>,
    /// The debug adapter supports conditional breakpoints.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_conditional_breakpoints: Option<bool>,
    /// The debug adapter supports the `configurationDone` request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_configuration_done_request: Option<bool>,
    /// The debug adapter supports the `asAddress` and `bytes` fields in the `dataBreakpointInfo` request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_data_breakpoint_bytes: Option<bool>,
    /// The debug adapter supports data breakpoints.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_data_breakpoints: Option<bool>,
    /// The debug adapter supports the delayed loading of parts of the stack, which requires that both the `startFrame` and `levels` arguments and the `totalFrames` result of the `stackTrace` request are supported.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_delayed_stack_trace_loading: Option<bool>,
    /// The debug adapter supports the `disassemble` request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_disassemble_request: Option<bool>,
    /// The debug adapter supports a (side effect free) `evaluate` request for data hovers.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_evaluate_for_hovers: Option<bool>,
    /// The debug adapter supports `filterOptions` as an argument on the `setExceptionBreakpoints` request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_exception_filter_options: Option<bool>,
    /// The debug adapter supports the `exceptionInfo` request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_exception_info_request: Option<bool>,
    /// The debug adapter supports `exceptionOptions` on the `setExceptionBreakpoints` request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_exception_options: Option<bool>,
    /// The debug adapter supports function breakpoints.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_function_breakpoints: Option<bool>,
    /// The debug adapter supports the `gotoTargets` request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_goto_targets_request: Option<bool>,
    /// The debug adapter supports breakpoints that break execution after a specified number of hits.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_hit_conditional_breakpoints: Option<bool>,
    /// The debug adapter supports adding breakpoints based on instruction references.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_instruction_breakpoints: Option<bool>,
    /// The debug adapter supports the `loadedSources` request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_loaded_sources_request: Option<bool>,
    /// The debug adapter supports log points by interpreting the `logMessage` attribute of the `SourceBreakpoint`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_log_points: Option<bool>,
    /// The debug adapter supports the `modules` request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_modules_request: Option<bool>,
    /// The debug adapter supports the `readMemory` request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_read_memory_request: Option<bool>,
    /// The debug adapter supports restarting a frame.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_restart_frame: Option<bool>,
    /// The debug adapter supports the `restart` request. In this case a client should not implement `restart` by terminating and relaunching the adapter but by calling the `restart` request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_restart_request: Option<bool>,
    /// The debug adapter supports the `setExpression` request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_set_expression: Option<bool>,
    /// The debug adapter supports setting a variable to a value.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_set_variable: Option<bool>,
    /// The debug adapter supports the `singleThread` property on the execution requests (`continue`, `next`, `stepIn`, `stepOut`, `reverseContinue`, `stepBack`).
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_single_thread_execution_requests: Option<bool>,
    /// The debug adapter supports stepping back via the `stepBack` and `reverseContinue` requests.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_step_back: Option<bool>,
    /// The debug adapter supports the `stepInTargets` request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_step_in_targets_request: Option<bool>,
    /// The debug adapter supports stepping granularities (argument `granularity`) for the stepping requests.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_stepping_granularity: Option<bool>,
    /// The debug adapter supports the `terminate` request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_terminate_request: Option<bool>,
    /// The debug adapter supports the `terminateThreads` request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_terminate_threads_request: Option<bool>,
    /// The debug adapter supports a `format` attribute on the `stackTrace`, `variables`, and `evaluate` requests.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_value_formatting_options: Option<bool>,
    /// The debug adapter supports the `writeMemory` request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_write_memory_request: Option<bool>,
}

/// The event indicates that one or more capabilities have changed.
/// Since the capabilities are dependent on the client and its UI, it might not be possible to change that at random times (or too late).
/// Consequently this event has a hint characteristic: a client can only be expected to make a 'best effort' in honoring individual capabilities but there are no guarantees.
/// Only changed capabilities need to be included, all other capabilities keep their values.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CapabilitiesEvent {
    /// The set of updated capabilities.
    pub capabilities: Capabilities,
}

/// The checksum of an item calculated by the specified algorithm.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Checksum {
    /// The algorithm used to calculate this checksum.
    pub algorithm: ChecksumAlgorithm,
    /// Value of the checksum, encoded as a hexadecimal value.
    pub checksum: String,
}

/// Names of checksum algorithms that may be supported by a debug adapter.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub enum ChecksumAlgorithm {
    #[serde(rename = "MD5")]
    Md5,
    #[serde(rename = "SHA1")]
    Sha1,
    #[serde(rename = "SHA256")]
    Sha256,
    Timestamp,
}

/// A `ColumnDescriptor` specifies what module attribute to show in a column of the modules view, how to format it,
/// and what the column's label should be.
/// It is only used if the underlying UI actually supports this level of customization.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ColumnDescriptor {
    /// Name of the attribute rendered in this column.
    pub attribute_name: String,
    /// Format to use for the rendered values in this column. TBD how the format strings looks like.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub format: Option<String>,
    /// Header UI label of column.
    pub label: String,
    /// Datatype of values in this column. Defaults to `string` if not specified.
    #[serde(rename = "type")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ty: Option<ColumnDescriptorType>,
    /// Width of this column in characters (hint only).
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub width: Option<u64>,
}

/// Datatype of values in this column. Defaults to `string` if not specified.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub enum ColumnDescriptorType {
    String,
    Number,
    Boolean,
    #[serde(rename = "unixTimestampUTC")]
    UnixTimestampUtc,
}

/// `CompletionItems` are the suggestions returned from the `completions` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CompletionItem {
    /// A human-readable string with additional information about this item, like type or symbol information.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub detail: Option<String>,
    /// The label of this completion item. By default this is also the text that is inserted when selecting this completion.
    pub label: String,
    /// Length determines how many characters are overwritten by the completion text and it is measured in UTF-16 code units. If missing the value 0 is assumed which results in the completion text being inserted.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub length: Option<u64>,
    /// Determines the length of the new selection after the text has been inserted (or replaced) and it is measured in UTF-16 code units. The selection can not extend beyond the bounds of the completion text. If omitted the length is assumed to be 0.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub selection_length: Option<u64>,
    /// Determines the start of the new selection after the text has been inserted (or replaced). `selectionStart` is measured in UTF-16 code units and must be in the range 0 and length of the completion text. If omitted the selection starts at the end of the completion text.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub selection_start: Option<u64>,
    /// A string that should be used when comparing this item with other items. If not returned or an empty string, the `label` is used instead.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub sort_text: Option<String>,
    /// Start position (within the `text` attribute of the `completions` request) where the completion text is added. The position is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. If the start position is omitted the text is added at the location specified by the `column` attribute of the `completions` request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub start: Option<u64>,
    /// If text is returned and not an empty string, then it is inserted instead of the label.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub text: Option<String>,
    /// The item's type. Typically the client uses this information to render the item in the UI with an icon.
    #[serde(rename = "type")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ty: Option<CompletionItemType>,
}

/// Some predefined types for the CompletionItem. Please note that not all clients have specific icons for all of them.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub enum CompletionItemType {
    Method,
    Function,
    Constructor,
    Field,
    Variable,
    Class,
    Interface,
    Module,
    Property,
    Unit,
    Value,
    Enum,
    Keyword,
    Snippet,
    Text,
    Color,
    File,
    Reference,
    Customcolor,
}

/// Arguments for `completions` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CompletionsArguments {
    /// The position within `text` for which to determine the completion proposals. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based.
    pub column: u32,
    /// Returns completions in the scope of this stack frame. If not specified, the completions are returned for the global scope.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub frame_id: Option<u64>,
    /// A line for which to determine the completion proposals. If missing the first line of the text is assumed.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub line: Option<u32>,
    /// One or more source lines. Typically this is the text users have typed into the debug console before they asked for completion.
    pub text: String,
}

/// Response to `completions` request.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CompletionsResponse {
    /// The possible completions for .
    pub targets: Vec<CompletionItem>,
}

/// Arguments for `configurationDone` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
pub struct ConfigurationDoneArguments;

/// Arguments for `continue` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ContinueArguments {
    /// If this flag is true, execution is resumed only for the thread with given `threadId`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub single_thread: Option<bool>,
    /// Specifies the active thread. If the debug adapter supports single thread execution (see `supportsSingleThreadExecutionRequests`) and the argument `singleThread` is true, only the thread with this ID is resumed.
    pub thread_id: u64,
}

/// Response to `continue` request.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ContinueResponse {
    /// If omitted or set to `true`, this response signals to the client that all threads have been resumed. The value `false` indicates that not all threads were resumed.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub all_threads_continued: Option<bool>,
}

/// The event indicates that the execution of the debuggee has continued.
/// Please note: a debug adapter is not expected to send this event in response to a request that implies that execution continues, e.g. `launch` or `continue`.
/// It is only necessary to send a `continued` event if there was no previous request that implied this.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ContinuedEvent {
    /// If omitted or set to `true`, this event signals to the client that all threads have been resumed. The value `false` indicates that not all threads were resumed.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub all_threads_continued: Option<bool>,
    /// The thread which was continued.
    pub thread_id: u64,
}

/// Properties of a data breakpoint passed to the `setDataBreakpoints` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct DataBreakpoint {
    /// The access type of the data.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub access_type: Option<DataBreakpointAccessType>,
    /// An expression for conditional breakpoints.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub condition: Option<String>,
    /// An id representing the data. This id is returned from the `dataBreakpointInfo` request.
    pub data_id: String,
    /// An expression that controls how many hits of the breakpoint are ignored.
    /// The debug adapter is expected to interpret the expression as needed.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub hit_condition: Option<String>,
}

/// This enumeration defines all possible access types for data breakpoints.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub enum DataBreakpointAccessType {
    Read,
    Write,
    ReadWrite,
}

/// Arguments for `dataBreakpointInfo` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct DataBreakpointInfoArguments {
    /// If `true`, the `name` is a memory address and the debugger should interpret it as a decimal value, or hex value if it is prefixed with `0x`.
    ///
    /// Clients may set this property only if the `supportsDataBreakpointBytes`
    /// capability is true.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub as_address: Option<bool>,
    /// If specified, a debug adapter should return information for the range of memory extending `bytes` number of bytes from the address or variable specified by `name`. Breakpoints set using the resulting data ID should pause on data access anywhere within that range.
    ///
    /// Clients may set this property only if the `supportsDataBreakpointBytes` capability is true.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub bytes: Option<u64>,
    /// When `name` is an expression, evaluate it in the scope of this stack frame. If not specified, the expression is evaluated in the global scope. When `variablesReference` is specified, this property has no effect.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub frame_id: Option<u64>,
    /// The mode of the desired breakpoint. If defined, this must be one of the `breakpointModes` the debug adapter advertised in its `Capabilities`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub mode: Option<String>,
    /// The name of the variable's child to obtain data breakpoint information for.
    /// If `variablesReference` isn't specified, this can be an expression, or an address if `asAddress` is also true.
    pub name: String,
    /// Reference to the variable container if the data breakpoint is requested for a child of the container. The `variablesReference` must have been obtained in the current suspended state. See 'Lifetime of Object References' in the Overview section for details.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub variables_reference: Option<u32>,
}

/// Response to `dataBreakpointInfo` request.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct DataBreakpointInfoResponse {
    /// Attribute lists the available access types for a potential data breakpoint. A UI client could surface this information.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub access_types: Option<Vec<DataBreakpointAccessType>>,
    /// Attribute indicates that a potential data breakpoint could be persisted across sessions.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub can_persist: Option<bool>,
    /// An identifier for the data on which a data breakpoint can be registered with the `setDataBreakpoints` request or null if no data breakpoint is available. If a `variablesReference` or `frameId` is passed, the `dataId` is valid in the current suspended state, otherwise it's valid indefinitely. See 'Lifetime of Object References' in the Overview section for details. Breakpoints set using the `dataId` in the `setDataBreakpoints` request may outlive the lifetime of the associated `dataId`.
    pub data_id: Option<String>,
    /// UI string that describes on what data the breakpoint is set on or why a data breakpoint is not available.
    pub description: String,
}

/// Arguments for `disassemble` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct DisassembleArguments {
    /// Number of instructions to disassemble starting at the specified location and offset.
    /// An adapter must return exactly this number of instructions - any unavailable instructions should be replaced with an implementation-defined 'invalid instruction' value.
    pub instruction_count: u64,
    /// Offset (in instructions) to be applied after the byte offset (if any) before disassembling. Can be negative.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub instruction_offset: Option<u64>,
    /// Memory reference to the base location containing the instructions to disassemble.
    pub memory_reference: String,
    /// Offset (in bytes) to be applied to the reference location before disassembling. Can be negative.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub offset: Option<u32>,
    /// If true, the adapter should attempt to resolve memory addresses and other values to symbolic names.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resolve_symbols: Option<bool>,
}

/// Response to `disassemble` request.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct DisassembleResponse {
    /// The list of disassembled instructions.
    pub instructions: Vec<DisassembledInstruction>,
}

/// Represents a single disassembled instruction.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct DisassembledInstruction {
    /// The address of the instruction. Treated as a hex value if prefixed with `0x`, or as a decimal value otherwise.
    pub address: String,
    /// The column within the line that corresponds to this instruction, if any.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub column: Option<u32>,
    /// The end column of the range that corresponds to this instruction, if any.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub end_column: Option<u32>,
    /// The end line of the range that corresponds to this instruction, if any.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub end_line: Option<u32>,
    /// Text representing the instruction and its operands, in an implementation-defined format.
    pub instruction: String,
    /// Raw bytes representing the instruction and its operands, in an implementation-defined format.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub instruction_bytes: Option<String>,
    /// The line within the source location that corresponds to this instruction, if any.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub line: Option<u32>,
    /// Source location that corresponds to this instruction, if any.
    /// Should always be set (if available) on the first instruction returned,
    /// but can be omitted afterwards if this instruction maps to the same source file as the previous instruction.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub location: Option<Source>,
    /// A hint for how to present the instruction in the UI.
    ///
    /// A value of `invalid` may be used to indicate this instruction is 'filler' and cannot be reached by the program. For example, unreadable memory addresses may be presented is 'invalid.'
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub presentation_hint: Option<DisassembledInstructionPresentationHint>,
    /// Name of the symbol that corresponds with the location of this instruction, if any.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub symbol: Option<String>,
}

/// A hint for how to present the instruction in the UI.
///
/// A value of `invalid` may be used to indicate this instruction is 'filler' and cannot be reached by the program. For example, unreadable memory addresses may be presented is 'invalid.'
#[derive(Default, Debug, Clone, Copy, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub enum DisassembledInstructionPresentationHint {
    Normal,
    Invalid,
    #[default]
    #[serde(other)]
    Unknown,
}

/// Arguments for `disconnect` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct DisconnectArguments {
    /// A value of true indicates that this `disconnect` request is part of a restart sequence.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub restart: Option<bool>,
    /// Indicates whether the debuggee should stay suspended when the debugger is disconnected.
    /// If unspecified, the debuggee should resume execution.
    /// The attribute is only honored by a debug adapter if the corresponding capability `supportSuspendDebuggee` is true.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub suspend_debuggee: Option<bool>,
    /// Indicates whether the debuggee should be terminated when the debugger is disconnected.
    /// If unspecified, the debug adapter is free to do whatever it thinks is best.
    /// The attribute is only honored by a debug adapter if the corresponding capability `supportTerminateDebuggee` is true.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub terminate_debuggee: Option<bool>,
}

/// On error (whenever `success` is false), the body can provide more details.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ErrorResponse {
    /// A structured error message.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub error: Option<Message>,
}

/// Arguments for `evaluate` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct EvaluateArguments {
    /// The contextual column where the expression should be evaluated. This may be provided if `line` is also provided.
    ///
    /// It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub column: Option<u32>,
    /// The context in which the evaluate request is used.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub context: Option<EvaluateArgumentsContext>,
    /// The expression to evaluate.
    pub expression: String,
    /// Specifies details on how to format the result.
    /// The attribute is only honored by a debug adapter if the corresponding capability `supportsValueFormattingOptions` is true.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub format: Option<ValueFormat>,
    /// Evaluate the expression in the scope of this stack frame. If not specified, the expression is evaluated in the global scope.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub frame_id: Option<u64>,
    /// The contextual line where the expression should be evaluated. In the 'hover' context, this should be set to the start of the expression being hovered.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub line: Option<u32>,
    /// The contextual source in which the `line` is found. This must be provided if `line` is provided.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub source: Option<Source>,
}

/// The context in which the evaluate request is used.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[non_exhaustive]
#[serde(rename_all = "camelCase")]
pub enum EvaluateArgumentsContext {
    /// evaluate is called from a watch view context.
    Watch,
    /// evaluate is called from a REPL context.
    Repl,
    /// evaluate is called to generate the debug hover contents.
    /// This value should only be used if the corresponding capability `supportsEvaluateForHovers` is true.
    Hover,
    /// evaluate is called to generate clipboard contents.
    /// This value should only be used if the corresponding capability `supportsClipboardContext` is true.
    Clipboard,
    /// evaluate is called from a variables view context.
    Variables,
    #[default]
    #[serde(other)]
    Unknown,
}

/// Response to `evaluate` request.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct EvaluateResponse {
    /// The number of indexed child variables.
    /// The client can use this information to present the variables in a paged UI and fetch them in chunks.
    /// The value should be less than or equal to 2147483647 (2^31-1).
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub indexed_variables: Option<u32>,
    /// A memory reference to a location appropriate for this result.
    /// For pointer type eval results, this is generally a reference to the memory address contained in the pointer.
    /// This attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub memory_reference: Option<String>,
    /// The number of named child variables.
    /// The client can use this information to present the variables in a paged UI and fetch them in chunks.
    /// The value should be less than or equal to 2147483647 (2^31-1).
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub named_variables: Option<u32>,
    /// Properties of an evaluate result that can be used to determine how to render the result in the UI.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub presentation_hint: Option<VariablePresentationHint>,
    /// The result of the evaluate request.
    pub result: String,
    /// The type of the evaluate result.
    /// This attribute should only be returned by a debug adapter if the corresponding capability `supportsVariableType` is true.
    #[serde(rename = "type")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ty: Option<String>,
    /// A reference that allows the client to request the location where the returned value is declared. For example, if a function pointer is returned, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location.
    ///
    /// This reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub value_location_reference: Option<u64>,
    /// If `variablesReference` is > 0, the evaluate result is structured and its children can be retrieved by passing `variablesReference` to the `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details.
    pub variables_reference: u32,
}

/// This enumeration defines all possible conditions when a thrown exception should result in a break.
/// never: never breaks,
/// always: always breaks,
/// unhandled: breaks when exception unhandled,
/// userUnhandled: breaks if the exception is not handled by user code.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub enum ExceptionBreakMode {
    Never,
    Always,
    Unhandled,
    UserUnhandled,
}

/// An `ExceptionBreakpointsFilter` is shown in the UI as an filter option for configuring how exceptions are dealt with.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ExceptionBreakpointsFilter {
    /// A help text providing information about the condition. This string is shown as the placeholder text for a text box and can be translated.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub condition_description: Option<String>,
    /// Initial value of the filter option. If not specified a value false is assumed.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub default: Option<bool>,
    /// A help text providing additional information about the exception filter. This string is typically shown as a hover and can be translated.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// The internal ID of the filter option. This value is passed to the `setExceptionBreakpoints` request.
    pub filter: String,
    /// The name of the filter option. This is shown in the UI.
    pub label: String,
    /// Controls whether a condition can be specified for this filter option. If false or missing, a condition can not be set.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_condition: Option<bool>,
}

/// Detailed information about an exception that has occurred.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ExceptionDetails {
    /// An expression that can be evaluated in the current scope to obtain the exception object.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub evaluate_name: Option<String>,
    /// Fully-qualified type name of the exception object.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub full_type_name: Option<String>,
    /// Details of the exception contained by this exception, if any.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub inner_exception: Option<Vec<ExceptionDetails>>,
    /// Message contained in the exception.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub message: Option<String>,
    /// Stack trace at the time the exception was thrown.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub stack_trace: Option<String>,
    /// Short type name of the exception object.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub type_name: Option<String>,
}

/// An `ExceptionFilterOptions` is used to specify an exception filter together with a condition for the `setExceptionBreakpoints` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ExceptionFilterOptions {
    /// An expression for conditional exceptions.
    /// The exception breaks into the debugger if the result of the condition is true.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub condition: Option<String>,
    /// ID of an exception filter returned by the `exceptionBreakpointFilters` capability.
    pub filter_id: String,
    /// The mode of this exception breakpoint. If defined, this must be one of the `breakpointModes` the debug adapter advertised in its `Capabilities`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub mode: Option<String>,
}

/// Arguments for `exceptionInfo` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ExceptionInfoArguments {
    /// Thread for which exception information should be retrieved.
    pub thread_id: u64,
}

/// Response to `exceptionInfo` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ExceptionInfoResponse {
    /// Mode that caused the exception notification to be raised.
    pub break_mode: ExceptionBreakMode,
    /// Descriptive text for the exception.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Detailed information about the exception.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub details: Option<ExceptionDetails>,
    /// ID of the exception that was thrown.
    pub exception_id: String,
}

/// An `ExceptionOptions` assigns configuration options to a set of exceptions.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ExceptionOptions {
    /// Condition when a thrown exception should result in a break.
    pub break_mode: ExceptionBreakMode,
    /// A path that selects a single or multiple exceptions in a tree. If `path` is missing, the whole tree is selected.
    /// By convention the first segment of the path is a category that is used to group exceptions in the UI.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub path: Option<Vec<ExceptionPathSegment>>,
}

/// An `ExceptionPathSegment` represents a segment in a path that is used to match leafs or nodes in a tree of exceptions.
/// If a segment consists of more than one name, it matches the names provided if `negate` is false or missing, or it matches anything except the names provided if `negate` is true.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ExceptionPathSegment {
    /// Depending on the value of `negate` the names that should match or not match.
    pub names: Vec<String>,
    /// If false or missing this segment matches the names provided, otherwise it matches anything except the names provided.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub negate: Option<bool>,
}

/// The event indicates that the debuggee has exited and returns its exit code.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ExitedEvent {
    /// The exit code returned from the debuggee.
    pub exit_code: u64,
}

/// Properties of a breakpoint passed to the `setFunctionBreakpoints` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct FunctionBreakpoint {
    /// An expression for conditional breakpoints.
    /// It is only honored by a debug adapter if the corresponding capability `supportsConditionalBreakpoints` is true.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub condition: Option<String>,
    /// An expression that controls how many hits of the breakpoint are ignored.
    /// The debug adapter is expected to interpret the expression as needed.
    /// The attribute is only honored by a debug adapter if the corresponding capability `supportsHitConditionalBreakpoints` is true.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub hit_condition: Option<String>,
    /// The name of the function.
    pub name: String,
}

/// Arguments for `goto` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct GotoArguments {
    /// The location where the debuggee will continue to run.
    pub target_id: u64,
    /// Set the goto target for this thread.
    pub thread_id: u64,
}

/// A `GotoTarget` describes a code location that can be used as a target in the `goto` request.
/// The possible goto targets can be determined via the `gotoTargets` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct GotoTarget {
    /// The column of the goto target.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub column: Option<u32>,
    /// The end column of the range covered by the goto target.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub end_column: Option<u32>,
    /// The end line of the range covered by the goto target.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub end_line: Option<u32>,
    /// Unique identifier for a goto target. This is used in the `goto` request.
    pub id: u64,
    /// A memory reference for the instruction pointer value represented by this target.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub instruction_pointer_reference: Option<String>,
    /// The name of the goto target (shown in the UI).
    pub label: String,
    /// The line of the goto target.
    pub line: u32,
}

/// Arguments for `gotoTargets` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct GotoTargetsArguments {
    /// The position within `line` for which the goto targets are determined. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub column: Option<u32>,
    /// The line location for which the goto targets are determined.
    pub line: u32,
    /// The source location for which the goto targets are determined.
    pub source: Source,
}

/// Response to `gotoTargets` request.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct GotoTargetsResponse {
    /// The possible goto targets of the specified location.
    pub targets: Vec<GotoTarget>,
}

/// Arguments for `initialize` request.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct InitializeRequestArguments {
    /// The ID of the debug adapter.
    #[serde(rename = "adapterID")]
    pub adapter_id: String,
    /// The ID of the client using this adapter.
    #[serde(rename = "clientID")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub client_id: Option<String>,
    /// The human-readable name of the client using this adapter.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub client_name: Option<String>,
    /// If true all column numbers are 1-based (default).
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub columns_start_at1: Option<bool>,
    /// If true all line numbers are 1-based (default).
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub lines_start_at1: Option<bool>,
    /// The ISO-639 locale of the client using this adapter, e.g. en-US or de-CH.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub locale: Option<String>,
    /// Determines in what format paths are specified. The default is `path`, which is the native format.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub path_format: Option<InitializeRequestArgumentsPathFormat>,
    /// The client will interpret ANSI escape sequences in the display of `OutputEvent.output` and `Variable.value` fields when `Capabilities.supportsANSIStyling` is also enabled.
    #[serde(rename = "supportsANSIStyling")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_ansistyling: Option<bool>,
    /// Client supports the `argsCanBeInterpretedByShell` attribute on the `runInTerminal` request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_args_can_be_interpreted_by_shell: Option<bool>,
    /// Client supports the `invalidated` event.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_invalidated_event: Option<bool>,
    /// Client supports the `memory` event.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_memory_event: Option<bool>,
    /// Client supports memory references.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_memory_references: Option<bool>,
    /// Client supports progress reporting.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_progress_reporting: Option<bool>,
    /// Client supports the `runInTerminal` request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_run_in_terminal_request: Option<bool>,
    /// Client supports the `startDebugging` request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_start_debugging_request: Option<bool>,
    /// Client supports the paging of variables.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_variable_paging: Option<bool>,
    /// Client supports the `type` attribute for variables.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub supports_variable_type: Option<bool>,
}

/// Determines in what format paths are specified. The default is `path`, which is the native format.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[non_exhaustive]
#[serde(rename_all = "camelCase")]
pub enum InitializeRequestArgumentsPathFormat {
    Path,
    Uri,
    #[default]
    #[serde(other)]
    Unknown,
}

/// Properties of a breakpoint passed to the `setInstructionBreakpoints` request
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct InstructionBreakpoint {
    /// An expression for conditional breakpoints.
    /// It is only honored by a debug adapter if the corresponding capability `supportsConditionalBreakpoints` is true.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub condition: Option<String>,
    /// An expression that controls how many hits of the breakpoint are ignored.
    /// The debug adapter is expected to interpret the expression as needed.
    /// The attribute is only honored by a debug adapter if the corresponding capability `supportsHitConditionalBreakpoints` is true.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub hit_condition: Option<String>,
    /// The instruction reference of the breakpoint.
    /// This should be a memory or instruction pointer reference from an `EvaluateResponse`, `Variable`, `StackFrame`, `GotoTarget`, or `Breakpoint`.
    pub instruction_reference: String,
    /// The mode of this breakpoint. If defined, this must be one of the `breakpointModes` the debug adapter advertised in its `Capabilities`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub mode: Option<String>,
    /// The offset from the instruction reference in bytes.
    /// This can be negative.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub offset: Option<u32>,
}

/// Logical areas that can be invalidated by the `invalidated` event.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[non_exhaustive]
#[serde(rename_all = "camelCase")]
pub enum InvalidatedAreas {
    /// All previously fetched data has become invalid and needs to be refetched.
    All,
    /// Previously fetched stack related data has become invalid and needs to be refetched.
    Stacks,
    /// Previously fetched thread related data has become invalid and needs to be refetched.
    Threads,
    /// Previously fetched variable data has become invalid and needs to be refetched.
    Variables,
    #[default]
    #[serde(other)]
    Unknown,
}

/// This event signals that some state in the debug adapter has changed and requires that the client needs to re-render the data snapshot previously requested.
/// Debug adapters do not have to emit this event for runtime changes like stopped or thread events because in that case the client refetches the new state anyway. But the event can be used for example to refresh the UI after rendering formatting has changed in the debug adapter.
/// This event should only be sent if the corresponding capability `supportsInvalidatedEvent` is true.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct InvalidatedEvent {
    /// Set of logical areas that got invalidated. This property has a hint characteristic: a client can only be expected to make a 'best effort' in honoring the areas but there are no guarantees. If this property is missing, empty, or if values are not understood, the client should assume a single value `all`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub areas: Option<Vec<InvalidatedAreas>>,
    /// If specified, the client only needs to refetch data related to this stack frame (and the `threadId` is ignored).
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub stack_frame_id: Option<u64>,
    /// If specified, the client only needs to refetch data related to this thread.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub thread_id: Option<u64>,
}

/// The event indicates that some source has been added, changed, or removed from the set of all loaded sources.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct LoadedSourceEvent {
    /// The reason for the event.
    pub reason: LoadedSourceEventReason,
    /// The new, changed, or removed source.
    pub source: Source,
}

/// The reason for the event.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub enum LoadedSourceEventReason {
    New,
    Changed,
    Removed,
}

/// Arguments for `loadedSources` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
pub struct LoadedSourcesArguments;

/// Response to `loadedSources` request.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct LoadedSourcesResponse {
    /// Set of loaded sources.
    pub sources: Vec<Source>,
}

/// Arguments for `locations` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct LocationsArguments {
    /// Location reference to resolve.
    pub location_reference: u64,
}

/// Response to `locations` request.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct LocationsResponse {
    /// Position of the location within the `line`. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. If no column is given, the first position in the start line is assumed.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub column: Option<u32>,
    /// End position of the location within `endLine`, present if the location refers to a range. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub end_column: Option<u32>,
    /// End line of the location, present if the location refers to a range.  The client capability `linesStartAt1` determines whether it is 0- or 1-based.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub end_line: Option<u32>,
    /// The line number of the location. The client capability `linesStartAt1` determines whether it is 0- or 1-based.
    pub line: u32,
    /// The source containing the location; either `source.path` or `source.sourceReference` must be specified.
    pub source: Source,
}

/// This event indicates that some memory range has been updated. It should only be sent if the corresponding capability `supportsMemoryEvent` is true.
/// Clients typically react to the event by re-issuing a `readMemory` request if they show the memory identified by the `memoryReference` and if the updated memory range overlaps the displayed range. Clients should not make assumptions how individual memory references relate to each other, so they should not assume that they are part of a single continuous address range and might overlap.
/// Debug adapters can use this event to indicate that the contents of a memory range has changed due to some other request like `setVariable` or `setExpression`. Debug adapters are not expected to emit this event for each and every memory change of a running program, because that information is typically not available from debuggers and it would flood clients with too many events.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct MemoryEvent {
    /// Number of bytes updated.
    pub count: u64,
    /// Memory reference of a memory range that has been updated.
    pub memory_reference: String,
    /// Starting offset in bytes where memory has been updated. Can be negative.
    pub offset: u32,
}

/// A structured message object. Used to return errors from requests.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Message {
    /// A format string for the message. Embedded variables have the form `{name}`.
    /// If variable name starts with an underscore character, the variable does not contain user data (PII) and can be safely used for telemetry purposes.
    pub format: String,
    /// Unique (within a debug adapter implementation) identifier for the message. The purpose of these error IDs is to help extension authors that have the requirement that every user visible error message needs a corresponding error number, so that users or customer support can find information about the specific error more easily.
    pub id: u64,
    /// If true send to telemetry.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub send_telemetry: Option<bool>,
    /// If true show user.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub show_user: Option<bool>,
    /// A url where additional information about this message can be found.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
    /// A label that is presented to the user as the UI for opening the url.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub url_label: Option<String>,
    /// An object used as a dictionary for looking up the variables in the format string.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub variables: Option<serde_json::Value>,
}

/// A Module object represents a row in the modules view.
/// The `id` attribute identifies a module in the modules view and is used in a `module` event for identifying a module for adding, updating or deleting.
/// The `name` attribute is used to minimally render the module in the UI.
///
/// Additional attributes can be added to the module. They show up in the module view if they have a corresponding `ColumnDescriptor`.
///
/// To avoid an unnecessary proliferation of additional attributes with similar semantics but different names, we recommend to re-use attributes from the 'recommended' list below first, and only introduce new attributes if nothing appropriate could be found.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Module {
    /// Address range covered by this module.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub address_range: Option<String>,
    /// Module created or modified, encoded as a RFC 3339 timestamp.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub date_time_stamp: Option<String>,
    /// Unique identifier for the module.
    pub id: ModuleId,
    /// True if the module is optimized.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub is_optimized: Option<bool>,
    /// True if the module is considered 'user code' by a debugger that supports 'Just My Code'.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub is_user_code: Option<bool>,
    /// A name of the module.
    pub name: String,
    /// Logical full path to the module. The exact definition is implementation defined, but usually this would be a full path to the on-disk file for the module.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub path: Option<String>,
    /// Logical full path to the symbol file. The exact definition is implementation defined.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub symbol_file_path: Option<String>,
    /// User-understandable description of if symbols were found for the module (ex: 'Symbols Loaded', 'Symbols not found', etc.)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub symbol_status: Option<String>,
    /// Version of Module.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub version: Option<String>,
}

/// The event indicates that some information about a module has changed.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ModuleEvent {
    /// The new, changed, or removed module. In case of `removed` only the module id is used.
    pub module: Module,
    /// The reason for the event.
    pub reason: ModuleEventReason,
}

/// The reason for the event.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub enum ModuleEventReason {
    New,
    Changed,
    Removed,
}

/// Arguments for `modules` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ModulesArguments {
    /// The number of modules to return. If `moduleCount` is not specified or 0, all modules are returned.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub module_count: Option<u64>,
    /// The index of the first module to return; if omitted modules start at 0.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub start_module: Option<u64>,
}

/// Response to `modules` request.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ModulesResponse {
    /// All modules or range of modules.
    pub modules: Vec<Module>,
    /// The total number of modules available.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_modules: Option<u64>,
}

/// Arguments for `next` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct NextArguments {
    /// Stepping granularity. If no granularity is specified, a granularity of `statement` is assumed.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub granularity: Option<SteppingGranularity>,
    /// If this flag is true, all other suspended threads are not resumed.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub single_thread: Option<bool>,
    /// Specifies the thread for which to resume execution for one step (of the given granularity).
    pub thread_id: u64,
}

/// The event indicates that the target has produced some output.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct OutputEvent {
    /// The output category. If not specified or if the category is not understood by the client, `console` is assumed.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub category: Option<OutputEventCategory>,
    /// The position in `line` where the output was produced. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub column: Option<u32>,
    /// Additional data to report. For the `telemetry` category the data is sent to telemetry, for the other categories the data is shown in JSON format.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub data: Option<serde_json::Value>,
    /// Support for keeping an output log organized by grouping related messages.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub group: Option<OutputEventGroup>,
    /// The source location's line where the output was produced.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub line: Option<u32>,
    /// A reference that allows the client to request the location where the new value is declared. For example, if the logged value is function pointer, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location.
    ///
    /// This reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub location_reference: Option<u64>,
    /// The output to report.
    ///
    /// ANSI escape sequences may be used to influence text color and styling if `supportsANSIStyling` is present in both the adapter's `Capabilities` and the client's `InitializeRequestArguments`. A client may strip any unrecognized ANSI sequences.
    ///
    /// If the `supportsANSIStyling` capabilities are not both true, then the client should display the output literally.
    pub output: String,
    /// The source location where the output was produced.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub source: Option<Source>,
    /// If an attribute `variablesReference` exists and its value is > 0, the output contains objects which can be retrieved by passing `variablesReference` to the `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub variables_reference: Option<u32>,
}

/// The output category. If not specified or if the category is not understood by the client, `console` is assumed.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[non_exhaustive]
#[serde(rename_all = "camelCase")]
pub enum OutputEventCategory {
    /// Show the output in the client's default message UI, e.g. a 'debug console'. This category should only be used for informational output from the debugger (as opposed to the debuggee).
    Console,
    /// A hint for the client to show the output in the client's UI for important and highly visible information, e.g. as a popup notification. This category should only be used for important messages from the debugger (as opposed to the debuggee). Since this category value is a hint, clients might ignore the hint and assume the `console` category.
    Important,
    /// Show the output as normal program output from the debuggee.
    Stdout,
    /// Show the output as error program output from the debuggee.
    Stderr,
    /// Send the output to telemetry instead of showing it to the user.
    Telemetry,
    #[default]
    #[serde(other)]
    Unknown,
}

/// Support for keeping an output log organized by grouping related messages.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub enum OutputEventGroup {
    /// Start a new group in expanded mode. Subsequent output events are members of the group and should be shown indented.
    /// The `output` attribute becomes the name of the group and is not indented.
    Start,
    /// Start a new group in collapsed mode. Subsequent output events are members of the group and should be shown indented (as soon as the group is expanded).
    /// The `output` attribute becomes the name of the group and is not indented.
    StartCollapsed,
    /// End the current group and decrease the indentation of subsequent output events.
    /// A non-empty `output` attribute is shown as the unindented end of the group.
    End,
}

/// Arguments for `pause` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct PauseArguments {
    /// Pause execution for this thread.
    pub thread_id: u64,
}

/// The event indicates that the debugger has begun debugging a new process. Either one that it has launched, or one that it has attached to.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ProcessEvent {
    /// If true, the process is running on the same computer as the debug adapter.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub is_local_process: Option<bool>,
    /// The logical name of the process. This is usually the full path to process's executable file. Example: /home/example/myproj/program.js.
    pub name: String,
    /// The size of a pointer or address for this process, in bits. This value may be used by clients when formatting addresses for display.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub pointer_size: Option<u64>,
    /// Describes how the debug engine started debugging this process.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub start_method: Option<ProcessEventStartMethod>,
    /// The process ID of the debugged process, as assigned by the operating system. This property should be omitted for logical processes that do not map to operating system processes on the machine.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub system_process_id: Option<u64>,
}

/// Describes how the debug engine started debugging this process.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub enum ProcessEventStartMethod {
    /// Process was launched under the debugger.
    Launch,
    /// Debugger attached to an existing process.
    Attach,
    /// A project launcher component has launched a new process in a suspended state and then asked the debugger to attach.
    AttachForSuspendedLaunch,
}

/// The event signals the end of the progress reporting with a final message.
/// This event should only be sent if the corresponding capability `supportsProgressReporting` is true.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ProgressEndEvent {
    /// More detailed progress message. If omitted, the previous message (if any) is used.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub message: Option<String>,
    /// The ID that was introduced in the initial `ProgressStartEvent`.
    pub progress_id: String,
}

/// The event signals that a long running operation is about to start and provides additional information for the client to set up a corresponding progress and cancellation UI.
/// The client is free to delay the showing of the UI in order to reduce flicker.
/// This event should only be sent if the corresponding capability `supportsProgressReporting` is true.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ProgressStartEvent {
    /// If true, the request that reports progress may be cancelled with a `cancel` request.
    /// So this property basically controls whether the client should use UX that supports cancellation.
    /// Clients that don't support cancellation are allowed to ignore the setting.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub cancellable: Option<bool>,
    /// More detailed progress message.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub message: Option<String>,
    /// Progress percentage to display (value range: 0 to 100). If omitted no percentage is shown.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub percentage: Option<u64>,
    /// An ID that can be used in subsequent `progressUpdate` and `progressEnd` events to make them refer to the same progress reporting.
    /// IDs must be unique within a debug session.
    pub progress_id: String,
    /// The request ID that this progress report is related to. If specified a debug adapter is expected to emit progress events for the long running request until the request has been either completed or cancelled.
    /// If the request ID is omitted, the progress report is assumed to be related to some general activity of the debug adapter.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub request_id: Option<u64>,
    /// Short title of the progress reporting. Shown in the UI to describe the long running operation.
    pub title: String,
}

/// The event signals that the progress reporting needs to be updated with a new message and/or percentage.
/// The client does not have to update the UI immediately, but the clients needs to keep track of the message and/or percentage values.
/// This event should only be sent if the corresponding capability `supportsProgressReporting` is true.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ProgressUpdateEvent {
    /// More detailed progress message. If omitted, the previous message (if any) is used.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub message: Option<String>,
    /// Progress percentage to display (value range: 0 to 100). If omitted no percentage is shown.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub percentage: Option<u64>,
    /// The ID that was introduced in the initial `progressStart` event.
    pub progress_id: String,
}

/// Arguments for `readMemory` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ReadMemoryArguments {
    /// Number of bytes to read at the specified location and offset.
    pub count: u64,
    /// Memory reference to the base location from which data should be read.
    pub memory_reference: String,
    /// Offset (in bytes) to be applied to the reference location before reading data. Can be negative.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub offset: Option<u32>,
}

/// Response to `readMemory` request.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ReadMemoryResponse {
    /// The address of the first byte of data returned.
    /// Treated as a hex value if prefixed with `0x`, or as a decimal value otherwise.
    pub address: String,
    /// The bytes read from memory, encoded using base64. If the decoded length of `data` is less than the requested `count` in the original `readMemory` request, and `unreadableBytes` is zero or omitted, then the client should assume it's reached the end of readable memory.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub data: Option<String>,
    /// The number of unreadable bytes encountered after the last successfully read byte.
    /// This can be used to determine the number of bytes that should be skipped before a subsequent `readMemory` request succeeds.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub unreadable_bytes: Option<u64>,
}

/// Arguments for `restartFrame` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct RestartFrameArguments {
    /// Restart the stack frame identified by `frameId`. The `frameId` must have been obtained in the current suspended state. See 'Lifetime of Object References' in the Overview section for details.
    pub frame_id: u64,
}

/// Arguments for `reverseContinue` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ReverseContinueArguments {
    /// If this flag is true, backward execution is resumed only for the thread with given `threadId`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub single_thread: Option<bool>,
    /// Specifies the active thread. If the debug adapter supports single thread execution (see `supportsSingleThreadExecutionRequests`) and the `singleThread` argument is true, only the thread with this ID is resumed.
    pub thread_id: u64,
}

/// Arguments for `runInTerminal` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct RunInTerminalRequestArguments {
    /// List of arguments. The first argument is the command to run.
    pub args: Vec<String>,
    /// This property should only be set if the corresponding capability `supportsArgsCanBeInterpretedByShell` is true. If the client uses an intermediary shell to launch the application, then the client must not attempt to escape characters with special meanings for the shell. The user is fully responsible for escaping as needed and that arguments using special characters may not be portable across shells.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub args_can_be_interpreted_by_shell: Option<bool>,
    /// Working directory for the command. For non-empty, valid paths this typically results in execution of a change directory command.
    pub cwd: String,
    /// Environment key-value pairs that are added to or removed from the default environment.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub env: Option<serde_json::Value>,
    /// What kind of terminal to launch. Defaults to `integrated` if not specified.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub kind: Option<RunInTerminalRequestArgumentsKind>,
    /// Title of the terminal.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,
}

/// What kind of terminal to launch. Defaults to `integrated` if not specified.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub enum RunInTerminalRequestArgumentsKind {
    Integrated,
    External,
}

/// Response to `runInTerminal` request.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct RunInTerminalResponse {
    /// The process ID. The value should be less than or equal to 2147483647 (2^31-1).
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub process_id: Option<u32>,
    /// The process ID of the terminal shell. The value should be less than or equal to 2147483647 (2^31-1).
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub shell_process_id: Option<u32>,
}

/// A `Scope` is a named container for variables. Optionally a scope can map to a source or a range within a source.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Scope {
    /// Start position of the range covered by the scope. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub column: Option<u32>,
    /// End position of the range covered by the scope. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub end_column: Option<u32>,
    /// The end line of the range covered by this scope.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub end_line: Option<u32>,
    /// If true, the number of variables in this scope is large or expensive to retrieve.
    pub expensive: bool,
    /// The number of indexed variables in this scope.
    /// The client can use this information to present the variables in a paged UI and fetch them in chunks.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub indexed_variables: Option<u32>,
    /// The start line of the range covered by this scope.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub line: Option<u32>,
    /// Name of the scope such as 'Arguments', 'Locals', or 'Registers'. This string is shown in the UI as is and can be translated.
    pub name: String,
    /// The number of named variables in this scope.
    /// The client can use this information to present the variables in a paged UI and fetch them in chunks.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub named_variables: Option<u32>,
    /// A hint for how to present this scope in the UI. If this attribute is missing, the scope is shown with a generic UI.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub presentation_hint: Option<ScopePresentationHint>,
    /// The source for this scope.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub source: Option<Source>,
    /// The variables of this scope can be retrieved by passing the value of `variablesReference` to the `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details.
    pub variables_reference: u32,
}

/// A hint for how to present this scope in the UI. If this attribute is missing, the scope is shown with a generic UI.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[non_exhaustive]
#[serde(rename_all = "camelCase")]
pub enum ScopePresentationHint {
    /// Scope contains method arguments.
    Arguments,
    /// Scope contains local variables.
    Locals,
    /// Scope contains registers. Only a single `registers` scope should be returned from a `scopes` request.
    Registers,
    /// Scope contains one or more return values.
    ReturnValue,
    #[default]
    #[serde(other)]
    Unknown,
}

/// Arguments for `scopes` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ScopesArguments {
    /// Retrieve the scopes for the stack frame identified by `frameId`. The `frameId` must have been obtained in the current suspended state. See 'Lifetime of Object References' in the Overview section for details.
    pub frame_id: u64,
}

/// Response to `scopes` request.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ScopesResponse {
    /// The scopes of the stack frame. If the array has length zero, there are no scopes available.
    pub scopes: Vec<Scope>,
}

/// Arguments for `setBreakpoints` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SetBreakpointsArguments {
    /// The code locations of the breakpoints.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub breakpoints: Option<Vec<SourceBreakpoint>>,
    /// Deprecated: The code locations of the breakpoints.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub lines: Option<Vec<u64>>,
    /// The source location of the breakpoints; either `source.path` or `source.sourceReference` must be specified.
    pub source: Source,
    /// A value of true indicates that the underlying source has been modified which results in new breakpoint locations.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub source_modified: Option<bool>,
}

/// Response to `setBreakpoints` request.
/// Returned is information about each breakpoint created by this request.
/// This includes the actual code location and whether the breakpoint could be verified.
/// The breakpoints returned are in the same order as the elements of the `breakpoints`
/// (or the deprecated `lines`) array in the arguments.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SetBreakpointsResponse {
    /// Information about the breakpoints.
    /// The array elements are in the same order as the elements of the `breakpoints` (or the deprecated `lines`) array in the arguments.
    pub breakpoints: Vec<Breakpoint>,
}

/// Arguments for `setDataBreakpoints` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SetDataBreakpointsArguments {
    /// The contents of this array replaces all existing data breakpoints. An empty array clears all data breakpoints.
    pub breakpoints: Vec<DataBreakpoint>,
}

/// Response to `setDataBreakpoints` request.
/// Returned is information about each breakpoint created by this request.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SetDataBreakpointsResponse {
    /// Information about the data breakpoints. The array elements correspond to the elements of the input argument `breakpoints` array.
    pub breakpoints: Vec<Breakpoint>,
}

/// Arguments for `setExceptionBreakpoints` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SetExceptionBreakpointsArguments {
    /// Configuration options for selected exceptions.
    /// The attribute is only honored by a debug adapter if the corresponding capability `supportsExceptionOptions` is true.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub exception_options: Option<Vec<ExceptionOptions>>,
    /// Set of exception filters and their options. The set of all possible exception filters is defined by the `exceptionBreakpointFilters` capability. This attribute is only honored by a debug adapter if the corresponding capability `supportsExceptionFilterOptions` is true. The `filter` and `filterOptions` sets are additive.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub filter_options: Option<Vec<ExceptionFilterOptions>>,
    /// Set of exception filters specified by their ID. The set of all possible exception filters is defined by the `exceptionBreakpointFilters` capability. The `filter` and `filterOptions` sets are additive.
    pub filters: Vec<String>,
}

/// Response to `setExceptionBreakpoints` request.
/// The response contains an array of `Breakpoint` objects with information about each exception breakpoint or filter. The `Breakpoint` objects are in the same order as the elements of the `filters`, `filterOptions`, `exceptionOptions` arrays given as arguments. If both `filters` and `filterOptions` are given, the returned array must start with `filters` information first, followed by `filterOptions` information.
/// The `verified` property of a `Breakpoint` object signals whether the exception breakpoint or filter could be successfully created and whether the condition is valid. In case of an error the `message` property explains the problem. The `id` property can be used to introduce a unique ID for the exception breakpoint or filter so that it can be updated subsequently by sending breakpoint events.
/// For backward compatibility both the `breakpoints` array and the enclosing `body` are optional. If these elements are missing a client is not able to show problems for individual exception breakpoints or filters.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SetExceptionBreakpointsResponse {
    /// Information about the exception breakpoints or filters.
    /// The breakpoints returned are in the same order as the elements of the `filters`, `filterOptions`, `exceptionOptions` arrays in the arguments. If both `filters` and `filterOptions` are given, the returned array must start with `filters` information first, followed by `filterOptions` information.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub breakpoints: Option<Vec<Breakpoint>>,
}

/// Arguments for `setExpression` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SetExpressionArguments {
    /// The l-value expression to assign to.
    pub expression: String,
    /// Specifies how the resulting value should be formatted.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub format: Option<ValueFormat>,
    /// Evaluate the expressions in the scope of this stack frame. If not specified, the expressions are evaluated in the global scope.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub frame_id: Option<u64>,
    /// The value expression to assign to the l-value expression.
    pub value: String,
}

/// Response to `setExpression` request.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SetExpressionResponse {
    /// The number of indexed child variables.
    /// The client can use this information to present the variables in a paged UI and fetch them in chunks.
    /// The value should be less than or equal to 2147483647 (2^31-1).
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub indexed_variables: Option<u32>,
    /// A memory reference to a location appropriate for this result.
    /// For pointer type eval results, this is generally a reference to the memory address contained in the pointer.
    /// This attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub memory_reference: Option<String>,
    /// The number of named child variables.
    /// The client can use this information to present the variables in a paged UI and fetch them in chunks.
    /// The value should be less than or equal to 2147483647 (2^31-1).
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub named_variables: Option<u32>,
    /// Properties of a value that can be used to determine how to render the result in the UI.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub presentation_hint: Option<VariablePresentationHint>,
    /// The type of the value.
    /// This attribute should only be returned by a debug adapter if the corresponding capability `supportsVariableType` is true.
    #[serde(rename = "type")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ty: Option<String>,
    /// The new value of the expression.
    pub value: String,
    /// A reference that allows the client to request the location where the new value is declared. For example, if the new value is function pointer, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location.
    ///
    /// This reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub value_location_reference: Option<u64>,
    /// If `variablesReference` is > 0, the evaluate result is structured and its children can be retrieved by passing `variablesReference` to the `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub variables_reference: Option<u32>,
}

/// Arguments for `setFunctionBreakpoints` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SetFunctionBreakpointsArguments {
    /// The function names of the breakpoints.
    pub breakpoints: Vec<FunctionBreakpoint>,
}

/// Response to `setFunctionBreakpoints` request.
/// Returned is information about each breakpoint created by this request.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SetFunctionBreakpointsResponse {
    /// Information about the breakpoints. The array elements correspond to the elements of the `breakpoints` array.
    pub breakpoints: Vec<Breakpoint>,
}

/// Arguments for `setInstructionBreakpoints` request
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SetInstructionBreakpointsArguments {
    /// The instruction references of the breakpoints
    pub breakpoints: Vec<InstructionBreakpoint>,
}

/// Response to `setInstructionBreakpoints` request
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SetInstructionBreakpointsResponse {
    /// Information about the breakpoints. The array elements correspond to the elements of the `breakpoints` array.
    pub breakpoints: Vec<Breakpoint>,
}

/// Arguments for `setVariable` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SetVariableArguments {
    /// Specifies details on how to format the response value.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub format: Option<ValueFormat>,
    /// The name of the variable in the container.
    pub name: String,
    /// The value of the variable.
    pub value: String,
    /// The reference of the variable container. The `variablesReference` must have been obtained in the current suspended state. See 'Lifetime of Object References' in the Overview section for details.
    pub variables_reference: u32,
}

/// Response to `setVariable` request.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SetVariableResponse {
    /// The number of indexed child variables.
    /// The client can use this information to present the variables in a paged UI and fetch them in chunks.
    /// The value should be less than or equal to 2147483647 (2^31-1).
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub indexed_variables: Option<u32>,
    /// A memory reference to a location appropriate for this result.
    /// For pointer type eval results, this is generally a reference to the memory address contained in the pointer.
    /// This attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub memory_reference: Option<String>,
    /// The number of named child variables.
    /// The client can use this information to present the variables in a paged UI and fetch them in chunks.
    /// The value should be less than or equal to 2147483647 (2^31-1).
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub named_variables: Option<u32>,
    /// The type of the new value. Typically shown in the UI when hovering over the value.
    #[serde(rename = "type")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ty: Option<String>,
    /// The new value of the variable.
    pub value: String,
    /// A reference that allows the client to request the location where the new value is declared. For example, if the new value is function pointer, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location.
    ///
    /// This reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub value_location_reference: Option<u64>,
    /// If `variablesReference` is > 0, the new value is structured and its children can be retrieved by passing `variablesReference` to the `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details.
    ///
    /// If this property is included in the response, any `variablesReference` previously associated with the updated variable, and those of its children, are no longer valid.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub variables_reference: Option<u32>,
}

/// A `Source` is a descriptor for source code.
/// It is returned from the debug adapter as part of a `StackFrame` and it is used by clients when specifying breakpoints.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Source {
    /// Additional data that a debug adapter might want to loop through the client.
    /// The client should leave the data intact and persist it across sessions. The client should not interpret the data.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub adapter_data: Option<serde_json::Value>,
    /// The checksums associated with this file.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub checksums: Option<Vec<Checksum>>,
    /// The short name of the source. Every source returned from the debug adapter has a name.
    /// When sending a source to the debug adapter this name is optional.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// The origin of this source. For example, 'internal module', 'inlined content from source map', etc.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub origin: Option<String>,
    /// The path of the source to be shown in the UI.
    /// It is only used to locate and load the content of the source if no `sourceReference` is specified (or its value is 0).
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub path: Option<String>,
    /// A hint for how to present the source in the UI.
    /// A value of `deemphasize` can be used to indicate that the source is not available or that it is skipped on stepping.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub presentation_hint: Option<SourcePresentationHint>,
    /// If the value > 0 the contents of the source must be retrieved through the `source` request (even if a path is specified).
    /// Since a `sourceReference` is only valid for a session, it can not be used to persist a source.
    /// The value should be less than or equal to 2147483647 (2^31-1).
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub source_reference: Option<u32>,
    /// A list of sources that are related to this source. These may be the source that generated this source.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub sources: Option<Vec<Source>>,
}

/// A hint for how to present the source in the UI.
/// A value of `deemphasize` can be used to indicate that the source is not available or that it is skipped on stepping.
#[derive(Default, Debug, Clone, Copy, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub enum SourcePresentationHint {
    Normal,
    Emphasize,
    Deemphasize,
    #[default]
    #[serde(other)]
    Unknown,
}

/// Arguments for `source` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SourceArguments {
    /// Specifies the source content to load. Either `source.path` or `source.sourceReference` must be specified.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub source: Option<Source>,
    /// The reference to the source. This is the same as `source.sourceReference`.
    /// This is provided for backward compatibility since old clients do not understand the `source` attribute.
    pub source_reference: u32,
}

/// Properties of a breakpoint or logpoint passed to the `setBreakpoints` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SourceBreakpoint {
    /// Start position within source line of the breakpoint or logpoint. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub column: Option<u32>,
    /// The expression for conditional breakpoints.
    /// It is only honored by a debug adapter if the corresponding capability `supportsConditionalBreakpoints` is true.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub condition: Option<String>,
    /// The expression that controls how many hits of the breakpoint are ignored.
    /// The debug adapter is expected to interpret the expression as needed.
    /// The attribute is only honored by a debug adapter if the corresponding capability `supportsHitConditionalBreakpoints` is true.
    /// If both this property and `condition` are specified, `hitCondition` should be evaluated only if the `condition` is met, and the debug adapter should stop only if both conditions are met.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub hit_condition: Option<String>,
    /// The source line of the breakpoint or logpoint.
    pub line: u32,
    /// If this attribute exists and is non-empty, the debug adapter must not 'break' (stop)
    /// but log the message instead. Expressions within `{}` are interpolated.
    /// The attribute is only honored by a debug adapter if the corresponding capability `supportsLogPoints` is true.
    /// If either `hitCondition` or `condition` is specified, then the message should only be logged if those conditions are met.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub log_message: Option<String>,
    /// The mode of this breakpoint. If defined, this must be one of the `breakpointModes` the debug adapter advertised in its `Capabilities`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub mode: Option<String>,
}

/// Response to `source` request.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SourceResponse {
    /// Content of the source reference.
    pub content: String,
    /// Content type (MIME type) of the source.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub mime_type: Option<String>,
}

/// A Stackframe contains the source location.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct StackFrame {
    /// Indicates whether this frame can be restarted with the `restartFrame` request. Clients should only use this if the debug adapter supports the `restart` request and the corresponding capability `supportsRestartFrame` is true. If a debug adapter has this capability, then `canRestart` defaults to `true` if the property is absent.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub can_restart: Option<bool>,
    /// Start position of the range covered by the stack frame. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. If attribute `source` is missing or doesn't exist, `column` is 0 and should be ignored by the client.
    pub column: u32,
    /// End position of the range covered by the stack frame. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub end_column: Option<u32>,
    /// The end line of the range covered by the stack frame.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub end_line: Option<u32>,
    /// An identifier for the stack frame. It must be unique across all threads.
    /// This id can be used to retrieve the scopes of the frame with the `scopes` request or to restart the execution of a stack frame.
    pub id: u64,
    /// A memory reference for the current instruction pointer in this frame.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub instruction_pointer_reference: Option<String>,
    /// The line within the source of the frame. If the source attribute is missing or doesn't exist, `line` is 0 and should be ignored by the client.
    pub line: u32,
    /// The module associated with this frame, if any.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub module_id: Option<ModuleId>,
    /// The name of the stack frame, typically a method name.
    pub name: String,
    /// A hint for how to present this frame in the UI.
    /// A value of `label` can be used to indicate that the frame is an artificial frame that is used as a visual label or separator. A value of `subtle` can be used to change the appearance of a frame in a 'subtle' way.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub presentation_hint: Option<StackFramePresentationHint>,
    /// The source of the frame.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub source: Option<Source>,
}

/// A hint for how to present this frame in the UI.
/// A value of `label` can be used to indicate that the frame is an artificial frame that is used as a visual label or separator. A value of `subtle` can be used to change the appearance of a frame in a 'subtle' way.
#[derive(Default, Debug, Clone, Copy, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub enum StackFramePresentationHint {
    Normal,
    Label,
    Subtle,
    #[serde(rename = "deemphasize")]
    Deemphasize,
    #[default]
    #[serde(other)]
    Unknown,
}

/// Provides formatting information for a stack frame.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct StackFrameFormat {
    /// Display the value in hex.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub hex: Option<bool>,
    /// Includes all stack frames, including those the debug adapter might otherwise hide.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub include_all: Option<bool>,
    /// Displays the line number of the stack frame.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub line: Option<bool>,
    /// Displays the module of the stack frame.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub module: Option<bool>,
    /// Displays the names of parameters for the stack frame.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub parameter_names: Option<bool>,
    /// Displays the types of parameters for the stack frame.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub parameter_types: Option<bool>,
    /// Displays the values of parameters for the stack frame.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub parameter_values: Option<bool>,
    /// Displays parameters for the stack frame.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub parameters: Option<bool>,
}

/// Arguments for `stackTrace` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct StackTraceArguments {
    /// Specifies details on how to format the returned `StackFrame.name`. The debug adapter may format requested details in any way that would make sense to a developer.
    /// The attribute is only honored by a debug adapter if the corresponding capability `supportsValueFormattingOptions` is true.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub format: Option<StackFrameFormat>,
    /// The maximum number of frames to return. If levels is not specified or 0, all frames are returned.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub levels: Option<u64>,
    /// The index of the first frame to return; if omitted frames start at 0.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub start_frame: Option<u64>,
    /// Retrieve the stacktrace for this thread.
    pub thread_id: u64,
}

/// Response to `stackTrace` request.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct StackTraceResponse {
    /// The frames of the stack frame. If the array has length zero, there are no stack frames available.
    /// This means that there is no location information available.
    pub stack_frames: Vec<StackFrame>,
    /// The total number of frames available in the stack. If omitted or if `totalFrames` is larger than the available frames, a client is expected to request frames until a request returns less frames than requested (which indicates the end of the stack). Returning monotonically increasing `totalFrames` values for subsequent requests can be used to enforce paging in the client.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_frames: Option<u64>,
}

/// Arguments for `startDebugging` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct StartDebuggingRequestArguments {
    /// Arguments passed to the new debug session. The arguments must only contain properties understood by the `launch` or `attach` requests of the debug adapter and they must not contain any client-specific properties (e.g. `type`) or client-specific features (e.g. substitutable 'variables').
    pub configuration: serde_json::Value,
    /// Indicates whether the new debug session should be started with a `launch` or `attach` request.
    pub request: StartDebuggingRequestArgumentsRequest,
}

/// Indicates whether the new debug session should be started with a `launch` or `attach` request.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub enum StartDebuggingRequestArgumentsRequest {
    Launch,
    Attach,
}

/// Arguments for `stepBack` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct StepBackArguments {
    /// Stepping granularity to step. If no granularity is specified, a granularity of `statement` is assumed.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub granularity: Option<SteppingGranularity>,
    /// If this flag is true, all other suspended threads are not resumed.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub single_thread: Option<bool>,
    /// Specifies the thread for which to resume execution for one step backwards (of the given granularity).
    pub thread_id: u64,
}

/// Arguments for `stepIn` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct StepInArguments {
    /// Stepping granularity. If no granularity is specified, a granularity of `statement` is assumed.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub granularity: Option<SteppingGranularity>,
    /// If this flag is true, all other suspended threads are not resumed.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub single_thread: Option<bool>,
    /// Id of the target to step into.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub target_id: Option<u64>,
    /// Specifies the thread for which to resume execution for one step-into (of the given granularity).
    pub thread_id: u64,
}

/// A `StepInTarget` can be used in the `stepIn` request and determines into which single target the `stepIn` request should step.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct StepInTarget {
    /// Start position of the range covered by the step in target. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub column: Option<u32>,
    /// End position of the range covered by the step in target. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub end_column: Option<u32>,
    /// The end line of the range covered by the step-in target.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub end_line: Option<u32>,
    /// Unique identifier for a step-in target.
    pub id: u64,
    /// The name of the step-in target (shown in the UI).
    pub label: String,
    /// The line of the step-in target.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub line: Option<u32>,
}

/// Arguments for `stepInTargets` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct StepInTargetsArguments {
    /// The stack frame for which to retrieve the possible step-in targets.
    pub frame_id: u64,
}

/// Response to `stepInTargets` request.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct StepInTargetsResponse {
    /// The possible step-in targets of the specified source location.
    pub targets: Vec<StepInTarget>,
}

/// Arguments for `stepOut` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct StepOutArguments {
    /// Stepping granularity. If no granularity is specified, a granularity of `statement` is assumed.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub granularity: Option<SteppingGranularity>,
    /// If this flag is true, all other suspended threads are not resumed.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub single_thread: Option<bool>,
    /// Specifies the thread for which to resume execution for one step-out (of the given granularity).
    pub thread_id: u64,
}

/// The granularity of one 'step' in the stepping requests `next`, `stepIn`, `stepOut`, and `stepBack`.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub enum SteppingGranularity {
    /// The step should allow the program to run until the current statement has finished executing.
    /// The meaning of a statement is determined by the adapter and it may be considered equivalent to a line.
    /// For example 'for(int i = 0; i < 10; i++)' could be considered to have 3 statements 'int i = 0', 'i < 10', and 'i++'.
    Statement,
    /// The step should allow the program to run until the current source line has executed.
    Line,
    /// The step should allow one instruction to execute (e.g. one x86 instruction).
    Instruction,
}

/// The event indicates that the execution of the debuggee has stopped due to some condition.
/// This can be caused by a breakpoint previously set, a stepping request has completed, by executing a debugger statement etc.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct StoppedEvent {
    /// If `allThreadsStopped` is true, a debug adapter can announce that all threads have stopped.
    /// - The client should use this information to enable that all threads can be expanded to access their stacktraces.
    /// - If the attribute is missing or false, only the thread with the given `threadId` can be expanded.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub all_threads_stopped: Option<bool>,
    /// The full reason for the event, e.g. 'Paused on exception'. This string is shown in the UI as is and can be translated.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Ids of the breakpoints that triggered the event. In most cases there is only a single breakpoint but here are some examples for multiple breakpoints:
    /// - Different types of breakpoints map to the same location.
    /// - Multiple source breakpoints get collapsed to the same instruction by the compiler/runtime.
    /// - Multiple function breakpoints with different function names map to the same location.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub hit_breakpoint_ids: Option<Vec<u64>>,
    /// A value of true hints to the client that this event should not change the focus.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub preserve_focus_hint: Option<bool>,
    /// The reason for the event.
    /// For backward compatibility this string is shown in the UI if the `description` attribute is missing (but it must not be translated).
    pub reason: StoppedEventReason,
    /// Additional information. E.g. if reason is `exception`, text contains the exception name. This string is shown in the UI.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub text: Option<String>,
    /// The thread which was stopped.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub thread_id: Option<u64>,
}

/// The reason for the event.
/// For backward compatibility this string is shown in the UI if the `description` attribute is missing (but it must not be translated).
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[non_exhaustive]
#[serde(rename_all = "camelCase")]
pub enum StoppedEventReason {
    Step,
    Breakpoint,
    Exception,
    Pause,
    Entry,
    Goto,
    #[serde(rename = "function breakpoint")]
    FunctionBreakpoint,
    #[serde(rename = "data breakpoint")]
    DataBreakpoint,
    #[serde(rename = "instruction breakpoint")]
    InstructionBreakpoint,
    #[default]
    #[serde(other)]
    Unknown,
}

/// Arguments for `terminate` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct TerminateArguments {
    /// A value of true indicates that this `terminate` request is part of a restart sequence.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub restart: Option<bool>,
}

/// Arguments for `terminateThreads` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct TerminateThreadsArguments {
    /// Ids of threads to be terminated.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub thread_ids: Option<Vec<u64>>,
}

/// The event indicates that debugging of the debuggee has terminated. This does **not** mean that the debuggee itself has exited.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct TerminatedEvent {
    /// A debug adapter may set `restart` to true (or to an arbitrary object) to request that the client restarts the session.
    /// The value is not interpreted by the client and passed unmodified as an attribute `__restart` to the `launch` and `attach` requests.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub restart: Option<serde_json::Value>,
}

/// A Thread
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Thread {
    /// Unique identifier for the thread.
    pub id: u64,
    /// The name of the thread.
    pub name: String,
}

/// The event indicates that a thread has started or exited.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ThreadEvent {
    /// The reason for the event.
    pub reason: ThreadEventReason,
    /// The identifier of the thread.
    pub thread_id: u64,
}

/// The reason for the event.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[non_exhaustive]
#[serde(rename_all = "camelCase")]
pub enum ThreadEventReason {
    Started,
    Exited,
    #[default]
    #[serde(other)]
    Unknown,
}

/// Response to `threads` request.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ThreadsResponse {
    /// All threads.
    pub threads: Vec<Thread>,
}

/// Provides formatting information for a value.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ValueFormat {
    /// Display the value in hex.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub hex: Option<bool>,
}

/// A Variable is a name/value pair.
/// The `type` attribute is shown if space permits or when hovering over the variable's name.
/// The `kind` attribute is used to render additional properties of the variable, e.g. different icons can be used to indicate that a variable is public or private.
/// If the value is structured (has children), a handle is provided to retrieve the children with the `variables` request.
/// If the number of named or indexed children is large, the numbers should be returned via the `namedVariables` and `indexedVariables` attributes.
/// The client can use this information to present the children in a paged UI and fetch them in chunks.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Variable {
    /// A reference that allows the client to request the location where the variable is declared. This should be present only if the adapter is likely to be able to resolve the location.
    ///
    /// This reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub declaration_location_reference: Option<u64>,
    /// The evaluatable name of this variable which can be passed to the `evaluate` request to fetch the variable's value.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub evaluate_name: Option<String>,
    /// The number of indexed child variables.
    /// The client can use this information to present the children in a paged UI and fetch them in chunks.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub indexed_variables: Option<u32>,
    /// A memory reference associated with this variable.
    /// For pointer type variables, this is generally a reference to the memory address contained in the pointer.
    /// For executable data, this reference may later be used in a `disassemble` request.
    /// This attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub memory_reference: Option<String>,
    /// The variable's name.
    pub name: String,
    /// The number of named child variables.
    /// The client can use this information to present the children in a paged UI and fetch them in chunks.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub named_variables: Option<u32>,
    /// Properties of a variable that can be used to determine how to render the variable in the UI.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub presentation_hint: Option<VariablePresentationHint>,
    /// The type of the variable's value. Typically shown in the UI when hovering over the value.
    /// This attribute should only be returned by a debug adapter if the corresponding capability `supportsVariableType` is true.
    #[serde(rename = "type")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ty: Option<String>,
    /// The variable's value.
    /// This can be a multi-line text, e.g. for a function the body of a function.
    /// For structured variables (which do not have a simple value), it is recommended to provide a one-line representation of the structured object. This helps to identify the structured object in the collapsed state when its children are not yet visible.
    /// An empty string can be used if no value should be shown in the UI.
    pub value: String,
    /// A reference that allows the client to request the location where the variable's value is declared. For example, if the variable contains a function pointer, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location.
    ///
    /// This reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub value_location_reference: Option<u64>,
    /// If `variablesReference` is > 0, the variable is structured and its children can be retrieved by passing `variablesReference` to the `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details.
    pub variables_reference: u32,
}

/// Properties of a variable that can be used to determine how to render the variable in the UI.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct VariablePresentationHint {
    /// Set of attributes represented as an array of strings. Before introducing additional values, try to use the listed values.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub attributes: Option<Vec<VariablePresentationHintAttributes>>,
    /// The kind of variable. Before introducing additional values, try to use the listed values.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub kind: Option<VariablePresentationHintKind>,
    /// If true, clients can present the variable with a UI that supports a specific gesture to trigger its evaluation.
    /// This mechanism can be used for properties that require executing code when retrieving their value and where the code execution can be expensive and/or produce side-effects. A typical example are properties based on a getter function.
    /// Please note that in addition to the `lazy` flag, the variable's `variablesReference` is expected to refer to a variable that will provide the value through another `variable` request.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub lazy: Option<bool>,
    /// Visibility of variable. Before introducing additional values, try to use the listed values.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub visibility: Option<VariablePresentationHintVisibility>,
}

#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[non_exhaustive]
#[serde(rename_all = "camelCase")]
pub enum VariablePresentationHintAttributes {
    /// Indicates that the object is static.
    Static,
    /// Indicates that the object is a constant.
    Constant,
    /// Indicates that the object is read only.
    ReadOnly,
    /// Indicates that the object is a raw string.
    RawString,
    /// Indicates that the object can have an Object ID created for it. This is a vestigial attribute that is used by some clients; 'Object ID's are not specified in the protocol.
    HasObjectId,
    /// Indicates that the object has an Object ID associated with it. This is a vestigial attribute that is used by some clients; 'Object ID's are not specified in the protocol.
    CanHaveObjectId,
    /// Indicates that the evaluation had side effects.
    HasSideEffects,
    /// Indicates that the object has its value tracked by a data breakpoint.
    HasDataBreakpoint,
    #[default]
    #[serde(other)]
    Unknown,
}

/// The kind of variable. Before introducing additional values, try to use the listed values.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[non_exhaustive]
#[serde(rename_all = "camelCase")]
pub enum VariablePresentationHintKind {
    /// Indicates that the object is a property.
    Property,
    /// Indicates that the object is a method.
    Method,
    /// Indicates that the object is a class.
    Class,
    /// Indicates that the object is data.
    Data,
    /// Indicates that the object is an event.
    Event,
    /// Indicates that the object is a base class.
    BaseClass,
    /// Indicates that the object is an inner class.
    InnerClass,
    /// Indicates that the object is an interface.
    Interface,
    /// Indicates that the object is the most derived class.
    MostDerivedClass,
    /// Indicates that the object is virtual, that means it is a synthetic object introduced by the adapter for rendering purposes, e.g. an index range for large arrays.
    Virtual,
    /// Deprecated: Indicates that a data breakpoint is registered for the object. The `hasDataBreakpoint` attribute should generally be used instead.
    DataBreakpoint,
    #[default]
    #[serde(other)]
    Unknown,
}

/// Visibility of variable. Before introducing additional values, try to use the listed values.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[non_exhaustive]
#[serde(rename_all = "camelCase")]
pub enum VariablePresentationHintVisibility {
    Public,
    Private,
    Protected,
    Internal,
    Final,
    #[default]
    #[serde(other)]
    Unknown,
}

/// Arguments for `variables` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct VariablesArguments {
    /// The number of variables to return. If count is missing or 0, all variables are returned.
    /// The attribute is only honored by a debug adapter if the corresponding capability `supportsVariablePaging` is true.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub count: Option<u64>,
    /// Filter to limit the child variables to either named or indexed. If omitted, both types are fetched.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub filter: Option<VariablesArgumentsFilter>,
    /// Specifies details on how to format the Variable values.
    /// The attribute is only honored by a debug adapter if the corresponding capability `supportsValueFormattingOptions` is true.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub format: Option<ValueFormat>,
    /// The index of the first variable to return; if omitted children start at 0.
    /// The attribute is only honored by a debug adapter if the corresponding capability `supportsVariablePaging` is true.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub start: Option<u64>,
    /// The variable for which to retrieve its children. The `variablesReference` must have been obtained in the current suspended state. See 'Lifetime of Object References' in the Overview section for details.
    pub variables_reference: u32,
}

/// Filter to limit the child variables to either named or indexed. If omitted, both types are fetched.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub enum VariablesArgumentsFilter {
    Indexed,
    Named,
}

/// Response to `variables` request.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct VariablesResponse {
    /// All (or a range) of variables for the given variable reference.
    pub variables: Vec<Variable>,
}

/// Arguments for `writeMemory` request.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct WriteMemoryArguments {
    /// Property to control partial writes. If true, the debug adapter should attempt to write memory even if the entire memory region is not writable. In such a case the debug adapter should stop after hitting the first byte of memory that cannot be written and return the number of bytes written in the response via the `offset` and `bytesWritten` properties.
    /// If false or missing, a debug adapter should attempt to verify the region is writable before writing, and fail the response if it is not.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub allow_partial: Option<bool>,
    /// Bytes to write, encoded using base64.
    pub data: String,
    /// Memory reference to the base location to which data should be written.
    pub memory_reference: String,
    /// Offset (in bytes) to be applied to the reference location before writing data. Can be negative.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub offset: Option<u32>,
}

/// Response to `writeMemory` request.
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct WriteMemoryResponse {
    /// Property that should be returned when `allowPartial` is true to indicate the number of bytes starting from address that were successfully written.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub bytes_written: Option<u64>,
    /// Property that should be returned when `allowPartial` is true to indicate the offset of the first byte of data successfully written. Can be negative.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub offset: Option<u32>,
}
