/*
 * IONOS Cloud - DNS API
 *
 * Cloud DNS service helps IONOS Cloud customers to automate DNS Zone and Record management.
 *
 * API version: 1.16.0
 * Contact: support@cloud.ionos.com
 */

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

package ionoscloud

import (
	"encoding/json"
)

// DnssecKeyParameters Parameters used to sign zone.
type DnssecKeyParameters struct {
	KeyParameters  *KeyParameters  `json:"keyParameters"`
	NsecParameters *NsecParameters `json:"nsecParameters"`
	// Signature validity in days
	Validity *int32 `json:"validity"`
}

// NewDnssecKeyParameters instantiates a new DnssecKeyParameters 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 NewDnssecKeyParameters(keyParameters KeyParameters, nsecParameters NsecParameters, validity int32) *DnssecKeyParameters {
	this := DnssecKeyParameters{}

	this.KeyParameters = &keyParameters
	this.NsecParameters = &nsecParameters
	this.Validity = &validity

	return &this
}

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

// GetKeyParameters returns the KeyParameters field value
// If the value is explicit nil, the zero value for KeyParameters will be returned
func (o *DnssecKeyParameters) GetKeyParameters() *KeyParameters {
	if o == nil {
		return nil
	}

	return o.KeyParameters

}

// GetKeyParametersOk returns a tuple with the KeyParameters field value
// 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 *DnssecKeyParameters) GetKeyParametersOk() (*KeyParameters, bool) {
	if o == nil {
		return nil, false
	}

	return o.KeyParameters, true
}

// SetKeyParameters sets field value
func (o *DnssecKeyParameters) SetKeyParameters(v KeyParameters) {

	o.KeyParameters = &v

}

// HasKeyParameters returns a boolean if a field has been set.
func (o *DnssecKeyParameters) HasKeyParameters() bool {
	if o != nil && o.KeyParameters != nil {
		return true
	}

	return false
}

// GetNsecParameters returns the NsecParameters field value
// If the value is explicit nil, the zero value for NsecParameters will be returned
func (o *DnssecKeyParameters) GetNsecParameters() *NsecParameters {
	if o == nil {
		return nil
	}

	return o.NsecParameters

}

// GetNsecParametersOk returns a tuple with the NsecParameters field value
// 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 *DnssecKeyParameters) GetNsecParametersOk() (*NsecParameters, bool) {
	if o == nil {
		return nil, false
	}

	return o.NsecParameters, true
}

// SetNsecParameters sets field value
func (o *DnssecKeyParameters) SetNsecParameters(v NsecParameters) {

	o.NsecParameters = &v

}

// HasNsecParameters returns a boolean if a field has been set.
func (o *DnssecKeyParameters) HasNsecParameters() bool {
	if o != nil && o.NsecParameters != nil {
		return true
	}

	return false
}

// GetValidity returns the Validity field value
// If the value is explicit nil, the zero value for int32 will be returned
func (o *DnssecKeyParameters) GetValidity() *int32 {
	if o == nil {
		return nil
	}

	return o.Validity

}

// GetValidityOk returns a tuple with the Validity field value
// 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 *DnssecKeyParameters) GetValidityOk() (*int32, bool) {
	if o == nil {
		return nil, false
	}

	return o.Validity, true
}

// SetValidity sets field value
func (o *DnssecKeyParameters) SetValidity(v int32) {

	o.Validity = &v

}

// HasValidity returns a boolean if a field has been set.
func (o *DnssecKeyParameters) HasValidity() bool {
	if o != nil && o.Validity != nil {
		return true
	}

	return false
}

func (o DnssecKeyParameters) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if o.KeyParameters != nil {
		toSerialize["keyParameters"] = o.KeyParameters
	}

	if o.NsecParameters != nil {
		toSerialize["nsecParameters"] = o.NsecParameters
	}

	if o.Validity != nil {
		toSerialize["validity"] = o.Validity
	}

	return json.Marshal(toSerialize)
}

type NullableDnssecKeyParameters struct {
	value *DnssecKeyParameters
	isSet bool
}

func (v NullableDnssecKeyParameters) Get() *DnssecKeyParameters {
	return v.value
}

func (v *NullableDnssecKeyParameters) Set(val *DnssecKeyParameters) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableDnssecKeyParameters(val *DnssecKeyParameters) *NullableDnssecKeyParameters {
	return &NullableDnssecKeyParameters{value: val, isSet: true}
}

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

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