mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
345 lines
9.0 KiB
Go
345 lines
9.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 KnowledgeFileLink type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &KnowledgeFileLink{}
|
|
|
|
// KnowledgeFileLink struct for KnowledgeFileLink
|
|
type KnowledgeFileLink struct {
|
|
// Direction is out when this file links to the other, in when the other links to this one, and shared when the two name the same entities.
|
|
Direction *string `json:"direction,omitempty"`
|
|
// File is the other file, by id.
|
|
File *string `json:"file,omitempty"`
|
|
// Kind is href (a hyperlink), cites (the text names the file), xref (a cross-reference inside one document) or entity (shared mentions).
|
|
Kind *string `json:"kind,omitempty"`
|
|
// Label is the link's own text, or the entities the two files share.
|
|
Label *string `json:"label,omitempty"`
|
|
// Name is the other file's name.
|
|
Name *string `json:"name,omitempty"`
|
|
// Weight is how many edges of this kind join the two; for shared entities, how many entities they share.
|
|
Weight *int64 `json:"weight,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _KnowledgeFileLink KnowledgeFileLink
|
|
|
|
// NewKnowledgeFileLink instantiates a new KnowledgeFileLink 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 NewKnowledgeFileLink() *KnowledgeFileLink {
|
|
this := KnowledgeFileLink{}
|
|
return &this
|
|
}
|
|
|
|
// NewKnowledgeFileLinkWithDefaults instantiates a new KnowledgeFileLink 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 NewKnowledgeFileLinkWithDefaults() *KnowledgeFileLink {
|
|
this := KnowledgeFileLink{}
|
|
return &this
|
|
}
|
|
|
|
// GetDirection returns the Direction field value if set, zero value otherwise.
|
|
func (o *KnowledgeFileLink) GetDirection() string {
|
|
if o == nil || IsNil(o.Direction) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Direction
|
|
}
|
|
|
|
// GetDirectionOk returns a tuple with the Direction field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *KnowledgeFileLink) GetDirectionOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Direction) {
|
|
return nil, false
|
|
}
|
|
return o.Direction, true
|
|
}
|
|
|
|
// HasDirection returns a boolean if a field has been set.
|
|
func (o *KnowledgeFileLink) HasDirection() bool {
|
|
if o != nil && !IsNil(o.Direction) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDirection gets a reference to the given string and assigns it to the Direction field.
|
|
func (o *KnowledgeFileLink) SetDirection(v string) {
|
|
o.Direction = &v
|
|
}
|
|
|
|
// GetFile returns the File field value if set, zero value otherwise.
|
|
func (o *KnowledgeFileLink) 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 *KnowledgeFileLink) 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 *KnowledgeFileLink) 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 *KnowledgeFileLink) SetFile(v string) {
|
|
o.File = &v
|
|
}
|
|
|
|
// GetKind returns the Kind field value if set, zero value otherwise.
|
|
func (o *KnowledgeFileLink) GetKind() string {
|
|
if o == nil || IsNil(o.Kind) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Kind
|
|
}
|
|
|
|
// GetKindOk returns a tuple with the Kind field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *KnowledgeFileLink) GetKindOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Kind) {
|
|
return nil, false
|
|
}
|
|
return o.Kind, true
|
|
}
|
|
|
|
// HasKind returns a boolean if a field has been set.
|
|
func (o *KnowledgeFileLink) HasKind() bool {
|
|
if o != nil && !IsNil(o.Kind) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetKind gets a reference to the given string and assigns it to the Kind field.
|
|
func (o *KnowledgeFileLink) SetKind(v string) {
|
|
o.Kind = &v
|
|
}
|
|
|
|
// GetLabel returns the Label field value if set, zero value otherwise.
|
|
func (o *KnowledgeFileLink) GetLabel() string {
|
|
if o == nil || IsNil(o.Label) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Label
|
|
}
|
|
|
|
// GetLabelOk returns a tuple with the Label field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *KnowledgeFileLink) GetLabelOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Label) {
|
|
return nil, false
|
|
}
|
|
return o.Label, true
|
|
}
|
|
|
|
// HasLabel returns a boolean if a field has been set.
|
|
func (o *KnowledgeFileLink) HasLabel() bool {
|
|
if o != nil && !IsNil(o.Label) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLabel gets a reference to the given string and assigns it to the Label field.
|
|
func (o *KnowledgeFileLink) SetLabel(v string) {
|
|
o.Label = &v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *KnowledgeFileLink) GetName() string {
|
|
if o == nil || IsNil(o.Name) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Name
|
|
}
|
|
|
|
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *KnowledgeFileLink) GetNameOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Name) {
|
|
return nil, false
|
|
}
|
|
return o.Name, true
|
|
}
|
|
|
|
// HasName returns a boolean if a field has been set.
|
|
func (o *KnowledgeFileLink) HasName() bool {
|
|
if o != nil && !IsNil(o.Name) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetName gets a reference to the given string and assigns it to the Name field.
|
|
func (o *KnowledgeFileLink) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetWeight returns the Weight field value if set, zero value otherwise.
|
|
func (o *KnowledgeFileLink) GetWeight() int64 {
|
|
if o == nil || IsNil(o.Weight) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Weight
|
|
}
|
|
|
|
// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *KnowledgeFileLink) GetWeightOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Weight) {
|
|
return nil, false
|
|
}
|
|
return o.Weight, true
|
|
}
|
|
|
|
// HasWeight returns a boolean if a field has been set.
|
|
func (o *KnowledgeFileLink) HasWeight() bool {
|
|
if o != nil && !IsNil(o.Weight) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetWeight gets a reference to the given int64 and assigns it to the Weight field.
|
|
func (o *KnowledgeFileLink) SetWeight(v int64) {
|
|
o.Weight = &v
|
|
}
|
|
|
|
func (o KnowledgeFileLink) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o KnowledgeFileLink) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Direction) {
|
|
toSerialize["direction"] = o.Direction
|
|
}
|
|
if !IsNil(o.File) {
|
|
toSerialize["file"] = o.File
|
|
}
|
|
if !IsNil(o.Kind) {
|
|
toSerialize["kind"] = o.Kind
|
|
}
|
|
if !IsNil(o.Label) {
|
|
toSerialize["label"] = o.Label
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.Weight) {
|
|
toSerialize["weight"] = o.Weight
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *KnowledgeFileLink) UnmarshalJSON(data []byte) (err error) {
|
|
varKnowledgeFileLink := _KnowledgeFileLink{}
|
|
|
|
err = json.Unmarshal(data, &varKnowledgeFileLink)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = KnowledgeFileLink(varKnowledgeFileLink)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "direction")
|
|
delete(additionalProperties, "file")
|
|
delete(additionalProperties, "kind")
|
|
delete(additionalProperties, "label")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "weight")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableKnowledgeFileLink struct {
|
|
value *KnowledgeFileLink
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableKnowledgeFileLink) Get() *KnowledgeFileLink {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableKnowledgeFileLink) Set(val *KnowledgeFileLink) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableKnowledgeFileLink) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableKnowledgeFileLink) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableKnowledgeFileLink(val *KnowledgeFileLink) *NullableKnowledgeFileLink {
|
|
return &NullableKnowledgeFileLink{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableKnowledgeFileLink) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableKnowledgeFileLink) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|