## 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>
177 lines
6 KiB
Go
177 lines
6 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 BGPGatewayConfig type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &BGPGatewayConfig{}
|
|
|
|
/*
|
|
types and functions for localAsn
|
|
*/
|
|
|
|
// isInteger
|
|
type BGPGatewayConfigGetLocalAsnAttributeType = *int64
|
|
type BGPGatewayConfigGetLocalAsnArgType = int64
|
|
type BGPGatewayConfigGetLocalAsnRetType = int64
|
|
|
|
func getBGPGatewayConfigGetLocalAsnAttributeTypeOk(arg BGPGatewayConfigGetLocalAsnAttributeType) (ret BGPGatewayConfigGetLocalAsnRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setBGPGatewayConfigGetLocalAsnAttributeType(arg *BGPGatewayConfigGetLocalAsnAttributeType, val BGPGatewayConfigGetLocalAsnRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for overrideAdvertisedRoutes
|
|
*/
|
|
|
|
// isArray
|
|
type BGPGatewayConfigGetOverrideAdvertisedRoutesAttributeType = *[]string
|
|
type BGPGatewayConfigGetOverrideAdvertisedRoutesArgType = []string
|
|
type BGPGatewayConfigGetOverrideAdvertisedRoutesRetType = []string
|
|
|
|
func getBGPGatewayConfigGetOverrideAdvertisedRoutesAttributeTypeOk(arg BGPGatewayConfigGetOverrideAdvertisedRoutesAttributeType) (ret BGPGatewayConfigGetOverrideAdvertisedRoutesRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setBGPGatewayConfigGetOverrideAdvertisedRoutesAttributeType(arg *BGPGatewayConfigGetOverrideAdvertisedRoutesAttributeType, val BGPGatewayConfigGetOverrideAdvertisedRoutesRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
// BGPGatewayConfig BGP configuration effects all connections. (only if bgpEnabled=true)
|
|
type BGPGatewayConfig struct {
|
|
// Local ASN for Private Use (reserved by IANA).
|
|
// Can be cast to int32 without loss of precision.
|
|
LocalAsn BGPGatewayConfigGetLocalAsnAttributeType `json:"localAsn,omitempty"`
|
|
// List of routes (IPv4 CIDR).
|
|
OverrideAdvertisedRoutes BGPGatewayConfigGetOverrideAdvertisedRoutesAttributeType `json:"overrideAdvertisedRoutes,omitempty"`
|
|
}
|
|
|
|
// NewBGPGatewayConfig instantiates a new BGPGatewayConfig 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 NewBGPGatewayConfig() *BGPGatewayConfig {
|
|
this := BGPGatewayConfig{}
|
|
return &this
|
|
}
|
|
|
|
// NewBGPGatewayConfigWithDefaults instantiates a new BGPGatewayConfig 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 NewBGPGatewayConfigWithDefaults() *BGPGatewayConfig {
|
|
this := BGPGatewayConfig{}
|
|
return &this
|
|
}
|
|
|
|
// GetLocalAsn returns the LocalAsn field value if set, zero value otherwise.
|
|
func (o *BGPGatewayConfig) GetLocalAsn() (res BGPGatewayConfigGetLocalAsnRetType) {
|
|
res, _ = o.GetLocalAsnOk()
|
|
return
|
|
}
|
|
|
|
// GetLocalAsnOk returns a tuple with the LocalAsn field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BGPGatewayConfig) GetLocalAsnOk() (ret BGPGatewayConfigGetLocalAsnRetType, ok bool) {
|
|
return getBGPGatewayConfigGetLocalAsnAttributeTypeOk(o.LocalAsn)
|
|
}
|
|
|
|
// HasLocalAsn returns a boolean if a field has been set.
|
|
func (o *BGPGatewayConfig) HasLocalAsn() bool {
|
|
_, ok := o.GetLocalAsnOk()
|
|
return ok
|
|
}
|
|
|
|
// SetLocalAsn gets a reference to the given int64 and assigns it to the LocalAsn field.
|
|
func (o *BGPGatewayConfig) SetLocalAsn(v BGPGatewayConfigGetLocalAsnRetType) {
|
|
setBGPGatewayConfigGetLocalAsnAttributeType(&o.LocalAsn, v)
|
|
}
|
|
|
|
// GetOverrideAdvertisedRoutes returns the OverrideAdvertisedRoutes field value if set, zero value otherwise.
|
|
func (o *BGPGatewayConfig) GetOverrideAdvertisedRoutes() (res BGPGatewayConfigGetOverrideAdvertisedRoutesRetType) {
|
|
res, _ = o.GetOverrideAdvertisedRoutesOk()
|
|
return
|
|
}
|
|
|
|
// GetOverrideAdvertisedRoutesOk returns a tuple with the OverrideAdvertisedRoutes field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BGPGatewayConfig) GetOverrideAdvertisedRoutesOk() (ret BGPGatewayConfigGetOverrideAdvertisedRoutesRetType, ok bool) {
|
|
return getBGPGatewayConfigGetOverrideAdvertisedRoutesAttributeTypeOk(o.OverrideAdvertisedRoutes)
|
|
}
|
|
|
|
// HasOverrideAdvertisedRoutes returns a boolean if a field has been set.
|
|
func (o *BGPGatewayConfig) HasOverrideAdvertisedRoutes() bool {
|
|
_, ok := o.GetOverrideAdvertisedRoutesOk()
|
|
return ok
|
|
}
|
|
|
|
// SetOverrideAdvertisedRoutes gets a reference to the given []string and assigns it to the OverrideAdvertisedRoutes field.
|
|
func (o *BGPGatewayConfig) SetOverrideAdvertisedRoutes(v BGPGatewayConfigGetOverrideAdvertisedRoutesRetType) {
|
|
setBGPGatewayConfigGetOverrideAdvertisedRoutesAttributeType(&o.OverrideAdvertisedRoutes, v)
|
|
}
|
|
|
|
func (o BGPGatewayConfig) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if val, ok := getBGPGatewayConfigGetLocalAsnAttributeTypeOk(o.LocalAsn); ok {
|
|
toSerialize["LocalAsn"] = val
|
|
}
|
|
if val, ok := getBGPGatewayConfigGetOverrideAdvertisedRoutesAttributeTypeOk(o.OverrideAdvertisedRoutes); ok {
|
|
toSerialize["OverrideAdvertisedRoutes"] = val
|
|
}
|
|
return toSerialize, nil
|
|
}
|
|
|
|
type NullableBGPGatewayConfig struct {
|
|
value *BGPGatewayConfig
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableBGPGatewayConfig) Get() *BGPGatewayConfig {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableBGPGatewayConfig) Set(val *BGPGatewayConfig) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableBGPGatewayConfig) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableBGPGatewayConfig) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableBGPGatewayConfig(val *BGPGatewayConfig) *NullableBGPGatewayConfig {
|
|
return &NullableBGPGatewayConfig{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableBGPGatewayConfig) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableBGPGatewayConfig) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|