diff --git a/CHANGELOG.md b/CHANGELOG.md index a2703966c..89c8754ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -216,6 +216,13 @@ - **Breaking Change/Fix:** `CreateBackupExecute` return type changed from `([]CreateBackupResponseItem, error)` to `(*CreateBackupResponseItem, error)` The go type now correctly models the actual JSON response, this operation was broken beforehand. This aligns `v1api` with the fix already applied to `v2api` in v0.2.0. - `vpn`: + - [v0.15.2](services/vpn/CHANGELOG.md#v0152) + - `v1api`: + - **Fix:** `NetworkConfig.PredefinedNetworkPrefix` field type changed from `[]string` to `*string` (the API expects a single CIDR string, not an array) + - **Feature:** Add `ASNNot` enum type (values `23456`, `65535`) to represent ASN values excluded from use + - **Improvement:** Update description of `BGPTunnelConfig.RemoteAsn` to reflect excluded ASN values + - `v1beta1api`: Align package to latest API specification + - `v1alpha1api`: Align package to latest API specification - [v0.15.1](services/vpn/CHANGELOG.md#v0151) - **Dependencies:** Bump STACKIT SDK core module from `v0.26.0` to `v0.27.0` diff --git a/services/vpn/CHANGELOG.md b/services/vpn/CHANGELOG.md index f96dde574..b2f277b96 100644 --- a/services/vpn/CHANGELOG.md +++ b/services/vpn/CHANGELOG.md @@ -1,3 +1,11 @@ +## v0.15.2 +- `v1api`: + - **Fix:** `NetworkConfig.PredefinedNetworkPrefix` field type changed from `[]string` to `*string` (the API expects a single CIDR string, not an array) + - **Feature:** Add `ASNNot` enum type (values `23456`, `65535`) to represent ASN values excluded from use + - **Improvement:** Update description of `BGPTunnelConfig.RemoteAsn` to reflect excluded ASN values +- `v1beta1api`: Align package to latest API specification +- `v1alpha1api`: Align package to latest API specification + ## v0.15.1 - **Dependencies:** Bump STACKIT SDK core module from `v0.26.0` to `v0.27.0` diff --git a/services/vpn/VERSION b/services/vpn/VERSION index 5f1dd0af5..a240c92a4 100644 --- a/services/vpn/VERSION +++ b/services/vpn/VERSION @@ -1 +1 @@ -v0.15.1 +v0.15.2 diff --git a/services/vpn/oas_commit b/services/vpn/oas_commit index 739d7a10c..84fb2776f 100644 --- a/services/vpn/oas_commit +++ b/services/vpn/oas_commit @@ -1 +1 @@ -d3401e53c9d91a6d95564111fc34bc9d341ef4e6 +3fc1363ce4ead752c576a30ee9cf0e1b5836ae35 diff --git a/services/vpn/v1alpha1api/model_asn_not.go b/services/vpn/v1alpha1api/model_asn_not.go new file mode 100644 index 000000000..d3b28d591 --- /dev/null +++ b/services/vpn/v1alpha1api/model_asn_not.go @@ -0,0 +1,113 @@ +/* +STACKIT VPN API + +Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec + +API version: 1alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1alpha1api + +import ( + "encoding/json" + "fmt" +) + +// ASNNot the model 'ASNNot' +type ASNNot float32 + +// List of ASN_not +const ( + ASNNOT__23456 ASNNot = 23456 + ASNNOT__65535 ASNNot = 65535 + ASNNOT__unknown_default_open_api ASNNot = 11184809 +) + +// All allowed values of ASNNot enum +var AllowedASNNotEnumValues = []ASNNot{ + 23456, + 65535, + 11184809, +} + +func (v *ASNNot) UnmarshalJSON(src []byte) error { + var value float32 + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ASNNot(value) + for _, existing := range AllowedASNNotEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = ASNNOT__unknown_default_open_api + return nil +} + +// NewASNNotFromValue returns a pointer to a valid ASNNot +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewASNNotFromValue(v float32) (*ASNNot, error) { + ev := ASNNot(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ASNNot: valid values are %v", v, AllowedASNNotEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ASNNot) IsValid() bool { + for _, existing := range AllowedASNNotEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ASN_not value +func (v ASNNot) Ptr() *ASNNot { + return &v +} + +type NullableASNNot struct { + value *ASNNot + isSet bool +} + +func (v NullableASNNot) Get() *ASNNot { + return v.value +} + +func (v *NullableASNNot) Set(val *ASNNot) { + v.value = val + v.isSet = true +} + +func (v NullableASNNot) IsSet() bool { + return v.isSet +} + +func (v *NullableASNNot) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableASNNot(val *ASNNot) *NullableASNNot { + return &NullableASNNot{value: val, isSet: true} +} + +func (v NullableASNNot) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableASNNot) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/vpn/v1alpha1api/model_bgp_tunnel_config.go b/services/vpn/v1alpha1api/model_bgp_tunnel_config.go index c7f7ade57..27ba0b04d 100644 --- a/services/vpn/v1alpha1api/model_bgp_tunnel_config.go +++ b/services/vpn/v1alpha1api/model_bgp_tunnel_config.go @@ -20,7 +20,7 @@ var _ MappedNullable = &BGPTunnelConfig{} // BGPTunnelConfig struct for BGPTunnelConfig type BGPTunnelConfig struct { - // ASN for private use (reserved by IANA), both 16Bit and 32Bit ranges are valid (RFC 6996). + // Number of an Autonomous System. Both 16Bit and 32Bit ranges are supported, excluding values reserved by: * RFC 7607 (0) * RFC 6793 (23456, AS_TRANS) * RFC 7300 (65535 and 4294967295, the \"Last ASNs\") RemoteAsn int64 `json:"remoteAsn"` AdditionalProperties map[string]interface{} } diff --git a/services/vpn/v1alpha1api/model_network_config.go b/services/vpn/v1alpha1api/model_network_config.go index b83d9d00b..d3f86a65b 100644 --- a/services/vpn/v1alpha1api/model_network_config.go +++ b/services/vpn/v1alpha1api/model_network_config.go @@ -20,7 +20,7 @@ var _ MappedNullable = &NetworkConfig{} // NetworkConfig struct for NetworkConfig type NetworkConfig struct { // The IPv4 network prefix (CIDR notation) allocated for the VPN gateway. Must have a prefix length of /28 or larger. Once the gateway is created, is not possible to change this attribute. - PredefinedNetworkPrefix []string `json:"predefinedNetworkPrefix,omitempty"` + PredefinedNetworkPrefix *string `json:"predefinedNetworkPrefix,omitempty" validate:"regexp=^((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4}(/([0-9]|[1-2][0-9]|3[0-2]))?$"` // Custom routing table ID for the VPN gateway RoutingTableId *string `json:"routingTableId,omitempty"` AdditionalProperties map[string]interface{} @@ -46,17 +46,17 @@ func NewNetworkConfigWithDefaults() *NetworkConfig { } // GetPredefinedNetworkPrefix returns the PredefinedNetworkPrefix field value if set, zero value otherwise. -func (o *NetworkConfig) GetPredefinedNetworkPrefix() []string { +func (o *NetworkConfig) GetPredefinedNetworkPrefix() string { if o == nil || IsNil(o.PredefinedNetworkPrefix) { - var ret []string + var ret string return ret } - return o.PredefinedNetworkPrefix + return *o.PredefinedNetworkPrefix } // GetPredefinedNetworkPrefixOk returns a tuple with the PredefinedNetworkPrefix field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NetworkConfig) GetPredefinedNetworkPrefixOk() ([]string, bool) { +func (o *NetworkConfig) GetPredefinedNetworkPrefixOk() (*string, bool) { if o == nil || IsNil(o.PredefinedNetworkPrefix) { return nil, false } @@ -72,9 +72,9 @@ func (o *NetworkConfig) HasPredefinedNetworkPrefix() bool { return false } -// SetPredefinedNetworkPrefix gets a reference to the given []string and assigns it to the PredefinedNetworkPrefix field. -func (o *NetworkConfig) SetPredefinedNetworkPrefix(v []string) { - o.PredefinedNetworkPrefix = v +// SetPredefinedNetworkPrefix gets a reference to the given string and assigns it to the PredefinedNetworkPrefix field. +func (o *NetworkConfig) SetPredefinedNetworkPrefix(v string) { + o.PredefinedNetworkPrefix = &v } // GetRoutingTableId returns the RoutingTableId field value if set, zero value otherwise. diff --git a/services/vpn/v1api/model_asn_not.go b/services/vpn/v1api/model_asn_not.go new file mode 100644 index 000000000..cd714fd6e --- /dev/null +++ b/services/vpn/v1api/model_asn_not.go @@ -0,0 +1,113 @@ +/* +STACKIT VPN API + +Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec + +API version: 1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// ASNNot the model 'ASNNot' +type ASNNot float32 + +// List of ASN_not +const ( + ASNNOT__23456 ASNNot = 23456 + ASNNOT__65535 ASNNot = 65535 + ASNNOT__unknown_default_open_api ASNNot = 11184809 +) + +// All allowed values of ASNNot enum +var AllowedASNNotEnumValues = []ASNNot{ + 23456, + 65535, + 11184809, +} + +func (v *ASNNot) UnmarshalJSON(src []byte) error { + var value float32 + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ASNNot(value) + for _, existing := range AllowedASNNotEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = ASNNOT__unknown_default_open_api + return nil +} + +// NewASNNotFromValue returns a pointer to a valid ASNNot +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewASNNotFromValue(v float32) (*ASNNot, error) { + ev := ASNNot(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ASNNot: valid values are %v", v, AllowedASNNotEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ASNNot) IsValid() bool { + for _, existing := range AllowedASNNotEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ASN_not value +func (v ASNNot) Ptr() *ASNNot { + return &v +} + +type NullableASNNot struct { + value *ASNNot + isSet bool +} + +func (v NullableASNNot) Get() *ASNNot { + return v.value +} + +func (v *NullableASNNot) Set(val *ASNNot) { + v.value = val + v.isSet = true +} + +func (v NullableASNNot) IsSet() bool { + return v.isSet +} + +func (v *NullableASNNot) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableASNNot(val *ASNNot) *NullableASNNot { + return &NullableASNNot{value: val, isSet: true} +} + +func (v NullableASNNot) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableASNNot) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/vpn/v1api/model_bgp_tunnel_config.go b/services/vpn/v1api/model_bgp_tunnel_config.go index 5859506ec..fc259e129 100644 --- a/services/vpn/v1api/model_bgp_tunnel_config.go +++ b/services/vpn/v1api/model_bgp_tunnel_config.go @@ -22,7 +22,7 @@ var _ MappedNullable = &BGPTunnelConfig{} type BGPTunnelConfig struct { // UUID of the BGPFilter to apply to incoming routes from this tunnel's BGP neighbor. The filter must exist in the same gateway. Multiple tunnels may reference the same BGPFilter; in that case the rules' 'match.peer' field can be used to scope behavior per neighbor. Outbound filtering is not yet supported; use gateway.bgp.overrideAdvertisedRoutes to control what is advertised. InboundFilterId NullableString `json:"inboundFilterId,omitempty"` - // ASN for private use (reserved by IANA), both 16Bit and 32Bit ranges are valid (RFC 6996). + // Number of an Autonomous System. Both 16Bit and 32Bit ranges are supported, excluding values reserved by: * RFC 7607 (0) * RFC 6793 (23456, AS_TRANS) * RFC 7300 (65535 and 4294967295, the \"Last ASNs\") RemoteAsn int64 `json:"remoteAsn"` AdditionalProperties map[string]interface{} } diff --git a/services/vpn/v1api/model_network_config.go b/services/vpn/v1api/model_network_config.go index 083e10de8..4c9c3b0f6 100644 --- a/services/vpn/v1api/model_network_config.go +++ b/services/vpn/v1api/model_network_config.go @@ -20,7 +20,7 @@ var _ MappedNullable = &NetworkConfig{} // NetworkConfig struct for NetworkConfig type NetworkConfig struct { // The IPv4 network prefix (CIDR notation) allocated for the VPN gateway. Must have a prefix length of /28 or larger. Once the gateway is created, is not possible to change this attribute. - PredefinedNetworkPrefix []string `json:"predefinedNetworkPrefix,omitempty"` + PredefinedNetworkPrefix *string `json:"predefinedNetworkPrefix,omitempty" validate:"regexp=^((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4}(/([0-9]|[1-2][0-9]|3[0-2]))?$"` // Custom routing table ID for the VPN gateway RoutingTableId *string `json:"routingTableId,omitempty"` AdditionalProperties map[string]interface{} @@ -46,17 +46,17 @@ func NewNetworkConfigWithDefaults() *NetworkConfig { } // GetPredefinedNetworkPrefix returns the PredefinedNetworkPrefix field value if set, zero value otherwise. -func (o *NetworkConfig) GetPredefinedNetworkPrefix() []string { +func (o *NetworkConfig) GetPredefinedNetworkPrefix() string { if o == nil || IsNil(o.PredefinedNetworkPrefix) { - var ret []string + var ret string return ret } - return o.PredefinedNetworkPrefix + return *o.PredefinedNetworkPrefix } // GetPredefinedNetworkPrefixOk returns a tuple with the PredefinedNetworkPrefix field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NetworkConfig) GetPredefinedNetworkPrefixOk() ([]string, bool) { +func (o *NetworkConfig) GetPredefinedNetworkPrefixOk() (*string, bool) { if o == nil || IsNil(o.PredefinedNetworkPrefix) { return nil, false } @@ -72,9 +72,9 @@ func (o *NetworkConfig) HasPredefinedNetworkPrefix() bool { return false } -// SetPredefinedNetworkPrefix gets a reference to the given []string and assigns it to the PredefinedNetworkPrefix field. -func (o *NetworkConfig) SetPredefinedNetworkPrefix(v []string) { - o.PredefinedNetworkPrefix = v +// SetPredefinedNetworkPrefix gets a reference to the given string and assigns it to the PredefinedNetworkPrefix field. +func (o *NetworkConfig) SetPredefinedNetworkPrefix(v string) { + o.PredefinedNetworkPrefix = &v } // GetRoutingTableId returns the RoutingTableId field value if set, zero value otherwise. diff --git a/services/vpn/v1beta1api/model_asn_not.go b/services/vpn/v1beta1api/model_asn_not.go new file mode 100644 index 000000000..3e00d36a4 --- /dev/null +++ b/services/vpn/v1beta1api/model_asn_not.go @@ -0,0 +1,113 @@ +/* +STACKIT VPN API + +Provision and manage STACKIT VPN gateways. Use this API to establish secure, encrypted IPsec tunnels between your STACKIT Network Area (SNA) and external networks. The service supports the following routing architectures: - Policy-based IPsec - Static route-based IPsec - Dynamic BGP IPsec + +API version: 1beta1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta1api + +import ( + "encoding/json" + "fmt" +) + +// ASNNot the model 'ASNNot' +type ASNNot float32 + +// List of ASN_not +const ( + ASNNOT__23456 ASNNot = 23456 + ASNNOT__65535 ASNNot = 65535 + ASNNOT__unknown_default_open_api ASNNot = 11184809 +) + +// All allowed values of ASNNot enum +var AllowedASNNotEnumValues = []ASNNot{ + 23456, + 65535, + 11184809, +} + +func (v *ASNNot) UnmarshalJSON(src []byte) error { + var value float32 + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ASNNot(value) + for _, existing := range AllowedASNNotEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = ASNNOT__unknown_default_open_api + return nil +} + +// NewASNNotFromValue returns a pointer to a valid ASNNot +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewASNNotFromValue(v float32) (*ASNNot, error) { + ev := ASNNot(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ASNNot: valid values are %v", v, AllowedASNNotEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ASNNot) IsValid() bool { + for _, existing := range AllowedASNNotEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ASN_not value +func (v ASNNot) Ptr() *ASNNot { + return &v +} + +type NullableASNNot struct { + value *ASNNot + isSet bool +} + +func (v NullableASNNot) Get() *ASNNot { + return v.value +} + +func (v *NullableASNNot) Set(val *ASNNot) { + v.value = val + v.isSet = true +} + +func (v NullableASNNot) IsSet() bool { + return v.isSet +} + +func (v *NullableASNNot) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableASNNot(val *ASNNot) *NullableASNNot { + return &NullableASNNot{value: val, isSet: true} +} + +func (v NullableASNNot) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableASNNot) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/vpn/v1beta1api/model_bgp_tunnel_config.go b/services/vpn/v1beta1api/model_bgp_tunnel_config.go index 9cad9160f..3a1f31894 100644 --- a/services/vpn/v1beta1api/model_bgp_tunnel_config.go +++ b/services/vpn/v1beta1api/model_bgp_tunnel_config.go @@ -20,7 +20,7 @@ var _ MappedNullable = &BGPTunnelConfig{} // BGPTunnelConfig struct for BGPTunnelConfig type BGPTunnelConfig struct { - // ASN for private use (reserved by IANA), both 16Bit and 32Bit ranges are valid (RFC 6996). + // Number of an Autonomous System. Both 16Bit and 32Bit ranges are supported, excluding values reserved by: * RFC 7607 (0) * RFC 6793 (23456, AS_TRANS) * RFC 7300 (65535 and 4294967295, the \"Last ASNs\") RemoteAsn int64 `json:"remoteAsn"` AdditionalProperties map[string]interface{} } diff --git a/services/vpn/v1beta1api/model_network_config.go b/services/vpn/v1beta1api/model_network_config.go index 046bdd371..56eae0b0e 100644 --- a/services/vpn/v1beta1api/model_network_config.go +++ b/services/vpn/v1beta1api/model_network_config.go @@ -20,7 +20,7 @@ var _ MappedNullable = &NetworkConfig{} // NetworkConfig struct for NetworkConfig type NetworkConfig struct { // The IPv4 network prefix (CIDR notation) allocated for the VPN gateway. Must have a prefix length of /28 or larger. Once the gateway is created, is not possible to change this attribute. - PredefinedNetworkPrefix []string `json:"predefinedNetworkPrefix,omitempty"` + PredefinedNetworkPrefix *string `json:"predefinedNetworkPrefix,omitempty" validate:"regexp=^((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4}(/([0-9]|[1-2][0-9]|3[0-2]))?$"` // Custom routing table ID for the VPN gateway RoutingTableId *string `json:"routingTableId,omitempty"` AdditionalProperties map[string]interface{} @@ -46,17 +46,17 @@ func NewNetworkConfigWithDefaults() *NetworkConfig { } // GetPredefinedNetworkPrefix returns the PredefinedNetworkPrefix field value if set, zero value otherwise. -func (o *NetworkConfig) GetPredefinedNetworkPrefix() []string { +func (o *NetworkConfig) GetPredefinedNetworkPrefix() string { if o == nil || IsNil(o.PredefinedNetworkPrefix) { - var ret []string + var ret string return ret } - return o.PredefinedNetworkPrefix + return *o.PredefinedNetworkPrefix } // GetPredefinedNetworkPrefixOk returns a tuple with the PredefinedNetworkPrefix field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NetworkConfig) GetPredefinedNetworkPrefixOk() ([]string, bool) { +func (o *NetworkConfig) GetPredefinedNetworkPrefixOk() (*string, bool) { if o == nil || IsNil(o.PredefinedNetworkPrefix) { return nil, false } @@ -72,9 +72,9 @@ func (o *NetworkConfig) HasPredefinedNetworkPrefix() bool { return false } -// SetPredefinedNetworkPrefix gets a reference to the given []string and assigns it to the PredefinedNetworkPrefix field. -func (o *NetworkConfig) SetPredefinedNetworkPrefix(v []string) { - o.PredefinedNetworkPrefix = v +// SetPredefinedNetworkPrefix gets a reference to the given string and assigns it to the PredefinedNetworkPrefix field. +func (o *NetworkConfig) SetPredefinedNetworkPrefix(v string) { + o.PredefinedNetworkPrefix = &v } // GetRoutingTableId returns the RoutingTableId field value if set, zero value otherwise.