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

// V1QuoteTrade Represents a quote trade data model.
type V1QuoteTrade struct {
	// The symbol identifier.
	SymbolId NullableString `json:"symbol_id,omitempty"`
	// The exchange time of the quote trade.
	TimeExchange *time.Time `json:"time_exchange,omitempty"`
	// The CoinAPI time when the quote trade was received.
	TimeCoinapi *time.Time `json:"time_coinapi,omitempty"`
	// The best asking price.
	AskPrice NullableFloat64 `json:"ask_price,omitempty"`
	// The volume resting on the best ask. If the value is equal to zero, then the size is unknown.
	AskSize NullableFloat64 `json:"ask_size,omitempty"`
	// The best bidding price.
	BidPrice NullableFloat64 `json:"bid_price,omitempty"`
	// The volume resting on the best bid. If the value is equal to zero, then the size is unknown.
	BidSize NullableFloat64 `json:"bid_size,omitempty"`
	LastTrade *V1LastTrade `json:"last_trade,omitempty"`
}

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

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

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

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

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

	return false
}

// SetSymbolId gets a reference to the given NullableString and assigns it to the SymbolId field.
func (o *V1QuoteTrade) SetSymbolId(v string) {
	o.SymbolId.Set(&v)
}
// SetSymbolIdNil sets the value for SymbolId to be an explicit nil
func (o *V1QuoteTrade) SetSymbolIdNil() {
	o.SymbolId.Set(nil)
}

// UnsetSymbolId ensures that no value is present for SymbolId, not even an explicit nil
func (o *V1QuoteTrade) UnsetSymbolId() {
	o.SymbolId.Unset()
}

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

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

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

	return false
}

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

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

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

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

	return false
}

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

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

// GetAskPriceOk returns a tuple with the AskPrice 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 *V1QuoteTrade) GetAskPriceOk() (*float64, bool) {
	if o == nil {
		return nil, false
	}
	return o.AskPrice.Get(), o.AskPrice.IsSet()
}

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

	return false
}

// SetAskPrice gets a reference to the given NullableFloat64 and assigns it to the AskPrice field.
func (o *V1QuoteTrade) SetAskPrice(v float64) {
	o.AskPrice.Set(&v)
}
// SetAskPriceNil sets the value for AskPrice to be an explicit nil
func (o *V1QuoteTrade) SetAskPriceNil() {
	o.AskPrice.Set(nil)
}

// UnsetAskPrice ensures that no value is present for AskPrice, not even an explicit nil
func (o *V1QuoteTrade) UnsetAskPrice() {
	o.AskPrice.Unset()
}

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

// GetAskSizeOk returns a tuple with the AskSize 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 *V1QuoteTrade) GetAskSizeOk() (*float64, bool) {
	if o == nil {
		return nil, false
	}
	return o.AskSize.Get(), o.AskSize.IsSet()
}

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

	return false
}

// SetAskSize gets a reference to the given NullableFloat64 and assigns it to the AskSize field.
func (o *V1QuoteTrade) SetAskSize(v float64) {
	o.AskSize.Set(&v)
}
// SetAskSizeNil sets the value for AskSize to be an explicit nil
func (o *V1QuoteTrade) SetAskSizeNil() {
	o.AskSize.Set(nil)
}

// UnsetAskSize ensures that no value is present for AskSize, not even an explicit nil
func (o *V1QuoteTrade) UnsetAskSize() {
	o.AskSize.Unset()
}

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

// GetBidPriceOk returns a tuple with the BidPrice 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 *V1QuoteTrade) GetBidPriceOk() (*float64, bool) {
	if o == nil {
		return nil, false
	}
	return o.BidPrice.Get(), o.BidPrice.IsSet()
}

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

	return false
}

// SetBidPrice gets a reference to the given NullableFloat64 and assigns it to the BidPrice field.
func (o *V1QuoteTrade) SetBidPrice(v float64) {
	o.BidPrice.Set(&v)
}
// SetBidPriceNil sets the value for BidPrice to be an explicit nil
func (o *V1QuoteTrade) SetBidPriceNil() {
	o.BidPrice.Set(nil)
}

// UnsetBidPrice ensures that no value is present for BidPrice, not even an explicit nil
func (o *V1QuoteTrade) UnsetBidPrice() {
	o.BidPrice.Unset()
}

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

// GetBidSizeOk returns a tuple with the BidSize 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 *V1QuoteTrade) GetBidSizeOk() (*float64, bool) {
	if o == nil {
		return nil, false
	}
	return o.BidSize.Get(), o.BidSize.IsSet()
}

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

	return false
}

// SetBidSize gets a reference to the given NullableFloat64 and assigns it to the BidSize field.
func (o *V1QuoteTrade) SetBidSize(v float64) {
	o.BidSize.Set(&v)
}
// SetBidSizeNil sets the value for BidSize to be an explicit nil
func (o *V1QuoteTrade) SetBidSizeNil() {
	o.BidSize.Set(nil)
}

// UnsetBidSize ensures that no value is present for BidSize, not even an explicit nil
func (o *V1QuoteTrade) UnsetBidSize() {
	o.BidSize.Unset()
}

// GetLastTrade returns the LastTrade field value if set, zero value otherwise.
func (o *V1QuoteTrade) GetLastTrade() V1LastTrade {
	if o == nil || IsNil(o.LastTrade) {
		var ret V1LastTrade
		return ret
	}
	return *o.LastTrade
}

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

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

	return false
}

// SetLastTrade gets a reference to the given V1LastTrade and assigns it to the LastTrade field.
func (o *V1QuoteTrade) SetLastTrade(v V1LastTrade) {
	o.LastTrade = &v
}

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

func (o V1QuoteTrade) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if o.SymbolId.IsSet() {
		toSerialize["symbol_id"] = o.SymbolId.Get()
	}
	if !IsNil(o.TimeExchange) {
		toSerialize["time_exchange"] = o.TimeExchange
	}
	if !IsNil(o.TimeCoinapi) {
		toSerialize["time_coinapi"] = o.TimeCoinapi
	}
	if o.AskPrice.IsSet() {
		toSerialize["ask_price"] = o.AskPrice.Get()
	}
	if o.AskSize.IsSet() {
		toSerialize["ask_size"] = o.AskSize.Get()
	}
	if o.BidPrice.IsSet() {
		toSerialize["bid_price"] = o.BidPrice.Get()
	}
	if o.BidSize.IsSet() {
		toSerialize["bid_size"] = o.BidSize.Get()
	}
	if !IsNil(o.LastTrade) {
		toSerialize["last_trade"] = o.LastTrade
	}
	return toSerialize, nil
}

type NullableV1QuoteTrade struct {
	value *V1QuoteTrade
	isSet bool
}

func (v NullableV1QuoteTrade) Get() *V1QuoteTrade {
	return v.value
}

func (v *NullableV1QuoteTrade) Set(val *V1QuoteTrade) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableV1QuoteTrade(val *V1QuoteTrade) *NullableV1QuoteTrade {
	return &NullableV1QuoteTrade{value: val, isSet: true}
}

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

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


