349 lines
14 KiB
Go
349 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 CreateGatewayConnectionPayload type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &CreateGatewayConnectionPayload{}
|
|
|
|
/*
|
|
types and functions for enabled
|
|
*/
|
|
|
|
// isBoolean
|
|
type CreateGatewayConnectionPayloadgetEnabledAttributeType = *bool
|
|
type CreateGatewayConnectionPayloadgetEnabledArgType = bool
|
|
type CreateGatewayConnectionPayloadgetEnabledRetType = bool
|
|
|
|
func getCreateGatewayConnectionPayloadgetEnabledAttributeTypeOk(arg CreateGatewayConnectionPayloadgetEnabledAttributeType) (ret CreateGatewayConnectionPayloadgetEnabledRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setCreateGatewayConnectionPayloadgetEnabledAttributeType(arg *CreateGatewayConnectionPayloadgetEnabledAttributeType, val CreateGatewayConnectionPayloadgetEnabledRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for localSubnets
|
|
*/
|
|
|
|
// isArray
|
|
type CreateGatewayConnectionPayloadGetLocalSubnetsAttributeType = *[]string
|
|
type CreateGatewayConnectionPayloadGetLocalSubnetsArgType = []string
|
|
type CreateGatewayConnectionPayloadGetLocalSubnetsRetType = []string
|
|
|
|
func getCreateGatewayConnectionPayloadGetLocalSubnetsAttributeTypeOk(arg CreateGatewayConnectionPayloadGetLocalSubnetsAttributeType) (ret CreateGatewayConnectionPayloadGetLocalSubnetsRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setCreateGatewayConnectionPayloadGetLocalSubnetsAttributeType(arg *CreateGatewayConnectionPayloadGetLocalSubnetsAttributeType, val CreateGatewayConnectionPayloadGetLocalSubnetsRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for name
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type CreateGatewayConnectionPayloadGetNameAttributeType = *string
|
|
|
|
func getCreateGatewayConnectionPayloadGetNameAttributeTypeOk(arg CreateGatewayConnectionPayloadGetNameAttributeType) (ret CreateGatewayConnectionPayloadGetNameRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setCreateGatewayConnectionPayloadGetNameAttributeType(arg *CreateGatewayConnectionPayloadGetNameAttributeType, val CreateGatewayConnectionPayloadGetNameRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type CreateGatewayConnectionPayloadGetNameArgType = string
|
|
type CreateGatewayConnectionPayloadGetNameRetType = string
|
|
|
|
/*
|
|
types and functions for remoteSubnets
|
|
*/
|
|
|
|
// isArray
|
|
type CreateGatewayConnectionPayloadGetRemoteSubnetsAttributeType = *[]string
|
|
type CreateGatewayConnectionPayloadGetRemoteSubnetsArgType = []string
|
|
type CreateGatewayConnectionPayloadGetRemoteSubnetsRetType = []string
|
|
|
|
func getCreateGatewayConnectionPayloadGetRemoteSubnetsAttributeTypeOk(arg CreateGatewayConnectionPayloadGetRemoteSubnetsAttributeType) (ret CreateGatewayConnectionPayloadGetRemoteSubnetsRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setCreateGatewayConnectionPayloadGetRemoteSubnetsAttributeType(arg *CreateGatewayConnectionPayloadGetRemoteSubnetsAttributeType, val CreateGatewayConnectionPayloadGetRemoteSubnetsRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for tunnel1
|
|
*/
|
|
|
|
// isModel
|
|
type CreateGatewayConnectionPayloadGetTunnel1AttributeType = *ConnectionRequestTunnel1
|
|
type CreateGatewayConnectionPayloadGetTunnel1ArgType = ConnectionRequestTunnel1
|
|
type CreateGatewayConnectionPayloadGetTunnel1RetType = ConnectionRequestTunnel1
|
|
|
|
func getCreateGatewayConnectionPayloadGetTunnel1AttributeTypeOk(arg CreateGatewayConnectionPayloadGetTunnel1AttributeType) (ret CreateGatewayConnectionPayloadGetTunnel1RetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setCreateGatewayConnectionPayloadGetTunnel1AttributeType(arg *CreateGatewayConnectionPayloadGetTunnel1AttributeType, val CreateGatewayConnectionPayloadGetTunnel1RetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for tunnel2
|
|
*/
|
|
|
|
// isModel
|
|
type CreateGatewayConnectionPayloadGetTunnel2AttributeType = *ConnectionRequestTunnel1
|
|
type CreateGatewayConnectionPayloadGetTunnel2ArgType = ConnectionRequestTunnel1
|
|
type CreateGatewayConnectionPayloadGetTunnel2RetType = ConnectionRequestTunnel1
|
|
|
|
func getCreateGatewayConnectionPayloadGetTunnel2AttributeTypeOk(arg CreateGatewayConnectionPayloadGetTunnel2AttributeType) (ret CreateGatewayConnectionPayloadGetTunnel2RetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setCreateGatewayConnectionPayloadGetTunnel2AttributeType(arg *CreateGatewayConnectionPayloadGetTunnel2AttributeType, val CreateGatewayConnectionPayloadGetTunnel2RetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
// CreateGatewayConnectionPayload struct for CreateGatewayConnectionPayload
|
|
type CreateGatewayConnectionPayload struct {
|
|
// This flag decides whether this connection should be enabled or disabled
|
|
Enabled CreateGatewayConnectionPayloadgetEnabledAttributeType `json:"enabled,omitempty"`
|
|
// List of local subnets (IPv4 CIDR).
|
|
// REQUIRED
|
|
LocalSubnets CreateGatewayConnectionPayloadGetLocalSubnetsAttributeType `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 CreateGatewayConnectionPayloadGetNameAttributeType `json:"name" required:"true"`
|
|
// List of remote subnets (IPv4 CIDR).
|
|
// REQUIRED
|
|
RemoteSubnets CreateGatewayConnectionPayloadGetRemoteSubnetsAttributeType `json:"remoteSubnets" required:"true"`
|
|
// REQUIRED
|
|
Tunnel1 CreateGatewayConnectionPayloadGetTunnel1AttributeType `json:"tunnel1" required:"true"`
|
|
// REQUIRED
|
|
Tunnel2 CreateGatewayConnectionPayloadGetTunnel2AttributeType `json:"tunnel2" required:"true"`
|
|
}
|
|
|
|
type _CreateGatewayConnectionPayload CreateGatewayConnectionPayload
|
|
|
|
// NewCreateGatewayConnectionPayload instantiates a new CreateGatewayConnectionPayload 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 NewCreateGatewayConnectionPayload(localSubnets CreateGatewayConnectionPayloadGetLocalSubnetsArgType, name CreateGatewayConnectionPayloadGetNameArgType, remoteSubnets CreateGatewayConnectionPayloadGetRemoteSubnetsArgType, tunnel1 CreateGatewayConnectionPayloadGetTunnel1ArgType, tunnel2 CreateGatewayConnectionPayloadGetTunnel2ArgType) *CreateGatewayConnectionPayload {
|
|
this := CreateGatewayConnectionPayload{}
|
|
setCreateGatewayConnectionPayloadGetLocalSubnetsAttributeType(&this.LocalSubnets, localSubnets)
|
|
setCreateGatewayConnectionPayloadGetNameAttributeType(&this.Name, name)
|
|
setCreateGatewayConnectionPayloadGetRemoteSubnetsAttributeType(&this.RemoteSubnets, remoteSubnets)
|
|
setCreateGatewayConnectionPayloadGetTunnel1AttributeType(&this.Tunnel1, tunnel1)
|
|
setCreateGatewayConnectionPayloadGetTunnel2AttributeType(&this.Tunnel2, tunnel2)
|
|
return &this
|
|
}
|
|
|
|
// NewCreateGatewayConnectionPayloadWithDefaults instantiates a new CreateGatewayConnectionPayload 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 NewCreateGatewayConnectionPayloadWithDefaults() *CreateGatewayConnectionPayload {
|
|
this := CreateGatewayConnectionPayload{}
|
|
return &this
|
|
}
|
|
|
|
// GetEnabled returns the Enabled field value if set, zero value otherwise.
|
|
func (o *CreateGatewayConnectionPayload) GetEnabled() (res CreateGatewayConnectionPayloadgetEnabledRetType) {
|
|
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 *CreateGatewayConnectionPayload) GetEnabledOk() (ret CreateGatewayConnectionPayloadgetEnabledRetType, ok bool) {
|
|
return getCreateGatewayConnectionPayloadgetEnabledAttributeTypeOk(o.Enabled)
|
|
}
|
|
|
|
// HasEnabled returns a boolean if a field has been set.
|
|
func (o *CreateGatewayConnectionPayload) HasEnabled() bool {
|
|
_, ok := o.GetEnabledOk()
|
|
return ok
|
|
}
|
|
|
|
// SetEnabled gets a reference to the given bool and assigns it to the Enabled field.
|
|
func (o *CreateGatewayConnectionPayload) SetEnabled(v CreateGatewayConnectionPayloadgetEnabledRetType) {
|
|
setCreateGatewayConnectionPayloadgetEnabledAttributeType(&o.Enabled, v)
|
|
}
|
|
|
|
// GetLocalSubnets returns the LocalSubnets field value
|
|
func (o *CreateGatewayConnectionPayload) GetLocalSubnets() (ret CreateGatewayConnectionPayloadGetLocalSubnetsRetType) {
|
|
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 *CreateGatewayConnectionPayload) GetLocalSubnetsOk() (ret CreateGatewayConnectionPayloadGetLocalSubnetsRetType, ok bool) {
|
|
return getCreateGatewayConnectionPayloadGetLocalSubnetsAttributeTypeOk(o.LocalSubnets)
|
|
}
|
|
|
|
// SetLocalSubnets sets field value
|
|
func (o *CreateGatewayConnectionPayload) SetLocalSubnets(v CreateGatewayConnectionPayloadGetLocalSubnetsRetType) {
|
|
setCreateGatewayConnectionPayloadGetLocalSubnetsAttributeType(&o.LocalSubnets, v)
|
|
}
|
|
|
|
// GetName returns the Name field value
|
|
func (o *CreateGatewayConnectionPayload) GetName() (ret CreateGatewayConnectionPayloadGetNameRetType) {
|
|
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 *CreateGatewayConnectionPayload) GetNameOk() (ret CreateGatewayConnectionPayloadGetNameRetType, ok bool) {
|
|
return getCreateGatewayConnectionPayloadGetNameAttributeTypeOk(o.Name)
|
|
}
|
|
|
|
// SetName sets field value
|
|
func (o *CreateGatewayConnectionPayload) SetName(v CreateGatewayConnectionPayloadGetNameRetType) {
|
|
setCreateGatewayConnectionPayloadGetNameAttributeType(&o.Name, v)
|
|
}
|
|
|
|
// GetRemoteSubnets returns the RemoteSubnets field value
|
|
func (o *CreateGatewayConnectionPayload) GetRemoteSubnets() (ret CreateGatewayConnectionPayloadGetRemoteSubnetsRetType) {
|
|
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 *CreateGatewayConnectionPayload) GetRemoteSubnetsOk() (ret CreateGatewayConnectionPayloadGetRemoteSubnetsRetType, ok bool) {
|
|
return getCreateGatewayConnectionPayloadGetRemoteSubnetsAttributeTypeOk(o.RemoteSubnets)
|
|
}
|
|
|
|
// SetRemoteSubnets sets field value
|
|
func (o *CreateGatewayConnectionPayload) SetRemoteSubnets(v CreateGatewayConnectionPayloadGetRemoteSubnetsRetType) {
|
|
setCreateGatewayConnectionPayloadGetRemoteSubnetsAttributeType(&o.RemoteSubnets, v)
|
|
}
|
|
|
|
// GetTunnel1 returns the Tunnel1 field value
|
|
func (o *CreateGatewayConnectionPayload) GetTunnel1() (ret CreateGatewayConnectionPayloadGetTunnel1RetType) {
|
|
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 *CreateGatewayConnectionPayload) GetTunnel1Ok() (ret CreateGatewayConnectionPayloadGetTunnel1RetType, ok bool) {
|
|
return getCreateGatewayConnectionPayloadGetTunnel1AttributeTypeOk(o.Tunnel1)
|
|
}
|
|
|
|
// SetTunnel1 sets field value
|
|
func (o *CreateGatewayConnectionPayload) SetTunnel1(v CreateGatewayConnectionPayloadGetTunnel1RetType) {
|
|
setCreateGatewayConnectionPayloadGetTunnel1AttributeType(&o.Tunnel1, v)
|
|
}
|
|
|
|
// GetTunnel2 returns the Tunnel2 field value
|
|
func (o *CreateGatewayConnectionPayload) GetTunnel2() (ret CreateGatewayConnectionPayloadGetTunnel2RetType) {
|
|
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 *CreateGatewayConnectionPayload) GetTunnel2Ok() (ret CreateGatewayConnectionPayloadGetTunnel2RetType, ok bool) {
|
|
return getCreateGatewayConnectionPayloadGetTunnel2AttributeTypeOk(o.Tunnel2)
|
|
}
|
|
|
|
// SetTunnel2 sets field value
|
|
func (o *CreateGatewayConnectionPayload) SetTunnel2(v CreateGatewayConnectionPayloadGetTunnel2RetType) {
|
|
setCreateGatewayConnectionPayloadGetTunnel2AttributeType(&o.Tunnel2, v)
|
|
}
|
|
|
|
func (o CreateGatewayConnectionPayload) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if val, ok := getCreateGatewayConnectionPayloadgetEnabledAttributeTypeOk(o.Enabled); ok {
|
|
toSerialize["Enabled"] = val
|
|
}
|
|
if val, ok := getCreateGatewayConnectionPayloadGetLocalSubnetsAttributeTypeOk(o.LocalSubnets); ok {
|
|
toSerialize["LocalSubnets"] = val
|
|
}
|
|
if val, ok := getCreateGatewayConnectionPayloadGetNameAttributeTypeOk(o.Name); ok {
|
|
toSerialize["Name"] = val
|
|
}
|
|
if val, ok := getCreateGatewayConnectionPayloadGetRemoteSubnetsAttributeTypeOk(o.RemoteSubnets); ok {
|
|
toSerialize["RemoteSubnets"] = val
|
|
}
|
|
if val, ok := getCreateGatewayConnectionPayloadGetTunnel1AttributeTypeOk(o.Tunnel1); ok {
|
|
toSerialize["Tunnel1"] = val
|
|
}
|
|
if val, ok := getCreateGatewayConnectionPayloadGetTunnel2AttributeTypeOk(o.Tunnel2); ok {
|
|
toSerialize["Tunnel2"] = val
|
|
}
|
|
return toSerialize, nil
|
|
}
|
|
|
|
type NullableCreateGatewayConnectionPayload struct {
|
|
value *CreateGatewayConnectionPayload
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableCreateGatewayConnectionPayload) Get() *CreateGatewayConnectionPayload {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableCreateGatewayConnectionPayload) Set(val *CreateGatewayConnectionPayload) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableCreateGatewayConnectionPayload) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableCreateGatewayConnectionPayload) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableCreateGatewayConnectionPayload(val *CreateGatewayConnectionPayload) *NullableCreateGatewayConnectionPayload {
|
|
return &NullableCreateGatewayConnectionPayload{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableCreateGatewayConnectionPayload) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableCreateGatewayConnectionPayload) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|