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

// OHLCVTimeseriesItem Represents a timeseries item with price and volume information.
type OHLCVTimeseriesItem struct {
	// Gets or sets the start time of the time period.
	TimePeriodStart *time.Time `json:"time_period_start,omitempty"`
	// Gets or sets the end time of the time period.
	TimePeriodEnd *time.Time `json:"time_period_end,omitempty"`
	// Gets or sets the time when the price opened.
	TimeOpen NullableTime `json:"time_open,omitempty"`
	// Gets or sets the time when the price closed.
	TimeClose NullableTime `json:"time_close,omitempty"`
	// Gets or sets the opening price.
	PriceOpen NullableFloat64 `json:"price_open,omitempty"`
	// Gets or sets the highest price during the time period.
	PriceHigh NullableFloat64 `json:"price_high,omitempty"`
	// Gets or sets the lowest price during the time period.
	PriceLow NullableFloat64 `json:"price_low,omitempty"`
	// Gets or sets the closing price.
	PriceClose NullableFloat64 `json:"price_close,omitempty"`
	// Gets or sets the total volume traded during the time period.
	VolumeTraded *float64 `json:"volume_traded,omitempty"`
	// Gets or sets the number of trades executed during the time period.
	TradesCount *int64 `json:"trades_count,omitempty"`
}

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

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

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

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

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

	return false
}

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

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

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

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

	return false
}

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

// GetTimeOpen returns the TimeOpen field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *OHLCVTimeseriesItem) GetTimeOpen() time.Time {
	if o == nil || IsNil(o.TimeOpen.Get()) {
		var ret time.Time
		return ret
	}
	return *o.TimeOpen.Get()
}

// GetTimeOpenOk returns a tuple with the TimeOpen 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 *OHLCVTimeseriesItem) GetTimeOpenOk() (*time.Time, bool) {
	if o == nil {
		return nil, false
	}
	return o.TimeOpen.Get(), o.TimeOpen.IsSet()
}

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

	return false
}

// SetTimeOpen gets a reference to the given NullableTime and assigns it to the TimeOpen field.
func (o *OHLCVTimeseriesItem) SetTimeOpen(v time.Time) {
	o.TimeOpen.Set(&v)
}
// SetTimeOpenNil sets the value for TimeOpen to be an explicit nil
func (o *OHLCVTimeseriesItem) SetTimeOpenNil() {
	o.TimeOpen.Set(nil)
}

// UnsetTimeOpen ensures that no value is present for TimeOpen, not even an explicit nil
func (o *OHLCVTimeseriesItem) UnsetTimeOpen() {
	o.TimeOpen.Unset()
}

// GetTimeClose returns the TimeClose field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *OHLCVTimeseriesItem) GetTimeClose() time.Time {
	if o == nil || IsNil(o.TimeClose.Get()) {
		var ret time.Time
		return ret
	}
	return *o.TimeClose.Get()
}

// GetTimeCloseOk returns a tuple with the TimeClose 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 *OHLCVTimeseriesItem) GetTimeCloseOk() (*time.Time, bool) {
	if o == nil {
		return nil, false
	}
	return o.TimeClose.Get(), o.TimeClose.IsSet()
}

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

	return false
}

// SetTimeClose gets a reference to the given NullableTime and assigns it to the TimeClose field.
func (o *OHLCVTimeseriesItem) SetTimeClose(v time.Time) {
	o.TimeClose.Set(&v)
}
// SetTimeCloseNil sets the value for TimeClose to be an explicit nil
func (o *OHLCVTimeseriesItem) SetTimeCloseNil() {
	o.TimeClose.Set(nil)
}

// UnsetTimeClose ensures that no value is present for TimeClose, not even an explicit nil
func (o *OHLCVTimeseriesItem) UnsetTimeClose() {
	o.TimeClose.Unset()
}

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

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

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

	return false
}

// SetPriceOpen gets a reference to the given NullableFloat64 and assigns it to the PriceOpen field.
func (o *OHLCVTimeseriesItem) SetPriceOpen(v float64) {
	o.PriceOpen.Set(&v)
}
// SetPriceOpenNil sets the value for PriceOpen to be an explicit nil
func (o *OHLCVTimeseriesItem) SetPriceOpenNil() {
	o.PriceOpen.Set(nil)
}

// UnsetPriceOpen ensures that no value is present for PriceOpen, not even an explicit nil
func (o *OHLCVTimeseriesItem) UnsetPriceOpen() {
	o.PriceOpen.Unset()
}

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

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

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

	return false
}

// SetPriceHigh gets a reference to the given NullableFloat64 and assigns it to the PriceHigh field.
func (o *OHLCVTimeseriesItem) SetPriceHigh(v float64) {
	o.PriceHigh.Set(&v)
}
// SetPriceHighNil sets the value for PriceHigh to be an explicit nil
func (o *OHLCVTimeseriesItem) SetPriceHighNil() {
	o.PriceHigh.Set(nil)
}

// UnsetPriceHigh ensures that no value is present for PriceHigh, not even an explicit nil
func (o *OHLCVTimeseriesItem) UnsetPriceHigh() {
	o.PriceHigh.Unset()
}

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

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

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

	return false
}

// SetPriceLow gets a reference to the given NullableFloat64 and assigns it to the PriceLow field.
func (o *OHLCVTimeseriesItem) SetPriceLow(v float64) {
	o.PriceLow.Set(&v)
}
// SetPriceLowNil sets the value for PriceLow to be an explicit nil
func (o *OHLCVTimeseriesItem) SetPriceLowNil() {
	o.PriceLow.Set(nil)
}

// UnsetPriceLow ensures that no value is present for PriceLow, not even an explicit nil
func (o *OHLCVTimeseriesItem) UnsetPriceLow() {
	o.PriceLow.Unset()
}

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

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

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

	return false
}

// SetPriceClose gets a reference to the given NullableFloat64 and assigns it to the PriceClose field.
func (o *OHLCVTimeseriesItem) SetPriceClose(v float64) {
	o.PriceClose.Set(&v)
}
// SetPriceCloseNil sets the value for PriceClose to be an explicit nil
func (o *OHLCVTimeseriesItem) SetPriceCloseNil() {
	o.PriceClose.Set(nil)
}

// UnsetPriceClose ensures that no value is present for PriceClose, not even an explicit nil
func (o *OHLCVTimeseriesItem) UnsetPriceClose() {
	o.PriceClose.Unset()
}

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

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

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

	return false
}

// SetVolumeTraded gets a reference to the given float64 and assigns it to the VolumeTraded field.
func (o *OHLCVTimeseriesItem) SetVolumeTraded(v float64) {
	o.VolumeTraded = &v
}

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

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

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

	return false
}

// SetTradesCount gets a reference to the given int64 and assigns it to the TradesCount field.
func (o *OHLCVTimeseriesItem) SetTradesCount(v int64) {
	o.TradesCount = &v
}

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

func (o OHLCVTimeseriesItem) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.TimePeriodStart) {
		toSerialize["time_period_start"] = o.TimePeriodStart
	}
	if !IsNil(o.TimePeriodEnd) {
		toSerialize["time_period_end"] = o.TimePeriodEnd
	}
	if o.TimeOpen.IsSet() {
		toSerialize["time_open"] = o.TimeOpen.Get()
	}
	if o.TimeClose.IsSet() {
		toSerialize["time_close"] = o.TimeClose.Get()
	}
	if o.PriceOpen.IsSet() {
		toSerialize["price_open"] = o.PriceOpen.Get()
	}
	if o.PriceHigh.IsSet() {
		toSerialize["price_high"] = o.PriceHigh.Get()
	}
	if o.PriceLow.IsSet() {
		toSerialize["price_low"] = o.PriceLow.Get()
	}
	if o.PriceClose.IsSet() {
		toSerialize["price_close"] = o.PriceClose.Get()
	}
	if !IsNil(o.VolumeTraded) {
		toSerialize["volume_traded"] = o.VolumeTraded
	}
	if !IsNil(o.TradesCount) {
		toSerialize["trades_count"] = o.TradesCount
	}
	return toSerialize, nil
}

type NullableOHLCVTimeseriesItem struct {
	value *OHLCVTimeseriesItem
	isSet bool
}

func (v NullableOHLCVTimeseriesItem) Get() *OHLCVTimeseriesItem {
	return v.value
}

func (v *NullableOHLCVTimeseriesItem) Set(val *OHLCVTimeseriesItem) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableOHLCVTimeseriesItem(val *OHLCVTimeseriesItem) *NullableOHLCVTimeseriesItem {
	return &NullableOHLCVTimeseriesItem{value: val, isSet: true}
}

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

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


