/* 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) }