## 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
14 KiB
Go
397 lines
14 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 ConnectionRequest type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &ConnectionRequest{}
|
|
|
|
/*
|
|
types and functions for enabled
|
|
*/
|
|
|
|
// isBoolean
|
|
type ConnectionRequestgetEnabledAttributeType = *bool
|
|
type ConnectionRequestgetEnabledArgType = bool
|
|
type ConnectionRequestgetEnabledRetType = bool
|
|
|
|
func getConnectionRequestgetEnabledAttributeTypeOk(arg ConnectionRequestgetEnabledAttributeType) (ret ConnectionRequestgetEnabledRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setConnectionRequestgetEnabledAttributeType(arg *ConnectionRequestgetEnabledAttributeType, val ConnectionRequestgetEnabledRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for labels
|
|
*/
|
|
|
|
// isContainer
|
|
type ConnectionRequestGetLabelsAttributeType = *map[string]string
|
|
type ConnectionRequestGetLabelsArgType = map[string]string
|
|
type ConnectionRequestGetLabelsRetType = map[string]string
|
|
|
|
func getConnectionRequestGetLabelsAttributeTypeOk(arg ConnectionRequestGetLabelsAttributeType) (ret ConnectionRequestGetLabelsRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setConnectionRequestGetLabelsAttributeType(arg *ConnectionRequestGetLabelsAttributeType, val ConnectionRequestGetLabelsRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for localSubnets
|
|
*/
|
|
|
|
// isArray
|
|
type ConnectionRequestGetLocalSubnetsAttributeType = *[]string
|
|
type ConnectionRequestGetLocalSubnetsArgType = []string
|
|
type ConnectionRequestGetLocalSubnetsRetType = []string
|
|
|
|
func getConnectionRequestGetLocalSubnetsAttributeTypeOk(arg ConnectionRequestGetLocalSubnetsAttributeType) (ret ConnectionRequestGetLocalSubnetsRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setConnectionRequestGetLocalSubnetsAttributeType(arg *ConnectionRequestGetLocalSubnetsAttributeType, val ConnectionRequestGetLocalSubnetsRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for name
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type ConnectionRequestGetNameAttributeType = *string
|
|
|
|
func getConnectionRequestGetNameAttributeTypeOk(arg ConnectionRequestGetNameAttributeType) (ret ConnectionRequestGetNameRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setConnectionRequestGetNameAttributeType(arg *ConnectionRequestGetNameAttributeType, val ConnectionRequestGetNameRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type ConnectionRequestGetNameArgType = string
|
|
type ConnectionRequestGetNameRetType = string
|
|
|
|
/*
|
|
types and functions for remoteSubnets
|
|
*/
|
|
|
|
// isArray
|
|
type ConnectionRequestGetRemoteSubnetsAttributeType = *[]string
|
|
type ConnectionRequestGetRemoteSubnetsArgType = []string
|
|
type ConnectionRequestGetRemoteSubnetsRetType = []string
|
|
|
|
func getConnectionRequestGetRemoteSubnetsAttributeTypeOk(arg ConnectionRequestGetRemoteSubnetsAttributeType) (ret ConnectionRequestGetRemoteSubnetsRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setConnectionRequestGetRemoteSubnetsAttributeType(arg *ConnectionRequestGetRemoteSubnetsAttributeType, val ConnectionRequestGetRemoteSubnetsRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for tunnel1
|
|
*/
|
|
|
|
// isModel
|
|
type ConnectionRequestGetTunnel1AttributeType = *ConnectionRequestTunnel1
|
|
type ConnectionRequestGetTunnel1ArgType = ConnectionRequestTunnel1
|
|
type ConnectionRequestGetTunnel1RetType = ConnectionRequestTunnel1
|
|
|
|
func getConnectionRequestGetTunnel1AttributeTypeOk(arg ConnectionRequestGetTunnel1AttributeType) (ret ConnectionRequestGetTunnel1RetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setConnectionRequestGetTunnel1AttributeType(arg *ConnectionRequestGetTunnel1AttributeType, val ConnectionRequestGetTunnel1RetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for tunnel2
|
|
*/
|
|
|
|
// isModel
|
|
type ConnectionRequestGetTunnel2AttributeType = *ConnectionRequestTunnel1
|
|
type ConnectionRequestGetTunnel2ArgType = ConnectionRequestTunnel1
|
|
type ConnectionRequestGetTunnel2RetType = ConnectionRequestTunnel1
|
|
|
|
func getConnectionRequestGetTunnel2AttributeTypeOk(arg ConnectionRequestGetTunnel2AttributeType) (ret ConnectionRequestGetTunnel2RetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setConnectionRequestGetTunnel2AttributeType(arg *ConnectionRequestGetTunnel2AttributeType, val ConnectionRequestGetTunnel2RetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
// ConnectionRequest struct for ConnectionRequest
|
|
type ConnectionRequest struct {
|
|
// This flag decides whether this connection should be enabled or disabled
|
|
Enabled ConnectionRequestgetEnabledAttributeType `json:"enabled,omitempty"`
|
|
// Map of custom labels. Key and values must be max 63 chars, start/end with alphanumeric.
|
|
Labels ConnectionRequestGetLabelsAttributeType `json:"labels,omitempty"`
|
|
// List of local subnets (IPv4 CIDR).
|
|
// REQUIRED
|
|
LocalSubnets ConnectionRequestGetLocalSubnetsAttributeType `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 ConnectionRequestGetNameAttributeType `json:"name" required:"true"`
|
|
// List of remote subnets (IPv4 CIDR).
|
|
// REQUIRED
|
|
RemoteSubnets ConnectionRequestGetRemoteSubnetsAttributeType `json:"remoteSubnets" required:"true"`
|
|
// REQUIRED
|
|
Tunnel1 ConnectionRequestGetTunnel1AttributeType `json:"tunnel1" required:"true"`
|
|
// REQUIRED
|
|
Tunnel2 ConnectionRequestGetTunnel2AttributeType `json:"tunnel2" required:"true"`
|
|
}
|
|
|
|
type _ConnectionRequest ConnectionRequest
|
|
|
|
// NewConnectionRequest instantiates a new ConnectionRequest 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 NewConnectionRequest(localSubnets ConnectionRequestGetLocalSubnetsArgType, name ConnectionRequestGetNameArgType, remoteSubnets ConnectionRequestGetRemoteSubnetsArgType, tunnel1 ConnectionRequestGetTunnel1ArgType, tunnel2 ConnectionRequestGetTunnel2ArgType) *ConnectionRequest {
|
|
this := ConnectionRequest{}
|
|
setConnectionRequestGetLocalSubnetsAttributeType(&this.LocalSubnets, localSubnets)
|
|
setConnectionRequestGetNameAttributeType(&this.Name, name)
|
|
setConnectionRequestGetRemoteSubnetsAttributeType(&this.RemoteSubnets, remoteSubnets)
|
|
setConnectionRequestGetTunnel1AttributeType(&this.Tunnel1, tunnel1)
|
|
setConnectionRequestGetTunnel2AttributeType(&this.Tunnel2, tunnel2)
|
|
return &this
|
|
}
|
|
|
|
// NewConnectionRequestWithDefaults instantiates a new ConnectionRequest 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 NewConnectionRequestWithDefaults() *ConnectionRequest {
|
|
this := ConnectionRequest{}
|
|
return &this
|
|
}
|
|
|
|
// GetEnabled returns the Enabled field value if set, zero value otherwise.
|
|
func (o *ConnectionRequest) GetEnabled() (res ConnectionRequestgetEnabledRetType) {
|
|
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 *ConnectionRequest) GetEnabledOk() (ret ConnectionRequestgetEnabledRetType, ok bool) {
|
|
return getConnectionRequestgetEnabledAttributeTypeOk(o.Enabled)
|
|
}
|
|
|
|
// HasEnabled returns a boolean if a field has been set.
|
|
func (o *ConnectionRequest) HasEnabled() bool {
|
|
_, ok := o.GetEnabledOk()
|
|
return ok
|
|
}
|
|
|
|
// SetEnabled gets a reference to the given bool and assigns it to the Enabled field.
|
|
func (o *ConnectionRequest) SetEnabled(v ConnectionRequestgetEnabledRetType) {
|
|
setConnectionRequestgetEnabledAttributeType(&o.Enabled, v)
|
|
}
|
|
|
|
// GetLabels returns the Labels field value if set, zero value otherwise.
|
|
func (o *ConnectionRequest) GetLabels() (res ConnectionRequestGetLabelsRetType) {
|
|
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 *ConnectionRequest) GetLabelsOk() (ret ConnectionRequestGetLabelsRetType, ok bool) {
|
|
return getConnectionRequestGetLabelsAttributeTypeOk(o.Labels)
|
|
}
|
|
|
|
// HasLabels returns a boolean if a field has been set.
|
|
func (o *ConnectionRequest) 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 *ConnectionRequest) SetLabels(v ConnectionRequestGetLabelsRetType) {
|
|
setConnectionRequestGetLabelsAttributeType(&o.Labels, v)
|
|
}
|
|
|
|
// GetLocalSubnets returns the LocalSubnets field value
|
|
func (o *ConnectionRequest) GetLocalSubnets() (ret ConnectionRequestGetLocalSubnetsRetType) {
|
|
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 *ConnectionRequest) GetLocalSubnetsOk() (ret ConnectionRequestGetLocalSubnetsRetType, ok bool) {
|
|
return getConnectionRequestGetLocalSubnetsAttributeTypeOk(o.LocalSubnets)
|
|
}
|
|
|
|
// SetLocalSubnets sets field value
|
|
func (o *ConnectionRequest) SetLocalSubnets(v ConnectionRequestGetLocalSubnetsRetType) {
|
|
setConnectionRequestGetLocalSubnetsAttributeType(&o.LocalSubnets, v)
|
|
}
|
|
|
|
// GetName returns the Name field value
|
|
func (o *ConnectionRequest) GetName() (ret ConnectionRequestGetNameRetType) {
|
|
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 *ConnectionRequest) GetNameOk() (ret ConnectionRequestGetNameRetType, ok bool) {
|
|
return getConnectionRequestGetNameAttributeTypeOk(o.Name)
|
|
}
|
|
|
|
// SetName sets field value
|
|
func (o *ConnectionRequest) SetName(v ConnectionRequestGetNameRetType) {
|
|
setConnectionRequestGetNameAttributeType(&o.Name, v)
|
|
}
|
|
|
|
// GetRemoteSubnets returns the RemoteSubnets field value
|
|
func (o *ConnectionRequest) GetRemoteSubnets() (ret ConnectionRequestGetRemoteSubnetsRetType) {
|
|
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 *ConnectionRequest) GetRemoteSubnetsOk() (ret ConnectionRequestGetRemoteSubnetsRetType, ok bool) {
|
|
return getConnectionRequestGetRemoteSubnetsAttributeTypeOk(o.RemoteSubnets)
|
|
}
|
|
|
|
// SetRemoteSubnets sets field value
|
|
func (o *ConnectionRequest) SetRemoteSubnets(v ConnectionRequestGetRemoteSubnetsRetType) {
|
|
setConnectionRequestGetRemoteSubnetsAttributeType(&o.RemoteSubnets, v)
|
|
}
|
|
|
|
// GetTunnel1 returns the Tunnel1 field value
|
|
func (o *ConnectionRequest) GetTunnel1() (ret ConnectionRequestGetTunnel1RetType) {
|
|
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 *ConnectionRequest) GetTunnel1Ok() (ret ConnectionRequestGetTunnel1RetType, ok bool) {
|
|
return getConnectionRequestGetTunnel1AttributeTypeOk(o.Tunnel1)
|
|
}
|
|
|
|
// SetTunnel1 sets field value
|
|
func (o *ConnectionRequest) SetTunnel1(v ConnectionRequestGetTunnel1RetType) {
|
|
setConnectionRequestGetTunnel1AttributeType(&o.Tunnel1, v)
|
|
}
|
|
|
|
// GetTunnel2 returns the Tunnel2 field value
|
|
func (o *ConnectionRequest) GetTunnel2() (ret ConnectionRequestGetTunnel2RetType) {
|
|
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 *ConnectionRequest) GetTunnel2Ok() (ret ConnectionRequestGetTunnel2RetType, ok bool) {
|
|
return getConnectionRequestGetTunnel2AttributeTypeOk(o.Tunnel2)
|
|
}
|
|
|
|
// SetTunnel2 sets field value
|
|
func (o *ConnectionRequest) SetTunnel2(v ConnectionRequestGetTunnel2RetType) {
|
|
setConnectionRequestGetTunnel2AttributeType(&o.Tunnel2, v)
|
|
}
|
|
|
|
func (o ConnectionRequest) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if val, ok := getConnectionRequestgetEnabledAttributeTypeOk(o.Enabled); ok {
|
|
toSerialize["Enabled"] = val
|
|
}
|
|
if val, ok := getConnectionRequestGetLabelsAttributeTypeOk(o.Labels); ok {
|
|
toSerialize["Labels"] = val
|
|
}
|
|
if val, ok := getConnectionRequestGetLocalSubnetsAttributeTypeOk(o.LocalSubnets); ok {
|
|
toSerialize["LocalSubnets"] = val
|
|
}
|
|
if val, ok := getConnectionRequestGetNameAttributeTypeOk(o.Name); ok {
|
|
toSerialize["Name"] = val
|
|
}
|
|
if val, ok := getConnectionRequestGetRemoteSubnetsAttributeTypeOk(o.RemoteSubnets); ok {
|
|
toSerialize["RemoteSubnets"] = val
|
|
}
|
|
if val, ok := getConnectionRequestGetTunnel1AttributeTypeOk(o.Tunnel1); ok {
|
|
toSerialize["Tunnel1"] = val
|
|
}
|
|
if val, ok := getConnectionRequestGetTunnel2AttributeTypeOk(o.Tunnel2); ok {
|
|
toSerialize["Tunnel2"] = val
|
|
}
|
|
return toSerialize, nil
|
|
}
|
|
|
|
type NullableConnectionRequest struct {
|
|
value *ConnectionRequest
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableConnectionRequest) Get() *ConnectionRequest {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableConnectionRequest) Set(val *ConnectionRequest) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableConnectionRequest) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableConnectionRequest) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableConnectionRequest(val *ConnectionRequest) *NullableConnectionRequest {
|
|
return &NullableConnectionRequest{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableConnectionRequest) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableConnectionRequest) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|