terraform-provider-stackitp.../pkg/vpnalpha/model_update_gateway_connection_payload.go
2026-01-21 09:07:29 +01:00

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 UpdateGatewayConnectionPayload type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &UpdateGatewayConnectionPayload{}
/*
types and functions for enabled
*/
// isBoolean
type UpdateGatewayConnectionPayloadgetEnabledAttributeType = *bool
type UpdateGatewayConnectionPayloadgetEnabledArgType = bool
type UpdateGatewayConnectionPayloadgetEnabledRetType = bool
func getUpdateGatewayConnectionPayloadgetEnabledAttributeTypeOk(arg UpdateGatewayConnectionPayloadgetEnabledAttributeType) (ret UpdateGatewayConnectionPayloadgetEnabledRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setUpdateGatewayConnectionPayloadgetEnabledAttributeType(arg *UpdateGatewayConnectionPayloadgetEnabledAttributeType, val UpdateGatewayConnectionPayloadgetEnabledRetType) {
*arg = &val
}
/*
types and functions for localSubnets
*/
// isArray
type UpdateGatewayConnectionPayloadGetLocalSubnetsAttributeType = *[]string
type UpdateGatewayConnectionPayloadGetLocalSubnetsArgType = []string
type UpdateGatewayConnectionPayloadGetLocalSubnetsRetType = []string
func getUpdateGatewayConnectionPayloadGetLocalSubnetsAttributeTypeOk(arg UpdateGatewayConnectionPayloadGetLocalSubnetsAttributeType) (ret UpdateGatewayConnectionPayloadGetLocalSubnetsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setUpdateGatewayConnectionPayloadGetLocalSubnetsAttributeType(arg *UpdateGatewayConnectionPayloadGetLocalSubnetsAttributeType, val UpdateGatewayConnectionPayloadGetLocalSubnetsRetType) {
*arg = &val
}
/*
types and functions for name
*/
// isNotNullableString
type UpdateGatewayConnectionPayloadGetNameAttributeType = *string
func getUpdateGatewayConnectionPayloadGetNameAttributeTypeOk(arg UpdateGatewayConnectionPayloadGetNameAttributeType) (ret UpdateGatewayConnectionPayloadGetNameRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setUpdateGatewayConnectionPayloadGetNameAttributeType(arg *UpdateGatewayConnectionPayloadGetNameAttributeType, val UpdateGatewayConnectionPayloadGetNameRetType) {
*arg = &val
}
type UpdateGatewayConnectionPayloadGetNameArgType = string
type UpdateGatewayConnectionPayloadGetNameRetType = string
/*
types and functions for remoteSubnets
*/
// isArray
type UpdateGatewayConnectionPayloadGetRemoteSubnetsAttributeType = *[]string
type UpdateGatewayConnectionPayloadGetRemoteSubnetsArgType = []string
type UpdateGatewayConnectionPayloadGetRemoteSubnetsRetType = []string
func getUpdateGatewayConnectionPayloadGetRemoteSubnetsAttributeTypeOk(arg UpdateGatewayConnectionPayloadGetRemoteSubnetsAttributeType) (ret UpdateGatewayConnectionPayloadGetRemoteSubnetsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setUpdateGatewayConnectionPayloadGetRemoteSubnetsAttributeType(arg *UpdateGatewayConnectionPayloadGetRemoteSubnetsAttributeType, val UpdateGatewayConnectionPayloadGetRemoteSubnetsRetType) {
*arg = &val
}
/*
types and functions for tunnel1
*/
// isModel
type UpdateGatewayConnectionPayloadGetTunnel1AttributeType = *ConnectionRequestTunnel1
type UpdateGatewayConnectionPayloadGetTunnel1ArgType = ConnectionRequestTunnel1
type UpdateGatewayConnectionPayloadGetTunnel1RetType = ConnectionRequestTunnel1
func getUpdateGatewayConnectionPayloadGetTunnel1AttributeTypeOk(arg UpdateGatewayConnectionPayloadGetTunnel1AttributeType) (ret UpdateGatewayConnectionPayloadGetTunnel1RetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setUpdateGatewayConnectionPayloadGetTunnel1AttributeType(arg *UpdateGatewayConnectionPayloadGetTunnel1AttributeType, val UpdateGatewayConnectionPayloadGetTunnel1RetType) {
*arg = &val
}
/*
types and functions for tunnel2
*/
// isModel
type UpdateGatewayConnectionPayloadGetTunnel2AttributeType = *ConnectionRequestTunnel1
type UpdateGatewayConnectionPayloadGetTunnel2ArgType = ConnectionRequestTunnel1
type UpdateGatewayConnectionPayloadGetTunnel2RetType = ConnectionRequestTunnel1
func getUpdateGatewayConnectionPayloadGetTunnel2AttributeTypeOk(arg UpdateGatewayConnectionPayloadGetTunnel2AttributeType) (ret UpdateGatewayConnectionPayloadGetTunnel2RetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setUpdateGatewayConnectionPayloadGetTunnel2AttributeType(arg *UpdateGatewayConnectionPayloadGetTunnel2AttributeType, val UpdateGatewayConnectionPayloadGetTunnel2RetType) {
*arg = &val
}
// UpdateGatewayConnectionPayload struct for UpdateGatewayConnectionPayload
type UpdateGatewayConnectionPayload struct {
// This flag decides whether this connection should be enabled or disabled
Enabled UpdateGatewayConnectionPayloadgetEnabledAttributeType `json:"enabled,omitempty"`
// List of local subnets (IPv4 CIDR).
// REQUIRED
LocalSubnets UpdateGatewayConnectionPayloadGetLocalSubnetsAttributeType `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 UpdateGatewayConnectionPayloadGetNameAttributeType `json:"name" required:"true"`
// List of remote subnets (IPv4 CIDR).
// REQUIRED
RemoteSubnets UpdateGatewayConnectionPayloadGetRemoteSubnetsAttributeType `json:"remoteSubnets" required:"true"`
// REQUIRED
Tunnel1 UpdateGatewayConnectionPayloadGetTunnel1AttributeType `json:"tunnel1" required:"true"`
// REQUIRED
Tunnel2 UpdateGatewayConnectionPayloadGetTunnel2AttributeType `json:"tunnel2" required:"true"`
}
type _UpdateGatewayConnectionPayload UpdateGatewayConnectionPayload
// NewUpdateGatewayConnectionPayload instantiates a new UpdateGatewayConnectionPayload 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 NewUpdateGatewayConnectionPayload(localSubnets UpdateGatewayConnectionPayloadGetLocalSubnetsArgType, name UpdateGatewayConnectionPayloadGetNameArgType, remoteSubnets UpdateGatewayConnectionPayloadGetRemoteSubnetsArgType, tunnel1 UpdateGatewayConnectionPayloadGetTunnel1ArgType, tunnel2 UpdateGatewayConnectionPayloadGetTunnel2ArgType) *UpdateGatewayConnectionPayload {
this := UpdateGatewayConnectionPayload{}
setUpdateGatewayConnectionPayloadGetLocalSubnetsAttributeType(&this.LocalSubnets, localSubnets)
setUpdateGatewayConnectionPayloadGetNameAttributeType(&this.Name, name)
setUpdateGatewayConnectionPayloadGetRemoteSubnetsAttributeType(&this.RemoteSubnets, remoteSubnets)
setUpdateGatewayConnectionPayloadGetTunnel1AttributeType(&this.Tunnel1, tunnel1)
setUpdateGatewayConnectionPayloadGetTunnel2AttributeType(&this.Tunnel2, tunnel2)
return &this
}
// NewUpdateGatewayConnectionPayloadWithDefaults instantiates a new UpdateGatewayConnectionPayload 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 NewUpdateGatewayConnectionPayloadWithDefaults() *UpdateGatewayConnectionPayload {
this := UpdateGatewayConnectionPayload{}
return &this
}
// GetEnabled returns the Enabled field value if set, zero value otherwise.
func (o *UpdateGatewayConnectionPayload) GetEnabled() (res UpdateGatewayConnectionPayloadgetEnabledRetType) {
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 *UpdateGatewayConnectionPayload) GetEnabledOk() (ret UpdateGatewayConnectionPayloadgetEnabledRetType, ok bool) {
return getUpdateGatewayConnectionPayloadgetEnabledAttributeTypeOk(o.Enabled)
}
// HasEnabled returns a boolean if a field has been set.
func (o *UpdateGatewayConnectionPayload) HasEnabled() bool {
_, ok := o.GetEnabledOk()
return ok
}
// SetEnabled gets a reference to the given bool and assigns it to the Enabled field.
func (o *UpdateGatewayConnectionPayload) SetEnabled(v UpdateGatewayConnectionPayloadgetEnabledRetType) {
setUpdateGatewayConnectionPayloadgetEnabledAttributeType(&o.Enabled, v)
}
// GetLocalSubnets returns the LocalSubnets field value
func (o *UpdateGatewayConnectionPayload) GetLocalSubnets() (ret UpdateGatewayConnectionPayloadGetLocalSubnetsRetType) {
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 *UpdateGatewayConnectionPayload) GetLocalSubnetsOk() (ret UpdateGatewayConnectionPayloadGetLocalSubnetsRetType, ok bool) {
return getUpdateGatewayConnectionPayloadGetLocalSubnetsAttributeTypeOk(o.LocalSubnets)
}
// SetLocalSubnets sets field value
func (o *UpdateGatewayConnectionPayload) SetLocalSubnets(v UpdateGatewayConnectionPayloadGetLocalSubnetsRetType) {
setUpdateGatewayConnectionPayloadGetLocalSubnetsAttributeType(&o.LocalSubnets, v)
}
// GetName returns the Name field value
func (o *UpdateGatewayConnectionPayload) GetName() (ret UpdateGatewayConnectionPayloadGetNameRetType) {
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 *UpdateGatewayConnectionPayload) GetNameOk() (ret UpdateGatewayConnectionPayloadGetNameRetType, ok bool) {
return getUpdateGatewayConnectionPayloadGetNameAttributeTypeOk(o.Name)
}
// SetName sets field value
func (o *UpdateGatewayConnectionPayload) SetName(v UpdateGatewayConnectionPayloadGetNameRetType) {
setUpdateGatewayConnectionPayloadGetNameAttributeType(&o.Name, v)
}
// GetRemoteSubnets returns the RemoteSubnets field value
func (o *UpdateGatewayConnectionPayload) GetRemoteSubnets() (ret UpdateGatewayConnectionPayloadGetRemoteSubnetsRetType) {
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 *UpdateGatewayConnectionPayload) GetRemoteSubnetsOk() (ret UpdateGatewayConnectionPayloadGetRemoteSubnetsRetType, ok bool) {
return getUpdateGatewayConnectionPayloadGetRemoteSubnetsAttributeTypeOk(o.RemoteSubnets)
}
// SetRemoteSubnets sets field value
func (o *UpdateGatewayConnectionPayload) SetRemoteSubnets(v UpdateGatewayConnectionPayloadGetRemoteSubnetsRetType) {
setUpdateGatewayConnectionPayloadGetRemoteSubnetsAttributeType(&o.RemoteSubnets, v)
}
// GetTunnel1 returns the Tunnel1 field value
func (o *UpdateGatewayConnectionPayload) GetTunnel1() (ret UpdateGatewayConnectionPayloadGetTunnel1RetType) {
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 *UpdateGatewayConnectionPayload) GetTunnel1Ok() (ret UpdateGatewayConnectionPayloadGetTunnel1RetType, ok bool) {
return getUpdateGatewayConnectionPayloadGetTunnel1AttributeTypeOk(o.Tunnel1)
}
// SetTunnel1 sets field value
func (o *UpdateGatewayConnectionPayload) SetTunnel1(v UpdateGatewayConnectionPayloadGetTunnel1RetType) {
setUpdateGatewayConnectionPayloadGetTunnel1AttributeType(&o.Tunnel1, v)
}
// GetTunnel2 returns the Tunnel2 field value
func (o *UpdateGatewayConnectionPayload) GetTunnel2() (ret UpdateGatewayConnectionPayloadGetTunnel2RetType) {
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 *UpdateGatewayConnectionPayload) GetTunnel2Ok() (ret UpdateGatewayConnectionPayloadGetTunnel2RetType, ok bool) {
return getUpdateGatewayConnectionPayloadGetTunnel2AttributeTypeOk(o.Tunnel2)
}
// SetTunnel2 sets field value
func (o *UpdateGatewayConnectionPayload) SetTunnel2(v UpdateGatewayConnectionPayloadGetTunnel2RetType) {
setUpdateGatewayConnectionPayloadGetTunnel2AttributeType(&o.Tunnel2, v)
}
func (o UpdateGatewayConnectionPayload) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getUpdateGatewayConnectionPayloadgetEnabledAttributeTypeOk(o.Enabled); ok {
toSerialize["Enabled"] = val
}
if val, ok := getUpdateGatewayConnectionPayloadGetLocalSubnetsAttributeTypeOk(o.LocalSubnets); ok {
toSerialize["LocalSubnets"] = val
}
if val, ok := getUpdateGatewayConnectionPayloadGetNameAttributeTypeOk(o.Name); ok {
toSerialize["Name"] = val
}
if val, ok := getUpdateGatewayConnectionPayloadGetRemoteSubnetsAttributeTypeOk(o.RemoteSubnets); ok {
toSerialize["RemoteSubnets"] = val
}
if val, ok := getUpdateGatewayConnectionPayloadGetTunnel1AttributeTypeOk(o.Tunnel1); ok {
toSerialize["Tunnel1"] = val
}
if val, ok := getUpdateGatewayConnectionPayloadGetTunnel2AttributeTypeOk(o.Tunnel2); ok {
toSerialize["Tunnel2"] = val
}
return toSerialize, nil
}
type NullableUpdateGatewayConnectionPayload struct {
value *UpdateGatewayConnectionPayload
isSet bool
}
func (v NullableUpdateGatewayConnectionPayload) Get() *UpdateGatewayConnectionPayload {
return v.value
}
func (v *NullableUpdateGatewayConnectionPayload) Set(val *UpdateGatewayConnectionPayload) {
v.value = val
v.isSet = true
}
func (v NullableUpdateGatewayConnectionPayload) IsSet() bool {
return v.isSet
}
func (v *NullableUpdateGatewayConnectionPayload) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableUpdateGatewayConnectionPayload(val *UpdateGatewayConnectionPayload) *NullableUpdateGatewayConnectionPayload {
return &NullableUpdateGatewayConnectionPayload{value: val, isSet: true}
}
func (v NullableUpdateGatewayConnectionPayload) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableUpdateGatewayConnectionPayload) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}