mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
231 lines
6.2 KiB
Go
231 lines
6.2 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 KnowledgeFileGraph type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &KnowledgeFileGraph{}
|
|
|
|
// KnowledgeFileGraph struct for KnowledgeFileGraph
|
|
type KnowledgeFileGraph struct {
|
|
// Entities are the entities it names, most mentioned first.
|
|
Entities []KnowledgeFileEntity `json:"entities,omitempty"`
|
|
// File is the file the graph is of.
|
|
File *KnowledgeFile `json:"file,omitempty"`
|
|
// Links are the other files it is joined to, strongest first.
|
|
Links []KnowledgeFileLink `json:"links,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _KnowledgeFileGraph KnowledgeFileGraph
|
|
|
|
// NewKnowledgeFileGraph instantiates a new KnowledgeFileGraph 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 NewKnowledgeFileGraph() *KnowledgeFileGraph {
|
|
this := KnowledgeFileGraph{}
|
|
return &this
|
|
}
|
|
|
|
// NewKnowledgeFileGraphWithDefaults instantiates a new KnowledgeFileGraph 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 NewKnowledgeFileGraphWithDefaults() *KnowledgeFileGraph {
|
|
this := KnowledgeFileGraph{}
|
|
return &this
|
|
}
|
|
|
|
// GetEntities returns the Entities field value if set, zero value otherwise.
|
|
func (o *KnowledgeFileGraph) GetEntities() []KnowledgeFileEntity {
|
|
if o == nil || IsNil(o.Entities) {
|
|
var ret []KnowledgeFileEntity
|
|
return ret
|
|
}
|
|
return o.Entities
|
|
}
|
|
|
|
// GetEntitiesOk returns a tuple with the Entities field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *KnowledgeFileGraph) GetEntitiesOk() ([]KnowledgeFileEntity, bool) {
|
|
if o == nil || IsNil(o.Entities) {
|
|
return nil, false
|
|
}
|
|
return o.Entities, true
|
|
}
|
|
|
|
// HasEntities returns a boolean if a field has been set.
|
|
func (o *KnowledgeFileGraph) HasEntities() bool {
|
|
if o != nil && !IsNil(o.Entities) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetEntities gets a reference to the given []KnowledgeFileEntity and assigns it to the Entities field.
|
|
func (o *KnowledgeFileGraph) SetEntities(v []KnowledgeFileEntity) {
|
|
o.Entities = v
|
|
}
|
|
|
|
// GetFile returns the File field value if set, zero value otherwise.
|
|
func (o *KnowledgeFileGraph) 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 *KnowledgeFileGraph) 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 *KnowledgeFileGraph) 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 *KnowledgeFileGraph) SetFile(v KnowledgeFile) {
|
|
o.File = &v
|
|
}
|
|
|
|
// GetLinks returns the Links field value if set, zero value otherwise.
|
|
func (o *KnowledgeFileGraph) GetLinks() []KnowledgeFileLink {
|
|
if o == nil || IsNil(o.Links) {
|
|
var ret []KnowledgeFileLink
|
|
return ret
|
|
}
|
|
return o.Links
|
|
}
|
|
|
|
// GetLinksOk returns a tuple with the Links field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *KnowledgeFileGraph) GetLinksOk() ([]KnowledgeFileLink, bool) {
|
|
if o == nil || IsNil(o.Links) {
|
|
return nil, false
|
|
}
|
|
return o.Links, true
|
|
}
|
|
|
|
// HasLinks returns a boolean if a field has been set.
|
|
func (o *KnowledgeFileGraph) HasLinks() bool {
|
|
if o != nil && !IsNil(o.Links) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLinks gets a reference to the given []KnowledgeFileLink and assigns it to the Links field.
|
|
func (o *KnowledgeFileGraph) SetLinks(v []KnowledgeFileLink) {
|
|
o.Links = v
|
|
}
|
|
|
|
func (o KnowledgeFileGraph) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o KnowledgeFileGraph) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Entities) {
|
|
toSerialize["entities"] = o.Entities
|
|
}
|
|
if !IsNil(o.File) {
|
|
toSerialize["file"] = o.File
|
|
}
|
|
if !IsNil(o.Links) {
|
|
toSerialize["links"] = o.Links
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *KnowledgeFileGraph) UnmarshalJSON(data []byte) (err error) {
|
|
varKnowledgeFileGraph := _KnowledgeFileGraph{}
|
|
|
|
err = json.Unmarshal(data, &varKnowledgeFileGraph)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = KnowledgeFileGraph(varKnowledgeFileGraph)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "entities")
|
|
delete(additionalProperties, "file")
|
|
delete(additionalProperties, "links")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableKnowledgeFileGraph struct {
|
|
value *KnowledgeFileGraph
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableKnowledgeFileGraph) Get() *KnowledgeFileGraph {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableKnowledgeFileGraph) Set(val *KnowledgeFileGraph) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableKnowledgeFileGraph) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableKnowledgeFileGraph) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableKnowledgeFileGraph(val *KnowledgeFileGraph) *NullableKnowledgeFileGraph {
|
|
return &NullableKnowledgeFileGraph{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableKnowledgeFileGraph) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableKnowledgeFileGraph) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|