-
Notifications
You must be signed in to change notification settings - Fork 0
/
chat_message_info.go
209 lines (207 loc) · 8.77 KB
/
chat_message_info.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
package models
import (
i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time"
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization"
)
// ChatMessageInfo
type ChatMessageInfo struct {
Entity
// Body of the chatMessage. This will still contain markers for @mentions and attachments even though the object doesn't return @mentions and attachments.
body ItemBodyable
// Date time object representing the time at which message was created.
createdDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time
// Read-only. If present, represents details of an event that happened in a chat, a channel, or a team, for example, members were added, and so on. For event messages, the messageType property is set to systemEventMessage.
eventDetail EventMessageDetailable
// Information about the sender of the message.
from ChatMessageFromIdentitySetable
// If set to true, the original message has been deleted.
isDeleted *bool
// The messageType property
messageType *ChatMessageType
}
// NewChatMessageInfo instantiates a new chatMessageInfo and sets the default values.
func NewChatMessageInfo()(*ChatMessageInfo) {
m := &ChatMessageInfo{
Entity: *NewEntity(),
}
return m
}
// CreateChatMessageInfoFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
func CreateChatMessageInfoFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewChatMessageInfo(), nil
}
// GetBody gets the body property value. Body of the chatMessage. This will still contain markers for @mentions and attachments even though the object doesn't return @mentions and attachments.
func (m *ChatMessageInfo) GetBody()(ItemBodyable) {
return m.body
}
// GetCreatedDateTime gets the createdDateTime property value. Date time object representing the time at which message was created.
func (m *ChatMessageInfo) GetCreatedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {
return m.createdDateTime
}
// GetEventDetail gets the eventDetail property value. Read-only. If present, represents details of an event that happened in a chat, a channel, or a team, for example, members were added, and so on. For event messages, the messageType property is set to systemEventMessage.
func (m *ChatMessageInfo) GetEventDetail()(EventMessageDetailable) {
return m.eventDetail
}
// GetFieldDeserializers the deserialization information for the current model
func (m *ChatMessageInfo) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := m.Entity.GetFieldDeserializers()
res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetObjectValue(CreateItemBodyFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
m.SetBody(val.(ItemBodyable))
}
return nil
}
res["createdDateTime"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetTimeValue()
if err != nil {
return err
}
if val != nil {
m.SetCreatedDateTime(val)
}
return nil
}
res["eventDetail"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetObjectValue(CreateEventMessageDetailFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
m.SetEventDetail(val.(EventMessageDetailable))
}
return nil
}
res["from"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetObjectValue(CreateChatMessageFromIdentitySetFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
m.SetFrom(val.(ChatMessageFromIdentitySetable))
}
return nil
}
res["isDeleted"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetBoolValue()
if err != nil {
return err
}
if val != nil {
m.SetIsDeleted(val)
}
return nil
}
res["messageType"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetEnumValue(ParseChatMessageType)
if err != nil {
return err
}
if val != nil {
m.SetMessageType(val.(*ChatMessageType))
}
return nil
}
return res
}
// GetFrom gets the from property value. Information about the sender of the message.
func (m *ChatMessageInfo) GetFrom()(ChatMessageFromIdentitySetable) {
return m.from
}
// GetIsDeleted gets the isDeleted property value. If set to true, the original message has been deleted.
func (m *ChatMessageInfo) GetIsDeleted()(*bool) {
return m.isDeleted
}
// GetMessageType gets the messageType property value. The messageType property
func (m *ChatMessageInfo) GetMessageType()(*ChatMessageType) {
return m.messageType
}
// Serialize serializes information the current object
func (m *ChatMessageInfo) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
err := m.Entity.Serialize(writer)
if err != nil {
return err
}
{
err = writer.WriteObjectValue("body", m.GetBody())
if err != nil {
return err
}
}
{
err = writer.WriteTimeValue("createdDateTime", m.GetCreatedDateTime())
if err != nil {
return err
}
}
{
err = writer.WriteObjectValue("eventDetail", m.GetEventDetail())
if err != nil {
return err
}
}
{
err = writer.WriteObjectValue("from", m.GetFrom())
if err != nil {
return err
}
}
{
err = writer.WriteBoolValue("isDeleted", m.GetIsDeleted())
if err != nil {
return err
}
}
if m.GetMessageType() != nil {
cast := (*m.GetMessageType()).String()
err = writer.WriteStringValue("messageType", &cast)
if err != nil {
return err
}
}
return nil
}
// SetBody sets the body property value. Body of the chatMessage. This will still contain markers for @mentions and attachments even though the object doesn't return @mentions and attachments.
func (m *ChatMessageInfo) SetBody(value ItemBodyable)() {
m.body = value
}
// SetCreatedDateTime sets the createdDateTime property value. Date time object representing the time at which message was created.
func (m *ChatMessageInfo) SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {
m.createdDateTime = value
}
// SetEventDetail sets the eventDetail property value. Read-only. If present, represents details of an event that happened in a chat, a channel, or a team, for example, members were added, and so on. For event messages, the messageType property is set to systemEventMessage.
func (m *ChatMessageInfo) SetEventDetail(value EventMessageDetailable)() {
m.eventDetail = value
}
// SetFrom sets the from property value. Information about the sender of the message.
func (m *ChatMessageInfo) SetFrom(value ChatMessageFromIdentitySetable)() {
m.from = value
}
// SetIsDeleted sets the isDeleted property value. If set to true, the original message has been deleted.
func (m *ChatMessageInfo) SetIsDeleted(value *bool)() {
m.isDeleted = value
}
// SetMessageType sets the messageType property value. The messageType property
func (m *ChatMessageInfo) SetMessageType(value *ChatMessageType)() {
m.messageType = value
}
// ChatMessageInfoable
type ChatMessageInfoable interface {
Entityable
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
GetBody()(ItemBodyable)
GetCreatedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
GetEventDetail()(EventMessageDetailable)
GetFrom()(ChatMessageFromIdentitySetable)
GetIsDeleted()(*bool)
GetMessageType()(*ChatMessageType)
SetBody(value ItemBodyable)()
SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)()
SetEventDetail(value EventMessageDetailable)()
SetFrom(value ChatMessageFromIdentitySetable)()
SetIsDeleted(value *bool)()
SetMessageType(value *ChatMessageType)()
}