mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
269 lines
7.2 KiB
Go
269 lines
7.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 KnowledgeSectionLink type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &KnowledgeSectionLink{}
|
|
|
|
// KnowledgeSectionLink struct for KnowledgeSectionLink
|
|
type KnowledgeSectionLink struct {
|
|
// File is the file the linked section is in.
|
|
File *KnowledgeFileBrief `json:"file,omitempty"`
|
|
// Kind is href, xref, cites, or entity (the two sections name the same entities).
|
|
Kind *string `json:"kind,omitempty"`
|
|
// Label is the link's text, or the entities the two share.
|
|
Label *string `json:"label,omitempty"`
|
|
// Section is the linked section.
|
|
Section *KnowledgeSectionBrief `json:"section,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _KnowledgeSectionLink KnowledgeSectionLink
|
|
|
|
// NewKnowledgeSectionLink instantiates a new KnowledgeSectionLink 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 NewKnowledgeSectionLink() *KnowledgeSectionLink {
|
|
this := KnowledgeSectionLink{}
|
|
return &this
|
|
}
|
|
|
|
// NewKnowledgeSectionLinkWithDefaults instantiates a new KnowledgeSectionLink 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 NewKnowledgeSectionLinkWithDefaults() *KnowledgeSectionLink {
|
|
this := KnowledgeSectionLink{}
|
|
return &this
|
|
}
|
|
|
|
// GetFile returns the File field value if set, zero value otherwise.
|
|
func (o *KnowledgeSectionLink) GetFile() KnowledgeFileBrief {
|
|
if o == nil || IsNil(o.File) {
|
|
var ret KnowledgeFileBrief
|
|
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 *KnowledgeSectionLink) GetFileOk() (*KnowledgeFileBrief, 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 *KnowledgeSectionLink) HasFile() bool {
|
|
if o != nil && !IsNil(o.File) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetFile gets a reference to the given KnowledgeFileBrief and assigns it to the File field.
|
|
func (o *KnowledgeSectionLink) SetFile(v KnowledgeFileBrief) {
|
|
o.File = &v
|
|
}
|
|
|
|
// GetKind returns the Kind field value if set, zero value otherwise.
|
|
func (o *KnowledgeSectionLink) 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 *KnowledgeSectionLink) 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 *KnowledgeSectionLink) 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 *KnowledgeSectionLink) SetKind(v string) {
|
|
o.Kind = &v
|
|
}
|
|
|
|
// GetLabel returns the Label field value if set, zero value otherwise.
|
|
func (o *KnowledgeSectionLink) 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 *KnowledgeSectionLink) 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 *KnowledgeSectionLink) 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 *KnowledgeSectionLink) SetLabel(v string) {
|
|
o.Label = &v
|
|
}
|
|
|
|
// GetSection returns the Section field value if set, zero value otherwise.
|
|
func (o *KnowledgeSectionLink) GetSection() KnowledgeSectionBrief {
|
|
if o == nil || IsNil(o.Section) {
|
|
var ret KnowledgeSectionBrief
|
|
return ret
|
|
}
|
|
return *o.Section
|
|
}
|
|
|
|
// GetSectionOk returns a tuple with the Section field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *KnowledgeSectionLink) GetSectionOk() (*KnowledgeSectionBrief, bool) {
|
|
if o == nil || IsNil(o.Section) {
|
|
return nil, false
|
|
}
|
|
return o.Section, true
|
|
}
|
|
|
|
// HasSection returns a boolean if a field has been set.
|
|
func (o *KnowledgeSectionLink) HasSection() bool {
|
|
if o != nil && !IsNil(o.Section) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSection gets a reference to the given KnowledgeSectionBrief and assigns it to the Section field.
|
|
func (o *KnowledgeSectionLink) SetSection(v KnowledgeSectionBrief) {
|
|
o.Section = &v
|
|
}
|
|
|
|
func (o KnowledgeSectionLink) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o KnowledgeSectionLink) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
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.Section) {
|
|
toSerialize["section"] = o.Section
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *KnowledgeSectionLink) UnmarshalJSON(data []byte) (err error) {
|
|
varKnowledgeSectionLink := _KnowledgeSectionLink{}
|
|
|
|
err = json.Unmarshal(data, &varKnowledgeSectionLink)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = KnowledgeSectionLink(varKnowledgeSectionLink)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "file")
|
|
delete(additionalProperties, "kind")
|
|
delete(additionalProperties, "label")
|
|
delete(additionalProperties, "section")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableKnowledgeSectionLink struct {
|
|
value *KnowledgeSectionLink
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableKnowledgeSectionLink) Get() *KnowledgeSectionLink {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableKnowledgeSectionLink) Set(val *KnowledgeSectionLink) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableKnowledgeSectionLink) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableKnowledgeSectionLink) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableKnowledgeSectionLink(val *KnowledgeSectionLink) *NullableKnowledgeSectionLink {
|
|
return &NullableKnowledgeSectionLink{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableKnowledgeSectionLink) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableKnowledgeSectionLink) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|