mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
193 lines
4.6 KiB
Go
193 lines
4.6 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 LspRange type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &LspRange{}
|
|
|
|
// LspRange struct for LspRange
|
|
type LspRange struct {
|
|
// End is the position just past the span, excluded — the range is half-open, so an empty range has Start equal to End.
|
|
End *LspPosition `json:"end,omitempty"`
|
|
// Start is the first position in the span, included.
|
|
Start *LspPosition `json:"start,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _LspRange LspRange
|
|
|
|
// NewLspRange instantiates a new LspRange 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 NewLspRange() *LspRange {
|
|
this := LspRange{}
|
|
return &this
|
|
}
|
|
|
|
// NewLspRangeWithDefaults instantiates a new LspRange 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 NewLspRangeWithDefaults() *LspRange {
|
|
this := LspRange{}
|
|
return &this
|
|
}
|
|
|
|
// GetEnd returns the End field value if set, zero value otherwise.
|
|
func (o *LspRange) GetEnd() LspPosition {
|
|
if o == nil || IsNil(o.End) {
|
|
var ret LspPosition
|
|
return ret
|
|
}
|
|
return *o.End
|
|
}
|
|
|
|
// GetEndOk returns a tuple with the End field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *LspRange) GetEndOk() (*LspPosition, bool) {
|
|
if o == nil || IsNil(o.End) {
|
|
return nil, false
|
|
}
|
|
return o.End, true
|
|
}
|
|
|
|
// HasEnd returns a boolean if a field has been set.
|
|
func (o *LspRange) HasEnd() bool {
|
|
if o != nil && !IsNil(o.End) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetEnd gets a reference to the given LspPosition and assigns it to the End field.
|
|
func (o *LspRange) SetEnd(v LspPosition) {
|
|
o.End = &v
|
|
}
|
|
|
|
// GetStart returns the Start field value if set, zero value otherwise.
|
|
func (o *LspRange) GetStart() LspPosition {
|
|
if o == nil || IsNil(o.Start) {
|
|
var ret LspPosition
|
|
return ret
|
|
}
|
|
return *o.Start
|
|
}
|
|
|
|
// GetStartOk returns a tuple with the Start field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *LspRange) GetStartOk() (*LspPosition, bool) {
|
|
if o == nil || IsNil(o.Start) {
|
|
return nil, false
|
|
}
|
|
return o.Start, true
|
|
}
|
|
|
|
// HasStart returns a boolean if a field has been set.
|
|
func (o *LspRange) HasStart() bool {
|
|
if o != nil && !IsNil(o.Start) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStart gets a reference to the given LspPosition and assigns it to the Start field.
|
|
func (o *LspRange) SetStart(v LspPosition) {
|
|
o.Start = &v
|
|
}
|
|
|
|
func (o LspRange) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o LspRange) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.End) {
|
|
toSerialize["end"] = o.End
|
|
}
|
|
if !IsNil(o.Start) {
|
|
toSerialize["start"] = o.Start
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *LspRange) UnmarshalJSON(data []byte) (err error) {
|
|
varLspRange := _LspRange{}
|
|
|
|
err = json.Unmarshal(data, &varLspRange)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = LspRange(varLspRange)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "end")
|
|
delete(additionalProperties, "start")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableLspRange struct {
|
|
value *LspRange
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableLspRange) Get() *LspRange {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableLspRange) Set(val *LspRange) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableLspRange) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableLspRange) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableLspRange(val *LspRange) *NullableLspRange {
|
|
return &NullableLspRange{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableLspRange) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableLspRange) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|