/*
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 Level1QuoteUpdateModel type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Level1QuoteUpdateModel{}

// Level1QuoteUpdateModel Represents the response DTO for quote update information
type Level1QuoteUpdateModel struct {
	// The stock symbol
	Symbol NullableString `json:"symbol,omitempty"`
	// Original timestamp in nanoseconds since epoch
	TimestampNanos *int64 `json:"timestamp_nanos,omitempty"`
	// Time when the quote update was recorded as DateTime
	Timestamp *time.Time `json:"timestamp,omitempty"`
	// Gets whether the symbol is available for trading True if active, False if halted, paused, or otherwise not available
	IsSymbolAvailable *bool `json:"is_symbol_available,omitempty"`
	// Gets whether the market session is regular or pre/post-market True if pre/post-market session, False if regular market session
	IsPrePostMarketSession *bool `json:"is_pre_post_market_session,omitempty"`
	// Ask size in number of shares
	AskSize *int32 `json:"ask_size,omitempty"`
	// Ask price as decimal
	AskPrice *float64 `json:"ask_price,omitempty"`
	// Bid price as decimal
	BidPrice *float64 `json:"bid_price,omitempty"`
	// Bid size in number of shares
	BidSize *int32 `json:"bid_size,omitempty"`
}

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

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

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

// GetSymbolOk returns a tuple with the Symbol 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 *Level1QuoteUpdateModel) GetSymbolOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.Symbol.Get(), o.Symbol.IsSet()
}

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

	return false
}

// SetSymbol gets a reference to the given NullableString and assigns it to the Symbol field.
func (o *Level1QuoteUpdateModel) SetSymbol(v string) {
	o.Symbol.Set(&v)
}
// SetSymbolNil sets the value for Symbol to be an explicit nil
func (o *Level1QuoteUpdateModel) SetSymbolNil() {
	o.Symbol.Set(nil)
}

// UnsetSymbol ensures that no value is present for Symbol, not even an explicit nil
func (o *Level1QuoteUpdateModel) UnsetSymbol() {
	o.Symbol.Unset()
}

// GetTimestampNanos returns the TimestampNanos field value if set, zero value otherwise.
func (o *Level1QuoteUpdateModel) 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 *Level1QuoteUpdateModel) 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 *Level1QuoteUpdateModel) 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 *Level1QuoteUpdateModel) SetTimestampNanos(v int64) {
	o.TimestampNanos = &v
}

// GetTimestamp returns the Timestamp field value if set, zero value otherwise.
func (o *Level1QuoteUpdateModel) 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 *Level1QuoteUpdateModel) 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 *Level1QuoteUpdateModel) 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 *Level1QuoteUpdateModel) SetTimestamp(v time.Time) {
	o.Timestamp = &v
}

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

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

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

	return false
}

// SetIsSymbolAvailable gets a reference to the given bool and assigns it to the IsSymbolAvailable field.
func (o *Level1QuoteUpdateModel) SetIsSymbolAvailable(v bool) {
	o.IsSymbolAvailable = &v
}

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

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

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

	return false
}

// SetIsPrePostMarketSession gets a reference to the given bool and assigns it to the IsPrePostMarketSession field.
func (o *Level1QuoteUpdateModel) SetIsPrePostMarketSession(v bool) {
	o.IsPrePostMarketSession = &v
}

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

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

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

	return false
}

// SetAskSize gets a reference to the given int32 and assigns it to the AskSize field.
func (o *Level1QuoteUpdateModel) SetAskSize(v int32) {
	o.AskSize = &v
}

// GetAskPrice returns the AskPrice field value if set, zero value otherwise.
func (o *Level1QuoteUpdateModel) GetAskPrice() float64 {
	if o == nil || IsNil(o.AskPrice) {
		var ret float64
		return ret
	}
	return *o.AskPrice
}

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

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

	return false
}

// SetAskPrice gets a reference to the given float64 and assigns it to the AskPrice field.
func (o *Level1QuoteUpdateModel) SetAskPrice(v float64) {
	o.AskPrice = &v
}

// GetBidPrice returns the BidPrice field value if set, zero value otherwise.
func (o *Level1QuoteUpdateModel) GetBidPrice() float64 {
	if o == nil || IsNil(o.BidPrice) {
		var ret float64
		return ret
	}
	return *o.BidPrice
}

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

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

	return false
}

// SetBidPrice gets a reference to the given float64 and assigns it to the BidPrice field.
func (o *Level1QuoteUpdateModel) SetBidPrice(v float64) {
	o.BidPrice = &v
}

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

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

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

	return false
}

// SetBidSize gets a reference to the given int32 and assigns it to the BidSize field.
func (o *Level1QuoteUpdateModel) SetBidSize(v int32) {
	o.BidSize = &v
}

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

func (o Level1QuoteUpdateModel) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if o.Symbol.IsSet() {
		toSerialize["symbol"] = o.Symbol.Get()
	}
	if !IsNil(o.TimestampNanos) {
		toSerialize["timestamp_nanos"] = o.TimestampNanos
	}
	if !IsNil(o.Timestamp) {
		toSerialize["timestamp"] = o.Timestamp
	}
	if !IsNil(o.IsSymbolAvailable) {
		toSerialize["is_symbol_available"] = o.IsSymbolAvailable
	}
	if !IsNil(o.IsPrePostMarketSession) {
		toSerialize["is_pre_post_market_session"] = o.IsPrePostMarketSession
	}
	if !IsNil(o.AskSize) {
		toSerialize["ask_size"] = o.AskSize
	}
	if !IsNil(o.AskPrice) {
		toSerialize["ask_price"] = o.AskPrice
	}
	if !IsNil(o.BidPrice) {
		toSerialize["bid_price"] = o.BidPrice
	}
	if !IsNil(o.BidSize) {
		toSerialize["bid_size"] = o.BidSize
	}
	return toSerialize, nil
}

type NullableLevel1QuoteUpdateModel struct {
	value *Level1QuoteUpdateModel
	isSet bool
}

func (v NullableLevel1QuoteUpdateModel) Get() *Level1QuoteUpdateModel {
	return v.value
}

func (v *NullableLevel1QuoteUpdateModel) Set(val *Level1QuoteUpdateModel) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableLevel1QuoteUpdateModel(val *Level1QuoteUpdateModel) *NullableLevel1QuoteUpdateModel {
	return &NullableLevel1QuoteUpdateModel{value: val, isSet: true}
}

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

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


