mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
231 lines
5.8 KiB
Go
231 lines
5.8 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 LspLocation type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &LspLocation{}
|
|
|
|
// LspLocation struct for LspLocation
|
|
type LspLocation struct {
|
|
// External is true when the answer left the repository — the case a static index cannot answer, and the reason this service resolves through dependencies.
|
|
External *bool `json:"external,omitempty"`
|
|
// Path is repo-relative while External is false, and the module coordinate (\"golang.org/x/[email protected]/semver/semver.go\") once it is true.
|
|
Path *string `json:"path,omitempty"`
|
|
// Range is the span inside that file, in LSP positions.
|
|
Range *LspRange `json:"range,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _LspLocation LspLocation
|
|
|
|
// NewLspLocation instantiates a new LspLocation 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 NewLspLocation() *LspLocation {
|
|
this := LspLocation{}
|
|
return &this
|
|
}
|
|
|
|
// NewLspLocationWithDefaults instantiates a new LspLocation 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 NewLspLocationWithDefaults() *LspLocation {
|
|
this := LspLocation{}
|
|
return &this
|
|
}
|
|
|
|
// GetExternal returns the External field value if set, zero value otherwise.
|
|
func (o *LspLocation) GetExternal() bool {
|
|
if o == nil || IsNil(o.External) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.External
|
|
}
|
|
|
|
// GetExternalOk returns a tuple with the External field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *LspLocation) GetExternalOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.External) {
|
|
return nil, false
|
|
}
|
|
return o.External, true
|
|
}
|
|
|
|
// HasExternal returns a boolean if a field has been set.
|
|
func (o *LspLocation) HasExternal() bool {
|
|
if o != nil && !IsNil(o.External) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetExternal gets a reference to the given bool and assigns it to the External field.
|
|
func (o *LspLocation) SetExternal(v bool) {
|
|
o.External = &v
|
|
}
|
|
|
|
// GetPath returns the Path field value if set, zero value otherwise.
|
|
func (o *LspLocation) 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 *LspLocation) 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 *LspLocation) 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 *LspLocation) SetPath(v string) {
|
|
o.Path = &v
|
|
}
|
|
|
|
// GetRange returns the Range field value if set, zero value otherwise.
|
|
func (o *LspLocation) GetRange() LspRange {
|
|
if o == nil || IsNil(o.Range) {
|
|
var ret LspRange
|
|
return ret
|
|
}
|
|
return *o.Range
|
|
}
|
|
|
|
// GetRangeOk returns a tuple with the Range field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *LspLocation) GetRangeOk() (*LspRange, bool) {
|
|
if o == nil || IsNil(o.Range) {
|
|
return nil, false
|
|
}
|
|
return o.Range, true
|
|
}
|
|
|
|
// HasRange returns a boolean if a field has been set.
|
|
func (o *LspLocation) HasRange() bool {
|
|
if o != nil && !IsNil(o.Range) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRange gets a reference to the given LspRange and assigns it to the Range field.
|
|
func (o *LspLocation) SetRange(v LspRange) {
|
|
o.Range = &v
|
|
}
|
|
|
|
func (o LspLocation) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o LspLocation) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.External) {
|
|
toSerialize["external"] = o.External
|
|
}
|
|
if !IsNil(o.Path) {
|
|
toSerialize["path"] = o.Path
|
|
}
|
|
if !IsNil(o.Range) {
|
|
toSerialize["range"] = o.Range
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *LspLocation) UnmarshalJSON(data []byte) (err error) {
|
|
varLspLocation := _LspLocation{}
|
|
|
|
err = json.Unmarshal(data, &varLspLocation)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = LspLocation(varLspLocation)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "external")
|
|
delete(additionalProperties, "path")
|
|
delete(additionalProperties, "range")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableLspLocation struct {
|
|
value *LspLocation
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableLspLocation) Get() *LspLocation {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableLspLocation) Set(val *LspLocation) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableLspLocation) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableLspLocation) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableLspLocation(val *LspLocation) *NullableLspLocation {
|
|
return &NullableLspLocation{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableLspLocation) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableLspLocation) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|