/*
 * 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"
)

// KeyParameters Key parameters used to sign the zone.
type KeyParameters struct {
	Algorithm *Algorithm `json:"algorithm"`
	KskBits   *KskBits   `json:"kskBits"`
	ZskBits   *ZskBits   `json:"zskBits"`
}

// NewKeyParameters instantiates a new KeyParameters 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 NewKeyParameters(algorithm Algorithm, kskBits KskBits, zskBits ZskBits) *KeyParameters {
	this := KeyParameters{}

	this.Algorithm = &algorithm
	this.KskBits = &kskBits
	this.ZskBits = &zskBits

	return &this
}

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

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

	return o.Algorithm

}

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

	return o.Algorithm, true
}

// SetAlgorithm sets field value
func (o *KeyParameters) SetAlgorithm(v Algorithm) {

	o.Algorithm = &v

}

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

	return false
}

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

	return o.KskBits

}

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

	return o.KskBits, true
}

// SetKskBits sets field value
func (o *KeyParameters) SetKskBits(v KskBits) {

	o.KskBits = &v

}

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

	return false
}

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

	return o.ZskBits

}

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

	return o.ZskBits, true
}

// SetZskBits sets field value
func (o *KeyParameters) SetZskBits(v ZskBits) {

	o.ZskBits = &v

}

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

	return false
}

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

	if o.KskBits != nil {
		toSerialize["kskBits"] = o.KskBits
	}

	if o.ZskBits != nil {
		toSerialize["zskBits"] = o.ZskBits
	}

	return json.Marshal(toSerialize)
}

type NullableKeyParameters struct {
	value *KeyParameters
	isSet bool
}

func (v NullableKeyParameters) Get() *KeyParameters {
	return v.value
}

func (v *NullableKeyParameters) Set(val *KeyParameters) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableKeyParameters(val *KeyParameters) *NullableKeyParameters {
	return &NullableKeyParameters{value: val, isSet: true}
}

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

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