## 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>
308 lines
11 KiB
Go
308 lines
11 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"
|
|
)
|
|
|
|
// checks if the TunnelConfiguration type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &TunnelConfiguration{}
|
|
|
|
/*
|
|
types and functions for bgpTunnelConfig
|
|
*/
|
|
|
|
// isModel
|
|
type TunnelConfigurationGetBgpTunnelConfigAttributeType = *BGPTunnelConfig
|
|
type TunnelConfigurationGetBgpTunnelConfigArgType = BGPTunnelConfig
|
|
type TunnelConfigurationGetBgpTunnelConfigRetType = BGPTunnelConfig
|
|
|
|
func getTunnelConfigurationGetBgpTunnelConfigAttributeTypeOk(arg TunnelConfigurationGetBgpTunnelConfigAttributeType) (ret TunnelConfigurationGetBgpTunnelConfigRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setTunnelConfigurationGetBgpTunnelConfigAttributeType(arg *TunnelConfigurationGetBgpTunnelConfigAttributeType, val TunnelConfigurationGetBgpTunnelConfigRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for phase1
|
|
*/
|
|
|
|
// isModel
|
|
type TunnelConfigurationGetPhase1AttributeType = *TunnelConfigurationPhase1
|
|
type TunnelConfigurationGetPhase1ArgType = TunnelConfigurationPhase1
|
|
type TunnelConfigurationGetPhase1RetType = TunnelConfigurationPhase1
|
|
|
|
func getTunnelConfigurationGetPhase1AttributeTypeOk(arg TunnelConfigurationGetPhase1AttributeType) (ret TunnelConfigurationGetPhase1RetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setTunnelConfigurationGetPhase1AttributeType(arg *TunnelConfigurationGetPhase1AttributeType, val TunnelConfigurationGetPhase1RetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for phase2
|
|
*/
|
|
|
|
// isModel
|
|
type TunnelConfigurationGetPhase2AttributeType = *TunnelConfigurationPhase2
|
|
type TunnelConfigurationGetPhase2ArgType = TunnelConfigurationPhase2
|
|
type TunnelConfigurationGetPhase2RetType = TunnelConfigurationPhase2
|
|
|
|
func getTunnelConfigurationGetPhase2AttributeTypeOk(arg TunnelConfigurationGetPhase2AttributeType) (ret TunnelConfigurationGetPhase2RetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setTunnelConfigurationGetPhase2AttributeType(arg *TunnelConfigurationGetPhase2AttributeType, val TunnelConfigurationGetPhase2RetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for preSharedKey
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type TunnelConfigurationGetPreSharedKeyAttributeType = *string
|
|
|
|
func getTunnelConfigurationGetPreSharedKeyAttributeTypeOk(arg TunnelConfigurationGetPreSharedKeyAttributeType) (ret TunnelConfigurationGetPreSharedKeyRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setTunnelConfigurationGetPreSharedKeyAttributeType(arg *TunnelConfigurationGetPreSharedKeyAttributeType, val TunnelConfigurationGetPreSharedKeyRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type TunnelConfigurationGetPreSharedKeyArgType = string
|
|
type TunnelConfigurationGetPreSharedKeyRetType = string
|
|
|
|
/*
|
|
types and functions for remoteAddress
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type TunnelConfigurationGetRemoteAddressAttributeType = *string
|
|
|
|
func getTunnelConfigurationGetRemoteAddressAttributeTypeOk(arg TunnelConfigurationGetRemoteAddressAttributeType) (ret TunnelConfigurationGetRemoteAddressRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setTunnelConfigurationGetRemoteAddressAttributeType(arg *TunnelConfigurationGetRemoteAddressAttributeType, val TunnelConfigurationGetRemoteAddressRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type TunnelConfigurationGetRemoteAddressArgType = string
|
|
type TunnelConfigurationGetRemoteAddressRetType = string
|
|
|
|
// TunnelConfiguration struct for TunnelConfiguration
|
|
type TunnelConfiguration struct {
|
|
BgpTunnelConfig TunnelConfigurationGetBgpTunnelConfigAttributeType `json:"bgpTunnelConfig,omitempty"`
|
|
// REQUIRED
|
|
Phase1 TunnelConfigurationGetPhase1AttributeType `json:"phase1" required:"true"`
|
|
// REQUIRED
|
|
Phase2 TunnelConfigurationGetPhase2AttributeType `json:"phase2" required:"true"`
|
|
// A Pre-Shared Key for authentication. Required in create-requests, optional in update-requests and omitted in every response.
|
|
PreSharedKey TunnelConfigurationGetPreSharedKeyAttributeType `json:"preSharedKey,omitempty"`
|
|
// REQUIRED
|
|
RemoteAddress TunnelConfigurationGetRemoteAddressAttributeType `json:"remoteAddress" required:"true"`
|
|
}
|
|
|
|
type _TunnelConfiguration TunnelConfiguration
|
|
|
|
// NewTunnelConfiguration instantiates a new TunnelConfiguration 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 NewTunnelConfiguration(phase1 TunnelConfigurationGetPhase1ArgType, phase2 TunnelConfigurationGetPhase2ArgType, remoteAddress TunnelConfigurationGetRemoteAddressArgType) *TunnelConfiguration {
|
|
this := TunnelConfiguration{}
|
|
setTunnelConfigurationGetPhase1AttributeType(&this.Phase1, phase1)
|
|
setTunnelConfigurationGetPhase2AttributeType(&this.Phase2, phase2)
|
|
setTunnelConfigurationGetRemoteAddressAttributeType(&this.RemoteAddress, remoteAddress)
|
|
return &this
|
|
}
|
|
|
|
// NewTunnelConfigurationWithDefaults instantiates a new TunnelConfiguration 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 NewTunnelConfigurationWithDefaults() *TunnelConfiguration {
|
|
this := TunnelConfiguration{}
|
|
return &this
|
|
}
|
|
|
|
// GetBgpTunnelConfig returns the BgpTunnelConfig field value if set, zero value otherwise.
|
|
func (o *TunnelConfiguration) GetBgpTunnelConfig() (res TunnelConfigurationGetBgpTunnelConfigRetType) {
|
|
res, _ = o.GetBgpTunnelConfigOk()
|
|
return
|
|
}
|
|
|
|
// GetBgpTunnelConfigOk returns a tuple with the BgpTunnelConfig field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TunnelConfiguration) GetBgpTunnelConfigOk() (ret TunnelConfigurationGetBgpTunnelConfigRetType, ok bool) {
|
|
return getTunnelConfigurationGetBgpTunnelConfigAttributeTypeOk(o.BgpTunnelConfig)
|
|
}
|
|
|
|
// HasBgpTunnelConfig returns a boolean if a field has been set.
|
|
func (o *TunnelConfiguration) HasBgpTunnelConfig() bool {
|
|
_, ok := o.GetBgpTunnelConfigOk()
|
|
return ok
|
|
}
|
|
|
|
// SetBgpTunnelConfig gets a reference to the given BGPTunnelConfig and assigns it to the BgpTunnelConfig field.
|
|
func (o *TunnelConfiguration) SetBgpTunnelConfig(v TunnelConfigurationGetBgpTunnelConfigRetType) {
|
|
setTunnelConfigurationGetBgpTunnelConfigAttributeType(&o.BgpTunnelConfig, v)
|
|
}
|
|
|
|
// GetPhase1 returns the Phase1 field value
|
|
func (o *TunnelConfiguration) GetPhase1() (ret TunnelConfigurationGetPhase1RetType) {
|
|
ret, _ = o.GetPhase1Ok()
|
|
return ret
|
|
}
|
|
|
|
// GetPhase1Ok returns a tuple with the Phase1 field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TunnelConfiguration) GetPhase1Ok() (ret TunnelConfigurationGetPhase1RetType, ok bool) {
|
|
return getTunnelConfigurationGetPhase1AttributeTypeOk(o.Phase1)
|
|
}
|
|
|
|
// SetPhase1 sets field value
|
|
func (o *TunnelConfiguration) SetPhase1(v TunnelConfigurationGetPhase1RetType) {
|
|
setTunnelConfigurationGetPhase1AttributeType(&o.Phase1, v)
|
|
}
|
|
|
|
// GetPhase2 returns the Phase2 field value
|
|
func (o *TunnelConfiguration) GetPhase2() (ret TunnelConfigurationGetPhase2RetType) {
|
|
ret, _ = o.GetPhase2Ok()
|
|
return ret
|
|
}
|
|
|
|
// GetPhase2Ok returns a tuple with the Phase2 field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TunnelConfiguration) GetPhase2Ok() (ret TunnelConfigurationGetPhase2RetType, ok bool) {
|
|
return getTunnelConfigurationGetPhase2AttributeTypeOk(o.Phase2)
|
|
}
|
|
|
|
// SetPhase2 sets field value
|
|
func (o *TunnelConfiguration) SetPhase2(v TunnelConfigurationGetPhase2RetType) {
|
|
setTunnelConfigurationGetPhase2AttributeType(&o.Phase2, v)
|
|
}
|
|
|
|
// GetPreSharedKey returns the PreSharedKey field value if set, zero value otherwise.
|
|
func (o *TunnelConfiguration) GetPreSharedKey() (res TunnelConfigurationGetPreSharedKeyRetType) {
|
|
res, _ = o.GetPreSharedKeyOk()
|
|
return
|
|
}
|
|
|
|
// GetPreSharedKeyOk returns a tuple with the PreSharedKey field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TunnelConfiguration) GetPreSharedKeyOk() (ret TunnelConfigurationGetPreSharedKeyRetType, ok bool) {
|
|
return getTunnelConfigurationGetPreSharedKeyAttributeTypeOk(o.PreSharedKey)
|
|
}
|
|
|
|
// HasPreSharedKey returns a boolean if a field has been set.
|
|
func (o *TunnelConfiguration) HasPreSharedKey() bool {
|
|
_, ok := o.GetPreSharedKeyOk()
|
|
return ok
|
|
}
|
|
|
|
// SetPreSharedKey gets a reference to the given string and assigns it to the PreSharedKey field.
|
|
func (o *TunnelConfiguration) SetPreSharedKey(v TunnelConfigurationGetPreSharedKeyRetType) {
|
|
setTunnelConfigurationGetPreSharedKeyAttributeType(&o.PreSharedKey, v)
|
|
}
|
|
|
|
// GetRemoteAddress returns the RemoteAddress field value
|
|
func (o *TunnelConfiguration) GetRemoteAddress() (ret TunnelConfigurationGetRemoteAddressRetType) {
|
|
ret, _ = o.GetRemoteAddressOk()
|
|
return ret
|
|
}
|
|
|
|
// GetRemoteAddressOk returns a tuple with the RemoteAddress field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TunnelConfiguration) GetRemoteAddressOk() (ret TunnelConfigurationGetRemoteAddressRetType, ok bool) {
|
|
return getTunnelConfigurationGetRemoteAddressAttributeTypeOk(o.RemoteAddress)
|
|
}
|
|
|
|
// SetRemoteAddress sets field value
|
|
func (o *TunnelConfiguration) SetRemoteAddress(v TunnelConfigurationGetRemoteAddressRetType) {
|
|
setTunnelConfigurationGetRemoteAddressAttributeType(&o.RemoteAddress, v)
|
|
}
|
|
|
|
func (o TunnelConfiguration) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if val, ok := getTunnelConfigurationGetBgpTunnelConfigAttributeTypeOk(o.BgpTunnelConfig); ok {
|
|
toSerialize["BgpTunnelConfig"] = val
|
|
}
|
|
if val, ok := getTunnelConfigurationGetPhase1AttributeTypeOk(o.Phase1); ok {
|
|
toSerialize["Phase1"] = val
|
|
}
|
|
if val, ok := getTunnelConfigurationGetPhase2AttributeTypeOk(o.Phase2); ok {
|
|
toSerialize["Phase2"] = val
|
|
}
|
|
if val, ok := getTunnelConfigurationGetPreSharedKeyAttributeTypeOk(o.PreSharedKey); ok {
|
|
toSerialize["PreSharedKey"] = val
|
|
}
|
|
if val, ok := getTunnelConfigurationGetRemoteAddressAttributeTypeOk(o.RemoteAddress); ok {
|
|
toSerialize["RemoteAddress"] = val
|
|
}
|
|
return toSerialize, nil
|
|
}
|
|
|
|
type NullableTunnelConfiguration struct {
|
|
value *TunnelConfiguration
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableTunnelConfiguration) Get() *TunnelConfiguration {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableTunnelConfiguration) Set(val *TunnelConfiguration) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableTunnelConfiguration) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableTunnelConfiguration) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableTunnelConfiguration(val *TunnelConfiguration) *NullableTunnelConfiguration {
|
|
return &NullableTunnelConfiguration{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableTunnelConfiguration) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableTunnelConfiguration) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|