hanzo_client/models/answer.rs
1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Answer {
16 /// Cold reports that this request paid to PREPARE the revision — the tree write, the dependency fetch and the language server's first index. It is the billed event, surfaced so a caller can see what it was charged for.
17 #[serde(rename = "cold", skip_serializing_if = "Option::is_none")]
18 pub cold: Option<bool>,
19 /// Completions is complete's answer: the candidates at the position, typed and resolved through the repository's dependencies rather than guessed from text.
20 #[serde(rename = "completions", skip_serializing_if = "Option::is_none")]
21 pub completions: Option<Vec<models::Completion>>,
22 /// Diagnostics is diagnostics' answer: every problem the server finds in the whole file, position ignored. Empty means it found none.
23 #[serde(rename = "diagnostics", skip_serializing_if = "Option::is_none")]
24 pub diagnostics: Option<Vec<models::Diagnostic>>,
25 /// Hover is hover's answer: the type and documentation as the language server itself renders them, so it is prose meant to be shown, not parsed.
26 #[serde(rename = "hover", skip_serializing_if = "Option::is_none")]
27 pub hover: Option<String>,
28 /// Lang is the language the server that answered speaks (\"go\"), as the daemon reports it. Empty when the daemon named none.
29 #[serde(rename = "lang", skip_serializing_if = "Option::is_none")]
30 pub lang: Option<String>,
31 /// Locations is locate's answer: where the symbol is defined, referenced, typed or implemented, per the relation asked for. Empty means the server resolved nothing there, which is an answer.
32 #[serde(rename = "locations", skip_serializing_if = "Option::is_none")]
33 pub locations: Option<Vec<models::Location>>,
34 /// Op is the question that was asked: hover, locate, symbols, diagnostics or complete. It names which result field below is the populated one.
35 #[serde(rename = "op", skip_serializing_if = "Option::is_none")]
36 pub op: Option<String>,
37 /// Path is the repo-relative file the question was about, echoed back.
38 #[serde(rename = "path", skip_serializing_if = "Option::is_none")]
39 pub path: Option<String>,
40 /// Repo is the repository the question was about, echoed back.
41 #[serde(rename = "repo", skip_serializing_if = "Option::is_none")]
42 pub repo: Option<String>,
43 /// Rev is the RESOLVED commit sha, never the branch or tag that was asked for. It is what makes an answer re-askable: a branch moves, this does not.
44 #[serde(rename = "rev", skip_serializing_if = "Option::is_none")]
45 pub rev: Option<String>,
46 /// Symbols is symbols' answer: the file's whole outline, position ignored.
47 #[serde(rename = "symbols", skip_serializing_if = "Option::is_none")]
48 pub symbols: Option<Vec<models::Symbol>>,
49}
50
51impl Answer {
52 pub fn new() -> Answer {
53 Answer {
54 cold: None,
55 completions: None,
56 diagnostics: None,
57 hover: None,
58 lang: None,
59 locations: None,
60 op: None,
61 path: None,
62 repo: None,
63 rev: None,
64 symbols: None,
65 }
66 }
67}
68