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

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

// IndexesIndexValueComponent struct for IndexesIndexValueComponent
type IndexesIndexValueComponent struct {
	ComponentId NullableString `json:"component_id,omitempty"`
	ComponentValue *float64 `json:"component_value,omitempty"`
}

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

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

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

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

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

	return false
}

// SetComponentId gets a reference to the given NullableString and assigns it to the ComponentId field.
func (o *IndexesIndexValueComponent) SetComponentId(v string) {
	o.ComponentId.Set(&v)
}
// SetComponentIdNil sets the value for ComponentId to be an explicit nil
func (o *IndexesIndexValueComponent) SetComponentIdNil() {
	o.ComponentId.Set(nil)
}

// UnsetComponentId ensures that no value is present for ComponentId, not even an explicit nil
func (o *IndexesIndexValueComponent) UnsetComponentId() {
	o.ComponentId.Unset()
}

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

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

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

	return false
}

// SetComponentValue gets a reference to the given float64 and assigns it to the ComponentValue field.
func (o *IndexesIndexValueComponent) SetComponentValue(v float64) {
	o.ComponentValue = &v
}

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

func (o IndexesIndexValueComponent) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if o.ComponentId.IsSet() {
		toSerialize["component_id"] = o.ComponentId.Get()
	}
	if !IsNil(o.ComponentValue) {
		toSerialize["component_value"] = o.ComponentValue
	}
	return toSerialize, nil
}

type NullableIndexesIndexValueComponent struct {
	value *IndexesIndexValueComponent
	isSet bool
}

func (v NullableIndexesIndexValueComponent) Get() *IndexesIndexValueComponent {
	return v.value
}

func (v *NullableIndexesIndexValueComponent) Set(val *IndexesIndexValueComponent) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableIndexesIndexValueComponent(val *IndexesIndexValueComponent) *NullableIndexesIndexValueComponent {
	return &NullableIndexesIndexValueComponent{value: val, isSet: true}
}

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

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


