/* 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" ) // checks if the TunnelConfigurationPhase1 type satisfies the MappedNullable interface at compile time var _ MappedNullable = &TunnelConfigurationPhase1{} /* types and functions for dhGroups */ // isArray type TunnelConfigurationPhase1GetDhGroupsAttributeType = *[]string type TunnelConfigurationPhase1GetDhGroupsArgType = []string type TunnelConfigurationPhase1GetDhGroupsRetType = []string func getTunnelConfigurationPhase1GetDhGroupsAttributeTypeOk(arg TunnelConfigurationPhase1GetDhGroupsAttributeType) (ret TunnelConfigurationPhase1GetDhGroupsRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setTunnelConfigurationPhase1GetDhGroupsAttributeType(arg *TunnelConfigurationPhase1GetDhGroupsAttributeType, val TunnelConfigurationPhase1GetDhGroupsRetType) { *arg = &val } /* types and functions for encryptionAlgorithms */ // isArray type TunnelConfigurationPhase1GetEncryptionAlgorithmsAttributeType = *[]string type TunnelConfigurationPhase1GetEncryptionAlgorithmsArgType = []string type TunnelConfigurationPhase1GetEncryptionAlgorithmsRetType = []string func getTunnelConfigurationPhase1GetEncryptionAlgorithmsAttributeTypeOk(arg TunnelConfigurationPhase1GetEncryptionAlgorithmsAttributeType) (ret TunnelConfigurationPhase1GetEncryptionAlgorithmsRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setTunnelConfigurationPhase1GetEncryptionAlgorithmsAttributeType(arg *TunnelConfigurationPhase1GetEncryptionAlgorithmsAttributeType, val TunnelConfigurationPhase1GetEncryptionAlgorithmsRetType) { *arg = &val } /* types and functions for integrityAlgorithms */ // isArray type TunnelConfigurationPhase1GetIntegrityAlgorithmsAttributeType = *[]string type TunnelConfigurationPhase1GetIntegrityAlgorithmsArgType = []string type TunnelConfigurationPhase1GetIntegrityAlgorithmsRetType = []string func getTunnelConfigurationPhase1GetIntegrityAlgorithmsAttributeTypeOk(arg TunnelConfigurationPhase1GetIntegrityAlgorithmsAttributeType) (ret TunnelConfigurationPhase1GetIntegrityAlgorithmsRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setTunnelConfigurationPhase1GetIntegrityAlgorithmsAttributeType(arg *TunnelConfigurationPhase1GetIntegrityAlgorithmsAttributeType, val TunnelConfigurationPhase1GetIntegrityAlgorithmsRetType) { *arg = &val } /* types and functions for rekeyTime */ // isInteger type TunnelConfigurationPhase1GetRekeyTimeAttributeType = *int64 type TunnelConfigurationPhase1GetRekeyTimeArgType = int64 type TunnelConfigurationPhase1GetRekeyTimeRetType = int64 func getTunnelConfigurationPhase1GetRekeyTimeAttributeTypeOk(arg TunnelConfigurationPhase1GetRekeyTimeAttributeType) (ret TunnelConfigurationPhase1GetRekeyTimeRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setTunnelConfigurationPhase1GetRekeyTimeAttributeType(arg *TunnelConfigurationPhase1GetRekeyTimeAttributeType, val TunnelConfigurationPhase1GetRekeyTimeRetType) { *arg = &val } // TunnelConfigurationPhase1 struct for TunnelConfigurationPhase1 type TunnelConfigurationPhase1 struct { // The Diffie-Hellman Group. Required, except if AEAD algorithms are selected. DhGroups TunnelConfigurationPhase1GetDhGroupsAttributeType `json:"dhGroups,omitempty"` // REQUIRED EncryptionAlgorithms TunnelConfigurationPhase1GetEncryptionAlgorithmsAttributeType `json:"encryptionAlgorithms" required:"true"` // REQUIRED IntegrityAlgorithms TunnelConfigurationPhase1GetIntegrityAlgorithmsAttributeType `json:"integrityAlgorithms" required:"true"` // Time to schedule a IKE re-keying (in seconds). // Can be cast to int32 without loss of precision. RekeyTime TunnelConfigurationPhase1GetRekeyTimeAttributeType `json:"rekeyTime,omitempty"` } type _TunnelConfigurationPhase1 TunnelConfigurationPhase1 // NewTunnelConfigurationPhase1 instantiates a new TunnelConfigurationPhase1 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 NewTunnelConfigurationPhase1(encryptionAlgorithms TunnelConfigurationPhase1GetEncryptionAlgorithmsArgType, integrityAlgorithms TunnelConfigurationPhase1GetIntegrityAlgorithmsArgType) *TunnelConfigurationPhase1 { this := TunnelConfigurationPhase1{} setTunnelConfigurationPhase1GetEncryptionAlgorithmsAttributeType(&this.EncryptionAlgorithms, encryptionAlgorithms) setTunnelConfigurationPhase1GetIntegrityAlgorithmsAttributeType(&this.IntegrityAlgorithms, integrityAlgorithms) return &this } // NewTunnelConfigurationPhase1WithDefaults instantiates a new TunnelConfigurationPhase1 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 NewTunnelConfigurationPhase1WithDefaults() *TunnelConfigurationPhase1 { this := TunnelConfigurationPhase1{} var rekeyTime int64 = 14400 this.RekeyTime = &rekeyTime return &this } // GetDhGroups returns the DhGroups field value if set, zero value otherwise. func (o *TunnelConfigurationPhase1) GetDhGroups() (res TunnelConfigurationPhase1GetDhGroupsRetType) { 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 *TunnelConfigurationPhase1) GetDhGroupsOk() (ret TunnelConfigurationPhase1GetDhGroupsRetType, ok bool) { return getTunnelConfigurationPhase1GetDhGroupsAttributeTypeOk(o.DhGroups) } // HasDhGroups returns a boolean if a field has been set. func (o *TunnelConfigurationPhase1) HasDhGroups() bool { _, ok := o.GetDhGroupsOk() return ok } // SetDhGroups gets a reference to the given []string and assigns it to the DhGroups field. func (o *TunnelConfigurationPhase1) SetDhGroups(v TunnelConfigurationPhase1GetDhGroupsRetType) { setTunnelConfigurationPhase1GetDhGroupsAttributeType(&o.DhGroups, v) } // GetEncryptionAlgorithms returns the EncryptionAlgorithms field value func (o *TunnelConfigurationPhase1) GetEncryptionAlgorithms() (ret TunnelConfigurationPhase1GetEncryptionAlgorithmsRetType) { 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 *TunnelConfigurationPhase1) GetEncryptionAlgorithmsOk() (ret TunnelConfigurationPhase1GetEncryptionAlgorithmsRetType, ok bool) { return getTunnelConfigurationPhase1GetEncryptionAlgorithmsAttributeTypeOk(o.EncryptionAlgorithms) } // SetEncryptionAlgorithms sets field value func (o *TunnelConfigurationPhase1) SetEncryptionAlgorithms(v TunnelConfigurationPhase1GetEncryptionAlgorithmsRetType) { setTunnelConfigurationPhase1GetEncryptionAlgorithmsAttributeType(&o.EncryptionAlgorithms, v) } // GetIntegrityAlgorithms returns the IntegrityAlgorithms field value func (o *TunnelConfigurationPhase1) GetIntegrityAlgorithms() (ret TunnelConfigurationPhase1GetIntegrityAlgorithmsRetType) { 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 *TunnelConfigurationPhase1) GetIntegrityAlgorithmsOk() (ret TunnelConfigurationPhase1GetIntegrityAlgorithmsRetType, ok bool) { return getTunnelConfigurationPhase1GetIntegrityAlgorithmsAttributeTypeOk(o.IntegrityAlgorithms) } // SetIntegrityAlgorithms sets field value func (o *TunnelConfigurationPhase1) SetIntegrityAlgorithms(v TunnelConfigurationPhase1GetIntegrityAlgorithmsRetType) { setTunnelConfigurationPhase1GetIntegrityAlgorithmsAttributeType(&o.IntegrityAlgorithms, v) } // GetRekeyTime returns the RekeyTime field value if set, zero value otherwise. func (o *TunnelConfigurationPhase1) GetRekeyTime() (res TunnelConfigurationPhase1GetRekeyTimeRetType) { 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 *TunnelConfigurationPhase1) GetRekeyTimeOk() (ret TunnelConfigurationPhase1GetRekeyTimeRetType, ok bool) { return getTunnelConfigurationPhase1GetRekeyTimeAttributeTypeOk(o.RekeyTime) } // HasRekeyTime returns a boolean if a field has been set. func (o *TunnelConfigurationPhase1) HasRekeyTime() bool { _, ok := o.GetRekeyTimeOk() return ok } // SetRekeyTime gets a reference to the given int64 and assigns it to the RekeyTime field. func (o *TunnelConfigurationPhase1) SetRekeyTime(v TunnelConfigurationPhase1GetRekeyTimeRetType) { setTunnelConfigurationPhase1GetRekeyTimeAttributeType(&o.RekeyTime, v) } func (o TunnelConfigurationPhase1) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getTunnelConfigurationPhase1GetDhGroupsAttributeTypeOk(o.DhGroups); ok { toSerialize["DhGroups"] = val } if val, ok := getTunnelConfigurationPhase1GetEncryptionAlgorithmsAttributeTypeOk(o.EncryptionAlgorithms); ok { toSerialize["EncryptionAlgorithms"] = val } if val, ok := getTunnelConfigurationPhase1GetIntegrityAlgorithmsAttributeTypeOk(o.IntegrityAlgorithms); ok { toSerialize["IntegrityAlgorithms"] = val } if val, ok := getTunnelConfigurationPhase1GetRekeyTimeAttributeTypeOk(o.RekeyTime); ok { toSerialize["RekeyTime"] = val } return toSerialize, nil } type NullableTunnelConfigurationPhase1 struct { value *TunnelConfigurationPhase1 isSet bool } func (v NullableTunnelConfigurationPhase1) Get() *TunnelConfigurationPhase1 { return v.value } func (v *NullableTunnelConfigurationPhase1) Set(val *TunnelConfigurationPhase1) { v.value = val v.isSet = true } func (v NullableTunnelConfigurationPhase1) IsSet() bool { return v.isSet } func (v *NullableTunnelConfigurationPhase1) Unset() { v.value = nil v.isSet = false } func NewNullableTunnelConfigurationPhase1(val *TunnelConfigurationPhase1) *NullableTunnelConfigurationPhase1 { return &NullableTunnelConfigurationPhase1{value: val, isSet: true} } func (v NullableTunnelConfigurationPhase1) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableTunnelConfigurationPhase1) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }