/*
TiDB Cloud Console API

TiDB Cloud Console API.

API version: v1beta1
*/

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

package client

import (
	"encoding/json"
)

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

// EstimatePriceResponsePrice struct for EstimatePriceResponsePrice
type EstimatePriceResponsePrice struct {
	ComponentType *Dedicatedv1beta1ComponentType `json:"componentType,omitempty"`
	ComputeDiscountedPrice *float64 `json:"computeDiscountedPrice,omitempty"`
	ComputeOriginalPrice *float64 `json:"computeOriginalPrice,omitempty"`
	StorageDiscountedPrice *float64 `json:"storageDiscountedPrice,omitempty"`
	StorageOriginalPrice *float64 `json:"storageOriginalPrice,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _EstimatePriceResponsePrice EstimatePriceResponsePrice

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

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

// GetComponentType returns the ComponentType field value if set, zero value otherwise.
func (o *EstimatePriceResponsePrice) GetComponentType() Dedicatedv1beta1ComponentType {
	if o == nil || IsNil(o.ComponentType) {
		var ret Dedicatedv1beta1ComponentType
		return ret
	}
	return *o.ComponentType
}

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

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

	return false
}

// SetComponentType gets a reference to the given Dedicatedv1beta1ComponentType and assigns it to the ComponentType field.
func (o *EstimatePriceResponsePrice) SetComponentType(v Dedicatedv1beta1ComponentType) {
	o.ComponentType = &v
}

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

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

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

	return false
}

// SetComputeDiscountedPrice gets a reference to the given float64 and assigns it to the ComputeDiscountedPrice field.
func (o *EstimatePriceResponsePrice) SetComputeDiscountedPrice(v float64) {
	o.ComputeDiscountedPrice = &v
}

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

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

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

	return false
}

// SetComputeOriginalPrice gets a reference to the given float64 and assigns it to the ComputeOriginalPrice field.
func (o *EstimatePriceResponsePrice) SetComputeOriginalPrice(v float64) {
	o.ComputeOriginalPrice = &v
}

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

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

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

	return false
}

// SetStorageDiscountedPrice gets a reference to the given float64 and assigns it to the StorageDiscountedPrice field.
func (o *EstimatePriceResponsePrice) SetStorageDiscountedPrice(v float64) {
	o.StorageDiscountedPrice = &v
}

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

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

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

	return false
}

// SetStorageOriginalPrice gets a reference to the given float64 and assigns it to the StorageOriginalPrice field.
func (o *EstimatePriceResponsePrice) SetStorageOriginalPrice(v float64) {
	o.StorageOriginalPrice = &v
}

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

func (o EstimatePriceResponsePrice) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.ComponentType) {
		toSerialize["componentType"] = o.ComponentType
	}
	if !IsNil(o.ComputeDiscountedPrice) {
		toSerialize["computeDiscountedPrice"] = o.ComputeDiscountedPrice
	}
	if !IsNil(o.ComputeOriginalPrice) {
		toSerialize["computeOriginalPrice"] = o.ComputeOriginalPrice
	}
	if !IsNil(o.StorageDiscountedPrice) {
		toSerialize["storageDiscountedPrice"] = o.StorageDiscountedPrice
	}
	if !IsNil(o.StorageOriginalPrice) {
		toSerialize["storageOriginalPrice"] = o.StorageOriginalPrice
	}

	for key, value := range o.AdditionalProperties {
		toSerialize[key] = value
	}

	return toSerialize, nil
}

func (o *EstimatePriceResponsePrice) UnmarshalJSON(data []byte) (err error) {
	varEstimatePriceResponsePrice := _EstimatePriceResponsePrice{}

	err = json.Unmarshal(data, &varEstimatePriceResponsePrice)

	if err != nil {
		return err
	}

	*o = EstimatePriceResponsePrice(varEstimatePriceResponsePrice)

	additionalProperties := make(map[string]interface{})

	if err = json.Unmarshal(data, &additionalProperties); err == nil {
		delete(additionalProperties, "componentType")
		delete(additionalProperties, "computeDiscountedPrice")
		delete(additionalProperties, "computeOriginalPrice")
		delete(additionalProperties, "storageDiscountedPrice")
		delete(additionalProperties, "storageOriginalPrice")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableEstimatePriceResponsePrice struct {
	value *EstimatePriceResponsePrice
	isSet bool
}

func (v NullableEstimatePriceResponsePrice) Get() *EstimatePriceResponsePrice {
	return v.value
}

func (v *NullableEstimatePriceResponsePrice) Set(val *EstimatePriceResponsePrice) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableEstimatePriceResponsePrice(val *EstimatePriceResponsePrice) *NullableEstimatePriceResponsePrice {
	return &NullableEstimatePriceResponsePrice{value: val, isSet: true}
}

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

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


