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

// TradeTradeModel Represents the response DTO for a single trade event (report or break).
type TradeTradeModel struct {
	// Indicates if this record represents a trade break (true) or a trade report (false).
	IsTradeBreak *bool `json:"is_trade_break,omitempty"`
	// The stock symbol.
	Symbol NullableString `json:"symbol,omitempty"`
	// Original timestamp in nanoseconds since epoch.
	TimestampNanos *int64 `json:"timestamp_nanos,omitempty"`
	// Time when the event was recorded as DateTime (UTC).
	Timestamp *time.Time `json:"timestamp,omitempty"`
	// Trade volume (or break volume) in number of shares.
	Size *int32 `json:"size,omitempty"`
	// Trade price (or break price) as decimal.
	Price *float64 `json:"price,omitempty"`
	// IEX trade identifier (same for report and its corresponding break).
	TradeId *int64 `json:"trade_id,omitempty"`
	// Bit 7 (Mask 0x80): Intermarket Sweep Flag. True: Intermarket Sweep Order (\"ISO\"). False: Non-Intermarket Sweep Order.
	IsIntermarketSweep *bool `json:"is_intermarket_sweep,omitempty"`
	// Bit 6 (Mask 0x40): Extended Hours Flag. True: Extended Hours Trade (i.e., Form T sale condition). False: Regular Market Session Trade.
	IsExtendedHoursTrade *bool `json:"is_extended_hours_trade,omitempty"`
	// Bit 5 (Mask 0x20): Odd Lot Flag. True: Odd Lot Trade. False: Round or Mixed Lot Trade.
	IsOddLotTrade *bool `json:"is_odd_lot_trade,omitempty"`
	// Bit 4 (Mask 0x10): Trade Through Exempt Flag. True: Trade is not subject to Rule 611 (Trade Through) of SEC Reg. NMS. False: Trade is subject to Rule 611 (Trade Through) of SEC Reg. NMS. Applied when the taking order was an ISO that traded through a protected quotation, OR the NBBO was crossed at the time of the trade, OR the trade occurred through a self-helped venue's quotation, OR the trade was a single-price cross.
	IsTradeThroughExempt *bool `json:"is_trade_through_exempt,omitempty"`
	// Bit 3 (Mask 0x08): Single-price Cross Trade Flag. True: Trade resulting from a single-price cross. False: Execution during continuous trading.
	IsSinglePriceCrossTrade *bool `json:"is_single_price_cross_trade,omitempty"`
}

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

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

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

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

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

	return false
}

// SetIsTradeBreak gets a reference to the given bool and assigns it to the IsTradeBreak field.
func (o *TradeTradeModel) SetIsTradeBreak(v bool) {
	o.IsTradeBreak = &v
}

// GetSymbol returns the Symbol field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *TradeTradeModel) 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 *TradeTradeModel) 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 *TradeTradeModel) 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 *TradeTradeModel) SetSymbol(v string) {
	o.Symbol.Set(&v)
}
// SetSymbolNil sets the value for Symbol to be an explicit nil
func (o *TradeTradeModel) SetSymbolNil() {
	o.Symbol.Set(nil)
}

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

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

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

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

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

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

	return false
}

// SetSize gets a reference to the given int32 and assigns it to the Size field.
func (o *TradeTradeModel) SetSize(v int32) {
	o.Size = &v
}

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

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

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

	return false
}

// SetPrice gets a reference to the given float64 and assigns it to the Price field.
func (o *TradeTradeModel) SetPrice(v float64) {
	o.Price = &v
}

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

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

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

	return false
}

// SetTradeId gets a reference to the given int64 and assigns it to the TradeId field.
func (o *TradeTradeModel) SetTradeId(v int64) {
	o.TradeId = &v
}

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

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

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

	return false
}

// SetIsIntermarketSweep gets a reference to the given bool and assigns it to the IsIntermarketSweep field.
func (o *TradeTradeModel) SetIsIntermarketSweep(v bool) {
	o.IsIntermarketSweep = &v
}

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

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

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

	return false
}

// SetIsExtendedHoursTrade gets a reference to the given bool and assigns it to the IsExtendedHoursTrade field.
func (o *TradeTradeModel) SetIsExtendedHoursTrade(v bool) {
	o.IsExtendedHoursTrade = &v
}

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

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

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

	return false
}

// SetIsOddLotTrade gets a reference to the given bool and assigns it to the IsOddLotTrade field.
func (o *TradeTradeModel) SetIsOddLotTrade(v bool) {
	o.IsOddLotTrade = &v
}

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

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

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

	return false
}

// SetIsTradeThroughExempt gets a reference to the given bool and assigns it to the IsTradeThroughExempt field.
func (o *TradeTradeModel) SetIsTradeThroughExempt(v bool) {
	o.IsTradeThroughExempt = &v
}

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

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

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

	return false
}

// SetIsSinglePriceCrossTrade gets a reference to the given bool and assigns it to the IsSinglePriceCrossTrade field.
func (o *TradeTradeModel) SetIsSinglePriceCrossTrade(v bool) {
	o.IsSinglePriceCrossTrade = &v
}

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

func (o TradeTradeModel) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.IsTradeBreak) {
		toSerialize["is_trade_break"] = o.IsTradeBreak
	}
	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.Size) {
		toSerialize["size"] = o.Size
	}
	if !IsNil(o.Price) {
		toSerialize["price"] = o.Price
	}
	if !IsNil(o.TradeId) {
		toSerialize["trade_id"] = o.TradeId
	}
	if !IsNil(o.IsIntermarketSweep) {
		toSerialize["is_intermarket_sweep"] = o.IsIntermarketSweep
	}
	if !IsNil(o.IsExtendedHoursTrade) {
		toSerialize["is_extended_hours_trade"] = o.IsExtendedHoursTrade
	}
	if !IsNil(o.IsOddLotTrade) {
		toSerialize["is_odd_lot_trade"] = o.IsOddLotTrade
	}
	if !IsNil(o.IsTradeThroughExempt) {
		toSerialize["is_trade_through_exempt"] = o.IsTradeThroughExempt
	}
	if !IsNil(o.IsSinglePriceCrossTrade) {
		toSerialize["is_single_price_cross_trade"] = o.IsSinglePriceCrossTrade
	}
	return toSerialize, nil
}

type NullableTradeTradeModel struct {
	value *TradeTradeModel
	isSet bool
}

func (v NullableTradeTradeModel) Get() *TradeTradeModel {
	return v.value
}

func (v *NullableTradeTradeModel) Set(val *TradeTradeModel) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableTradeTradeModel(val *TradeTradeModel) *NullableTradeTradeModel {
	return &NullableTradeTradeModel{value: val, isSet: true}
}

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

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


