/*
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"
)

// checks if the V1ExchangeRates type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &V1ExchangeRates{}

// V1ExchangeRates Represents exchange rates for a specific base asset.
type V1ExchangeRates struct {
	// Gets or sets the base asset ID.
	AssetIdBase NullableString `json:"asset_id_base,omitempty"`
	// Gets or sets the list of exchange rates.
	Rates []V1ExchangeRatesRate `json:"rates,omitempty"`
}

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

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

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

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

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

	return false
}

// SetAssetIdBase gets a reference to the given NullableString and assigns it to the AssetIdBase field.
func (o *V1ExchangeRates) SetAssetIdBase(v string) {
	o.AssetIdBase.Set(&v)
}
// SetAssetIdBaseNil sets the value for AssetIdBase to be an explicit nil
func (o *V1ExchangeRates) SetAssetIdBaseNil() {
	o.AssetIdBase.Set(nil)
}

// UnsetAssetIdBase ensures that no value is present for AssetIdBase, not even an explicit nil
func (o *V1ExchangeRates) UnsetAssetIdBase() {
	o.AssetIdBase.Unset()
}

// GetRates returns the Rates field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *V1ExchangeRates) GetRates() []V1ExchangeRatesRate {
	if o == nil {
		var ret []V1ExchangeRatesRate
		return ret
	}
	return o.Rates
}

// GetRatesOk returns a tuple with the Rates 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 *V1ExchangeRates) GetRatesOk() ([]V1ExchangeRatesRate, bool) {
	if o == nil || IsNil(o.Rates) {
		return nil, false
	}
	return o.Rates, true
}

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

	return false
}

// SetRates gets a reference to the given []V1ExchangeRatesRate and assigns it to the Rates field.
func (o *V1ExchangeRates) SetRates(v []V1ExchangeRatesRate) {
	o.Rates = v
}

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

func (o V1ExchangeRates) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if o.AssetIdBase.IsSet() {
		toSerialize["asset_id_base"] = o.AssetIdBase.Get()
	}
	if o.Rates != nil {
		toSerialize["rates"] = o.Rates
	}
	return toSerialize, nil
}

type NullableV1ExchangeRates struct {
	value *V1ExchangeRates
	isSet bool
}

func (v NullableV1ExchangeRates) Get() *V1ExchangeRates {
	return v.value
}

func (v *NullableV1ExchangeRates) Set(val *V1ExchangeRates) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableV1ExchangeRates(val *V1ExchangeRates) *NullableV1ExchangeRates {
	return &NullableV1ExchangeRates{value: val, isSet: true}
}

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

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


