/*
Echo Server API

Echo Server API

API version: 0.1.0
Contact: team@openapitools.org
*/

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

package openapi

import (
	"encoding/json"
)

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

// NumberPropertiesOnly struct for NumberPropertiesOnly
type NumberPropertiesOnly struct {
	Number *float32 `json:"number,omitempty"`
	Float *float32 `json:"float,omitempty"`
	Double *float64 `json:"double,omitempty"`
}

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

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

// GetNumber returns the Number field value if set, zero value otherwise.
func (o *NumberPropertiesOnly) GetNumber() float32 {
	if o == nil || IsNil(o.Number) {
		var ret float32
		return ret
	}
	return *o.Number
}

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

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

	return false
}

// SetNumber gets a reference to the given float32 and assigns it to the Number field.
func (o *NumberPropertiesOnly) SetNumber(v float32) {
	o.Number = &v
}

// GetFloat returns the Float field value if set, zero value otherwise.
func (o *NumberPropertiesOnly) GetFloat() float32 {
	if o == nil || IsNil(o.Float) {
		var ret float32
		return ret
	}
	return *o.Float
}

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

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

	return false
}

// SetFloat gets a reference to the given float32 and assigns it to the Float field.
func (o *NumberPropertiesOnly) SetFloat(v float32) {
	o.Float = &v
}

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

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

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

	return false
}

// SetDouble gets a reference to the given float64 and assigns it to the Double field.
func (o *NumberPropertiesOnly) SetDouble(v float64) {
	o.Double = &v
}

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

func (o NumberPropertiesOnly) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Number) {
		toSerialize["number"] = o.Number
	}
	if !IsNil(o.Float) {
		toSerialize["float"] = o.Float
	}
	if !IsNil(o.Double) {
		toSerialize["double"] = o.Double
	}
	return toSerialize, nil
}

type NullableNumberPropertiesOnly struct {
	value *NumberPropertiesOnly
	isSet bool
}

func (v NullableNumberPropertiesOnly) Get() *NumberPropertiesOnly {
	return v.value
}

func (v *NullableNumberPropertiesOnly) Set(val *NumberPropertiesOnly) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableNumberPropertiesOnly(val *NumberPropertiesOnly) *NullableNumberPropertiesOnly {
	return &NullableNumberPropertiesOnly{value: val, isSet: true}
}

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

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


