349 lines
12 KiB
Go
349 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 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 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"`
|
|
// 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)
|
|
}
|
|
|
|
// 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 := 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)
|
|
}
|