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

// V1ExchangeRatesRate Represents an exchange rate within a collection of exchange rates.
type V1ExchangeRatesRate struct {
	// Gets or sets the time of the exchange rate.
	Time *time.Time `json:"time,omitempty"`
	// Gets or sets the quote asset ID of the exchange rate.
	AssetIdQuote NullableString `json:"asset_id_quote,omitempty"`
	// Gets or sets the exchange rate value.
	Rate *float64 `json:"rate,omitempty"`
}

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

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

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

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

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

	return false
}

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

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

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

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

	return false
}

// SetAssetIdQuote gets a reference to the given NullableString and assigns it to the AssetIdQuote field.
func (o *V1ExchangeRatesRate) SetAssetIdQuote(v string) {
	o.AssetIdQuote.Set(&v)
}
// SetAssetIdQuoteNil sets the value for AssetIdQuote to be an explicit nil
func (o *V1ExchangeRatesRate) SetAssetIdQuoteNil() {
	o.AssetIdQuote.Set(nil)
}

// UnsetAssetIdQuote ensures that no value is present for AssetIdQuote, not even an explicit nil
func (o *V1ExchangeRatesRate) UnsetAssetIdQuote() {
	o.AssetIdQuote.Unset()
}

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

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

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

	return false
}

// SetRate gets a reference to the given float64 and assigns it to the Rate field.
func (o *V1ExchangeRatesRate) SetRate(v float64) {
	o.Rate = &v
}

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

func (o V1ExchangeRatesRate) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Time) {
		toSerialize["time"] = o.Time
	}
	if o.AssetIdQuote.IsSet() {
		toSerialize["asset_id_quote"] = o.AssetIdQuote.Get()
	}
	if !IsNil(o.Rate) {
		toSerialize["rate"] = o.Rate
	}
	return toSerialize, nil
}

type NullableV1ExchangeRatesRate struct {
	value *V1ExchangeRatesRate
	isSet bool
}

func (v NullableV1ExchangeRatesRate) Get() *V1ExchangeRatesRate {
	return v.value
}

func (v *NullableV1ExchangeRatesRate) Set(val *V1ExchangeRatesRate) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableV1ExchangeRatesRate(val *V1ExchangeRatesRate) *NullableV1ExchangeRatesRate {
	return &NullableV1ExchangeRatesRate{value: val, isSet: true}
}

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

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


