Files
sdk/model_lsp_answer.go

535 lines
14 KiB
Go

/*
Hanzo Cloud API
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/.
API version: v1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hanzoai
import (
"encoding/json"
)
// checks if the LspAnswer type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &LspAnswer{}
// LspAnswer struct for LspAnswer
type LspAnswer struct {
// 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.
Cold *bool `json:"cold,omitempty"`
// Completions is complete's answer: the candidates at the position, typed and resolved through the repository's dependencies rather than guessed from text.
Completions []LspCompletion `json:"completions,omitempty"`
// Diagnostics is diagnostics' answer: every problem the server finds in the whole file, position ignored. Empty means it found none.
Diagnostics []LspDiagnostic `json:"diagnostics,omitempty"`
// 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.
Hover *string `json:"hover,omitempty"`
// Lang is the language the server that answered speaks (\"go\"), as the daemon reports it. Empty when the daemon named none.
Lang *string `json:"lang,omitempty"`
// 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.
Locations []LspLocation `json:"locations,omitempty"`
// Op is the question that was asked: hover, locate, symbols, diagnostics or complete. It names which result field below is the populated one.
Op *string `json:"op,omitempty"`
// Path is the repo-relative file the question was about, echoed back.
Path *string `json:"path,omitempty"`
// Repo is the repository the question was about, echoed back.
Repo *string `json:"repo,omitempty"`
// 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.
Rev *string `json:"rev,omitempty"`
// Symbols is symbols' answer: the file's whole outline, position ignored.
Symbols []LspSymbol `json:"symbols,omitempty"`
AdditionalProperties map[string]interface{}
}
type _LspAnswer LspAnswer
// NewLspAnswer instantiates a new LspAnswer object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewLspAnswer() *LspAnswer {
this := LspAnswer{}
return &this
}
// NewLspAnswerWithDefaults instantiates a new LspAnswer object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewLspAnswerWithDefaults() *LspAnswer {
this := LspAnswer{}
return &this
}
// GetCold returns the Cold field value if set, zero value otherwise.
func (o *LspAnswer) GetCold() bool {
if o == nil || IsNil(o.Cold) {
var ret bool
return ret
}
return *o.Cold
}
// GetColdOk returns a tuple with the Cold field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LspAnswer) GetColdOk() (*bool, bool) {
if o == nil || IsNil(o.Cold) {
return nil, false
}
return o.Cold, true
}
// HasCold returns a boolean if a field has been set.
func (o *LspAnswer) HasCold() bool {
if o != nil && !IsNil(o.Cold) {
return true
}
return false
}
// SetCold gets a reference to the given bool and assigns it to the Cold field.
func (o *LspAnswer) SetCold(v bool) {
o.Cold = &v
}
// GetCompletions returns the Completions field value if set, zero value otherwise.
func (o *LspAnswer) GetCompletions() []LspCompletion {
if o == nil || IsNil(o.Completions) {
var ret []LspCompletion
return ret
}
return o.Completions
}
// GetCompletionsOk returns a tuple with the Completions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LspAnswer) GetCompletionsOk() ([]LspCompletion, bool) {
if o == nil || IsNil(o.Completions) {
return nil, false
}
return o.Completions, true
}
// HasCompletions returns a boolean if a field has been set.
func (o *LspAnswer) HasCompletions() bool {
if o != nil && !IsNil(o.Completions) {
return true
}
return false
}
// SetCompletions gets a reference to the given []LspCompletion and assigns it to the Completions field.
func (o *LspAnswer) SetCompletions(v []LspCompletion) {
o.Completions = v
}
// GetDiagnostics returns the Diagnostics field value if set, zero value otherwise.
func (o *LspAnswer) GetDiagnostics() []LspDiagnostic {
if o == nil || IsNil(o.Diagnostics) {
var ret []LspDiagnostic
return ret
}
return o.Diagnostics
}
// GetDiagnosticsOk returns a tuple with the Diagnostics field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LspAnswer) GetDiagnosticsOk() ([]LspDiagnostic, bool) {
if o == nil || IsNil(o.Diagnostics) {
return nil, false
}
return o.Diagnostics, true
}
// HasDiagnostics returns a boolean if a field has been set.
func (o *LspAnswer) HasDiagnostics() bool {
if o != nil && !IsNil(o.Diagnostics) {
return true
}
return false
}
// SetDiagnostics gets a reference to the given []LspDiagnostic and assigns it to the Diagnostics field.
func (o *LspAnswer) SetDiagnostics(v []LspDiagnostic) {
o.Diagnostics = v
}
// GetHover returns the Hover field value if set, zero value otherwise.
func (o *LspAnswer) GetHover() string {
if o == nil || IsNil(o.Hover) {
var ret string
return ret
}
return *o.Hover
}
// GetHoverOk returns a tuple with the Hover field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LspAnswer) GetHoverOk() (*string, bool) {
if o == nil || IsNil(o.Hover) {
return nil, false
}
return o.Hover, true
}
// HasHover returns a boolean if a field has been set.
func (o *LspAnswer) HasHover() bool {
if o != nil && !IsNil(o.Hover) {
return true
}
return false
}
// SetHover gets a reference to the given string and assigns it to the Hover field.
func (o *LspAnswer) SetHover(v string) {
o.Hover = &v
}
// GetLang returns the Lang field value if set, zero value otherwise.
func (o *LspAnswer) GetLang() string {
if o == nil || IsNil(o.Lang) {
var ret string
return ret
}
return *o.Lang
}
// GetLangOk returns a tuple with the Lang field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LspAnswer) GetLangOk() (*string, bool) {
if o == nil || IsNil(o.Lang) {
return nil, false
}
return o.Lang, true
}
// HasLang returns a boolean if a field has been set.
func (o *LspAnswer) HasLang() bool {
if o != nil && !IsNil(o.Lang) {
return true
}
return false
}
// SetLang gets a reference to the given string and assigns it to the Lang field.
func (o *LspAnswer) SetLang(v string) {
o.Lang = &v
}
// GetLocations returns the Locations field value if set, zero value otherwise.
func (o *LspAnswer) GetLocations() []LspLocation {
if o == nil || IsNil(o.Locations) {
var ret []LspLocation
return ret
}
return o.Locations
}
// GetLocationsOk returns a tuple with the Locations field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LspAnswer) GetLocationsOk() ([]LspLocation, bool) {
if o == nil || IsNil(o.Locations) {
return nil, false
}
return o.Locations, true
}
// HasLocations returns a boolean if a field has been set.
func (o *LspAnswer) HasLocations() bool {
if o != nil && !IsNil(o.Locations) {
return true
}
return false
}
// SetLocations gets a reference to the given []LspLocation and assigns it to the Locations field.
func (o *LspAnswer) SetLocations(v []LspLocation) {
o.Locations = v
}
// GetOp returns the Op field value if set, zero value otherwise.
func (o *LspAnswer) GetOp() string {
if o == nil || IsNil(o.Op) {
var ret string
return ret
}
return *o.Op
}
// GetOpOk returns a tuple with the Op field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LspAnswer) GetOpOk() (*string, bool) {
if o == nil || IsNil(o.Op) {
return nil, false
}
return o.Op, true
}
// HasOp returns a boolean if a field has been set.
func (o *LspAnswer) HasOp() bool {
if o != nil && !IsNil(o.Op) {
return true
}
return false
}
// SetOp gets a reference to the given string and assigns it to the Op field.
func (o *LspAnswer) SetOp(v string) {
o.Op = &v
}
// GetPath returns the Path field value if set, zero value otherwise.
func (o *LspAnswer) GetPath() string {
if o == nil || IsNil(o.Path) {
var ret string
return ret
}
return *o.Path
}
// GetPathOk returns a tuple with the Path field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LspAnswer) GetPathOk() (*string, bool) {
if o == nil || IsNil(o.Path) {
return nil, false
}
return o.Path, true
}
// HasPath returns a boolean if a field has been set.
func (o *LspAnswer) HasPath() bool {
if o != nil && !IsNil(o.Path) {
return true
}
return false
}
// SetPath gets a reference to the given string and assigns it to the Path field.
func (o *LspAnswer) SetPath(v string) {
o.Path = &v
}
// GetRepo returns the Repo field value if set, zero value otherwise.
func (o *LspAnswer) GetRepo() string {
if o == nil || IsNil(o.Repo) {
var ret string
return ret
}
return *o.Repo
}
// GetRepoOk returns a tuple with the Repo field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LspAnswer) GetRepoOk() (*string, bool) {
if o == nil || IsNil(o.Repo) {
return nil, false
}
return o.Repo, true
}
// HasRepo returns a boolean if a field has been set.
func (o *LspAnswer) HasRepo() bool {
if o != nil && !IsNil(o.Repo) {
return true
}
return false
}
// SetRepo gets a reference to the given string and assigns it to the Repo field.
func (o *LspAnswer) SetRepo(v string) {
o.Repo = &v
}
// GetRev returns the Rev field value if set, zero value otherwise.
func (o *LspAnswer) GetRev() string {
if o == nil || IsNil(o.Rev) {
var ret string
return ret
}
return *o.Rev
}
// GetRevOk returns a tuple with the Rev field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LspAnswer) GetRevOk() (*string, bool) {
if o == nil || IsNil(o.Rev) {
return nil, false
}
return o.Rev, true
}
// HasRev returns a boolean if a field has been set.
func (o *LspAnswer) HasRev() bool {
if o != nil && !IsNil(o.Rev) {
return true
}
return false
}
// SetRev gets a reference to the given string and assigns it to the Rev field.
func (o *LspAnswer) SetRev(v string) {
o.Rev = &v
}
// GetSymbols returns the Symbols field value if set, zero value otherwise.
func (o *LspAnswer) GetSymbols() []LspSymbol {
if o == nil || IsNil(o.Symbols) {
var ret []LspSymbol
return ret
}
return o.Symbols
}
// GetSymbolsOk returns a tuple with the Symbols field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LspAnswer) GetSymbolsOk() ([]LspSymbol, bool) {
if o == nil || IsNil(o.Symbols) {
return nil, false
}
return o.Symbols, true
}
// HasSymbols returns a boolean if a field has been set.
func (o *LspAnswer) HasSymbols() bool {
if o != nil && !IsNil(o.Symbols) {
return true
}
return false
}
// SetSymbols gets a reference to the given []LspSymbol and assigns it to the Symbols field.
func (o *LspAnswer) SetSymbols(v []LspSymbol) {
o.Symbols = v
}
func (o LspAnswer) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o LspAnswer) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Cold) {
toSerialize["cold"] = o.Cold
}
if !IsNil(o.Completions) {
toSerialize["completions"] = o.Completions
}
if !IsNil(o.Diagnostics) {
toSerialize["diagnostics"] = o.Diagnostics
}
if !IsNil(o.Hover) {
toSerialize["hover"] = o.Hover
}
if !IsNil(o.Lang) {
toSerialize["lang"] = o.Lang
}
if !IsNil(o.Locations) {
toSerialize["locations"] = o.Locations
}
if !IsNil(o.Op) {
toSerialize["op"] = o.Op
}
if !IsNil(o.Path) {
toSerialize["path"] = o.Path
}
if !IsNil(o.Repo) {
toSerialize["repo"] = o.Repo
}
if !IsNil(o.Rev) {
toSerialize["rev"] = o.Rev
}
if !IsNil(o.Symbols) {
toSerialize["symbols"] = o.Symbols
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *LspAnswer) UnmarshalJSON(data []byte) (err error) {
varLspAnswer := _LspAnswer{}
err = json.Unmarshal(data, &varLspAnswer)
if err != nil {
return err
}
*o = LspAnswer(varLspAnswer)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "cold")
delete(additionalProperties, "completions")
delete(additionalProperties, "diagnostics")
delete(additionalProperties, "hover")
delete(additionalProperties, "lang")
delete(additionalProperties, "locations")
delete(additionalProperties, "op")
delete(additionalProperties, "path")
delete(additionalProperties, "repo")
delete(additionalProperties, "rev")
delete(additionalProperties, "symbols")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableLspAnswer struct {
value *LspAnswer
isSet bool
}
func (v NullableLspAnswer) Get() *LspAnswer {
return v.value
}
func (v *NullableLspAnswer) Set(val *LspAnswer) {
v.value = val
v.isSet = true
}
func (v NullableLspAnswer) IsSet() bool {
return v.isSet
}
func (v *NullableLspAnswer) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableLspAnswer(val *LspAnswer) *NullableLspAnswer {
return &NullableLspAnswer{value: val, isSet: true}
}
func (v NullableLspAnswer) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableLspAnswer) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}