// 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 SharePointMigrationJobPostponedEvent struct {
    SharePointMigrationEvent
}
// NewSharePointMigrationJobPostponedEvent instantiates a new SharePointMigrationJobPostponedEvent and sets the default values.
func NewSharePointMigrationJobPostponedEvent()(*SharePointMigrationJobPostponedEvent) {
    m := &SharePointMigrationJobPostponedEvent{
        SharePointMigrationEvent: *NewSharePointMigrationEvent(),
    }
    return m
}
// CreateSharePointMigrationJobPostponedEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
// returns a Parsable when successful
func CreateSharePointMigrationJobPostponedEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
    return NewSharePointMigrationJobPostponedEvent(), nil
}
// GetFieldDeserializers the deserialization information for the current model
// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful
func (m *SharePointMigrationJobPostponedEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
    res := m.SharePointMigrationEvent.GetFieldDeserializers()
    res["jobsInQueue"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
        val, err := n.GetInt64Value()
        if err != nil {
            return err
        }
        if val != nil {
            m.SetJobsInQueue(val)
        }
        return nil
    }
    res["nextPickupDateTime"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
        val, err := n.GetTimeValue()
        if err != nil {
            return err
        }
        if val != nil {
            m.SetNextPickupDateTime(val)
        }
        return nil
    }
    res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
        val, err := n.GetStringValue()
        if err != nil {
            return err
        }
        if val != nil {
            m.SetReason(val)
        }
        return nil
    }
    res["totalRetryCount"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
        val, err := n.GetInt32Value()
        if err != nil {
            return err
        }
        if val != nil {
            m.SetTotalRetryCount(val)
        }
        return nil
    }
    return res
}
// GetJobsInQueue gets the jobsInQueue property value. The number of migration jobs in the queue of the current database. Read-only.
// returns a *int64 when successful
func (m *SharePointMigrationJobPostponedEvent) GetJobsInQueue()(*int64) {
    val, err := m.GetBackingStore().Get("jobsInQueue")
    if err != nil {
        panic(err)
    }
    if val != nil {
        return val.(*int64)
    }
    return nil
}
// GetNextPickupDateTime gets the nextPickupDateTime property value. The date and time that indicate when this job is picked up next. The timestamp type represents date and time information using ISO 8601 format and is always in UTC. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only.
// returns a *Time when successful
func (m *SharePointMigrationJobPostponedEvent) GetNextPickupDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {
    val, err := m.GetBackingStore().Get("nextPickupDateTime")
    if err != nil {
        panic(err)
    }
    if val != nil {
        return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
    }
    return nil
}
// GetReason gets the reason property value. The reason for the postponement. Read-only.
// returns a *string when successful
func (m *SharePointMigrationJobPostponedEvent) GetReason()(*string) {
    val, err := m.GetBackingStore().Get("reason")
    if err != nil {
        panic(err)
    }
    if val != nil {
        return val.(*string)
    }
    return nil
}
// GetTotalRetryCount gets the totalRetryCount property value. The current retry count of the job. Read-only.
// returns a *int32 when successful
func (m *SharePointMigrationJobPostponedEvent) GetTotalRetryCount()(*int32) {
    val, err := m.GetBackingStore().Get("totalRetryCount")
    if err != nil {
        panic(err)
    }
    if val != nil {
        return val.(*int32)
    }
    return nil
}
// Serialize serializes information the current object
func (m *SharePointMigrationJobPostponedEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
    err := m.SharePointMigrationEvent.Serialize(writer)
    if err != nil {
        return err
    }
    {
        err = writer.WriteInt64Value("jobsInQueue", m.GetJobsInQueue())
        if err != nil {
            return err
        }
    }
    {
        err = writer.WriteTimeValue("nextPickupDateTime", m.GetNextPickupDateTime())
        if err != nil {
            return err
        }
    }
    {
        err = writer.WriteStringValue("reason", m.GetReason())
        if err != nil {
            return err
        }
    }
    {
        err = writer.WriteInt32Value("totalRetryCount", m.GetTotalRetryCount())
        if err != nil {
            return err
        }
    }
    return nil
}
// SetJobsInQueue sets the jobsInQueue property value. The number of migration jobs in the queue of the current database. Read-only.
func (m *SharePointMigrationJobPostponedEvent) SetJobsInQueue(value *int64)() {
    err := m.GetBackingStore().Set("jobsInQueue", value)
    if err != nil {
        panic(err)
    }
}
// SetNextPickupDateTime sets the nextPickupDateTime property value. The date and time that indicate when this job is picked up next. The timestamp type represents date and time information using ISO 8601 format and is always in UTC. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only.
func (m *SharePointMigrationJobPostponedEvent) SetNextPickupDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {
    err := m.GetBackingStore().Set("nextPickupDateTime", value)
    if err != nil {
        panic(err)
    }
}
// SetReason sets the reason property value. The reason for the postponement. Read-only.
func (m *SharePointMigrationJobPostponedEvent) SetReason(value *string)() {
    err := m.GetBackingStore().Set("reason", value)
    if err != nil {
        panic(err)
    }
}
// SetTotalRetryCount sets the totalRetryCount property value. The current retry count of the job. Read-only.
func (m *SharePointMigrationJobPostponedEvent) SetTotalRetryCount(value *int32)() {
    err := m.GetBackingStore().Set("totalRetryCount", value)
    if err != nil {
        panic(err)
    }
}
type SharePointMigrationJobPostponedEventable interface {
    i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
    SharePointMigrationEventable
    GetJobsInQueue()(*int64)
    GetNextPickupDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
    GetReason()(*string)
    GetTotalRetryCount()(*int32)
    SetJobsInQueue(value *int64)()
    SetNextPickupDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)()
    SetReason(value *string)()
    SetTotalRetryCount(value *int32)()
}
