Files
sdk/model_article.go

450 lines
11 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 Article type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Article{}
// Article struct for Article
type Article struct {
Content []Block `json:"content,omitempty"`
CreatedTime *string `json:"createdTime,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
Glossary []string `json:"glossary,omitempty"`
Name *string `json:"name,omitempty"`
Owner *string `json:"owner,omitempty"`
Text *string `json:"text,omitempty"`
Type *string `json:"type,omitempty"`
Workflow *string `json:"workflow,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Article Article
// NewArticle instantiates a new Article 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 NewArticle() *Article {
this := Article{}
return &this
}
// NewArticleWithDefaults instantiates a new Article 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 NewArticleWithDefaults() *Article {
this := Article{}
return &this
}
// GetContent returns the Content field value if set, zero value otherwise.
func (o *Article) GetContent() []Block {
if o == nil || IsNil(o.Content) {
var ret []Block
return ret
}
return o.Content
}
// GetContentOk returns a tuple with the Content field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Article) GetContentOk() ([]Block, bool) {
if o == nil || IsNil(o.Content) {
return nil, false
}
return o.Content, true
}
// HasContent returns a boolean if a field has been set.
func (o *Article) HasContent() bool {
if o != nil && !IsNil(o.Content) {
return true
}
return false
}
// SetContent gets a reference to the given []Block and assigns it to the Content field.
func (o *Article) SetContent(v []Block) {
o.Content = v
}
// GetCreatedTime returns the CreatedTime field value if set, zero value otherwise.
func (o *Article) GetCreatedTime() string {
if o == nil || IsNil(o.CreatedTime) {
var ret string
return ret
}
return *o.CreatedTime
}
// GetCreatedTimeOk returns a tuple with the CreatedTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Article) GetCreatedTimeOk() (*string, bool) {
if o == nil || IsNil(o.CreatedTime) {
return nil, false
}
return o.CreatedTime, true
}
// HasCreatedTime returns a boolean if a field has been set.
func (o *Article) HasCreatedTime() bool {
if o != nil && !IsNil(o.CreatedTime) {
return true
}
return false
}
// SetCreatedTime gets a reference to the given string and assigns it to the CreatedTime field.
func (o *Article) SetCreatedTime(v string) {
o.CreatedTime = &v
}
// GetDisplayName returns the DisplayName field value if set, zero value otherwise.
func (o *Article) GetDisplayName() string {
if o == nil || IsNil(o.DisplayName) {
var ret string
return ret
}
return *o.DisplayName
}
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Article) GetDisplayNameOk() (*string, bool) {
if o == nil || IsNil(o.DisplayName) {
return nil, false
}
return o.DisplayName, true
}
// HasDisplayName returns a boolean if a field has been set.
func (o *Article) HasDisplayName() bool {
if o != nil && !IsNil(o.DisplayName) {
return true
}
return false
}
// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field.
func (o *Article) SetDisplayName(v string) {
o.DisplayName = &v
}
// GetGlossary returns the Glossary field value if set, zero value otherwise.
func (o *Article) GetGlossary() []string {
if o == nil || IsNil(o.Glossary) {
var ret []string
return ret
}
return o.Glossary
}
// GetGlossaryOk returns a tuple with the Glossary field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Article) GetGlossaryOk() ([]string, bool) {
if o == nil || IsNil(o.Glossary) {
return nil, false
}
return o.Glossary, true
}
// HasGlossary returns a boolean if a field has been set.
func (o *Article) HasGlossary() bool {
if o != nil && !IsNil(o.Glossary) {
return true
}
return false
}
// SetGlossary gets a reference to the given []string and assigns it to the Glossary field.
func (o *Article) SetGlossary(v []string) {
o.Glossary = v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *Article) 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 *Article) 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 *Article) 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 *Article) SetName(v string) {
o.Name = &v
}
// GetOwner returns the Owner field value if set, zero value otherwise.
func (o *Article) GetOwner() string {
if o == nil || IsNil(o.Owner) {
var ret string
return ret
}
return *o.Owner
}
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Article) GetOwnerOk() (*string, bool) {
if o == nil || IsNil(o.Owner) {
return nil, false
}
return o.Owner, true
}
// HasOwner returns a boolean if a field has been set.
func (o *Article) HasOwner() bool {
if o != nil && !IsNil(o.Owner) {
return true
}
return false
}
// SetOwner gets a reference to the given string and assigns it to the Owner field.
func (o *Article) SetOwner(v string) {
o.Owner = &v
}
// GetText returns the Text field value if set, zero value otherwise.
func (o *Article) GetText() string {
if o == nil || IsNil(o.Text) {
var ret string
return ret
}
return *o.Text
}
// GetTextOk returns a tuple with the Text field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Article) GetTextOk() (*string, bool) {
if o == nil || IsNil(o.Text) {
return nil, false
}
return o.Text, true
}
// HasText returns a boolean if a field has been set.
func (o *Article) HasText() bool {
if o != nil && !IsNil(o.Text) {
return true
}
return false
}
// SetText gets a reference to the given string and assigns it to the Text field.
func (o *Article) SetText(v string) {
o.Text = &v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *Article) GetType() string {
if o == nil || IsNil(o.Type) {
var ret string
return ret
}
return *o.Type
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Article) GetTypeOk() (*string, bool) {
if o == nil || IsNil(o.Type) {
return nil, false
}
return o.Type, true
}
// HasType returns a boolean if a field has been set.
func (o *Article) HasType() bool {
if o != nil && !IsNil(o.Type) {
return true
}
return false
}
// SetType gets a reference to the given string and assigns it to the Type field.
func (o *Article) SetType(v string) {
o.Type = &v
}
// GetWorkflow returns the Workflow field value if set, zero value otherwise.
func (o *Article) GetWorkflow() string {
if o == nil || IsNil(o.Workflow) {
var ret string
return ret
}
return *o.Workflow
}
// GetWorkflowOk returns a tuple with the Workflow field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Article) GetWorkflowOk() (*string, bool) {
if o == nil || IsNil(o.Workflow) {
return nil, false
}
return o.Workflow, true
}
// HasWorkflow returns a boolean if a field has been set.
func (o *Article) HasWorkflow() bool {
if o != nil && !IsNil(o.Workflow) {
return true
}
return false
}
// SetWorkflow gets a reference to the given string and assigns it to the Workflow field.
func (o *Article) SetWorkflow(v string) {
o.Workflow = &v
}
func (o Article) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Article) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Content) {
toSerialize["content"] = o.Content
}
if !IsNil(o.CreatedTime) {
toSerialize["createdTime"] = o.CreatedTime
}
if !IsNil(o.DisplayName) {
toSerialize["displayName"] = o.DisplayName
}
if !IsNil(o.Glossary) {
toSerialize["glossary"] = o.Glossary
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Owner) {
toSerialize["owner"] = o.Owner
}
if !IsNil(o.Text) {
toSerialize["text"] = o.Text
}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
if !IsNil(o.Workflow) {
toSerialize["workflow"] = o.Workflow
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Article) UnmarshalJSON(data []byte) (err error) {
varArticle := _Article{}
err = json.Unmarshal(data, &varArticle)
if err != nil {
return err
}
*o = Article(varArticle)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "content")
delete(additionalProperties, "createdTime")
delete(additionalProperties, "displayName")
delete(additionalProperties, "glossary")
delete(additionalProperties, "name")
delete(additionalProperties, "owner")
delete(additionalProperties, "text")
delete(additionalProperties, "type")
delete(additionalProperties, "workflow")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableArticle struct {
value *Article
isSet bool
}
func (v NullableArticle) Get() *Article {
return v.value
}
func (v *NullableArticle) Set(val *Article) {
v.value = val
v.isSet = true
}
func (v NullableArticle) IsSet() bool {
return v.isSet
}
func (v *NullableArticle) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableArticle(val *Article) *NullableArticle {
return &NullableArticle{value: val, isSet: true}
}
func (v NullableArticle) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableArticle) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}