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

// V1OrderBook Represents an order book with additional information and functionality.
type V1OrderBook struct {
	// The symbol identifier.
	SymbolId NullableString `json:"symbol_id,omitempty"`
	// The exchange time of the order book.
	TimeExchange *time.Time `json:"time_exchange,omitempty"`
	// The CoinAPI time when the order book was received.
	TimeCoinapi *time.Time `json:"time_coinapi,omitempty"`
	// The asks made by market makers.
	Asks interface{} `json:"asks,omitempty"`
	// The bids made by market makers.
	Bids interface{} `json:"bids,omitempty"`
}

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

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

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

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

// GetTimeExchange returns the TimeExchange field value if set, zero value otherwise.
func (o *V1OrderBook) 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 *V1OrderBook) 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 *V1OrderBook) 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 *V1OrderBook) SetTimeExchange(v time.Time) {
	o.TimeExchange = &v
}

// GetTimeCoinapi returns the TimeCoinapi field value if set, zero value otherwise.
func (o *V1OrderBook) 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 *V1OrderBook) 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 *V1OrderBook) 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 *V1OrderBook) SetTimeCoinapi(v time.Time) {
	o.TimeCoinapi = &v
}

// GetAsks returns the Asks field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *V1OrderBook) GetAsks() interface{} {
	if o == nil {
		var ret interface{}
		return ret
	}
	return o.Asks
}

// GetAsksOk returns a tuple with the Asks 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 *V1OrderBook) GetAsksOk() (*interface{}, bool) {
	if o == nil || IsNil(o.Asks) {
		return nil, false
	}
	return &o.Asks, true
}

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

	return false
}

// SetAsks gets a reference to the given interface{} and assigns it to the Asks field.
func (o *V1OrderBook) SetAsks(v interface{}) {
	o.Asks = v
}

// GetBids returns the Bids field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *V1OrderBook) GetBids() interface{} {
	if o == nil {
		var ret interface{}
		return ret
	}
	return o.Bids
}

// GetBidsOk returns a tuple with the Bids 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 *V1OrderBook) GetBidsOk() (*interface{}, bool) {
	if o == nil || IsNil(o.Bids) {
		return nil, false
	}
	return &o.Bids, true
}

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

	return false
}

// SetBids gets a reference to the given interface{} and assigns it to the Bids field.
func (o *V1OrderBook) SetBids(v interface{}) {
	o.Bids = v
}

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

func (o V1OrderBook) 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.Asks != nil {
		toSerialize["asks"] = o.Asks
	}
	if o.Bids != nil {
		toSerialize["bids"] = o.Bids
	}
	return toSerialize, nil
}

type NullableV1OrderBook struct {
	value *V1OrderBook
	isSet bool
}

func (v NullableV1OrderBook) Get() *V1OrderBook {
	return v.value
}

func (v *NullableV1OrderBook) Set(val *V1OrderBook) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableV1OrderBook(val *V1OrderBook) *NullableV1OrderBook {
	return &NullableV1OrderBook{value: val, isSet: true}
}

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

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


