mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
307 lines
7.6 KiB
Go
307 lines
7.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 CodeCitation type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &CodeCitation{}
|
|
|
|
// CodeCitation struct for CodeCitation
|
|
type CodeCitation struct {
|
|
// EndLine is its last line, inclusive.
|
|
EndLine *int64 `json:"endLine,omitempty"`
|
|
// File is the path inside the repo, relative to its root.
|
|
File *string `json:"file,omitempty"`
|
|
// Line is the first line of the cited region, 1-based.
|
|
Line *int64 `json:"line,omitempty"`
|
|
// Repo is the repository the cited code lives in (\"owner/name\"), absent when the ask was already scoped to one.
|
|
Repo *string `json:"repo,omitempty"`
|
|
// Symbol is the declaration the region belongs to, when it belongs to one.
|
|
Symbol *string `json:"symbol,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _CodeCitation CodeCitation
|
|
|
|
// NewCodeCitation instantiates a new CodeCitation 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 NewCodeCitation() *CodeCitation {
|
|
this := CodeCitation{}
|
|
return &this
|
|
}
|
|
|
|
// NewCodeCitationWithDefaults instantiates a new CodeCitation 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 NewCodeCitationWithDefaults() *CodeCitation {
|
|
this := CodeCitation{}
|
|
return &this
|
|
}
|
|
|
|
// GetEndLine returns the EndLine field value if set, zero value otherwise.
|
|
func (o *CodeCitation) GetEndLine() int64 {
|
|
if o == nil || IsNil(o.EndLine) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.EndLine
|
|
}
|
|
|
|
// GetEndLineOk returns a tuple with the EndLine field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CodeCitation) GetEndLineOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.EndLine) {
|
|
return nil, false
|
|
}
|
|
return o.EndLine, true
|
|
}
|
|
|
|
// HasEndLine returns a boolean if a field has been set.
|
|
func (o *CodeCitation) HasEndLine() bool {
|
|
if o != nil && !IsNil(o.EndLine) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetEndLine gets a reference to the given int64 and assigns it to the EndLine field.
|
|
func (o *CodeCitation) SetEndLine(v int64) {
|
|
o.EndLine = &v
|
|
}
|
|
|
|
// GetFile returns the File field value if set, zero value otherwise.
|
|
func (o *CodeCitation) GetFile() string {
|
|
if o == nil || IsNil(o.File) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.File
|
|
}
|
|
|
|
// GetFileOk returns a tuple with the File field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CodeCitation) GetFileOk() (*string, bool) {
|
|
if o == nil || IsNil(o.File) {
|
|
return nil, false
|
|
}
|
|
return o.File, true
|
|
}
|
|
|
|
// HasFile returns a boolean if a field has been set.
|
|
func (o *CodeCitation) HasFile() bool {
|
|
if o != nil && !IsNil(o.File) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetFile gets a reference to the given string and assigns it to the File field.
|
|
func (o *CodeCitation) SetFile(v string) {
|
|
o.File = &v
|
|
}
|
|
|
|
// GetLine returns the Line field value if set, zero value otherwise.
|
|
func (o *CodeCitation) 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 *CodeCitation) 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 *CodeCitation) 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 *CodeCitation) SetLine(v int64) {
|
|
o.Line = &v
|
|
}
|
|
|
|
// GetRepo returns the Repo field value if set, zero value otherwise.
|
|
func (o *CodeCitation) 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 *CodeCitation) 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 *CodeCitation) 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 *CodeCitation) SetRepo(v string) {
|
|
o.Repo = &v
|
|
}
|
|
|
|
// GetSymbol returns the Symbol field value if set, zero value otherwise.
|
|
func (o *CodeCitation) GetSymbol() string {
|
|
if o == nil || IsNil(o.Symbol) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Symbol
|
|
}
|
|
|
|
// GetSymbolOk returns a tuple with the Symbol field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CodeCitation) GetSymbolOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Symbol) {
|
|
return nil, false
|
|
}
|
|
return o.Symbol, true
|
|
}
|
|
|
|
// HasSymbol returns a boolean if a field has been set.
|
|
func (o *CodeCitation) HasSymbol() bool {
|
|
if o != nil && !IsNil(o.Symbol) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSymbol gets a reference to the given string and assigns it to the Symbol field.
|
|
func (o *CodeCitation) SetSymbol(v string) {
|
|
o.Symbol = &v
|
|
}
|
|
|
|
func (o CodeCitation) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o CodeCitation) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.EndLine) {
|
|
toSerialize["endLine"] = o.EndLine
|
|
}
|
|
if !IsNil(o.File) {
|
|
toSerialize["file"] = o.File
|
|
}
|
|
if !IsNil(o.Line) {
|
|
toSerialize["line"] = o.Line
|
|
}
|
|
if !IsNil(o.Repo) {
|
|
toSerialize["repo"] = o.Repo
|
|
}
|
|
if !IsNil(o.Symbol) {
|
|
toSerialize["symbol"] = o.Symbol
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *CodeCitation) UnmarshalJSON(data []byte) (err error) {
|
|
varCodeCitation := _CodeCitation{}
|
|
|
|
err = json.Unmarshal(data, &varCodeCitation)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = CodeCitation(varCodeCitation)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "endLine")
|
|
delete(additionalProperties, "file")
|
|
delete(additionalProperties, "line")
|
|
delete(additionalProperties, "repo")
|
|
delete(additionalProperties, "symbol")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableCodeCitation struct {
|
|
value *CodeCitation
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableCodeCitation) Get() *CodeCitation {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableCodeCitation) Set(val *CodeCitation) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableCodeCitation) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableCodeCitation) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableCodeCitation(val *CodeCitation) *NullableCodeCitation {
|
|
return &NullableCodeCitation{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableCodeCitation) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableCodeCitation) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|