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

// BlockTemplateRequestModel struct for BlockTemplateRequestModel
type BlockTemplateRequestModel struct {
	MinerAddress *string `json:"miner_address,omitempty"`
	StakeholderAddress *string `json:"stakeholder_address,omitempty"`
	ExNonce *string `json:"ex_nonce,omitempty"`
	PosBlock *bool `json:"pos_block,omitempty"`
	IgnorePowTsCheck *bool `json:"ignore_pow_ts_check,omitempty"`
	Pe *PosEntryModel `json:"pe,omitempty"`
	ExplicitTxs []string `json:"explicit_txs,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _BlockTemplateRequestModel BlockTemplateRequestModel

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

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

// GetMinerAddress returns the MinerAddress field value if set, zero value otherwise.
func (o *BlockTemplateRequestModel) GetMinerAddress() string {
	if o == nil || IsNil(o.MinerAddress) {
		var ret string
		return ret
	}
	return *o.MinerAddress
}

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

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

	return false
}

// SetMinerAddress gets a reference to the given string and assigns it to the MinerAddress field.
func (o *BlockTemplateRequestModel) SetMinerAddress(v string) {
	o.MinerAddress = &v
}

// GetStakeholderAddress returns the StakeholderAddress field value if set, zero value otherwise.
func (o *BlockTemplateRequestModel) GetStakeholderAddress() string {
	if o == nil || IsNil(o.StakeholderAddress) {
		var ret string
		return ret
	}
	return *o.StakeholderAddress
}

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

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

	return false
}

// SetStakeholderAddress gets a reference to the given string and assigns it to the StakeholderAddress field.
func (o *BlockTemplateRequestModel) SetStakeholderAddress(v string) {
	o.StakeholderAddress = &v
}

// GetExNonce returns the ExNonce field value if set, zero value otherwise.
func (o *BlockTemplateRequestModel) GetExNonce() string {
	if o == nil || IsNil(o.ExNonce) {
		var ret string
		return ret
	}
	return *o.ExNonce
}

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

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

	return false
}

// SetExNonce gets a reference to the given string and assigns it to the ExNonce field.
func (o *BlockTemplateRequestModel) SetExNonce(v string) {
	o.ExNonce = &v
}

// GetPosBlock returns the PosBlock field value if set, zero value otherwise.
func (o *BlockTemplateRequestModel) GetPosBlock() bool {
	if o == nil || IsNil(o.PosBlock) {
		var ret bool
		return ret
	}
	return *o.PosBlock
}

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

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

	return false
}

// SetPosBlock gets a reference to the given bool and assigns it to the PosBlock field.
func (o *BlockTemplateRequestModel) SetPosBlock(v bool) {
	o.PosBlock = &v
}

// GetIgnorePowTsCheck returns the IgnorePowTsCheck field value if set, zero value otherwise.
func (o *BlockTemplateRequestModel) GetIgnorePowTsCheck() bool {
	if o == nil || IsNil(o.IgnorePowTsCheck) {
		var ret bool
		return ret
	}
	return *o.IgnorePowTsCheck
}

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

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

	return false
}

// SetIgnorePowTsCheck gets a reference to the given bool and assigns it to the IgnorePowTsCheck field.
func (o *BlockTemplateRequestModel) SetIgnorePowTsCheck(v bool) {
	o.IgnorePowTsCheck = &v
}

// GetPe returns the Pe field value if set, zero value otherwise.
func (o *BlockTemplateRequestModel) GetPe() PosEntryModel {
	if o == nil || IsNil(o.Pe) {
		var ret PosEntryModel
		return ret
	}
	return *o.Pe
}

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

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

	return false
}

// SetPe gets a reference to the given PosEntryModel and assigns it to the Pe field.
func (o *BlockTemplateRequestModel) SetPe(v PosEntryModel) {
	o.Pe = &v
}

// GetExplicitTxs returns the ExplicitTxs field value if set, zero value otherwise.
func (o *BlockTemplateRequestModel) GetExplicitTxs() []string {
	if o == nil || IsNil(o.ExplicitTxs) {
		var ret []string
		return ret
	}
	return o.ExplicitTxs
}

// GetExplicitTxsOk returns a tuple with the ExplicitTxs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BlockTemplateRequestModel) GetExplicitTxsOk() ([]string, bool) {
	if o == nil || IsNil(o.ExplicitTxs) {
		return nil, false
	}
	return o.ExplicitTxs, true
}

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

	return false
}

// SetExplicitTxs gets a reference to the given []string and assigns it to the ExplicitTxs field.
func (o *BlockTemplateRequestModel) SetExplicitTxs(v []string) {
	o.ExplicitTxs = v
}

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

func (o BlockTemplateRequestModel) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.MinerAddress) {
		toSerialize["miner_address"] = o.MinerAddress
	}
	if !IsNil(o.StakeholderAddress) {
		toSerialize["stakeholder_address"] = o.StakeholderAddress
	}
	if !IsNil(o.ExNonce) {
		toSerialize["ex_nonce"] = o.ExNonce
	}
	if !IsNil(o.PosBlock) {
		toSerialize["pos_block"] = o.PosBlock
	}
	if !IsNil(o.IgnorePowTsCheck) {
		toSerialize["ignore_pow_ts_check"] = o.IgnorePowTsCheck
	}
	if !IsNil(o.Pe) {
		toSerialize["pe"] = o.Pe
	}
	if !IsNil(o.ExplicitTxs) {
		toSerialize["explicit_txs"] = o.ExplicitTxs
	}

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

	return toSerialize, nil
}

func (o *BlockTemplateRequestModel) UnmarshalJSON(data []byte) (err error) {
	varBlockTemplateRequestModel := _BlockTemplateRequestModel{}

	err = json.Unmarshal(data, &varBlockTemplateRequestModel)

	if err != nil {
		return err
	}

	*o = BlockTemplateRequestModel(varBlockTemplateRequestModel)

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

	if err = json.Unmarshal(data, &additionalProperties); err == nil {
		delete(additionalProperties, "miner_address")
		delete(additionalProperties, "stakeholder_address")
		delete(additionalProperties, "ex_nonce")
		delete(additionalProperties, "pos_block")
		delete(additionalProperties, "ignore_pow_ts_check")
		delete(additionalProperties, "pe")
		delete(additionalProperties, "explicit_txs")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableBlockTemplateRequestModel struct {
	value *BlockTemplateRequestModel
	isSet bool
}

func (v NullableBlockTemplateRequestModel) Get() *BlockTemplateRequestModel {
	return v.value
}

func (v *NullableBlockTemplateRequestModel) Set(val *BlockTemplateRequestModel) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableBlockTemplateRequestModel(val *BlockTemplateRequestModel) *NullableBlockTemplateRequestModel {
	return &NullableBlockTemplateRequestModel{value: val, isSet: true}
}

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

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


