## 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>
397 lines
12 KiB
Go
397 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 Connection type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &Connection{}
|
|
|
|
/*
|
|
types and functions for enabled
|
|
*/
|
|
|
|
// isBoolean
|
|
type ConnectiongetEnabledAttributeType = *bool
|
|
type ConnectiongetEnabledArgType = bool
|
|
type ConnectiongetEnabledRetType = bool
|
|
|
|
func getConnectiongetEnabledAttributeTypeOk(arg ConnectiongetEnabledAttributeType) (ret ConnectiongetEnabledRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setConnectiongetEnabledAttributeType(arg *ConnectiongetEnabledAttributeType, val ConnectiongetEnabledRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for labels
|
|
*/
|
|
|
|
// isContainer
|
|
type ConnectionGetLabelsAttributeType = *map[string]string
|
|
type ConnectionGetLabelsArgType = map[string]string
|
|
type ConnectionGetLabelsRetType = map[string]string
|
|
|
|
func getConnectionGetLabelsAttributeTypeOk(arg ConnectionGetLabelsAttributeType) (ret ConnectionGetLabelsRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setConnectionGetLabelsAttributeType(arg *ConnectionGetLabelsAttributeType, val ConnectionGetLabelsRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for localSubnets
|
|
*/
|
|
|
|
// isArray
|
|
type ConnectionGetLocalSubnetsAttributeType = *[]string
|
|
type ConnectionGetLocalSubnetsArgType = []string
|
|
type ConnectionGetLocalSubnetsRetType = []string
|
|
|
|
func getConnectionGetLocalSubnetsAttributeTypeOk(arg ConnectionGetLocalSubnetsAttributeType) (ret ConnectionGetLocalSubnetsRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setConnectionGetLocalSubnetsAttributeType(arg *ConnectionGetLocalSubnetsAttributeType, val ConnectionGetLocalSubnetsRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for name
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type ConnectionGetNameAttributeType = *string
|
|
|
|
func getConnectionGetNameAttributeTypeOk(arg ConnectionGetNameAttributeType) (ret ConnectionGetNameRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setConnectionGetNameAttributeType(arg *ConnectionGetNameAttributeType, val ConnectionGetNameRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type ConnectionGetNameArgType = string
|
|
type ConnectionGetNameRetType = string
|
|
|
|
/*
|
|
types and functions for remoteSubnets
|
|
*/
|
|
|
|
// isArray
|
|
type ConnectionGetRemoteSubnetsAttributeType = *[]string
|
|
type ConnectionGetRemoteSubnetsArgType = []string
|
|
type ConnectionGetRemoteSubnetsRetType = []string
|
|
|
|
func getConnectionGetRemoteSubnetsAttributeTypeOk(arg ConnectionGetRemoteSubnetsAttributeType) (ret ConnectionGetRemoteSubnetsRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setConnectionGetRemoteSubnetsAttributeType(arg *ConnectionGetRemoteSubnetsAttributeType, val ConnectionGetRemoteSubnetsRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for tunnel1
|
|
*/
|
|
|
|
// isModel
|
|
type ConnectionGetTunnel1AttributeType = *ConnectionRequestTunnel1
|
|
type ConnectionGetTunnel1ArgType = ConnectionRequestTunnel1
|
|
type ConnectionGetTunnel1RetType = ConnectionRequestTunnel1
|
|
|
|
func getConnectionGetTunnel1AttributeTypeOk(arg ConnectionGetTunnel1AttributeType) (ret ConnectionGetTunnel1RetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setConnectionGetTunnel1AttributeType(arg *ConnectionGetTunnel1AttributeType, val ConnectionGetTunnel1RetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for tunnel2
|
|
*/
|
|
|
|
// isModel
|
|
type ConnectionGetTunnel2AttributeType = *ConnectionRequestTunnel1
|
|
type ConnectionGetTunnel2ArgType = ConnectionRequestTunnel1
|
|
type ConnectionGetTunnel2RetType = ConnectionRequestTunnel1
|
|
|
|
func getConnectionGetTunnel2AttributeTypeOk(arg ConnectionGetTunnel2AttributeType) (ret ConnectionGetTunnel2RetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setConnectionGetTunnel2AttributeType(arg *ConnectionGetTunnel2AttributeType, val ConnectionGetTunnel2RetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
// Connection struct for Connection
|
|
type Connection struct {
|
|
// This flag decides whether this connection should be enabled or disabled
|
|
Enabled ConnectiongetEnabledAttributeType `json:"enabled,omitempty"`
|
|
// Map of custom labels. Key and values must be max 63 chars, start/end with alphanumeric.
|
|
Labels ConnectionGetLabelsAttributeType `json:"labels,omitempty"`
|
|
// List of local subnets (IPv4 CIDR).
|
|
// REQUIRED
|
|
LocalSubnets ConnectionGetLocalSubnetsAttributeType `json:"localSubnets" required:"true"`
|
|
// The name of the connection. Maximum 20 characters (only alphanumeric and hyphens allowed). The name bust be unique within the parent Gateway. Currently renaming is not possible therefore deleting and re-creating the connection is necessary.
|
|
// REQUIRED
|
|
Name ConnectionGetNameAttributeType `json:"name" required:"true"`
|
|
// List of remote subnets (IPv4 CIDR).
|
|
// REQUIRED
|
|
RemoteSubnets ConnectionGetRemoteSubnetsAttributeType `json:"remoteSubnets" required:"true"`
|
|
// REQUIRED
|
|
Tunnel1 ConnectionGetTunnel1AttributeType `json:"tunnel1" required:"true"`
|
|
// REQUIRED
|
|
Tunnel2 ConnectionGetTunnel2AttributeType `json:"tunnel2" required:"true"`
|
|
}
|
|
|
|
type _Connection Connection
|
|
|
|
// NewConnection instantiates a new Connection 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 NewConnection(localSubnets ConnectionGetLocalSubnetsArgType, name ConnectionGetNameArgType, remoteSubnets ConnectionGetRemoteSubnetsArgType, tunnel1 ConnectionGetTunnel1ArgType, tunnel2 ConnectionGetTunnel2ArgType) *Connection {
|
|
this := Connection{}
|
|
setConnectionGetLocalSubnetsAttributeType(&this.LocalSubnets, localSubnets)
|
|
setConnectionGetNameAttributeType(&this.Name, name)
|
|
setConnectionGetRemoteSubnetsAttributeType(&this.RemoteSubnets, remoteSubnets)
|
|
setConnectionGetTunnel1AttributeType(&this.Tunnel1, tunnel1)
|
|
setConnectionGetTunnel2AttributeType(&this.Tunnel2, tunnel2)
|
|
return &this
|
|
}
|
|
|
|
// NewConnectionWithDefaults instantiates a new Connection 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 NewConnectionWithDefaults() *Connection {
|
|
this := Connection{}
|
|
return &this
|
|
}
|
|
|
|
// GetEnabled returns the Enabled field value if set, zero value otherwise.
|
|
func (o *Connection) GetEnabled() (res ConnectiongetEnabledRetType) {
|
|
res, _ = o.GetEnabledOk()
|
|
return
|
|
}
|
|
|
|
// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Connection) GetEnabledOk() (ret ConnectiongetEnabledRetType, ok bool) {
|
|
return getConnectiongetEnabledAttributeTypeOk(o.Enabled)
|
|
}
|
|
|
|
// HasEnabled returns a boolean if a field has been set.
|
|
func (o *Connection) HasEnabled() bool {
|
|
_, ok := o.GetEnabledOk()
|
|
return ok
|
|
}
|
|
|
|
// SetEnabled gets a reference to the given bool and assigns it to the Enabled field.
|
|
func (o *Connection) SetEnabled(v ConnectiongetEnabledRetType) {
|
|
setConnectiongetEnabledAttributeType(&o.Enabled, v)
|
|
}
|
|
|
|
// GetLabels returns the Labels field value if set, zero value otherwise.
|
|
func (o *Connection) GetLabels() (res ConnectionGetLabelsRetType) {
|
|
res, _ = o.GetLabelsOk()
|
|
return
|
|
}
|
|
|
|
// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Connection) GetLabelsOk() (ret ConnectionGetLabelsRetType, ok bool) {
|
|
return getConnectionGetLabelsAttributeTypeOk(o.Labels)
|
|
}
|
|
|
|
// HasLabels returns a boolean if a field has been set.
|
|
func (o *Connection) HasLabels() bool {
|
|
_, ok := o.GetLabelsOk()
|
|
return ok
|
|
}
|
|
|
|
// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field.
|
|
func (o *Connection) SetLabels(v ConnectionGetLabelsRetType) {
|
|
setConnectionGetLabelsAttributeType(&o.Labels, v)
|
|
}
|
|
|
|
// GetLocalSubnets returns the LocalSubnets field value
|
|
func (o *Connection) GetLocalSubnets() (ret ConnectionGetLocalSubnetsRetType) {
|
|
ret, _ = o.GetLocalSubnetsOk()
|
|
return ret
|
|
}
|
|
|
|
// GetLocalSubnetsOk returns a tuple with the LocalSubnets field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Connection) GetLocalSubnetsOk() (ret ConnectionGetLocalSubnetsRetType, ok bool) {
|
|
return getConnectionGetLocalSubnetsAttributeTypeOk(o.LocalSubnets)
|
|
}
|
|
|
|
// SetLocalSubnets sets field value
|
|
func (o *Connection) SetLocalSubnets(v ConnectionGetLocalSubnetsRetType) {
|
|
setConnectionGetLocalSubnetsAttributeType(&o.LocalSubnets, v)
|
|
}
|
|
|
|
// GetName returns the Name field value
|
|
func (o *Connection) GetName() (ret ConnectionGetNameRetType) {
|
|
ret, _ = o.GetNameOk()
|
|
return ret
|
|
}
|
|
|
|
// GetNameOk returns a tuple with the Name field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Connection) GetNameOk() (ret ConnectionGetNameRetType, ok bool) {
|
|
return getConnectionGetNameAttributeTypeOk(o.Name)
|
|
}
|
|
|
|
// SetName sets field value
|
|
func (o *Connection) SetName(v ConnectionGetNameRetType) {
|
|
setConnectionGetNameAttributeType(&o.Name, v)
|
|
}
|
|
|
|
// GetRemoteSubnets returns the RemoteSubnets field value
|
|
func (o *Connection) GetRemoteSubnets() (ret ConnectionGetRemoteSubnetsRetType) {
|
|
ret, _ = o.GetRemoteSubnetsOk()
|
|
return ret
|
|
}
|
|
|
|
// GetRemoteSubnetsOk returns a tuple with the RemoteSubnets field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Connection) GetRemoteSubnetsOk() (ret ConnectionGetRemoteSubnetsRetType, ok bool) {
|
|
return getConnectionGetRemoteSubnetsAttributeTypeOk(o.RemoteSubnets)
|
|
}
|
|
|
|
// SetRemoteSubnets sets field value
|
|
func (o *Connection) SetRemoteSubnets(v ConnectionGetRemoteSubnetsRetType) {
|
|
setConnectionGetRemoteSubnetsAttributeType(&o.RemoteSubnets, v)
|
|
}
|
|
|
|
// GetTunnel1 returns the Tunnel1 field value
|
|
func (o *Connection) GetTunnel1() (ret ConnectionGetTunnel1RetType) {
|
|
ret, _ = o.GetTunnel1Ok()
|
|
return ret
|
|
}
|
|
|
|
// GetTunnel1Ok returns a tuple with the Tunnel1 field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Connection) GetTunnel1Ok() (ret ConnectionGetTunnel1RetType, ok bool) {
|
|
return getConnectionGetTunnel1AttributeTypeOk(o.Tunnel1)
|
|
}
|
|
|
|
// SetTunnel1 sets field value
|
|
func (o *Connection) SetTunnel1(v ConnectionGetTunnel1RetType) {
|
|
setConnectionGetTunnel1AttributeType(&o.Tunnel1, v)
|
|
}
|
|
|
|
// GetTunnel2 returns the Tunnel2 field value
|
|
func (o *Connection) GetTunnel2() (ret ConnectionGetTunnel2RetType) {
|
|
ret, _ = o.GetTunnel2Ok()
|
|
return ret
|
|
}
|
|
|
|
// GetTunnel2Ok returns a tuple with the Tunnel2 field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Connection) GetTunnel2Ok() (ret ConnectionGetTunnel2RetType, ok bool) {
|
|
return getConnectionGetTunnel2AttributeTypeOk(o.Tunnel2)
|
|
}
|
|
|
|
// SetTunnel2 sets field value
|
|
func (o *Connection) SetTunnel2(v ConnectionGetTunnel2RetType) {
|
|
setConnectionGetTunnel2AttributeType(&o.Tunnel2, v)
|
|
}
|
|
|
|
func (o Connection) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if val, ok := getConnectiongetEnabledAttributeTypeOk(o.Enabled); ok {
|
|
toSerialize["Enabled"] = val
|
|
}
|
|
if val, ok := getConnectionGetLabelsAttributeTypeOk(o.Labels); ok {
|
|
toSerialize["Labels"] = val
|
|
}
|
|
if val, ok := getConnectionGetLocalSubnetsAttributeTypeOk(o.LocalSubnets); ok {
|
|
toSerialize["LocalSubnets"] = val
|
|
}
|
|
if val, ok := getConnectionGetNameAttributeTypeOk(o.Name); ok {
|
|
toSerialize["Name"] = val
|
|
}
|
|
if val, ok := getConnectionGetRemoteSubnetsAttributeTypeOk(o.RemoteSubnets); ok {
|
|
toSerialize["RemoteSubnets"] = val
|
|
}
|
|
if val, ok := getConnectionGetTunnel1AttributeTypeOk(o.Tunnel1); ok {
|
|
toSerialize["Tunnel1"] = val
|
|
}
|
|
if val, ok := getConnectionGetTunnel2AttributeTypeOk(o.Tunnel2); ok {
|
|
toSerialize["Tunnel2"] = val
|
|
}
|
|
return toSerialize, nil
|
|
}
|
|
|
|
type NullableConnection struct {
|
|
value *Connection
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableConnection) Get() *Connection {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableConnection) Set(val *Connection) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableConnection) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableConnection) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableConnection(val *Connection) *NullableConnection {
|
|
return &NullableConnection{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableConnection) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableConnection) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|