/*
 * VPN Gateways
 *
 * POC Docs for VPN gateway as service
 *
 * API version: 0.0.1
 * Contact: support@cloud.ionos.com
 */

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

package vpn

import (
	"encoding/json"
)

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

// IKEEncryption Settings for the initial security exchange phase.
type IKEEncryption struct {
	// The Diffie-Hellman Group to use for IPSec Encryption.\\ Options:   - 15-MODP3072   - 16-MODP4096   - 19-ECP256   - 20-ECP384   - 21-ECP521   - 28-ECP256BP   - 29-ECP384BP   - 30-ECP512BP
	DiffieHellmanGroup *string `json:"diffieHellmanGroup,omitempty"`
	// The encryption algorithm to use for IPSec Encryption.\\ Options: - AES128-CTR - AES256-CTR - AES128-GCM-16 - AES256-GCM-16 - AES128-GCM-12 - AES256-GCM-12 - AES128-CCM-12 - AES256-CCM-12 - AES128 - AES256
	EncryptionAlgorithm *string `json:"encryptionAlgorithm,omitempty"`
	// The integrity algorithm to use for IPSec Encryption.\\ Options: - SHA256 - SHA384 - SHA512 - AES-XCBC
	IntegrityAlgorithm *string `json:"integrityAlgorithm,omitempty"`
	// The phase lifetime in seconds.
	Lifetime *int32 `json:"lifetime,omitempty"`
}

// NewIKEEncryption instantiates a new IKEEncryption 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 NewIKEEncryption() *IKEEncryption {
	this := IKEEncryption{}

	var lifetime int32 = 86400
	this.Lifetime = &lifetime

	return &this
}

// NewIKEEncryptionWithDefaults instantiates a new IKEEncryption 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 NewIKEEncryptionWithDefaults() *IKEEncryption {
	this := IKEEncryption{}
	var lifetime int32 = 86400
	this.Lifetime = &lifetime
	return &this
}

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

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

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

	return false
}

// SetDiffieHellmanGroup gets a reference to the given string and assigns it to the DiffieHellmanGroup field.
func (o *IKEEncryption) SetDiffieHellmanGroup(v string) {
	o.DiffieHellmanGroup = &v
}

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

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

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

	return false
}

// SetEncryptionAlgorithm gets a reference to the given string and assigns it to the EncryptionAlgorithm field.
func (o *IKEEncryption) SetEncryptionAlgorithm(v string) {
	o.EncryptionAlgorithm = &v
}

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

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

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

	return false
}

// SetIntegrityAlgorithm gets a reference to the given string and assigns it to the IntegrityAlgorithm field.
func (o *IKEEncryption) SetIntegrityAlgorithm(v string) {
	o.IntegrityAlgorithm = &v
}

// GetLifetime returns the Lifetime field value if set, zero value otherwise.
func (o *IKEEncryption) GetLifetime() int32 {
	if o == nil || IsNil(o.Lifetime) {
		var ret int32
		return ret
	}
	return *o.Lifetime
}

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

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

	return false
}

// SetLifetime gets a reference to the given int32 and assigns it to the Lifetime field.
func (o *IKEEncryption) SetLifetime(v int32) {
	o.Lifetime = &v
}

func (o IKEEncryption) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.DiffieHellmanGroup) {
		toSerialize["diffieHellmanGroup"] = o.DiffieHellmanGroup
	}
	if !IsNil(o.EncryptionAlgorithm) {
		toSerialize["encryptionAlgorithm"] = o.EncryptionAlgorithm
	}
	if !IsNil(o.IntegrityAlgorithm) {
		toSerialize["integrityAlgorithm"] = o.IntegrityAlgorithm
	}
	if !IsNil(o.Lifetime) {
		toSerialize["lifetime"] = o.Lifetime
	}
	return toSerialize, nil
}

type NullableIKEEncryption struct {
	value *IKEEncryption
	isSet bool
}

func (v NullableIKEEncryption) Get() *IKEEncryption {
	return v.value
}

func (v *NullableIKEEncryption) Set(val *IKEEncryption) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableIKEEncryption(val *IKEEncryption) *NullableIKEEncryption {
	return &NullableIKEEncryption{value: val, isSet: true}
}

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

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