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

// V1ExchangeRatesTimeseriesItem Represents an item in the exchange rate timeseries.
type V1ExchangeRatesTimeseriesItem struct {
	// Gets or sets the start time of the period.
	TimePeriodStart *time.Time `json:"time_period_start,omitempty"`
	// Gets or sets the end time of the period.
	TimePeriodEnd *time.Time `json:"time_period_end,omitempty"`
	// Gets or sets the opening time of the period.
	TimeOpen NullableTime `json:"time_open,omitempty"`
	// Gets or sets the closing time of the period.
	TimeClose NullableTime `json:"time_close,omitempty"`
	// Gets or sets the opening rate for the period.
	RateOpen NullableFloat64 `json:"rate_open,omitempty"`
	// Gets or sets the highest rate for the period.
	RateHigh NullableFloat64 `json:"rate_high,omitempty"`
	// Gets or sets the lowest rate for the period.
	RateLow NullableFloat64 `json:"rate_low,omitempty"`
	// Gets or sets the closing rate for the period.
	RateClose NullableFloat64 `json:"rate_close,omitempty"`
}

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

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

// GetTimePeriodStart returns the TimePeriodStart field value if set, zero value otherwise.
func (o *V1ExchangeRatesTimeseriesItem) 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 *V1ExchangeRatesTimeseriesItem) 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 *V1ExchangeRatesTimeseriesItem) 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 *V1ExchangeRatesTimeseriesItem) SetTimePeriodStart(v time.Time) {
	o.TimePeriodStart = &v
}

// GetTimePeriodEnd returns the TimePeriodEnd field value if set, zero value otherwise.
func (o *V1ExchangeRatesTimeseriesItem) 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 *V1ExchangeRatesTimeseriesItem) 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 *V1ExchangeRatesTimeseriesItem) 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 *V1ExchangeRatesTimeseriesItem) 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 *V1ExchangeRatesTimeseriesItem) 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 *V1ExchangeRatesTimeseriesItem) 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 *V1ExchangeRatesTimeseriesItem) 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 *V1ExchangeRatesTimeseriesItem) SetTimeOpen(v time.Time) {
	o.TimeOpen.Set(&v)
}
// SetTimeOpenNil sets the value for TimeOpen to be an explicit nil
func (o *V1ExchangeRatesTimeseriesItem) SetTimeOpenNil() {
	o.TimeOpen.Set(nil)
}

// UnsetTimeOpen ensures that no value is present for TimeOpen, not even an explicit nil
func (o *V1ExchangeRatesTimeseriesItem) 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 *V1ExchangeRatesTimeseriesItem) 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 *V1ExchangeRatesTimeseriesItem) 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 *V1ExchangeRatesTimeseriesItem) 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 *V1ExchangeRatesTimeseriesItem) SetTimeClose(v time.Time) {
	o.TimeClose.Set(&v)
}
// SetTimeCloseNil sets the value for TimeClose to be an explicit nil
func (o *V1ExchangeRatesTimeseriesItem) SetTimeCloseNil() {
	o.TimeClose.Set(nil)
}

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

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

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

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

	return false
}

// SetRateOpen gets a reference to the given NullableFloat64 and assigns it to the RateOpen field.
func (o *V1ExchangeRatesTimeseriesItem) SetRateOpen(v float64) {
	o.RateOpen.Set(&v)
}
// SetRateOpenNil sets the value for RateOpen to be an explicit nil
func (o *V1ExchangeRatesTimeseriesItem) SetRateOpenNil() {
	o.RateOpen.Set(nil)
}

// UnsetRateOpen ensures that no value is present for RateOpen, not even an explicit nil
func (o *V1ExchangeRatesTimeseriesItem) UnsetRateOpen() {
	o.RateOpen.Unset()
}

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

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

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

	return false
}

// SetRateHigh gets a reference to the given NullableFloat64 and assigns it to the RateHigh field.
func (o *V1ExchangeRatesTimeseriesItem) SetRateHigh(v float64) {
	o.RateHigh.Set(&v)
}
// SetRateHighNil sets the value for RateHigh to be an explicit nil
func (o *V1ExchangeRatesTimeseriesItem) SetRateHighNil() {
	o.RateHigh.Set(nil)
}

// UnsetRateHigh ensures that no value is present for RateHigh, not even an explicit nil
func (o *V1ExchangeRatesTimeseriesItem) UnsetRateHigh() {
	o.RateHigh.Unset()
}

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

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

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

	return false
}

// SetRateLow gets a reference to the given NullableFloat64 and assigns it to the RateLow field.
func (o *V1ExchangeRatesTimeseriesItem) SetRateLow(v float64) {
	o.RateLow.Set(&v)
}
// SetRateLowNil sets the value for RateLow to be an explicit nil
func (o *V1ExchangeRatesTimeseriesItem) SetRateLowNil() {
	o.RateLow.Set(nil)
}

// UnsetRateLow ensures that no value is present for RateLow, not even an explicit nil
func (o *V1ExchangeRatesTimeseriesItem) UnsetRateLow() {
	o.RateLow.Unset()
}

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

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

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

	return false
}

// SetRateClose gets a reference to the given NullableFloat64 and assigns it to the RateClose field.
func (o *V1ExchangeRatesTimeseriesItem) SetRateClose(v float64) {
	o.RateClose.Set(&v)
}
// SetRateCloseNil sets the value for RateClose to be an explicit nil
func (o *V1ExchangeRatesTimeseriesItem) SetRateCloseNil() {
	o.RateClose.Set(nil)
}

// UnsetRateClose ensures that no value is present for RateClose, not even an explicit nil
func (o *V1ExchangeRatesTimeseriesItem) UnsetRateClose() {
	o.RateClose.Unset()
}

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

func (o V1ExchangeRatesTimeseriesItem) 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.RateOpen.IsSet() {
		toSerialize["rate_open"] = o.RateOpen.Get()
	}
	if o.RateHigh.IsSet() {
		toSerialize["rate_high"] = o.RateHigh.Get()
	}
	if o.RateLow.IsSet() {
		toSerialize["rate_low"] = o.RateLow.Get()
	}
	if o.RateClose.IsSet() {
		toSerialize["rate_close"] = o.RateClose.Get()
	}
	return toSerialize, nil
}

type NullableV1ExchangeRatesTimeseriesItem struct {
	value *V1ExchangeRatesTimeseriesItem
	isSet bool
}

func (v NullableV1ExchangeRatesTimeseriesItem) Get() *V1ExchangeRatesTimeseriesItem {
	return v.value
}

func (v *NullableV1ExchangeRatesTimeseriesItem) Set(val *V1ExchangeRatesTimeseriesItem) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableV1ExchangeRatesTimeseriesItem(val *V1ExchangeRatesTimeseriesItem) *NullableV1ExchangeRatesTimeseriesItem {
	return &NullableV1ExchangeRatesTimeseriesItem{value: val, isSet: true}
}

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

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


