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

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

// V1MetricData Represents a data model for metric data.
type V1MetricData struct {
	// Gets or sets the symbol id.
	SymbolId NullableString `json:"symbol_id,omitempty"`
	// Gets or sets the time at which the value is recorded.
	Time *time.Time `json:"time,omitempty"`
	// Gets or sets the value of the metric.
	Value *float64 `json:"value,omitempty"`
}

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

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

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

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

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

	return false
}

// SetSymbolId gets a reference to the given NullableString and assigns it to the SymbolId field.
func (o *V1MetricData) SetSymbolId(v string) {
	o.SymbolId.Set(&v)
}
// SetSymbolIdNil sets the value for SymbolId to be an explicit nil
func (o *V1MetricData) SetSymbolIdNil() {
	o.SymbolId.Set(nil)
}

// UnsetSymbolId ensures that no value is present for SymbolId, not even an explicit nil
func (o *V1MetricData) UnsetSymbolId() {
	o.SymbolId.Unset()
}

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

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

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

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

	return false
}

// SetValue gets a reference to the given float64 and assigns it to the Value field.
func (o *V1MetricData) SetValue(v float64) {
	o.Value = &v
}

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

func (o V1MetricData) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if o.SymbolId.IsSet() {
		toSerialize["symbol_id"] = o.SymbolId.Get()
	}
	if !IsNil(o.Time) {
		toSerialize["time"] = o.Time
	}
	if !IsNil(o.Value) {
		toSerialize["value"] = o.Value
	}
	return toSerialize, nil
}

type NullableV1MetricData struct {
	value *V1MetricData
	isSet bool
}

func (v NullableV1MetricData) Get() *V1MetricData {
	return v.value
}

func (v *NullableV1MetricData) Set(val *V1MetricData) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableV1MetricData(val *V1MetricData) *NullableV1MetricData {
	return &NullableV1MetricData{value: val, isSet: true}
}

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

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


