/*
OPEN OUTCRY API

# Introduction This API is documented in **OpenAPI 3.0 format**.  This API the following operations: * Retrieve a list of available instruments * Retrieve a list of executed trades  # Basics * API calls have to be secured with HTTPS. * All data has to be submitted UTF-8 encoded. * The reply is sent JSON encoded.

API version: 1.0.0
*/

// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.

package api

import (
	"encoding/json"
)

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

// CurrencyList List of currencies supported by app
type CurrencyList struct {
	Data []Currency `json:"data,omitempty"`
}

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

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

// GetData returns the Data field value if set, zero value otherwise.
func (o *CurrencyList) GetData() []Currency {
	if o == nil || IsNil(o.Data) {
		var ret []Currency
		return ret
	}
	return o.Data
}

// GetDataOk returns a tuple with the Data field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CurrencyList) GetDataOk() ([]Currency, bool) {
	if o == nil || IsNil(o.Data) {
		return nil, false
	}
	return o.Data, true
}

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

	return false
}

// SetData gets a reference to the given []Currency and assigns it to the Data field.
func (o *CurrencyList) SetData(v []Currency) {
	o.Data = v
}

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

func (o CurrencyList) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Data) {
		toSerialize["data"] = o.Data
	}
	return toSerialize, nil
}

type NullableCurrencyList struct {
	value *CurrencyList
	isSet bool
}

func (v NullableCurrencyList) Get() *CurrencyList {
	return v.value
}

func (v *NullableCurrencyList) Set(val *CurrencyList) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableCurrencyList(val *CurrencyList) *NullableCurrencyList {
	return &NullableCurrencyList{value: val, isSet: true}
}

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

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