Files
sdk/model_knowledge_graph_out.go

231 lines
6.3 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 KnowledgeGraphOut type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &KnowledgeGraphOut{}
// KnowledgeGraphOut struct for KnowledgeGraphOut
type KnowledgeGraphOut struct {
// Degraded is true when the store was unreachable and this graph is honestly empty rather than wrong. Absent on a normal answer.
Degraded *bool `json:"degraded,omitempty"`
// Edges are the parent tree, the resolved wikilinks and the connector provenance.
Edges []KnowledgeGraphEdge `json:"edges,omitempty"`
// Nodes are the pages, memories, sources, connectors and unresolved link targets.
Nodes []KnowledgeGraphNode `json:"nodes,omitempty"`
AdditionalProperties map[string]interface{}
}
type _KnowledgeGraphOut KnowledgeGraphOut
// NewKnowledgeGraphOut instantiates a new KnowledgeGraphOut 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 NewKnowledgeGraphOut() *KnowledgeGraphOut {
this := KnowledgeGraphOut{}
return &this
}
// NewKnowledgeGraphOutWithDefaults instantiates a new KnowledgeGraphOut 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 NewKnowledgeGraphOutWithDefaults() *KnowledgeGraphOut {
this := KnowledgeGraphOut{}
return &this
}
// GetDegraded returns the Degraded field value if set, zero value otherwise.
func (o *KnowledgeGraphOut) GetDegraded() bool {
if o == nil || IsNil(o.Degraded) {
var ret bool
return ret
}
return *o.Degraded
}
// GetDegradedOk returns a tuple with the Degraded field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KnowledgeGraphOut) GetDegradedOk() (*bool, bool) {
if o == nil || IsNil(o.Degraded) {
return nil, false
}
return o.Degraded, true
}
// HasDegraded returns a boolean if a field has been set.
func (o *KnowledgeGraphOut) HasDegraded() bool {
if o != nil && !IsNil(o.Degraded) {
return true
}
return false
}
// SetDegraded gets a reference to the given bool and assigns it to the Degraded field.
func (o *KnowledgeGraphOut) SetDegraded(v bool) {
o.Degraded = &v
}
// GetEdges returns the Edges field value if set, zero value otherwise.
func (o *KnowledgeGraphOut) GetEdges() []KnowledgeGraphEdge {
if o == nil || IsNil(o.Edges) {
var ret []KnowledgeGraphEdge
return ret
}
return o.Edges
}
// GetEdgesOk returns a tuple with the Edges field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KnowledgeGraphOut) GetEdgesOk() ([]KnowledgeGraphEdge, bool) {
if o == nil || IsNil(o.Edges) {
return nil, false
}
return o.Edges, true
}
// HasEdges returns a boolean if a field has been set.
func (o *KnowledgeGraphOut) HasEdges() bool {
if o != nil && !IsNil(o.Edges) {
return true
}
return false
}
// SetEdges gets a reference to the given []KnowledgeGraphEdge and assigns it to the Edges field.
func (o *KnowledgeGraphOut) SetEdges(v []KnowledgeGraphEdge) {
o.Edges = v
}
// GetNodes returns the Nodes field value if set, zero value otherwise.
func (o *KnowledgeGraphOut) GetNodes() []KnowledgeGraphNode {
if o == nil || IsNil(o.Nodes) {
var ret []KnowledgeGraphNode
return ret
}
return o.Nodes
}
// GetNodesOk returns a tuple with the Nodes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KnowledgeGraphOut) GetNodesOk() ([]KnowledgeGraphNode, bool) {
if o == nil || IsNil(o.Nodes) {
return nil, false
}
return o.Nodes, true
}
// HasNodes returns a boolean if a field has been set.
func (o *KnowledgeGraphOut) HasNodes() bool {
if o != nil && !IsNil(o.Nodes) {
return true
}
return false
}
// SetNodes gets a reference to the given []KnowledgeGraphNode and assigns it to the Nodes field.
func (o *KnowledgeGraphOut) SetNodes(v []KnowledgeGraphNode) {
o.Nodes = v
}
func (o KnowledgeGraphOut) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o KnowledgeGraphOut) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Degraded) {
toSerialize["degraded"] = o.Degraded
}
if !IsNil(o.Edges) {
toSerialize["edges"] = o.Edges
}
if !IsNil(o.Nodes) {
toSerialize["nodes"] = o.Nodes
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *KnowledgeGraphOut) UnmarshalJSON(data []byte) (err error) {
varKnowledgeGraphOut := _KnowledgeGraphOut{}
err = json.Unmarshal(data, &varKnowledgeGraphOut)
if err != nil {
return err
}
*o = KnowledgeGraphOut(varKnowledgeGraphOut)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "degraded")
delete(additionalProperties, "edges")
delete(additionalProperties, "nodes")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableKnowledgeGraphOut struct {
value *KnowledgeGraphOut
isSet bool
}
func (v NullableKnowledgeGraphOut) Get() *KnowledgeGraphOut {
return v.value
}
func (v *NullableKnowledgeGraphOut) Set(val *KnowledgeGraphOut) {
v.value = val
v.isSet = true
}
func (v NullableKnowledgeGraphOut) IsSet() bool {
return v.isSet
}
func (v *NullableKnowledgeGraphOut) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableKnowledgeGraphOut(val *KnowledgeGraphOut) *NullableKnowledgeGraphOut {
return &NullableKnowledgeGraphOut{value: val, isSet: true}
}
func (v NullableKnowledgeGraphOut) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableKnowledgeGraphOut) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}