Files
sdk/model_team_team_message.go

611 lines
17 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 TeamTeamMessage type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TeamTeamMessage{}
// TeamTeamMessage struct for TeamTeamMessage
type TeamTeamMessage struct {
// Author is the team account uuid that wrote it. It is an ACCOUNT and not a display name: what to call somebody is the roster's answer (GET /v1/team/members), and copying it onto every message is how the two come to disagree. An agent's messages carry the account derived from its id, so the same field answers for both.
Author *string `json:"author,omitempty"`
// Channel is the channel it was said in — the same id the channel listing answers with, so a caller holding a message can name its channel without a second read. A reply names the channel its thread is in; a comment on a document has none.
Channel *string `json:"channel,omitempty"`
// CreatedOn is unix MILLIseconds, which is what the platform stamps.
CreatedOn *int64 `json:"createdOn,omitempty"`
// Doc is the document this message is a comment on. Empty for a message in a channel.
Doc *string `json:"doc,omitempty"`
// EditedOn is when the author last edited the message, unix milliseconds. Absent for a message never edited.
EditedOn *int64 `json:"editedOn,omitempty"`
// Files are the files attached to the message.
Files []TeamTeamFile `json:"files,omitempty"`
// ID is the message document's own id.
Id *string `json:"id,omitempty"`
// LastReply is when the thread was last answered, unix milliseconds. Absent for a message with no replies.
LastReply *int64 `json:"lastReply,omitempty"`
// Mentions are the account uuids the message @-mentions — exactly the people inbox.go told they were mentioned.
Mentions []string `json:"mentions,omitempty"`
// Reactions are the emoji people reacted with, one entry per emoji, in the order each emoji was first used.
Reactions []TeamTeamReaction `json:"reactions,omitempty"`
// Replies is how many replies the message's thread holds.
Replies *int64 `json:"replies,omitempty"`
// Text is the message as PLAIN TEXT. The document stores markup; this is the same `plainText` reduction the agent responder reads a prompt with, so a caller never has to parse the client's markup to know what was said. A mention reads as \"@Name\" here and is listed by id in Mentions.
Text *string `json:"text,omitempty"`
// Thread is the message this one replies to. Empty for a message that starts a conversation rather than answering one.
Thread *string `json:"thread,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TeamTeamMessage TeamTeamMessage
// NewTeamTeamMessage instantiates a new TeamTeamMessage 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 NewTeamTeamMessage() *TeamTeamMessage {
this := TeamTeamMessage{}
return &this
}
// NewTeamTeamMessageWithDefaults instantiates a new TeamTeamMessage 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 NewTeamTeamMessageWithDefaults() *TeamTeamMessage {
this := TeamTeamMessage{}
return &this
}
// GetAuthor returns the Author field value if set, zero value otherwise.
func (o *TeamTeamMessage) GetAuthor() string {
if o == nil || IsNil(o.Author) {
var ret string
return ret
}
return *o.Author
}
// GetAuthorOk returns a tuple with the Author field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TeamTeamMessage) GetAuthorOk() (*string, bool) {
if o == nil || IsNil(o.Author) {
return nil, false
}
return o.Author, true
}
// HasAuthor returns a boolean if a field has been set.
func (o *TeamTeamMessage) HasAuthor() bool {
if o != nil && !IsNil(o.Author) {
return true
}
return false
}
// SetAuthor gets a reference to the given string and assigns it to the Author field.
func (o *TeamTeamMessage) SetAuthor(v string) {
o.Author = &v
}
// GetChannel returns the Channel field value if set, zero value otherwise.
func (o *TeamTeamMessage) GetChannel() string {
if o == nil || IsNil(o.Channel) {
var ret string
return ret
}
return *o.Channel
}
// GetChannelOk returns a tuple with the Channel field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TeamTeamMessage) GetChannelOk() (*string, bool) {
if o == nil || IsNil(o.Channel) {
return nil, false
}
return o.Channel, true
}
// HasChannel returns a boolean if a field has been set.
func (o *TeamTeamMessage) HasChannel() bool {
if o != nil && !IsNil(o.Channel) {
return true
}
return false
}
// SetChannel gets a reference to the given string and assigns it to the Channel field.
func (o *TeamTeamMessage) SetChannel(v string) {
o.Channel = &v
}
// GetCreatedOn returns the CreatedOn field value if set, zero value otherwise.
func (o *TeamTeamMessage) GetCreatedOn() int64 {
if o == nil || IsNil(o.CreatedOn) {
var ret int64
return ret
}
return *o.CreatedOn
}
// GetCreatedOnOk returns a tuple with the CreatedOn field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TeamTeamMessage) GetCreatedOnOk() (*int64, bool) {
if o == nil || IsNil(o.CreatedOn) {
return nil, false
}
return o.CreatedOn, true
}
// HasCreatedOn returns a boolean if a field has been set.
func (o *TeamTeamMessage) HasCreatedOn() bool {
if o != nil && !IsNil(o.CreatedOn) {
return true
}
return false
}
// SetCreatedOn gets a reference to the given int64 and assigns it to the CreatedOn field.
func (o *TeamTeamMessage) SetCreatedOn(v int64) {
o.CreatedOn = &v
}
// GetDoc returns the Doc field value if set, zero value otherwise.
func (o *TeamTeamMessage) GetDoc() string {
if o == nil || IsNil(o.Doc) {
var ret string
return ret
}
return *o.Doc
}
// GetDocOk returns a tuple with the Doc field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TeamTeamMessage) GetDocOk() (*string, bool) {
if o == nil || IsNil(o.Doc) {
return nil, false
}
return o.Doc, true
}
// HasDoc returns a boolean if a field has been set.
func (o *TeamTeamMessage) HasDoc() bool {
if o != nil && !IsNil(o.Doc) {
return true
}
return false
}
// SetDoc gets a reference to the given string and assigns it to the Doc field.
func (o *TeamTeamMessage) SetDoc(v string) {
o.Doc = &v
}
// GetEditedOn returns the EditedOn field value if set, zero value otherwise.
func (o *TeamTeamMessage) GetEditedOn() int64 {
if o == nil || IsNil(o.EditedOn) {
var ret int64
return ret
}
return *o.EditedOn
}
// GetEditedOnOk returns a tuple with the EditedOn field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TeamTeamMessage) GetEditedOnOk() (*int64, bool) {
if o == nil || IsNil(o.EditedOn) {
return nil, false
}
return o.EditedOn, true
}
// HasEditedOn returns a boolean if a field has been set.
func (o *TeamTeamMessage) HasEditedOn() bool {
if o != nil && !IsNil(o.EditedOn) {
return true
}
return false
}
// SetEditedOn gets a reference to the given int64 and assigns it to the EditedOn field.
func (o *TeamTeamMessage) SetEditedOn(v int64) {
o.EditedOn = &v
}
// GetFiles returns the Files field value if set, zero value otherwise.
func (o *TeamTeamMessage) GetFiles() []TeamTeamFile {
if o == nil || IsNil(o.Files) {
var ret []TeamTeamFile
return ret
}
return o.Files
}
// GetFilesOk returns a tuple with the Files field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TeamTeamMessage) GetFilesOk() ([]TeamTeamFile, bool) {
if o == nil || IsNil(o.Files) {
return nil, false
}
return o.Files, true
}
// HasFiles returns a boolean if a field has been set.
func (o *TeamTeamMessage) HasFiles() bool {
if o != nil && !IsNil(o.Files) {
return true
}
return false
}
// SetFiles gets a reference to the given []TeamTeamFile and assigns it to the Files field.
func (o *TeamTeamMessage) SetFiles(v []TeamTeamFile) {
o.Files = v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *TeamTeamMessage) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TeamTeamMessage) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *TeamTeamMessage) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *TeamTeamMessage) SetId(v string) {
o.Id = &v
}
// GetLastReply returns the LastReply field value if set, zero value otherwise.
func (o *TeamTeamMessage) GetLastReply() int64 {
if o == nil || IsNil(o.LastReply) {
var ret int64
return ret
}
return *o.LastReply
}
// GetLastReplyOk returns a tuple with the LastReply field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TeamTeamMessage) GetLastReplyOk() (*int64, bool) {
if o == nil || IsNil(o.LastReply) {
return nil, false
}
return o.LastReply, true
}
// HasLastReply returns a boolean if a field has been set.
func (o *TeamTeamMessage) HasLastReply() bool {
if o != nil && !IsNil(o.LastReply) {
return true
}
return false
}
// SetLastReply gets a reference to the given int64 and assigns it to the LastReply field.
func (o *TeamTeamMessage) SetLastReply(v int64) {
o.LastReply = &v
}
// GetMentions returns the Mentions field value if set, zero value otherwise.
func (o *TeamTeamMessage) GetMentions() []string {
if o == nil || IsNil(o.Mentions) {
var ret []string
return ret
}
return o.Mentions
}
// GetMentionsOk returns a tuple with the Mentions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TeamTeamMessage) GetMentionsOk() ([]string, bool) {
if o == nil || IsNil(o.Mentions) {
return nil, false
}
return o.Mentions, true
}
// HasMentions returns a boolean if a field has been set.
func (o *TeamTeamMessage) HasMentions() bool {
if o != nil && !IsNil(o.Mentions) {
return true
}
return false
}
// SetMentions gets a reference to the given []string and assigns it to the Mentions field.
func (o *TeamTeamMessage) SetMentions(v []string) {
o.Mentions = v
}
// GetReactions returns the Reactions field value if set, zero value otherwise.
func (o *TeamTeamMessage) GetReactions() []TeamTeamReaction {
if o == nil || IsNil(o.Reactions) {
var ret []TeamTeamReaction
return ret
}
return o.Reactions
}
// GetReactionsOk returns a tuple with the Reactions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TeamTeamMessage) GetReactionsOk() ([]TeamTeamReaction, bool) {
if o == nil || IsNil(o.Reactions) {
return nil, false
}
return o.Reactions, true
}
// HasReactions returns a boolean if a field has been set.
func (o *TeamTeamMessage) HasReactions() bool {
if o != nil && !IsNil(o.Reactions) {
return true
}
return false
}
// SetReactions gets a reference to the given []TeamTeamReaction and assigns it to the Reactions field.
func (o *TeamTeamMessage) SetReactions(v []TeamTeamReaction) {
o.Reactions = v
}
// GetReplies returns the Replies field value if set, zero value otherwise.
func (o *TeamTeamMessage) GetReplies() int64 {
if o == nil || IsNil(o.Replies) {
var ret int64
return ret
}
return *o.Replies
}
// GetRepliesOk returns a tuple with the Replies field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TeamTeamMessage) GetRepliesOk() (*int64, bool) {
if o == nil || IsNil(o.Replies) {
return nil, false
}
return o.Replies, true
}
// HasReplies returns a boolean if a field has been set.
func (o *TeamTeamMessage) HasReplies() bool {
if o != nil && !IsNil(o.Replies) {
return true
}
return false
}
// SetReplies gets a reference to the given int64 and assigns it to the Replies field.
func (o *TeamTeamMessage) SetReplies(v int64) {
o.Replies = &v
}
// GetText returns the Text field value if set, zero value otherwise.
func (o *TeamTeamMessage) 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 *TeamTeamMessage) 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 *TeamTeamMessage) 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 *TeamTeamMessage) SetText(v string) {
o.Text = &v
}
// GetThread returns the Thread field value if set, zero value otherwise.
func (o *TeamTeamMessage) GetThread() string {
if o == nil || IsNil(o.Thread) {
var ret string
return ret
}
return *o.Thread
}
// GetThreadOk returns a tuple with the Thread field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TeamTeamMessage) GetThreadOk() (*string, bool) {
if o == nil || IsNil(o.Thread) {
return nil, false
}
return o.Thread, true
}
// HasThread returns a boolean if a field has been set.
func (o *TeamTeamMessage) HasThread() bool {
if o != nil && !IsNil(o.Thread) {
return true
}
return false
}
// SetThread gets a reference to the given string and assigns it to the Thread field.
func (o *TeamTeamMessage) SetThread(v string) {
o.Thread = &v
}
func (o TeamTeamMessage) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TeamTeamMessage) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Author) {
toSerialize["author"] = o.Author
}
if !IsNil(o.Channel) {
toSerialize["channel"] = o.Channel
}
if !IsNil(o.CreatedOn) {
toSerialize["createdOn"] = o.CreatedOn
}
if !IsNil(o.Doc) {
toSerialize["doc"] = o.Doc
}
if !IsNil(o.EditedOn) {
toSerialize["editedOn"] = o.EditedOn
}
if !IsNil(o.Files) {
toSerialize["files"] = o.Files
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.LastReply) {
toSerialize["lastReply"] = o.LastReply
}
if !IsNil(o.Mentions) {
toSerialize["mentions"] = o.Mentions
}
if !IsNil(o.Reactions) {
toSerialize["reactions"] = o.Reactions
}
if !IsNil(o.Replies) {
toSerialize["replies"] = o.Replies
}
if !IsNil(o.Text) {
toSerialize["text"] = o.Text
}
if !IsNil(o.Thread) {
toSerialize["thread"] = o.Thread
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TeamTeamMessage) UnmarshalJSON(data []byte) (err error) {
varTeamTeamMessage := _TeamTeamMessage{}
err = json.Unmarshal(data, &varTeamTeamMessage)
if err != nil {
return err
}
*o = TeamTeamMessage(varTeamTeamMessage)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "author")
delete(additionalProperties, "channel")
delete(additionalProperties, "createdOn")
delete(additionalProperties, "doc")
delete(additionalProperties, "editedOn")
delete(additionalProperties, "files")
delete(additionalProperties, "id")
delete(additionalProperties, "lastReply")
delete(additionalProperties, "mentions")
delete(additionalProperties, "reactions")
delete(additionalProperties, "replies")
delete(additionalProperties, "text")
delete(additionalProperties, "thread")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTeamTeamMessage struct {
value *TeamTeamMessage
isSet bool
}
func (v NullableTeamTeamMessage) Get() *TeamTeamMessage {
return v.value
}
func (v *NullableTeamTeamMessage) Set(val *TeamTeamMessage) {
v.value = val
v.isSet = true
}
func (v NullableTeamTeamMessage) IsSet() bool {
return v.isSet
}
func (v *NullableTeamTeamMessage) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTeamTeamMessage(val *TeamTeamMessage) *NullableTeamTeamMessage {
return &NullableTeamTeamMessage{value: val, isSet: true}
}
func (v NullableTeamTeamMessage) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTeamTeamMessage) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}