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

// IndexesIndexDefinitionSnapshotEntry struct for IndexesIndexDefinitionSnapshotEntry
type IndexesIndexDefinitionSnapshotEntry struct {
	IndexId NullableString `json:"index_id,omitempty"`
	Timestamp *time.Time `json:"timestamp,omitempty"`
	Value *float64 `json:"value,omitempty"`
}

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

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

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

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

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

	return false
}

// SetIndexId gets a reference to the given NullableString and assigns it to the IndexId field.
func (o *IndexesIndexDefinitionSnapshotEntry) SetIndexId(v string) {
	o.IndexId.Set(&v)
}
// SetIndexIdNil sets the value for IndexId to be an explicit nil
func (o *IndexesIndexDefinitionSnapshotEntry) SetIndexIdNil() {
	o.IndexId.Set(nil)
}

// UnsetIndexId ensures that no value is present for IndexId, not even an explicit nil
func (o *IndexesIndexDefinitionSnapshotEntry) UnsetIndexId() {
	o.IndexId.Unset()
}

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

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

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

	return false
}

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

// GetValue returns the Value field value if set, zero value otherwise.
func (o *IndexesIndexDefinitionSnapshotEntry) 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 *IndexesIndexDefinitionSnapshotEntry) 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 *IndexesIndexDefinitionSnapshotEntry) 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 *IndexesIndexDefinitionSnapshotEntry) SetValue(v float64) {
	o.Value = &v
}

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

func (o IndexesIndexDefinitionSnapshotEntry) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if o.IndexId.IsSet() {
		toSerialize["index_id"] = o.IndexId.Get()
	}
	if !IsNil(o.Timestamp) {
		toSerialize["timestamp"] = o.Timestamp
	}
	if !IsNil(o.Value) {
		toSerialize["value"] = o.Value
	}
	return toSerialize, nil
}

type NullableIndexesIndexDefinitionSnapshotEntry struct {
	value *IndexesIndexDefinitionSnapshotEntry
	isSet bool
}

func (v NullableIndexesIndexDefinitionSnapshotEntry) Get() *IndexesIndexDefinitionSnapshotEntry {
	return v.value
}

func (v *NullableIndexesIndexDefinitionSnapshotEntry) Set(val *IndexesIndexDefinitionSnapshotEntry) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableIndexesIndexDefinitionSnapshotEntry(val *IndexesIndexDefinitionSnapshotEntry) *NullableIndexesIndexDefinitionSnapshotEntry {
	return &NullableIndexesIndexDefinitionSnapshotEntry{value: val, isSet: true}
}

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

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


