## 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
12 KiB
Go
308 lines
12 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 ConnectionRequestTunnel1 type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &ConnectionRequestTunnel1{}
|
|
|
|
/*
|
|
types and functions for bgpTunnelConfig
|
|
*/
|
|
|
|
// isModel
|
|
type ConnectionRequestTunnel1GetBgpTunnelConfigAttributeType = *BGPTunnelConfig
|
|
type ConnectionRequestTunnel1GetBgpTunnelConfigArgType = BGPTunnelConfig
|
|
type ConnectionRequestTunnel1GetBgpTunnelConfigRetType = BGPTunnelConfig
|
|
|
|
func getConnectionRequestTunnel1GetBgpTunnelConfigAttributeTypeOk(arg ConnectionRequestTunnel1GetBgpTunnelConfigAttributeType) (ret ConnectionRequestTunnel1GetBgpTunnelConfigRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setConnectionRequestTunnel1GetBgpTunnelConfigAttributeType(arg *ConnectionRequestTunnel1GetBgpTunnelConfigAttributeType, val ConnectionRequestTunnel1GetBgpTunnelConfigRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for phase1
|
|
*/
|
|
|
|
// isModel
|
|
type ConnectionRequestTunnel1GetPhase1AttributeType = *TunnelConfigurationPhase1
|
|
type ConnectionRequestTunnel1GetPhase1ArgType = TunnelConfigurationPhase1
|
|
type ConnectionRequestTunnel1GetPhase1RetType = TunnelConfigurationPhase1
|
|
|
|
func getConnectionRequestTunnel1GetPhase1AttributeTypeOk(arg ConnectionRequestTunnel1GetPhase1AttributeType) (ret ConnectionRequestTunnel1GetPhase1RetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setConnectionRequestTunnel1GetPhase1AttributeType(arg *ConnectionRequestTunnel1GetPhase1AttributeType, val ConnectionRequestTunnel1GetPhase1RetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for phase2
|
|
*/
|
|
|
|
// isModel
|
|
type ConnectionRequestTunnel1GetPhase2AttributeType = *TunnelConfigurationPhase2
|
|
type ConnectionRequestTunnel1GetPhase2ArgType = TunnelConfigurationPhase2
|
|
type ConnectionRequestTunnel1GetPhase2RetType = TunnelConfigurationPhase2
|
|
|
|
func getConnectionRequestTunnel1GetPhase2AttributeTypeOk(arg ConnectionRequestTunnel1GetPhase2AttributeType) (ret ConnectionRequestTunnel1GetPhase2RetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setConnectionRequestTunnel1GetPhase2AttributeType(arg *ConnectionRequestTunnel1GetPhase2AttributeType, val ConnectionRequestTunnel1GetPhase2RetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for preSharedKey
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type ConnectionRequestTunnel1GetPreSharedKeyAttributeType = *string
|
|
|
|
func getConnectionRequestTunnel1GetPreSharedKeyAttributeTypeOk(arg ConnectionRequestTunnel1GetPreSharedKeyAttributeType) (ret ConnectionRequestTunnel1GetPreSharedKeyRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setConnectionRequestTunnel1GetPreSharedKeyAttributeType(arg *ConnectionRequestTunnel1GetPreSharedKeyAttributeType, val ConnectionRequestTunnel1GetPreSharedKeyRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type ConnectionRequestTunnel1GetPreSharedKeyArgType = string
|
|
type ConnectionRequestTunnel1GetPreSharedKeyRetType = string
|
|
|
|
/*
|
|
types and functions for remoteAddress
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type ConnectionRequestTunnel1GetRemoteAddressAttributeType = *string
|
|
|
|
func getConnectionRequestTunnel1GetRemoteAddressAttributeTypeOk(arg ConnectionRequestTunnel1GetRemoteAddressAttributeType) (ret ConnectionRequestTunnel1GetRemoteAddressRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setConnectionRequestTunnel1GetRemoteAddressAttributeType(arg *ConnectionRequestTunnel1GetRemoteAddressAttributeType, val ConnectionRequestTunnel1GetRemoteAddressRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type ConnectionRequestTunnel1GetRemoteAddressArgType = string
|
|
type ConnectionRequestTunnel1GetRemoteAddressRetType = string
|
|
|
|
// ConnectionRequestTunnel1 struct for ConnectionRequestTunnel1
|
|
type ConnectionRequestTunnel1 struct {
|
|
BgpTunnelConfig ConnectionRequestTunnel1GetBgpTunnelConfigAttributeType `json:"bgpTunnelConfig,omitempty"`
|
|
// REQUIRED
|
|
Phase1 ConnectionRequestTunnel1GetPhase1AttributeType `json:"phase1" required:"true"`
|
|
// REQUIRED
|
|
Phase2 ConnectionRequestTunnel1GetPhase2AttributeType `json:"phase2" required:"true"`
|
|
// A Pre-Shared Key for authentication. Required in create-requests, optional in update-requests and omitted in every response.
|
|
PreSharedKey ConnectionRequestTunnel1GetPreSharedKeyAttributeType `json:"preSharedKey,omitempty"`
|
|
// REQUIRED
|
|
RemoteAddress ConnectionRequestTunnel1GetRemoteAddressAttributeType `json:"remoteAddress" required:"true"`
|
|
}
|
|
|
|
type _ConnectionRequestTunnel1 ConnectionRequestTunnel1
|
|
|
|
// NewConnectionRequestTunnel1 instantiates a new ConnectionRequestTunnel1 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 NewConnectionRequestTunnel1(phase1 ConnectionRequestTunnel1GetPhase1ArgType, phase2 ConnectionRequestTunnel1GetPhase2ArgType, remoteAddress ConnectionRequestTunnel1GetRemoteAddressArgType) *ConnectionRequestTunnel1 {
|
|
this := ConnectionRequestTunnel1{}
|
|
setConnectionRequestTunnel1GetPhase1AttributeType(&this.Phase1, phase1)
|
|
setConnectionRequestTunnel1GetPhase2AttributeType(&this.Phase2, phase2)
|
|
setConnectionRequestTunnel1GetRemoteAddressAttributeType(&this.RemoteAddress, remoteAddress)
|
|
return &this
|
|
}
|
|
|
|
// NewConnectionRequestTunnel1WithDefaults instantiates a new ConnectionRequestTunnel1 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 NewConnectionRequestTunnel1WithDefaults() *ConnectionRequestTunnel1 {
|
|
this := ConnectionRequestTunnel1{}
|
|
return &this
|
|
}
|
|
|
|
// GetBgpTunnelConfig returns the BgpTunnelConfig field value if set, zero value otherwise.
|
|
func (o *ConnectionRequestTunnel1) GetBgpTunnelConfig() (res ConnectionRequestTunnel1GetBgpTunnelConfigRetType) {
|
|
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 *ConnectionRequestTunnel1) GetBgpTunnelConfigOk() (ret ConnectionRequestTunnel1GetBgpTunnelConfigRetType, ok bool) {
|
|
return getConnectionRequestTunnel1GetBgpTunnelConfigAttributeTypeOk(o.BgpTunnelConfig)
|
|
}
|
|
|
|
// HasBgpTunnelConfig returns a boolean if a field has been set.
|
|
func (o *ConnectionRequestTunnel1) HasBgpTunnelConfig() bool {
|
|
_, ok := o.GetBgpTunnelConfigOk()
|
|
return ok
|
|
}
|
|
|
|
// SetBgpTunnelConfig gets a reference to the given BGPTunnelConfig and assigns it to the BgpTunnelConfig field.
|
|
func (o *ConnectionRequestTunnel1) SetBgpTunnelConfig(v ConnectionRequestTunnel1GetBgpTunnelConfigRetType) {
|
|
setConnectionRequestTunnel1GetBgpTunnelConfigAttributeType(&o.BgpTunnelConfig, v)
|
|
}
|
|
|
|
// GetPhase1 returns the Phase1 field value
|
|
func (o *ConnectionRequestTunnel1) GetPhase1() (ret ConnectionRequestTunnel1GetPhase1RetType) {
|
|
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 *ConnectionRequestTunnel1) GetPhase1Ok() (ret ConnectionRequestTunnel1GetPhase1RetType, ok bool) {
|
|
return getConnectionRequestTunnel1GetPhase1AttributeTypeOk(o.Phase1)
|
|
}
|
|
|
|
// SetPhase1 sets field value
|
|
func (o *ConnectionRequestTunnel1) SetPhase1(v ConnectionRequestTunnel1GetPhase1RetType) {
|
|
setConnectionRequestTunnel1GetPhase1AttributeType(&o.Phase1, v)
|
|
}
|
|
|
|
// GetPhase2 returns the Phase2 field value
|
|
func (o *ConnectionRequestTunnel1) GetPhase2() (ret ConnectionRequestTunnel1GetPhase2RetType) {
|
|
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 *ConnectionRequestTunnel1) GetPhase2Ok() (ret ConnectionRequestTunnel1GetPhase2RetType, ok bool) {
|
|
return getConnectionRequestTunnel1GetPhase2AttributeTypeOk(o.Phase2)
|
|
}
|
|
|
|
// SetPhase2 sets field value
|
|
func (o *ConnectionRequestTunnel1) SetPhase2(v ConnectionRequestTunnel1GetPhase2RetType) {
|
|
setConnectionRequestTunnel1GetPhase2AttributeType(&o.Phase2, v)
|
|
}
|
|
|
|
// GetPreSharedKey returns the PreSharedKey field value if set, zero value otherwise.
|
|
func (o *ConnectionRequestTunnel1) GetPreSharedKey() (res ConnectionRequestTunnel1GetPreSharedKeyRetType) {
|
|
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 *ConnectionRequestTunnel1) GetPreSharedKeyOk() (ret ConnectionRequestTunnel1GetPreSharedKeyRetType, ok bool) {
|
|
return getConnectionRequestTunnel1GetPreSharedKeyAttributeTypeOk(o.PreSharedKey)
|
|
}
|
|
|
|
// HasPreSharedKey returns a boolean if a field has been set.
|
|
func (o *ConnectionRequestTunnel1) HasPreSharedKey() bool {
|
|
_, ok := o.GetPreSharedKeyOk()
|
|
return ok
|
|
}
|
|
|
|
// SetPreSharedKey gets a reference to the given string and assigns it to the PreSharedKey field.
|
|
func (o *ConnectionRequestTunnel1) SetPreSharedKey(v ConnectionRequestTunnel1GetPreSharedKeyRetType) {
|
|
setConnectionRequestTunnel1GetPreSharedKeyAttributeType(&o.PreSharedKey, v)
|
|
}
|
|
|
|
// GetRemoteAddress returns the RemoteAddress field value
|
|
func (o *ConnectionRequestTunnel1) GetRemoteAddress() (ret ConnectionRequestTunnel1GetRemoteAddressRetType) {
|
|
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 *ConnectionRequestTunnel1) GetRemoteAddressOk() (ret ConnectionRequestTunnel1GetRemoteAddressRetType, ok bool) {
|
|
return getConnectionRequestTunnel1GetRemoteAddressAttributeTypeOk(o.RemoteAddress)
|
|
}
|
|
|
|
// SetRemoteAddress sets field value
|
|
func (o *ConnectionRequestTunnel1) SetRemoteAddress(v ConnectionRequestTunnel1GetRemoteAddressRetType) {
|
|
setConnectionRequestTunnel1GetRemoteAddressAttributeType(&o.RemoteAddress, v)
|
|
}
|
|
|
|
func (o ConnectionRequestTunnel1) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if val, ok := getConnectionRequestTunnel1GetBgpTunnelConfigAttributeTypeOk(o.BgpTunnelConfig); ok {
|
|
toSerialize["BgpTunnelConfig"] = val
|
|
}
|
|
if val, ok := getConnectionRequestTunnel1GetPhase1AttributeTypeOk(o.Phase1); ok {
|
|
toSerialize["Phase1"] = val
|
|
}
|
|
if val, ok := getConnectionRequestTunnel1GetPhase2AttributeTypeOk(o.Phase2); ok {
|
|
toSerialize["Phase2"] = val
|
|
}
|
|
if val, ok := getConnectionRequestTunnel1GetPreSharedKeyAttributeTypeOk(o.PreSharedKey); ok {
|
|
toSerialize["PreSharedKey"] = val
|
|
}
|
|
if val, ok := getConnectionRequestTunnel1GetRemoteAddressAttributeTypeOk(o.RemoteAddress); ok {
|
|
toSerialize["RemoteAddress"] = val
|
|
}
|
|
return toSerialize, nil
|
|
}
|
|
|
|
type NullableConnectionRequestTunnel1 struct {
|
|
value *ConnectionRequestTunnel1
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableConnectionRequestTunnel1) Get() *ConnectionRequestTunnel1 {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableConnectionRequestTunnel1) Set(val *ConnectionRequestTunnel1) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableConnectionRequestTunnel1) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableConnectionRequestTunnel1) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableConnectionRequestTunnel1(val *ConnectionRequestTunnel1) *NullableConnectionRequestTunnel1 {
|
|
return &NullableConnectionRequestTunnel1{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableConnectionRequestTunnel1) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableConnectionRequestTunnel1) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|