Files
sdk/model_lsp_query.go

345 lines
8.7 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 LspQuery type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &LspQuery{}
// LspQuery struct for LspQuery
type LspQuery struct {
// Character is a 0-based UTF-16 code-unit offset within Line, per the LSP specification — not a byte offset and not a rune index.
Character *int64 `json:"character,omitempty"`
// Line is 0-based, per the LSP specification.
Line *int64 `json:"line,omitempty"`
// Path is the repo-relative file, e.g. \"apps/lsp/lsp.go\".
Path *string `json:"path,omitempty"`
// Relation refines locate: definition, reference, type or implementation. Empty means definition. Every other op ignores it.
Relation *string `json:"relation,omitempty"`
// Repo is the repository NAME within the caller's own org, e.g. \"cloud\". Not a URL and not an owner/name pair: the owner is the validated principal's org, so this names a repository the caller already owns.
Repo *string `json:"repo,omitempty"`
// Rev is a branch, tag or commit sha. Empty means the default branch. It is resolved to a commit before anything else happens, so an answer is always about one immutable tree.
Rev *string `json:"rev,omitempty"`
AdditionalProperties map[string]interface{}
}
type _LspQuery LspQuery
// NewLspQuery instantiates a new LspQuery 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 NewLspQuery() *LspQuery {
this := LspQuery{}
return &this
}
// NewLspQueryWithDefaults instantiates a new LspQuery 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 NewLspQueryWithDefaults() *LspQuery {
this := LspQuery{}
return &this
}
// GetCharacter returns the Character field value if set, zero value otherwise.
func (o *LspQuery) GetCharacter() int64 {
if o == nil || IsNil(o.Character) {
var ret int64
return ret
}
return *o.Character
}
// GetCharacterOk returns a tuple with the Character field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LspQuery) GetCharacterOk() (*int64, bool) {
if o == nil || IsNil(o.Character) {
return nil, false
}
return o.Character, true
}
// HasCharacter returns a boolean if a field has been set.
func (o *LspQuery) HasCharacter() bool {
if o != nil && !IsNil(o.Character) {
return true
}
return false
}
// SetCharacter gets a reference to the given int64 and assigns it to the Character field.
func (o *LspQuery) SetCharacter(v int64) {
o.Character = &v
}
// GetLine returns the Line field value if set, zero value otherwise.
func (o *LspQuery) GetLine() int64 {
if o == nil || IsNil(o.Line) {
var ret int64
return ret
}
return *o.Line
}
// GetLineOk returns a tuple with the Line field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LspQuery) GetLineOk() (*int64, bool) {
if o == nil || IsNil(o.Line) {
return nil, false
}
return o.Line, true
}
// HasLine returns a boolean if a field has been set.
func (o *LspQuery) HasLine() bool {
if o != nil && !IsNil(o.Line) {
return true
}
return false
}
// SetLine gets a reference to the given int64 and assigns it to the Line field.
func (o *LspQuery) SetLine(v int64) {
o.Line = &v
}
// GetPath returns the Path field value if set, zero value otherwise.
func (o *LspQuery) 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 *LspQuery) 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 *LspQuery) 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 *LspQuery) SetPath(v string) {
o.Path = &v
}
// GetRelation returns the Relation field value if set, zero value otherwise.
func (o *LspQuery) GetRelation() string {
if o == nil || IsNil(o.Relation) {
var ret string
return ret
}
return *o.Relation
}
// GetRelationOk returns a tuple with the Relation field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LspQuery) GetRelationOk() (*string, bool) {
if o == nil || IsNil(o.Relation) {
return nil, false
}
return o.Relation, true
}
// HasRelation returns a boolean if a field has been set.
func (o *LspQuery) HasRelation() bool {
if o != nil && !IsNil(o.Relation) {
return true
}
return false
}
// SetRelation gets a reference to the given string and assigns it to the Relation field.
func (o *LspQuery) SetRelation(v string) {
o.Relation = &v
}
// GetRepo returns the Repo field value if set, zero value otherwise.
func (o *LspQuery) 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 *LspQuery) 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 *LspQuery) 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 *LspQuery) SetRepo(v string) {
o.Repo = &v
}
// GetRev returns the Rev field value if set, zero value otherwise.
func (o *LspQuery) 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 *LspQuery) 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 *LspQuery) 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 *LspQuery) SetRev(v string) {
o.Rev = &v
}
func (o LspQuery) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o LspQuery) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Character) {
toSerialize["character"] = o.Character
}
if !IsNil(o.Line) {
toSerialize["line"] = o.Line
}
if !IsNil(o.Path) {
toSerialize["path"] = o.Path
}
if !IsNil(o.Relation) {
toSerialize["relation"] = o.Relation
}
if !IsNil(o.Repo) {
toSerialize["repo"] = o.Repo
}
if !IsNil(o.Rev) {
toSerialize["rev"] = o.Rev
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *LspQuery) UnmarshalJSON(data []byte) (err error) {
varLspQuery := _LspQuery{}
err = json.Unmarshal(data, &varLspQuery)
if err != nil {
return err
}
*o = LspQuery(varLspQuery)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "character")
delete(additionalProperties, "line")
delete(additionalProperties, "path")
delete(additionalProperties, "relation")
delete(additionalProperties, "repo")
delete(additionalProperties, "rev")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableLspQuery struct {
value *LspQuery
isSet bool
}
func (v NullableLspQuery) Get() *LspQuery {
return v.value
}
func (v *NullableLspQuery) Set(val *LspQuery) {
v.value = val
v.isSet = true
}
func (v NullableLspQuery) IsSet() bool {
return v.isSet
}
func (v *NullableLspQuery) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableLspQuery(val *LspQuery) *NullableLspQuery {
return &NullableLspQuery{value: val, isSet: true}
}
func (v NullableLspQuery) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableLspQuery) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}