// 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"
)

type ContentActivity struct {
    Entity
}
// NewContentActivity instantiates a new ContentActivity and sets the default values.
func NewContentActivity()(*ContentActivity) {
    m := &ContentActivity{
        Entity: *NewEntity(),
    }
    return m
}
// CreateContentActivityFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
// returns a Parsable when successful
func CreateContentActivityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
    return NewContentActivity(), nil
}
// GetContentMetadata gets the contentMetadata property value. The contentMetadata property
// returns a ProcessContentRequestable when successful
func (m *ContentActivity) GetContentMetadata()(ProcessContentRequestable) {
    val, err := m.GetBackingStore().Get("contentMetadata")
    if err != nil {
        panic(err)
    }
    if val != nil {
        return val.(ProcessContentRequestable)
    }
    return nil
}
// GetFieldDeserializers the deserialization information for the current model
// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful
func (m *ContentActivity) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
    res := m.Entity.GetFieldDeserializers()
    res["contentMetadata"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
        val, err := n.GetObjectValue(CreateProcessContentRequestFromDiscriminatorValue)
        if err != nil {
            return err
        }
        if val != nil {
            m.SetContentMetadata(val.(ProcessContentRequestable))
        }
        return nil
    }
    res["scopeIdentifier"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
        val, err := n.GetStringValue()
        if err != nil {
            return err
        }
        if val != nil {
            m.SetScopeIdentifier(val)
        }
        return nil
    }
    res["userId"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
        val, err := n.GetStringValue()
        if err != nil {
            return err
        }
        if val != nil {
            m.SetUserId(val)
        }
        return nil
    }
    return res
}
// GetScopeIdentifier gets the scopeIdentifier property value. The scope identified from computed protection scopes.
// returns a *string when successful
func (m *ContentActivity) GetScopeIdentifier()(*string) {
    val, err := m.GetBackingStore().Get("scopeIdentifier")
    if err != nil {
        panic(err)
    }
    if val != nil {
        return val.(*string)
    }
    return nil
}
// GetUserId gets the userId property value. ID of the user.
// returns a *string when successful
func (m *ContentActivity) GetUserId()(*string) {
    val, err := m.GetBackingStore().Get("userId")
    if err != nil {
        panic(err)
    }
    if val != nil {
        return val.(*string)
    }
    return nil
}
// Serialize serializes information the current object
func (m *ContentActivity) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
    err := m.Entity.Serialize(writer)
    if err != nil {
        return err
    }
    {
        err = writer.WriteObjectValue("contentMetadata", m.GetContentMetadata())
        if err != nil {
            return err
        }
    }
    {
        err = writer.WriteStringValue("scopeIdentifier", m.GetScopeIdentifier())
        if err != nil {
            return err
        }
    }
    {
        err = writer.WriteStringValue("userId", m.GetUserId())
        if err != nil {
            return err
        }
    }
    return nil
}
// SetContentMetadata sets the contentMetadata property value. The contentMetadata property
func (m *ContentActivity) SetContentMetadata(value ProcessContentRequestable)() {
    err := m.GetBackingStore().Set("contentMetadata", value)
    if err != nil {
        panic(err)
    }
}
// SetScopeIdentifier sets the scopeIdentifier property value. The scope identified from computed protection scopes.
func (m *ContentActivity) SetScopeIdentifier(value *string)() {
    err := m.GetBackingStore().Set("scopeIdentifier", value)
    if err != nil {
        panic(err)
    }
}
// SetUserId sets the userId property value. ID of the user.
func (m *ContentActivity) SetUserId(value *string)() {
    err := m.GetBackingStore().Set("userId", value)
    if err != nil {
        panic(err)
    }
}
type ContentActivityable interface {
    Entityable
    i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
    GetContentMetadata()(ProcessContentRequestable)
    GetScopeIdentifier()(*string)
    GetUserId()(*string)
    SetContentMetadata(value ProcessContentRequestable)()
    SetScopeIdentifier(value *string)()
    SetUserId(value *string)()
}
