// 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 SharePointMigrationJobCancelledEvent struct {
    SharePointMigrationEvent
}
// NewSharePointMigrationJobCancelledEvent instantiates a new SharePointMigrationJobCancelledEvent and sets the default values.
func NewSharePointMigrationJobCancelledEvent()(*SharePointMigrationJobCancelledEvent) {
    m := &SharePointMigrationJobCancelledEvent{
        SharePointMigrationEvent: *NewSharePointMigrationEvent(),
    }
    return m
}
// CreateSharePointMigrationJobCancelledEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
// returns a Parsable when successful
func CreateSharePointMigrationJobCancelledEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
    return NewSharePointMigrationJobCancelledEvent(), nil
}
// GetFieldDeserializers the deserialization information for the current model
// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful
func (m *SharePointMigrationJobCancelledEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
    res := m.SharePointMigrationEvent.GetFieldDeserializers()
    res["isCancelledByUser"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
        val, err := n.GetBoolValue()
        if err != nil {
            return err
        }
        if val != nil {
            m.SetIsCancelledByUser(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
}
// GetIsCancelledByUser gets the isCancelledByUser property value. True when a user cancels the job; otherwise, false. Read-only.
// returns a *bool when successful
func (m *SharePointMigrationJobCancelledEvent) GetIsCancelledByUser()(*bool) {
    val, err := m.GetBackingStore().Get("isCancelledByUser")
    if err != nil {
        panic(err)
    }
    if val != nil {
        return val.(*bool)
    }
    return nil
}
// GetTotalRetryCount gets the totalRetryCount property value. The current retry count of the job. Read-only.
// returns a *int32 when successful
func (m *SharePointMigrationJobCancelledEvent) 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 *SharePointMigrationJobCancelledEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
    err := m.SharePointMigrationEvent.Serialize(writer)
    if err != nil {
        return err
    }
    {
        err = writer.WriteBoolValue("isCancelledByUser", m.GetIsCancelledByUser())
        if err != nil {
            return err
        }
    }
    {
        err = writer.WriteInt32Value("totalRetryCount", m.GetTotalRetryCount())
        if err != nil {
            return err
        }
    }
    return nil
}
// SetIsCancelledByUser sets the isCancelledByUser property value. True when a user cancels the job; otherwise, false. Read-only.
func (m *SharePointMigrationJobCancelledEvent) SetIsCancelledByUser(value *bool)() {
    err := m.GetBackingStore().Set("isCancelledByUser", value)
    if err != nil {
        panic(err)
    }
}
// SetTotalRetryCount sets the totalRetryCount property value. The current retry count of the job. Read-only.
func (m *SharePointMigrationJobCancelledEvent) SetTotalRetryCount(value *int32)() {
    err := m.GetBackingStore().Set("totalRetryCount", value)
    if err != nil {
        panic(err)
    }
}
type SharePointMigrationJobCancelledEventable interface {
    i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
    SharePointMigrationEventable
    GetIsCancelledByUser()(*bool)
    GetTotalRetryCount()(*int32)
    SetIsCancelledByUser(value *bool)()
    SetTotalRetryCount(value *int32)()
}
