terraform-provider-stackitp.../pkg/vpnalpha/model_tunnel_configuration_phase2.go
Marcel S. Henselin 9f41c4da7f
Some checks failed
Publish / Check GoReleaser config (push) Successful in 4s
Release / goreleaser (push) Failing after 29s
Publish / Publish provider (push) Failing after 4m24s
feat: auto generated files and new structure (#4)
## Description

<!-- **Please link some issue here describing what you are trying to achieve.**

In case there is no issue present for your PR, please consider creating one.
At least please give us some description what you are trying to achieve and why your change is needed. -->

relates to #1234

## Checklist

- [ ] Issue was linked above
- [ ] Code format was applied: `make fmt`
- [ ] Examples were added / adjusted (see `examples/` directory)
- [x] Docs are up-to-date: `make generate-docs` (will be checked by CI)
- [ ] Unit tests got implemented or updated
- [ ] Acceptance tests got implemented or updated (see e.g. [here](f5f99d1709/stackit/internal/services/dns/dns_acc_test.go))
- [x] Unit tests are passing: `make test` (will be checked by CI)
- [x] No linter issues: `make lint` (will be checked by CI)

Reviewed-on: #4
Reviewed-by: Andre_Harms <andre.harms@stackit.cloud>
Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
Co-committed-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
2026-01-29 14:10:25 +00:00

582 lines
23 KiB
Go

/*
STACKIT VPN API
The STACKIT VPN API provides endpoints to provision and manage VPN instances in your STACKIT project.
API version: 1alpha1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package vpnalpha
import (
"encoding/json"
"fmt"
)
// checks if the TunnelConfigurationPhase2 type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TunnelConfigurationPhase2{}
/*
types and functions for dhGroups
*/
// isArray
type TunnelConfigurationPhase2GetDhGroupsAttributeType = *[]string
type TunnelConfigurationPhase2GetDhGroupsArgType = []string
type TunnelConfigurationPhase2GetDhGroupsRetType = []string
func getTunnelConfigurationPhase2GetDhGroupsAttributeTypeOk(arg TunnelConfigurationPhase2GetDhGroupsAttributeType) (ret TunnelConfigurationPhase2GetDhGroupsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelConfigurationPhase2GetDhGroupsAttributeType(arg *TunnelConfigurationPhase2GetDhGroupsAttributeType, val TunnelConfigurationPhase2GetDhGroupsRetType) {
*arg = &val
}
/*
types and functions for encryptionAlgorithms
*/
// isArray
type TunnelConfigurationPhase2GetEncryptionAlgorithmsAttributeType = *[]string
type TunnelConfigurationPhase2GetEncryptionAlgorithmsArgType = []string
type TunnelConfigurationPhase2GetEncryptionAlgorithmsRetType = []string
func getTunnelConfigurationPhase2GetEncryptionAlgorithmsAttributeTypeOk(arg TunnelConfigurationPhase2GetEncryptionAlgorithmsAttributeType) (ret TunnelConfigurationPhase2GetEncryptionAlgorithmsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelConfigurationPhase2GetEncryptionAlgorithmsAttributeType(arg *TunnelConfigurationPhase2GetEncryptionAlgorithmsAttributeType, val TunnelConfigurationPhase2GetEncryptionAlgorithmsRetType) {
*arg = &val
}
/*
types and functions for integrityAlgorithms
*/
// isArray
type TunnelConfigurationPhase2GetIntegrityAlgorithmsAttributeType = *[]string
type TunnelConfigurationPhase2GetIntegrityAlgorithmsArgType = []string
type TunnelConfigurationPhase2GetIntegrityAlgorithmsRetType = []string
func getTunnelConfigurationPhase2GetIntegrityAlgorithmsAttributeTypeOk(arg TunnelConfigurationPhase2GetIntegrityAlgorithmsAttributeType) (ret TunnelConfigurationPhase2GetIntegrityAlgorithmsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelConfigurationPhase2GetIntegrityAlgorithmsAttributeType(arg *TunnelConfigurationPhase2GetIntegrityAlgorithmsAttributeType, val TunnelConfigurationPhase2GetIntegrityAlgorithmsRetType) {
*arg = &val
}
/*
types and functions for dpdAction
*/
// isEnum
// TunnelConfigurationPhase2DpdAction Action to perform for this CHILD_SA on DPD timeout. \"clear\": Closes the CHILD_SA and does not take further action. \"trap\": installs a trap policy which will catch matching traffic and tries to re-negotiate the tunnel on-demand). \"restart\": immediately tries to re-negotiate the CILD_SA under a fresh IKE_SA.
// value type for enums
type TunnelConfigurationPhase2DpdAction string
// List of DpdAction
const (
TUNNELCONFIGURATIONPHASE2DPD_ACTION_CLEAR TunnelConfigurationPhase2DpdAction = "clear"
TUNNELCONFIGURATIONPHASE2DPD_ACTION_TRAP TunnelConfigurationPhase2DpdAction = "trap"
TUNNELCONFIGURATIONPHASE2DPD_ACTION_RESTART TunnelConfigurationPhase2DpdAction = "restart"
)
// All allowed values of TunnelConfigurationPhase2 enum
var AllowedTunnelConfigurationPhase2DpdActionEnumValues = []TunnelConfigurationPhase2DpdAction{
"clear",
"trap",
"restart",
}
func (v *TunnelConfigurationPhase2DpdAction) UnmarshalJSON(src []byte) error {
// use a type alias to prevent infinite recursion during unmarshal,
// see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers
type TmpJson TunnelConfigurationPhase2DpdAction
var value TmpJson
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
// Allow unmarshalling zero value for testing purposes
var zeroValue TmpJson
if value == zeroValue {
return nil
}
enumTypeValue := TunnelConfigurationPhase2DpdAction(value)
for _, existing := range AllowedTunnelConfigurationPhase2DpdActionEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid TunnelConfigurationPhase2", value)
}
// NewTunnelConfigurationPhase2DpdActionFromValue returns a pointer to a valid TunnelConfigurationPhase2DpdAction
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewTunnelConfigurationPhase2DpdActionFromValue(v TunnelConfigurationPhase2DpdAction) (*TunnelConfigurationPhase2DpdAction, error) {
ev := TunnelConfigurationPhase2DpdAction(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for TunnelConfigurationPhase2DpdAction: valid values are %v", v, AllowedTunnelConfigurationPhase2DpdActionEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v TunnelConfigurationPhase2DpdAction) IsValid() bool {
for _, existing := range AllowedTunnelConfigurationPhase2DpdActionEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to DpdActionDpdAction value
func (v TunnelConfigurationPhase2DpdAction) Ptr() *TunnelConfigurationPhase2DpdAction {
return &v
}
type NullableTunnelConfigurationPhase2DpdAction struct {
value *TunnelConfigurationPhase2DpdAction
isSet bool
}
func (v NullableTunnelConfigurationPhase2DpdAction) Get() *TunnelConfigurationPhase2DpdAction {
return v.value
}
func (v *NullableTunnelConfigurationPhase2DpdAction) Set(val *TunnelConfigurationPhase2DpdAction) {
v.value = val
v.isSet = true
}
func (v NullableTunnelConfigurationPhase2DpdAction) IsSet() bool {
return v.isSet
}
func (v *NullableTunnelConfigurationPhase2DpdAction) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTunnelConfigurationPhase2DpdAction(val *TunnelConfigurationPhase2DpdAction) *NullableTunnelConfigurationPhase2DpdAction {
return &NullableTunnelConfigurationPhase2DpdAction{value: val, isSet: true}
}
func (v NullableTunnelConfigurationPhase2DpdAction) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTunnelConfigurationPhase2DpdAction) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type TunnelConfigurationPhase2GetDpdActionAttributeType = *TunnelConfigurationPhase2DpdAction
type TunnelConfigurationPhase2GetDpdActionArgType = TunnelConfigurationPhase2DpdAction
type TunnelConfigurationPhase2GetDpdActionRetType = TunnelConfigurationPhase2DpdAction
func getTunnelConfigurationPhase2GetDpdActionAttributeTypeOk(arg TunnelConfigurationPhase2GetDpdActionAttributeType) (ret TunnelConfigurationPhase2GetDpdActionRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelConfigurationPhase2GetDpdActionAttributeType(arg *TunnelConfigurationPhase2GetDpdActionAttributeType, val TunnelConfigurationPhase2GetDpdActionRetType) {
*arg = &val
}
/*
types and functions for rekeyTime
*/
// isInteger
type TunnelConfigurationPhase2GetRekeyTimeAttributeType = *int64
type TunnelConfigurationPhase2GetRekeyTimeArgType = int64
type TunnelConfigurationPhase2GetRekeyTimeRetType = int64
func getTunnelConfigurationPhase2GetRekeyTimeAttributeTypeOk(arg TunnelConfigurationPhase2GetRekeyTimeAttributeType) (ret TunnelConfigurationPhase2GetRekeyTimeRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelConfigurationPhase2GetRekeyTimeAttributeType(arg *TunnelConfigurationPhase2GetRekeyTimeAttributeType, val TunnelConfigurationPhase2GetRekeyTimeRetType) {
*arg = &val
}
/*
types and functions for startAction
*/
// isEnum
// TunnelConfigurationPhase2StartAction Action to perform after loading the connection configuration. \"none\": The connection will be loaded but needs to be manually initiated. \"trap\": installs a trap policy which triggers the tunnel as soon as matching traffic has been detected. \"start\": initiates the connection actively. \"start|stop\": Immediately initiate a connection for which trap policies have been installed.
// value type for enums
type TunnelConfigurationPhase2StartAction string
// List of StartAction
const (
TUNNELCONFIGURATIONPHASE2START_ACTION_NONE TunnelConfigurationPhase2StartAction = "none"
TUNNELCONFIGURATIONPHASE2START_ACTION_TRAP TunnelConfigurationPhase2StartAction = "trap"
TUNNELCONFIGURATIONPHASE2START_ACTION_START TunnelConfigurationPhase2StartAction = "start"
TUNNELCONFIGURATIONPHASE2START_ACTION_TRAP_START TunnelConfigurationPhase2StartAction = "trap|start"
)
// All allowed values of TunnelConfigurationPhase2 enum
var AllowedTunnelConfigurationPhase2StartActionEnumValues = []TunnelConfigurationPhase2StartAction{
"none",
"trap",
"start",
"trap|start",
}
func (v *TunnelConfigurationPhase2StartAction) UnmarshalJSON(src []byte) error {
// use a type alias to prevent infinite recursion during unmarshal,
// see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers
type TmpJson TunnelConfigurationPhase2StartAction
var value TmpJson
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
// Allow unmarshalling zero value for testing purposes
var zeroValue TmpJson
if value == zeroValue {
return nil
}
enumTypeValue := TunnelConfigurationPhase2StartAction(value)
for _, existing := range AllowedTunnelConfigurationPhase2StartActionEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid TunnelConfigurationPhase2", value)
}
// NewTunnelConfigurationPhase2StartActionFromValue returns a pointer to a valid TunnelConfigurationPhase2StartAction
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewTunnelConfigurationPhase2StartActionFromValue(v TunnelConfigurationPhase2StartAction) (*TunnelConfigurationPhase2StartAction, error) {
ev := TunnelConfigurationPhase2StartAction(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for TunnelConfigurationPhase2StartAction: valid values are %v", v, AllowedTunnelConfigurationPhase2StartActionEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v TunnelConfigurationPhase2StartAction) IsValid() bool {
for _, existing := range AllowedTunnelConfigurationPhase2StartActionEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to StartActionStartAction value
func (v TunnelConfigurationPhase2StartAction) Ptr() *TunnelConfigurationPhase2StartAction {
return &v
}
type NullableTunnelConfigurationPhase2StartAction struct {
value *TunnelConfigurationPhase2StartAction
isSet bool
}
func (v NullableTunnelConfigurationPhase2StartAction) Get() *TunnelConfigurationPhase2StartAction {
return v.value
}
func (v *NullableTunnelConfigurationPhase2StartAction) Set(val *TunnelConfigurationPhase2StartAction) {
v.value = val
v.isSet = true
}
func (v NullableTunnelConfigurationPhase2StartAction) IsSet() bool {
return v.isSet
}
func (v *NullableTunnelConfigurationPhase2StartAction) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTunnelConfigurationPhase2StartAction(val *TunnelConfigurationPhase2StartAction) *NullableTunnelConfigurationPhase2StartAction {
return &NullableTunnelConfigurationPhase2StartAction{value: val, isSet: true}
}
func (v NullableTunnelConfigurationPhase2StartAction) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTunnelConfigurationPhase2StartAction) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type TunnelConfigurationPhase2GetStartActionAttributeType = *TunnelConfigurationPhase2StartAction
type TunnelConfigurationPhase2GetStartActionArgType = TunnelConfigurationPhase2StartAction
type TunnelConfigurationPhase2GetStartActionRetType = TunnelConfigurationPhase2StartAction
func getTunnelConfigurationPhase2GetStartActionAttributeTypeOk(arg TunnelConfigurationPhase2GetStartActionAttributeType) (ret TunnelConfigurationPhase2GetStartActionRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelConfigurationPhase2GetStartActionAttributeType(arg *TunnelConfigurationPhase2GetStartActionAttributeType, val TunnelConfigurationPhase2GetStartActionRetType) {
*arg = &val
}
// TunnelConfigurationPhase2 struct for TunnelConfigurationPhase2
type TunnelConfigurationPhase2 struct {
// The Diffie-Hellman Group. Required, except if AEAD algorithms are selected.
DhGroups TunnelConfigurationPhase2GetDhGroupsAttributeType `json:"dhGroups,omitempty"`
// REQUIRED
EncryptionAlgorithms TunnelConfigurationPhase2GetEncryptionAlgorithmsAttributeType `json:"encryptionAlgorithms" required:"true"`
// REQUIRED
IntegrityAlgorithms TunnelConfigurationPhase2GetIntegrityAlgorithmsAttributeType `json:"integrityAlgorithms" required:"true"`
// Action to perform for this CHILD_SA on DPD timeout. \"clear\": Closes the CHILD_SA and does not take further action. \"trap\": installs a trap policy which will catch matching traffic and tries to re-negotiate the tunnel on-demand). \"restart\": immediately tries to re-negotiate the CILD_SA under a fresh IKE_SA.
DpdAction TunnelConfigurationPhase2GetDpdActionAttributeType `json:"dpdAction,omitempty"`
// Time to schedule a Child SA re-keying (in seconds).
// Can be cast to int32 without loss of precision.
RekeyTime TunnelConfigurationPhase2GetRekeyTimeAttributeType `json:"rekeyTime,omitempty"`
// Action to perform after loading the connection configuration. \"none\": The connection will be loaded but needs to be manually initiated. \"trap\": installs a trap policy which triggers the tunnel as soon as matching traffic has been detected. \"start\": initiates the connection actively. \"start|stop\": Immediately initiate a connection for which trap policies have been installed.
StartAction TunnelConfigurationPhase2GetStartActionAttributeType `json:"startAction,omitempty"`
}
type _TunnelConfigurationPhase2 TunnelConfigurationPhase2
// NewTunnelConfigurationPhase2 instantiates a new TunnelConfigurationPhase2 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 NewTunnelConfigurationPhase2(encryptionAlgorithms TunnelConfigurationPhase2GetEncryptionAlgorithmsArgType, integrityAlgorithms TunnelConfigurationPhase2GetIntegrityAlgorithmsArgType) *TunnelConfigurationPhase2 {
this := TunnelConfigurationPhase2{}
setTunnelConfigurationPhase2GetEncryptionAlgorithmsAttributeType(&this.EncryptionAlgorithms, encryptionAlgorithms)
setTunnelConfigurationPhase2GetIntegrityAlgorithmsAttributeType(&this.IntegrityAlgorithms, integrityAlgorithms)
return &this
}
// NewTunnelConfigurationPhase2WithDefaults instantiates a new TunnelConfigurationPhase2 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 NewTunnelConfigurationPhase2WithDefaults() *TunnelConfigurationPhase2 {
this := TunnelConfigurationPhase2{}
var dpdAction TunnelConfigurationPhase2DpdAction = "restart"
this.DpdAction = &dpdAction
var rekeyTime int64 = 3600
this.RekeyTime = &rekeyTime
var startAction TunnelConfigurationPhase2StartAction = "start"
this.StartAction = &startAction
return &this
}
// GetDhGroups returns the DhGroups field value if set, zero value otherwise.
func (o *TunnelConfigurationPhase2) GetDhGroups() (res TunnelConfigurationPhase2GetDhGroupsRetType) {
res, _ = o.GetDhGroupsOk()
return
}
// GetDhGroupsOk returns a tuple with the DhGroups field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TunnelConfigurationPhase2) GetDhGroupsOk() (ret TunnelConfigurationPhase2GetDhGroupsRetType, ok bool) {
return getTunnelConfigurationPhase2GetDhGroupsAttributeTypeOk(o.DhGroups)
}
// HasDhGroups returns a boolean if a field has been set.
func (o *TunnelConfigurationPhase2) HasDhGroups() bool {
_, ok := o.GetDhGroupsOk()
return ok
}
// SetDhGroups gets a reference to the given []string and assigns it to the DhGroups field.
func (o *TunnelConfigurationPhase2) SetDhGroups(v TunnelConfigurationPhase2GetDhGroupsRetType) {
setTunnelConfigurationPhase2GetDhGroupsAttributeType(&o.DhGroups, v)
}
// GetEncryptionAlgorithms returns the EncryptionAlgorithms field value
func (o *TunnelConfigurationPhase2) GetEncryptionAlgorithms() (ret TunnelConfigurationPhase2GetEncryptionAlgorithmsRetType) {
ret, _ = o.GetEncryptionAlgorithmsOk()
return ret
}
// GetEncryptionAlgorithmsOk returns a tuple with the EncryptionAlgorithms field value
// and a boolean to check if the value has been set.
func (o *TunnelConfigurationPhase2) GetEncryptionAlgorithmsOk() (ret TunnelConfigurationPhase2GetEncryptionAlgorithmsRetType, ok bool) {
return getTunnelConfigurationPhase2GetEncryptionAlgorithmsAttributeTypeOk(o.EncryptionAlgorithms)
}
// SetEncryptionAlgorithms sets field value
func (o *TunnelConfigurationPhase2) SetEncryptionAlgorithms(v TunnelConfigurationPhase2GetEncryptionAlgorithmsRetType) {
setTunnelConfigurationPhase2GetEncryptionAlgorithmsAttributeType(&o.EncryptionAlgorithms, v)
}
// GetIntegrityAlgorithms returns the IntegrityAlgorithms field value
func (o *TunnelConfigurationPhase2) GetIntegrityAlgorithms() (ret TunnelConfigurationPhase2GetIntegrityAlgorithmsRetType) {
ret, _ = o.GetIntegrityAlgorithmsOk()
return ret
}
// GetIntegrityAlgorithmsOk returns a tuple with the IntegrityAlgorithms field value
// and a boolean to check if the value has been set.
func (o *TunnelConfigurationPhase2) GetIntegrityAlgorithmsOk() (ret TunnelConfigurationPhase2GetIntegrityAlgorithmsRetType, ok bool) {
return getTunnelConfigurationPhase2GetIntegrityAlgorithmsAttributeTypeOk(o.IntegrityAlgorithms)
}
// SetIntegrityAlgorithms sets field value
func (o *TunnelConfigurationPhase2) SetIntegrityAlgorithms(v TunnelConfigurationPhase2GetIntegrityAlgorithmsRetType) {
setTunnelConfigurationPhase2GetIntegrityAlgorithmsAttributeType(&o.IntegrityAlgorithms, v)
}
// GetDpdAction returns the DpdAction field value if set, zero value otherwise.
func (o *TunnelConfigurationPhase2) GetDpdAction() (res TunnelConfigurationPhase2GetDpdActionRetType) {
res, _ = o.GetDpdActionOk()
return
}
// GetDpdActionOk returns a tuple with the DpdAction field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TunnelConfigurationPhase2) GetDpdActionOk() (ret TunnelConfigurationPhase2GetDpdActionRetType, ok bool) {
return getTunnelConfigurationPhase2GetDpdActionAttributeTypeOk(o.DpdAction)
}
// HasDpdAction returns a boolean if a field has been set.
func (o *TunnelConfigurationPhase2) HasDpdAction() bool {
_, ok := o.GetDpdActionOk()
return ok
}
// SetDpdAction gets a reference to the given string and assigns it to the DpdAction field.
func (o *TunnelConfigurationPhase2) SetDpdAction(v TunnelConfigurationPhase2GetDpdActionRetType) {
setTunnelConfigurationPhase2GetDpdActionAttributeType(&o.DpdAction, v)
}
// GetRekeyTime returns the RekeyTime field value if set, zero value otherwise.
func (o *TunnelConfigurationPhase2) GetRekeyTime() (res TunnelConfigurationPhase2GetRekeyTimeRetType) {
res, _ = o.GetRekeyTimeOk()
return
}
// GetRekeyTimeOk returns a tuple with the RekeyTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TunnelConfigurationPhase2) GetRekeyTimeOk() (ret TunnelConfigurationPhase2GetRekeyTimeRetType, ok bool) {
return getTunnelConfigurationPhase2GetRekeyTimeAttributeTypeOk(o.RekeyTime)
}
// HasRekeyTime returns a boolean if a field has been set.
func (o *TunnelConfigurationPhase2) HasRekeyTime() bool {
_, ok := o.GetRekeyTimeOk()
return ok
}
// SetRekeyTime gets a reference to the given int64 and assigns it to the RekeyTime field.
func (o *TunnelConfigurationPhase2) SetRekeyTime(v TunnelConfigurationPhase2GetRekeyTimeRetType) {
setTunnelConfigurationPhase2GetRekeyTimeAttributeType(&o.RekeyTime, v)
}
// GetStartAction returns the StartAction field value if set, zero value otherwise.
func (o *TunnelConfigurationPhase2) GetStartAction() (res TunnelConfigurationPhase2GetStartActionRetType) {
res, _ = o.GetStartActionOk()
return
}
// GetStartActionOk returns a tuple with the StartAction field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TunnelConfigurationPhase2) GetStartActionOk() (ret TunnelConfigurationPhase2GetStartActionRetType, ok bool) {
return getTunnelConfigurationPhase2GetStartActionAttributeTypeOk(o.StartAction)
}
// HasStartAction returns a boolean if a field has been set.
func (o *TunnelConfigurationPhase2) HasStartAction() bool {
_, ok := o.GetStartActionOk()
return ok
}
// SetStartAction gets a reference to the given string and assigns it to the StartAction field.
func (o *TunnelConfigurationPhase2) SetStartAction(v TunnelConfigurationPhase2GetStartActionRetType) {
setTunnelConfigurationPhase2GetStartActionAttributeType(&o.StartAction, v)
}
func (o TunnelConfigurationPhase2) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getTunnelConfigurationPhase2GetDhGroupsAttributeTypeOk(o.DhGroups); ok {
toSerialize["DhGroups"] = val
}
if val, ok := getTunnelConfigurationPhase2GetEncryptionAlgorithmsAttributeTypeOk(o.EncryptionAlgorithms); ok {
toSerialize["EncryptionAlgorithms"] = val
}
if val, ok := getTunnelConfigurationPhase2GetIntegrityAlgorithmsAttributeTypeOk(o.IntegrityAlgorithms); ok {
toSerialize["IntegrityAlgorithms"] = val
}
if val, ok := getTunnelConfigurationPhase2GetDpdActionAttributeTypeOk(o.DpdAction); ok {
toSerialize["DpdAction"] = val
}
if val, ok := getTunnelConfigurationPhase2GetRekeyTimeAttributeTypeOk(o.RekeyTime); ok {
toSerialize["RekeyTime"] = val
}
if val, ok := getTunnelConfigurationPhase2GetStartActionAttributeTypeOk(o.StartAction); ok {
toSerialize["StartAction"] = val
}
return toSerialize, nil
}
type NullableTunnelConfigurationPhase2 struct {
value *TunnelConfigurationPhase2
isSet bool
}
func (v NullableTunnelConfigurationPhase2) Get() *TunnelConfigurationPhase2 {
return v.value
}
func (v *NullableTunnelConfigurationPhase2) Set(val *TunnelConfigurationPhase2) {
v.value = val
v.isSet = true
}
func (v NullableTunnelConfigurationPhase2) IsSet() bool {
return v.isSet
}
func (v *NullableTunnelConfigurationPhase2) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTunnelConfigurationPhase2(val *TunnelConfigurationPhase2) *NullableTunnelConfigurationPhase2 {
return &NullableTunnelConfigurationPhase2{value: val, isSet: true}
}
func (v NullableTunnelConfigurationPhase2) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTunnelConfigurationPhase2) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}