/*
Libre Graph API

Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.

API version: v1.0.8
*/

// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.

package libregraph

import (
	"encoding/json"
	"time"
)

// checks if the SignInActivity type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &SignInActivity{}

// SignInActivity Provides the last successful sign-in attempt for a user
type SignInActivity struct {
	// The date and time of the last successful sign-in for the user.
	LastSuccessfulSignInDateTime *time.Time `json:"lastSuccessfulSignInDateTime,omitempty"`
}

// NewSignInActivity instantiates a new SignInActivity object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewSignInActivity() *SignInActivity {
	this := SignInActivity{}
	return &this
}

// NewSignInActivityWithDefaults instantiates a new SignInActivity object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewSignInActivityWithDefaults() *SignInActivity {
	this := SignInActivity{}
	return &this
}

// GetLastSuccessfulSignInDateTime returns the LastSuccessfulSignInDateTime field value if set, zero value otherwise.
func (o *SignInActivity) GetLastSuccessfulSignInDateTime() time.Time {
	if o == nil || IsNil(o.LastSuccessfulSignInDateTime) {
		var ret time.Time
		return ret
	}
	return *o.LastSuccessfulSignInDateTime
}

// GetLastSuccessfulSignInDateTimeOk returns a tuple with the LastSuccessfulSignInDateTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SignInActivity) GetLastSuccessfulSignInDateTimeOk() (*time.Time, bool) {
	if o == nil || IsNil(o.LastSuccessfulSignInDateTime) {
		return nil, false
	}
	return o.LastSuccessfulSignInDateTime, true
}

// HasLastSuccessfulSignInDateTime returns a boolean if a field has been set.
func (o *SignInActivity) HasLastSuccessfulSignInDateTime() bool {
	if o != nil && !IsNil(o.LastSuccessfulSignInDateTime) {
		return true
	}

	return false
}

// SetLastSuccessfulSignInDateTime gets a reference to the given time.Time and assigns it to the LastSuccessfulSignInDateTime field.
func (o *SignInActivity) SetLastSuccessfulSignInDateTime(v time.Time) {
	o.LastSuccessfulSignInDateTime = &v
}

func (o SignInActivity) MarshalJSON() ([]byte, error) {
	toSerialize,err := o.ToMap()
	if err != nil {
		return []byte{}, err
	}
	return json.Marshal(toSerialize)
}

func (o SignInActivity) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.LastSuccessfulSignInDateTime) {
		toSerialize["lastSuccessfulSignInDateTime"] = o.LastSuccessfulSignInDateTime
	}
	return toSerialize, nil
}

type NullableSignInActivity struct {
	value *SignInActivity
	isSet bool
}

func (v NullableSignInActivity) Get() *SignInActivity {
	return v.value
}

func (v *NullableSignInActivity) Set(val *SignInActivity) {
	v.value = val
	v.isSet = true
}

func (v NullableSignInActivity) IsSet() bool {
	return v.isSet
}

func (v *NullableSignInActivity) Unset() {
	v.value = nil
	v.isSet = false
}

func NewNullableSignInActivity(val *SignInActivity) *NullableSignInActivity {
	return &NullableSignInActivity{value: val, isSet: true}
}

func (v NullableSignInActivity) MarshalJSON() ([]byte, error) {
	return json.Marshal(v.value)
}

func (v *NullableSignInActivity) UnmarshalJSON(src []byte) error {
	v.isSet = true
	return json.Unmarshal(src, &v.value)
}


