// Code generated by Microsoft Kiota - DO NOT EDIT.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

package models

import (
    i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time"
    i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization"
)

type ExchangeMessageTraceDetail struct {
    Entity
}
// NewExchangeMessageTraceDetail instantiates a new ExchangeMessageTraceDetail and sets the default values.
func NewExchangeMessageTraceDetail()(*ExchangeMessageTraceDetail) {
    m := &ExchangeMessageTraceDetail{
        Entity: *NewEntity(),
    }
    return m
}
// CreateExchangeMessageTraceDetailFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
// returns a Parsable when successful
func CreateExchangeMessageTraceDetailFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
    return NewExchangeMessageTraceDetail(), nil
}
// GetAction gets the action property value. The action taken on the message during the event.
// returns a *string when successful
func (m *ExchangeMessageTraceDetail) GetAction()(*string) {
    val, err := m.GetBackingStore().Get("action")
    if err != nil {
        panic(err)
    }
    if val != nil {
        return val.(*string)
    }
    return nil
}
// GetData gets the data property value. Additional data associated with the event, containing supplementary information specific to the event.
// returns a *string when successful
func (m *ExchangeMessageTraceDetail) GetData()(*string) {
    val, err := m.GetBackingStore().Get("data")
    if err != nil {
        panic(err)
    }
    if val != nil {
        return val.(*string)
    }
    return nil
}
// GetDateTime gets the dateTime property value. The date and time when the event occurred. The timestamp is in UTC format.
// returns a *Time when successful
func (m *ExchangeMessageTraceDetail) GetDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {
    val, err := m.GetBackingStore().Get("dateTime")
    if err != nil {
        panic(err)
    }
    if val != nil {
        return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
    }
    return nil
}
// GetDescription gets the description property value. A detailed description that provides context about what happened during message processing.
// returns a *string when successful
func (m *ExchangeMessageTraceDetail) GetDescription()(*string) {
    val, err := m.GetBackingStore().Get("description")
    if err != nil {
        panic(err)
    }
    if val != nil {
        return val.(*string)
    }
    return nil
}
// GetEvent gets the event property value. The event that occurred during message processing.
// returns a *string when successful
func (m *ExchangeMessageTraceDetail) GetEvent()(*string) {
    val, err := m.GetBackingStore().Get("event")
    if err != nil {
        panic(err)
    }
    if val != nil {
        return val.(*string)
    }
    return nil
}
// GetFieldDeserializers the deserialization information for the current model
// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful
func (m *ExchangeMessageTraceDetail) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
    res := m.Entity.GetFieldDeserializers()
    res["action"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
        val, err := n.GetStringValue()
        if err != nil {
            return err
        }
        if val != nil {
            m.SetAction(val)
        }
        return nil
    }
    res["data"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
        val, err := n.GetStringValue()
        if err != nil {
            return err
        }
        if val != nil {
            m.SetData(val)
        }
        return nil
    }
    res["dateTime"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
        val, err := n.GetTimeValue()
        if err != nil {
            return err
        }
        if val != nil {
            m.SetDateTime(val)
        }
        return nil
    }
    res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
        val, err := n.GetStringValue()
        if err != nil {
            return err
        }
        if val != nil {
            m.SetDescription(val)
        }
        return nil
    }
    res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
        val, err := n.GetStringValue()
        if err != nil {
            return err
        }
        if val != nil {
            m.SetEvent(val)
        }
        return nil
    }
    res["messageId"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
        val, err := n.GetStringValue()
        if err != nil {
            return err
        }
        if val != nil {
            m.SetMessageId(val)
        }
        return nil
    }
    return res
}
// GetMessageId gets the messageId property value. The Message-ID header field of the message. The format depends on the messaging server that sent the message.
// returns a *string when successful
func (m *ExchangeMessageTraceDetail) GetMessageId()(*string) {
    val, err := m.GetBackingStore().Get("messageId")
    if err != nil {
        panic(err)
    }
    if val != nil {
        return val.(*string)
    }
    return nil
}
// Serialize serializes information the current object
func (m *ExchangeMessageTraceDetail) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
    err := m.Entity.Serialize(writer)
    if err != nil {
        return err
    }
    {
        err = writer.WriteStringValue("action", m.GetAction())
        if err != nil {
            return err
        }
    }
    {
        err = writer.WriteStringValue("data", m.GetData())
        if err != nil {
            return err
        }
    }
    {
        err = writer.WriteTimeValue("dateTime", m.GetDateTime())
        if err != nil {
            return err
        }
    }
    {
        err = writer.WriteStringValue("description", m.GetDescription())
        if err != nil {
            return err
        }
    }
    {
        err = writer.WriteStringValue("event", m.GetEvent())
        if err != nil {
            return err
        }
    }
    {
        err = writer.WriteStringValue("messageId", m.GetMessageId())
        if err != nil {
            return err
        }
    }
    return nil
}
// SetAction sets the action property value. The action taken on the message during the event.
func (m *ExchangeMessageTraceDetail) SetAction(value *string)() {
    err := m.GetBackingStore().Set("action", value)
    if err != nil {
        panic(err)
    }
}
// SetData sets the data property value. Additional data associated with the event, containing supplementary information specific to the event.
func (m *ExchangeMessageTraceDetail) SetData(value *string)() {
    err := m.GetBackingStore().Set("data", value)
    if err != nil {
        panic(err)
    }
}
// SetDateTime sets the dateTime property value. The date and time when the event occurred. The timestamp is in UTC format.
func (m *ExchangeMessageTraceDetail) SetDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {
    err := m.GetBackingStore().Set("dateTime", value)
    if err != nil {
        panic(err)
    }
}
// SetDescription sets the description property value. A detailed description that provides context about what happened during message processing.
func (m *ExchangeMessageTraceDetail) SetDescription(value *string)() {
    err := m.GetBackingStore().Set("description", value)
    if err != nil {
        panic(err)
    }
}
// SetEvent sets the event property value. The event that occurred during message processing.
func (m *ExchangeMessageTraceDetail) SetEvent(value *string)() {
    err := m.GetBackingStore().Set("event", value)
    if err != nil {
        panic(err)
    }
}
// SetMessageId sets the messageId property value. The Message-ID header field of the message. The format depends on the messaging server that sent the message.
func (m *ExchangeMessageTraceDetail) SetMessageId(value *string)() {
    err := m.GetBackingStore().Set("messageId", value)
    if err != nil {
        panic(err)
    }
}
type ExchangeMessageTraceDetailable interface {
    Entityable
    i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
    GetAction()(*string)
    GetData()(*string)
    GetDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
    GetDescription()(*string)
    GetEvent()(*string)
    GetMessageId()(*string)
    SetAction(value *string)()
    SetData(value *string)()
    SetDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)()
    SetDescription(value *string)()
    SetEvent(value *string)()
    SetMessageId(value *string)()
}
