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

// V1Trade Represents a trade executed on the exchange.
type V1Trade struct {
	// The symbol identifier.
	SymbolId NullableString `json:"symbol_id,omitempty"`
	// The time of trade reported by the exchange.
	TimeExchange *time.Time `json:"time_exchange,omitempty"`
	// The time when the trade was received by CoinAPI.
	TimeCoinapi *time.Time `json:"time_coinapi,omitempty"`
	// The unique identifier for the trade.
	Uuid *string `json:"uuid,omitempty"`
	// The price of the transaction.
	Price *float64 `json:"price,omitempty"`
	// The base asset amount traded in the transaction.
	Size *float64 `json:"size,omitempty"`
	// The aggressor side of the transaction (BUY/SELL/BUY_ESTIMATED/SELL_ESTIMATED/UNKNOWN).
	TakerSide NullableString `json:"taker_side,omitempty"`
	// The trade identifier.
	IdTrade NullableString `json:"id_trade,omitempty"`
	// The order maker identifier.
	IdOrderMaker NullableString `json:"id_order_maker,omitempty"`
	// The order taker identifier.
	IdOrderTaker NullableString `json:"id_order_taker,omitempty"`
}

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

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

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

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

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

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

// GetUuid returns the Uuid field value if set, zero value otherwise.
func (o *V1Trade) GetUuid() string {
	if o == nil || IsNil(o.Uuid) {
		var ret string
		return ret
	}
	return *o.Uuid
}

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

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

	return false
}

// SetUuid gets a reference to the given string and assigns it to the Uuid field.
func (o *V1Trade) SetUuid(v string) {
	o.Uuid = &v
}

// GetPrice returns the Price field value if set, zero value otherwise.
func (o *V1Trade) 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 *V1Trade) 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 *V1Trade) 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 *V1Trade) SetPrice(v float64) {
	o.Price = &v
}

// GetSize returns the Size field value if set, zero value otherwise.
func (o *V1Trade) GetSize() float64 {
	if o == nil || IsNil(o.Size) {
		var ret float64
		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 *V1Trade) GetSizeOk() (*float64, 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 *V1Trade) HasSize() bool {
	if o != nil && !IsNil(o.Size) {
		return true
	}

	return false
}

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

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

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

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

	return false
}

// SetTakerSide gets a reference to the given NullableString and assigns it to the TakerSide field.
func (o *V1Trade) SetTakerSide(v string) {
	o.TakerSide.Set(&v)
}
// SetTakerSideNil sets the value for TakerSide to be an explicit nil
func (o *V1Trade) SetTakerSideNil() {
	o.TakerSide.Set(nil)
}

// UnsetTakerSide ensures that no value is present for TakerSide, not even an explicit nil
func (o *V1Trade) UnsetTakerSide() {
	o.TakerSide.Unset()
}

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

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

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

	return false
}

// SetIdTrade gets a reference to the given NullableString and assigns it to the IdTrade field.
func (o *V1Trade) SetIdTrade(v string) {
	o.IdTrade.Set(&v)
}
// SetIdTradeNil sets the value for IdTrade to be an explicit nil
func (o *V1Trade) SetIdTradeNil() {
	o.IdTrade.Set(nil)
}

// UnsetIdTrade ensures that no value is present for IdTrade, not even an explicit nil
func (o *V1Trade) UnsetIdTrade() {
	o.IdTrade.Unset()
}

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

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

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

	return false
}

// SetIdOrderMaker gets a reference to the given NullableString and assigns it to the IdOrderMaker field.
func (o *V1Trade) SetIdOrderMaker(v string) {
	o.IdOrderMaker.Set(&v)
}
// SetIdOrderMakerNil sets the value for IdOrderMaker to be an explicit nil
func (o *V1Trade) SetIdOrderMakerNil() {
	o.IdOrderMaker.Set(nil)
}

// UnsetIdOrderMaker ensures that no value is present for IdOrderMaker, not even an explicit nil
func (o *V1Trade) UnsetIdOrderMaker() {
	o.IdOrderMaker.Unset()
}

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

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

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

	return false
}

// SetIdOrderTaker gets a reference to the given NullableString and assigns it to the IdOrderTaker field.
func (o *V1Trade) SetIdOrderTaker(v string) {
	o.IdOrderTaker.Set(&v)
}
// SetIdOrderTakerNil sets the value for IdOrderTaker to be an explicit nil
func (o *V1Trade) SetIdOrderTakerNil() {
	o.IdOrderTaker.Set(nil)
}

// UnsetIdOrderTaker ensures that no value is present for IdOrderTaker, not even an explicit nil
func (o *V1Trade) UnsetIdOrderTaker() {
	o.IdOrderTaker.Unset()
}

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

func (o V1Trade) 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 !IsNil(o.Uuid) {
		toSerialize["uuid"] = o.Uuid
	}
	if !IsNil(o.Price) {
		toSerialize["price"] = o.Price
	}
	if !IsNil(o.Size) {
		toSerialize["size"] = o.Size
	}
	if o.TakerSide.IsSet() {
		toSerialize["taker_side"] = o.TakerSide.Get()
	}
	if o.IdTrade.IsSet() {
		toSerialize["id_trade"] = o.IdTrade.Get()
	}
	if o.IdOrderMaker.IsSet() {
		toSerialize["id_order_maker"] = o.IdOrderMaker.Get()
	}
	if o.IdOrderTaker.IsSet() {
		toSerialize["id_order_taker"] = o.IdOrderTaker.Get()
	}
	return toSerialize, nil
}

type NullableV1Trade struct {
	value *V1Trade
	isSet bool
}

func (v NullableV1Trade) Get() *V1Trade {
	return v.value
}

func (v *NullableV1Trade) Set(val *V1Trade) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableV1Trade(val *V1Trade) *NullableV1Trade {
	return &NullableV1Trade{value: val, isSet: true}
}

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

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


