/*
Lethean Blockchain API

OpenAPI for Lethean Blockchain

API version: 6.0.1
*/

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

package lthn

import (
	"encoding/json"
)

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

// PerformanceModel struct for PerformanceModel
type PerformanceModel struct {
	BlockProcessing *BlockProcessingPerformanceModel `json:"block_processing,omitempty"`
	TxProcessing *TxProcessingPerformanceModel `json:"tx_processing,omitempty"`
	TxPool *TxPoolPerformanceModel `json:"tx_pool,omitempty"`
	DbStatInfo *DbStatInfoModel `json:"db_stat_info,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _PerformanceModel PerformanceModel

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

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

// GetBlockProcessing returns the BlockProcessing field value if set, zero value otherwise.
func (o *PerformanceModel) GetBlockProcessing() BlockProcessingPerformanceModel {
	if o == nil || IsNil(o.BlockProcessing) {
		var ret BlockProcessingPerformanceModel
		return ret
	}
	return *o.BlockProcessing
}

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

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

	return false
}

// SetBlockProcessing gets a reference to the given BlockProcessingPerformanceModel and assigns it to the BlockProcessing field.
func (o *PerformanceModel) SetBlockProcessing(v BlockProcessingPerformanceModel) {
	o.BlockProcessing = &v
}

// GetTxProcessing returns the TxProcessing field value if set, zero value otherwise.
func (o *PerformanceModel) GetTxProcessing() TxProcessingPerformanceModel {
	if o == nil || IsNil(o.TxProcessing) {
		var ret TxProcessingPerformanceModel
		return ret
	}
	return *o.TxProcessing
}

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

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

	return false
}

// SetTxProcessing gets a reference to the given TxProcessingPerformanceModel and assigns it to the TxProcessing field.
func (o *PerformanceModel) SetTxProcessing(v TxProcessingPerformanceModel) {
	o.TxProcessing = &v
}

// GetTxPool returns the TxPool field value if set, zero value otherwise.
func (o *PerformanceModel) GetTxPool() TxPoolPerformanceModel {
	if o == nil || IsNil(o.TxPool) {
		var ret TxPoolPerformanceModel
		return ret
	}
	return *o.TxPool
}

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

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

	return false
}

// SetTxPool gets a reference to the given TxPoolPerformanceModel and assigns it to the TxPool field.
func (o *PerformanceModel) SetTxPool(v TxPoolPerformanceModel) {
	o.TxPool = &v
}

// GetDbStatInfo returns the DbStatInfo field value if set, zero value otherwise.
func (o *PerformanceModel) GetDbStatInfo() DbStatInfoModel {
	if o == nil || IsNil(o.DbStatInfo) {
		var ret DbStatInfoModel
		return ret
	}
	return *o.DbStatInfo
}

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

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

	return false
}

// SetDbStatInfo gets a reference to the given DbStatInfoModel and assigns it to the DbStatInfo field.
func (o *PerformanceModel) SetDbStatInfo(v DbStatInfoModel) {
	o.DbStatInfo = &v
}

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

func (o PerformanceModel) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.BlockProcessing) {
		toSerialize["block_processing"] = o.BlockProcessing
	}
	if !IsNil(o.TxProcessing) {
		toSerialize["tx_processing"] = o.TxProcessing
	}
	if !IsNil(o.TxPool) {
		toSerialize["tx_pool"] = o.TxPool
	}
	if !IsNil(o.DbStatInfo) {
		toSerialize["db_stat_info"] = o.DbStatInfo
	}

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

	return toSerialize, nil
}

func (o *PerformanceModel) UnmarshalJSON(data []byte) (err error) {
	varPerformanceModel := _PerformanceModel{}

	err = json.Unmarshal(data, &varPerformanceModel)

	if err != nil {
		return err
	}

	*o = PerformanceModel(varPerformanceModel)

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

	if err = json.Unmarshal(data, &additionalProperties); err == nil {
		delete(additionalProperties, "block_processing")
		delete(additionalProperties, "tx_processing")
		delete(additionalProperties, "tx_pool")
		delete(additionalProperties, "db_stat_info")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullablePerformanceModel struct {
	value *PerformanceModel
	isSet bool
}

func (v NullablePerformanceModel) Get() *PerformanceModel {
	return v.value
}

func (v *NullablePerformanceModel) Set(val *PerformanceModel) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullablePerformanceModel(val *PerformanceModel) *NullablePerformanceModel {
	return &NullablePerformanceModel{value: val, isSet: true}
}

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

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


