/*
FinFeedAPI Stock REST API

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

API version: v1
Contact: support@apibricks.io
*/

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

package openapi

import (
	"encoding/json"
	"time"
)

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

// AdminSystemEventModel Represents the response DTO for system event information
type AdminSystemEventModel struct {
	// Original timestamp in nanoseconds since epoch
	TimestampNanos *int64 `json:"timestamp_nanos,omitempty"`
	// Time when the system event was recorded as DateTime
	Timestamp *time.Time `json:"timestamp,omitempty"`
	// System event as byte value
	SystemEvent *int32 `json:"system_event,omitempty"`
	// System event as string
	SystemEventCode NullableString `json:"system_event_code,omitempty"`
	// Human-readable description of the system event
	SystemEventText NullableString `json:"system_event_text,omitempty"`
	// Indicates if the system event is 'Start of Messages' (O). Outside of heartbeat messages on the lower level protocol,  the start of day message is the first message sent in any trading session.
	IsSystemEventStartOfMessages *bool `json:"is_system_event_start_of_messages,omitempty"`
	// Indicates if the system event is 'Start of System Hours' (S). This message indicates that IEX is open and ready to start accepting orders.
	IsSystemEventStartOfSystemHours *bool `json:"is_system_event_start_of_system_hours,omitempty"`
	// Indicates if the system event is 'Start of Regular Market Hours' (R). This message indicates that DAY and GTX orders, as well as market orders and pegged orders,  are available for execution on IEX.
	IsSystemEventStartOfRegularMarketHours *bool `json:"is_system_event_start_of_regular_market_hours,omitempty"`
	// Indicates if the system event is 'End of Regular Market Hours' (M). This message indicates that DAY orders, market orders, and pegged orders  are no longer accepted by IEX.
	IsSystemEventEndOfRegularMarketHours *bool `json:"is_system_event_end_of_regular_market_hours,omitempty"`
	// Indicates if the system event is 'End of System Hours' (E). This message indicates that IEX is now closed and will not accept  any new orders during this trading session. It is still possible  to receive messages after the end of day.
	IsSystemEventEndOfSystemHours *bool `json:"is_system_event_end_of_system_hours,omitempty"`
	// Indicates if the system event is 'End of Messages' (C). This is always the last message sent in any trading session.
	IsSystemEventEndOfMessages *bool `json:"is_system_event_end_of_messages,omitempty"`
}

// NewAdminSystemEventModel instantiates a new AdminSystemEventModel 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 NewAdminSystemEventModel() *AdminSystemEventModel {
	this := AdminSystemEventModel{}
	return &this
}

// NewAdminSystemEventModelWithDefaults instantiates a new AdminSystemEventModel 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 NewAdminSystemEventModelWithDefaults() *AdminSystemEventModel {
	this := AdminSystemEventModel{}
	return &this
}

// GetTimestampNanos returns the TimestampNanos field value if set, zero value otherwise.
func (o *AdminSystemEventModel) GetTimestampNanos() int64 {
	if o == nil || IsNil(o.TimestampNanos) {
		var ret int64
		return ret
	}
	return *o.TimestampNanos
}

// GetTimestampNanosOk returns a tuple with the TimestampNanos field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AdminSystemEventModel) GetTimestampNanosOk() (*int64, bool) {
	if o == nil || IsNil(o.TimestampNanos) {
		return nil, false
	}
	return o.TimestampNanos, true
}

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

	return false
}

// SetTimestampNanos gets a reference to the given int64 and assigns it to the TimestampNanos field.
func (o *AdminSystemEventModel) SetTimestampNanos(v int64) {
	o.TimestampNanos = &v
}

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

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

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

	return false
}

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

// GetSystemEvent returns the SystemEvent field value if set, zero value otherwise.
func (o *AdminSystemEventModel) GetSystemEvent() int32 {
	if o == nil || IsNil(o.SystemEvent) {
		var ret int32
		return ret
	}
	return *o.SystemEvent
}

// GetSystemEventOk returns a tuple with the SystemEvent field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AdminSystemEventModel) GetSystemEventOk() (*int32, bool) {
	if o == nil || IsNil(o.SystemEvent) {
		return nil, false
	}
	return o.SystemEvent, true
}

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

	return false
}

// SetSystemEvent gets a reference to the given int32 and assigns it to the SystemEvent field.
func (o *AdminSystemEventModel) SetSystemEvent(v int32) {
	o.SystemEvent = &v
}

// GetSystemEventCode returns the SystemEventCode field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AdminSystemEventModel) GetSystemEventCode() string {
	if o == nil || IsNil(o.SystemEventCode.Get()) {
		var ret string
		return ret
	}
	return *o.SystemEventCode.Get()
}

// GetSystemEventCodeOk returns a tuple with the SystemEventCode field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *AdminSystemEventModel) GetSystemEventCodeOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.SystemEventCode.Get(), o.SystemEventCode.IsSet()
}

// HasSystemEventCode returns a boolean if a field has been set.
func (o *AdminSystemEventModel) HasSystemEventCode() bool {
	if o != nil && o.SystemEventCode.IsSet() {
		return true
	}

	return false
}

// SetSystemEventCode gets a reference to the given NullableString and assigns it to the SystemEventCode field.
func (o *AdminSystemEventModel) SetSystemEventCode(v string) {
	o.SystemEventCode.Set(&v)
}
// SetSystemEventCodeNil sets the value for SystemEventCode to be an explicit nil
func (o *AdminSystemEventModel) SetSystemEventCodeNil() {
	o.SystemEventCode.Set(nil)
}

// UnsetSystemEventCode ensures that no value is present for SystemEventCode, not even an explicit nil
func (o *AdminSystemEventModel) UnsetSystemEventCode() {
	o.SystemEventCode.Unset()
}

// GetSystemEventText returns the SystemEventText field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AdminSystemEventModel) GetSystemEventText() string {
	if o == nil || IsNil(o.SystemEventText.Get()) {
		var ret string
		return ret
	}
	return *o.SystemEventText.Get()
}

// GetSystemEventTextOk returns a tuple with the SystemEventText field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *AdminSystemEventModel) GetSystemEventTextOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.SystemEventText.Get(), o.SystemEventText.IsSet()
}

// HasSystemEventText returns a boolean if a field has been set.
func (o *AdminSystemEventModel) HasSystemEventText() bool {
	if o != nil && o.SystemEventText.IsSet() {
		return true
	}

	return false
}

// SetSystemEventText gets a reference to the given NullableString and assigns it to the SystemEventText field.
func (o *AdminSystemEventModel) SetSystemEventText(v string) {
	o.SystemEventText.Set(&v)
}
// SetSystemEventTextNil sets the value for SystemEventText to be an explicit nil
func (o *AdminSystemEventModel) SetSystemEventTextNil() {
	o.SystemEventText.Set(nil)
}

// UnsetSystemEventText ensures that no value is present for SystemEventText, not even an explicit nil
func (o *AdminSystemEventModel) UnsetSystemEventText() {
	o.SystemEventText.Unset()
}

// GetIsSystemEventStartOfMessages returns the IsSystemEventStartOfMessages field value if set, zero value otherwise.
func (o *AdminSystemEventModel) GetIsSystemEventStartOfMessages() bool {
	if o == nil || IsNil(o.IsSystemEventStartOfMessages) {
		var ret bool
		return ret
	}
	return *o.IsSystemEventStartOfMessages
}

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

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

	return false
}

// SetIsSystemEventStartOfMessages gets a reference to the given bool and assigns it to the IsSystemEventStartOfMessages field.
func (o *AdminSystemEventModel) SetIsSystemEventStartOfMessages(v bool) {
	o.IsSystemEventStartOfMessages = &v
}

// GetIsSystemEventStartOfSystemHours returns the IsSystemEventStartOfSystemHours field value if set, zero value otherwise.
func (o *AdminSystemEventModel) GetIsSystemEventStartOfSystemHours() bool {
	if o == nil || IsNil(o.IsSystemEventStartOfSystemHours) {
		var ret bool
		return ret
	}
	return *o.IsSystemEventStartOfSystemHours
}

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

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

	return false
}

// SetIsSystemEventStartOfSystemHours gets a reference to the given bool and assigns it to the IsSystemEventStartOfSystemHours field.
func (o *AdminSystemEventModel) SetIsSystemEventStartOfSystemHours(v bool) {
	o.IsSystemEventStartOfSystemHours = &v
}

// GetIsSystemEventStartOfRegularMarketHours returns the IsSystemEventStartOfRegularMarketHours field value if set, zero value otherwise.
func (o *AdminSystemEventModel) GetIsSystemEventStartOfRegularMarketHours() bool {
	if o == nil || IsNil(o.IsSystemEventStartOfRegularMarketHours) {
		var ret bool
		return ret
	}
	return *o.IsSystemEventStartOfRegularMarketHours
}

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

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

	return false
}

// SetIsSystemEventStartOfRegularMarketHours gets a reference to the given bool and assigns it to the IsSystemEventStartOfRegularMarketHours field.
func (o *AdminSystemEventModel) SetIsSystemEventStartOfRegularMarketHours(v bool) {
	o.IsSystemEventStartOfRegularMarketHours = &v
}

// GetIsSystemEventEndOfRegularMarketHours returns the IsSystemEventEndOfRegularMarketHours field value if set, zero value otherwise.
func (o *AdminSystemEventModel) GetIsSystemEventEndOfRegularMarketHours() bool {
	if o == nil || IsNil(o.IsSystemEventEndOfRegularMarketHours) {
		var ret bool
		return ret
	}
	return *o.IsSystemEventEndOfRegularMarketHours
}

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

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

	return false
}

// SetIsSystemEventEndOfRegularMarketHours gets a reference to the given bool and assigns it to the IsSystemEventEndOfRegularMarketHours field.
func (o *AdminSystemEventModel) SetIsSystemEventEndOfRegularMarketHours(v bool) {
	o.IsSystemEventEndOfRegularMarketHours = &v
}

// GetIsSystemEventEndOfSystemHours returns the IsSystemEventEndOfSystemHours field value if set, zero value otherwise.
func (o *AdminSystemEventModel) GetIsSystemEventEndOfSystemHours() bool {
	if o == nil || IsNil(o.IsSystemEventEndOfSystemHours) {
		var ret bool
		return ret
	}
	return *o.IsSystemEventEndOfSystemHours
}

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

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

	return false
}

// SetIsSystemEventEndOfSystemHours gets a reference to the given bool and assigns it to the IsSystemEventEndOfSystemHours field.
func (o *AdminSystemEventModel) SetIsSystemEventEndOfSystemHours(v bool) {
	o.IsSystemEventEndOfSystemHours = &v
}

// GetIsSystemEventEndOfMessages returns the IsSystemEventEndOfMessages field value if set, zero value otherwise.
func (o *AdminSystemEventModel) GetIsSystemEventEndOfMessages() bool {
	if o == nil || IsNil(o.IsSystemEventEndOfMessages) {
		var ret bool
		return ret
	}
	return *o.IsSystemEventEndOfMessages
}

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

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

	return false
}

// SetIsSystemEventEndOfMessages gets a reference to the given bool and assigns it to the IsSystemEventEndOfMessages field.
func (o *AdminSystemEventModel) SetIsSystemEventEndOfMessages(v bool) {
	o.IsSystemEventEndOfMessages = &v
}

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

func (o AdminSystemEventModel) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.TimestampNanos) {
		toSerialize["timestamp_nanos"] = o.TimestampNanos
	}
	if !IsNil(o.Timestamp) {
		toSerialize["timestamp"] = o.Timestamp
	}
	if !IsNil(o.SystemEvent) {
		toSerialize["system_event"] = o.SystemEvent
	}
	if o.SystemEventCode.IsSet() {
		toSerialize["system_event_code"] = o.SystemEventCode.Get()
	}
	if o.SystemEventText.IsSet() {
		toSerialize["system_event_text"] = o.SystemEventText.Get()
	}
	if !IsNil(o.IsSystemEventStartOfMessages) {
		toSerialize["is_system_event_start_of_messages"] = o.IsSystemEventStartOfMessages
	}
	if !IsNil(o.IsSystemEventStartOfSystemHours) {
		toSerialize["is_system_event_start_of_system_hours"] = o.IsSystemEventStartOfSystemHours
	}
	if !IsNil(o.IsSystemEventStartOfRegularMarketHours) {
		toSerialize["is_system_event_start_of_regular_market_hours"] = o.IsSystemEventStartOfRegularMarketHours
	}
	if !IsNil(o.IsSystemEventEndOfRegularMarketHours) {
		toSerialize["is_system_event_end_of_regular_market_hours"] = o.IsSystemEventEndOfRegularMarketHours
	}
	if !IsNil(o.IsSystemEventEndOfSystemHours) {
		toSerialize["is_system_event_end_of_system_hours"] = o.IsSystemEventEndOfSystemHours
	}
	if !IsNil(o.IsSystemEventEndOfMessages) {
		toSerialize["is_system_event_end_of_messages"] = o.IsSystemEventEndOfMessages
	}
	return toSerialize, nil
}

type NullableAdminSystemEventModel struct {
	value *AdminSystemEventModel
	isSet bool
}

func (v NullableAdminSystemEventModel) Get() *AdminSystemEventModel {
	return v.value
}

func (v *NullableAdminSystemEventModel) Set(val *AdminSystemEventModel) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableAdminSystemEventModel(val *AdminSystemEventModel) *NullableAdminSystemEventModel {
	return &NullableAdminSystemEventModel{value: val, isSet: true}
}

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

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


