Files
sdk/model_lsp_position.go

193 lines
4.9 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 LspPosition type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &LspPosition{}
// LspPosition struct for LspPosition
type LspPosition 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. An emoji before the cursor counts as one here and as two in Go's arithmetic.
Character *int64 `json:"character,omitempty"`
// Line is 0-BASED, per the LSP specification — one less than the line an editor shows a human.
Line *int64 `json:"line,omitempty"`
AdditionalProperties map[string]interface{}
}
type _LspPosition LspPosition
// NewLspPosition instantiates a new LspPosition 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 NewLspPosition() *LspPosition {
this := LspPosition{}
return &this
}
// NewLspPositionWithDefaults instantiates a new LspPosition 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 NewLspPositionWithDefaults() *LspPosition {
this := LspPosition{}
return &this
}
// GetCharacter returns the Character field value if set, zero value otherwise.
func (o *LspPosition) 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 *LspPosition) 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 *LspPosition) 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 *LspPosition) SetCharacter(v int64) {
o.Character = &v
}
// GetLine returns the Line field value if set, zero value otherwise.
func (o *LspPosition) 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 *LspPosition) 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 *LspPosition) 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 *LspPosition) SetLine(v int64) {
o.Line = &v
}
func (o LspPosition) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o LspPosition) 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
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *LspPosition) UnmarshalJSON(data []byte) (err error) {
varLspPosition := _LspPosition{}
err = json.Unmarshal(data, &varLspPosition)
if err != nil {
return err
}
*o = LspPosition(varLspPosition)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "character")
delete(additionalProperties, "line")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableLspPosition struct {
value *LspPosition
isSet bool
}
func (v NullableLspPosition) Get() *LspPosition {
return v.value
}
func (v *NullableLspPosition) Set(val *LspPosition) {
v.value = val
v.isSet = true
}
func (v NullableLspPosition) IsSet() bool {
return v.isSet
}
func (v *NullableLspPosition) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableLspPosition(val *LspPosition) *NullableLspPosition {
return &NullableLspPosition{value: val, isSet: true}
}
func (v NullableLspPosition) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableLspPosition) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}