Files
sdk/model_knowledge_toc_out.go

193 lines
5.0 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 KnowledgeTocOut type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &KnowledgeTocOut{}
// KnowledgeTocOut struct for KnowledgeTocOut
type KnowledgeTocOut struct {
// File is the file it is of.
File *KnowledgeFile `json:"file,omitempty"`
// Sections are its nodes in document order, the document first; Parent makes them a tree.
Sections []KnowledgeTocEntry `json:"sections,omitempty"`
AdditionalProperties map[string]interface{}
}
type _KnowledgeTocOut KnowledgeTocOut
// NewKnowledgeTocOut instantiates a new KnowledgeTocOut 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 NewKnowledgeTocOut() *KnowledgeTocOut {
this := KnowledgeTocOut{}
return &this
}
// NewKnowledgeTocOutWithDefaults instantiates a new KnowledgeTocOut 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 NewKnowledgeTocOutWithDefaults() *KnowledgeTocOut {
this := KnowledgeTocOut{}
return &this
}
// GetFile returns the File field value if set, zero value otherwise.
func (o *KnowledgeTocOut) GetFile() KnowledgeFile {
if o == nil || IsNil(o.File) {
var ret KnowledgeFile
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 *KnowledgeTocOut) GetFileOk() (*KnowledgeFile, 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 *KnowledgeTocOut) HasFile() bool {
if o != nil && !IsNil(o.File) {
return true
}
return false
}
// SetFile gets a reference to the given KnowledgeFile and assigns it to the File field.
func (o *KnowledgeTocOut) SetFile(v KnowledgeFile) {
o.File = &v
}
// GetSections returns the Sections field value if set, zero value otherwise.
func (o *KnowledgeTocOut) GetSections() []KnowledgeTocEntry {
if o == nil || IsNil(o.Sections) {
var ret []KnowledgeTocEntry
return ret
}
return o.Sections
}
// GetSectionsOk returns a tuple with the Sections field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KnowledgeTocOut) GetSectionsOk() ([]KnowledgeTocEntry, bool) {
if o == nil || IsNil(o.Sections) {
return nil, false
}
return o.Sections, true
}
// HasSections returns a boolean if a field has been set.
func (o *KnowledgeTocOut) HasSections() bool {
if o != nil && !IsNil(o.Sections) {
return true
}
return false
}
// SetSections gets a reference to the given []KnowledgeTocEntry and assigns it to the Sections field.
func (o *KnowledgeTocOut) SetSections(v []KnowledgeTocEntry) {
o.Sections = v
}
func (o KnowledgeTocOut) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o KnowledgeTocOut) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.File) {
toSerialize["file"] = o.File
}
if !IsNil(o.Sections) {
toSerialize["sections"] = o.Sections
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *KnowledgeTocOut) UnmarshalJSON(data []byte) (err error) {
varKnowledgeTocOut := _KnowledgeTocOut{}
err = json.Unmarshal(data, &varKnowledgeTocOut)
if err != nil {
return err
}
*o = KnowledgeTocOut(varKnowledgeTocOut)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "file")
delete(additionalProperties, "sections")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableKnowledgeTocOut struct {
value *KnowledgeTocOut
isSet bool
}
func (v NullableKnowledgeTocOut) Get() *KnowledgeTocOut {
return v.value
}
func (v *NullableKnowledgeTocOut) Set(val *KnowledgeTocOut) {
v.value = val
v.isSet = true
}
func (v NullableKnowledgeTocOut) IsSet() bool {
return v.isSet
}
func (v *NullableKnowledgeTocOut) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableKnowledgeTocOut(val *KnowledgeTocOut) *NullableKnowledgeTocOut {
return &NullableKnowledgeTocOut{value: val, isSet: true}
}
func (v NullableKnowledgeTocOut) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableKnowledgeTocOut) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}