// 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 (
    i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization"
)

// OnlineMeetingEngagementConversation a conversation for Teams QA online meeting.
type OnlineMeetingEngagementConversation struct {
    EngagementConversation
}
// NewOnlineMeetingEngagementConversation instantiates a new OnlineMeetingEngagementConversation and sets the default values.
func NewOnlineMeetingEngagementConversation()(*OnlineMeetingEngagementConversation) {
    m := &OnlineMeetingEngagementConversation{
        EngagementConversation: *NewEngagementConversation(),
    }
    odataTypeValue := "#microsoft.graph.onlineMeetingEngagementConversation"
    m.SetOdataType(&odataTypeValue)
    return m
}
// CreateOnlineMeetingEngagementConversationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
// returns a Parsable when successful
func CreateOnlineMeetingEngagementConversationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
    return NewOnlineMeetingEngagementConversation(), nil
}
// GetFieldDeserializers the deserialization information for the current model
// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful
func (m *OnlineMeetingEngagementConversation) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
    res := m.EngagementConversation.GetFieldDeserializers()
    res["moderationState"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
        val, err := n.GetEnumValue(ParseEngagementConversationModerationState)
        if err != nil {
            return err
        }
        if val != nil {
            m.SetModerationState(val.(*EngagementConversationModerationState))
        }
        return nil
    }
    res["onlineMeeting"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
        val, err := n.GetObjectValue(CreateOnlineMeetingFromDiscriminatorValue)
        if err != nil {
            return err
        }
        if val != nil {
            m.SetOnlineMeeting(val.(OnlineMeetingable))
        }
        return nil
    }
    res["onlineMeetingId"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
        val, err := n.GetStringValue()
        if err != nil {
            return err
        }
        if val != nil {
            m.SetOnlineMeetingId(val)
        }
        return nil
    }
    res["organizer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
        val, err := n.GetObjectValue(CreateEngagementIdentitySetFromDiscriminatorValue)
        if err != nil {
            return err
        }
        if val != nil {
            m.SetOrganizer(val.(EngagementIdentitySetable))
        }
        return nil
    }
    res["upvoteCount"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
        val, err := n.GetInt32Value()
        if err != nil {
            return err
        }
        if val != nil {
            m.SetUpvoteCount(val)
        }
        return nil
    }
    return res
}
// GetModerationState gets the moderationState property value. Represents the moderation state of an Engage conversation message.
// returns a *EngagementConversationModerationState when successful
func (m *OnlineMeetingEngagementConversation) GetModerationState()(*EngagementConversationModerationState) {
    val, err := m.GetBackingStore().Get("moderationState")
    if err != nil {
        panic(err)
    }
    if val != nil {
        return val.(*EngagementConversationModerationState)
    }
    return nil
}
// GetOnlineMeeting gets the onlineMeeting property value. The onlineMeeting property
// returns a OnlineMeetingable when successful
func (m *OnlineMeetingEngagementConversation) GetOnlineMeeting()(OnlineMeetingable) {
    val, err := m.GetBackingStore().Get("onlineMeeting")
    if err != nil {
        panic(err)
    }
    if val != nil {
        return val.(OnlineMeetingable)
    }
    return nil
}
// GetOnlineMeetingId gets the onlineMeetingId property value. The unique identifier of the online meeting associated with this conversation. The online meeting ID links the conversation to a specific meeting instance.
// returns a *string when successful
func (m *OnlineMeetingEngagementConversation) GetOnlineMeetingId()(*string) {
    val, err := m.GetBackingStore().Get("onlineMeetingId")
    if err != nil {
        panic(err)
    }
    if val != nil {
        return val.(*string)
    }
    return nil
}
// GetOrganizer gets the organizer property value. The organizer property
// returns a EngagementIdentitySetable when successful
func (m *OnlineMeetingEngagementConversation) GetOrganizer()(EngagementIdentitySetable) {
    val, err := m.GetBackingStore().Get("organizer")
    if err != nil {
        panic(err)
    }
    if val != nil {
        return val.(EngagementIdentitySetable)
    }
    return nil
}
// GetUpvoteCount gets the upvoteCount property value. The number of upvotes the conversation received.
// returns a *int32 when successful
func (m *OnlineMeetingEngagementConversation) GetUpvoteCount()(*int32) {
    val, err := m.GetBackingStore().Get("upvoteCount")
    if err != nil {
        panic(err)
    }
    if val != nil {
        return val.(*int32)
    }
    return nil
}
// Serialize serializes information the current object
func (m *OnlineMeetingEngagementConversation) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
    err := m.EngagementConversation.Serialize(writer)
    if err != nil {
        return err
    }
    if m.GetModerationState() != nil {
        cast := (*m.GetModerationState()).String()
        err = writer.WriteStringValue("moderationState", &cast)
        if err != nil {
            return err
        }
    }
    {
        err = writer.WriteObjectValue("onlineMeeting", m.GetOnlineMeeting())
        if err != nil {
            return err
        }
    }
    {
        err = writer.WriteStringValue("onlineMeetingId", m.GetOnlineMeetingId())
        if err != nil {
            return err
        }
    }
    {
        err = writer.WriteObjectValue("organizer", m.GetOrganizer())
        if err != nil {
            return err
        }
    }
    return nil
}
// SetModerationState sets the moderationState property value. Represents the moderation state of an Engage conversation message.
func (m *OnlineMeetingEngagementConversation) SetModerationState(value *EngagementConversationModerationState)() {
    err := m.GetBackingStore().Set("moderationState", value)
    if err != nil {
        panic(err)
    }
}
// SetOnlineMeeting sets the onlineMeeting property value. The onlineMeeting property
func (m *OnlineMeetingEngagementConversation) SetOnlineMeeting(value OnlineMeetingable)() {
    err := m.GetBackingStore().Set("onlineMeeting", value)
    if err != nil {
        panic(err)
    }
}
// SetOnlineMeetingId sets the onlineMeetingId property value. The unique identifier of the online meeting associated with this conversation. The online meeting ID links the conversation to a specific meeting instance.
func (m *OnlineMeetingEngagementConversation) SetOnlineMeetingId(value *string)() {
    err := m.GetBackingStore().Set("onlineMeetingId", value)
    if err != nil {
        panic(err)
    }
}
// SetOrganizer sets the organizer property value. The organizer property
func (m *OnlineMeetingEngagementConversation) SetOrganizer(value EngagementIdentitySetable)() {
    err := m.GetBackingStore().Set("organizer", value)
    if err != nil {
        panic(err)
    }
}
// SetUpvoteCount sets the upvoteCount property value. The number of upvotes the conversation received.
func (m *OnlineMeetingEngagementConversation) SetUpvoteCount(value *int32)() {
    err := m.GetBackingStore().Set("upvoteCount", value)
    if err != nil {
        panic(err)
    }
}
type OnlineMeetingEngagementConversationable interface {
    EngagementConversationable
    i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
    GetModerationState()(*EngagementConversationModerationState)
    GetOnlineMeeting()(OnlineMeetingable)
    GetOnlineMeetingId()(*string)
    GetOrganizer()(EngagementIdentitySetable)
    GetUpvoteCount()(*int32)
    SetModerationState(value *EngagementConversationModerationState)()
    SetOnlineMeeting(value OnlineMeetingable)()
    SetOnlineMeetingId(value *string)()
    SetOrganizer(value EngagementIdentitySetable)()
    SetUpvoteCount(value *int32)()
}
