diff --git a/services/vpn/oas_commit b/services/vpn/oas_commit index ffaaf3db1..854b4d05a 100644 --- a/services/vpn/oas_commit +++ b/services/vpn/oas_commit @@ -1 +1 @@ -18e00f0b26b2cd1f3403bbf0c2e64e7fe333b4d1 +f0f8f6fffec1443b5a8cab41d989cc063797883b diff --git a/services/vpn/v1alpha1api/model_create_gateway_payload.go b/services/vpn/v1alpha1api/model_create_gateway_payload.go index b21102b04..f6c99ada3 100644 --- a/services/vpn/v1alpha1api/model_create_gateway_payload.go +++ b/services/vpn/v1alpha1api/model_create_gateway_payload.go @@ -25,7 +25,8 @@ type CreateGatewayPayload struct { // A user-friendly name for the VPN gateway. DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$"` // Map of custom labels. Key and values must be a string with max 63 chars, start/end with alphanumeric. The key of a label follows the same rules as the `LabelValue` except that it cannot be empty. - Labels *map[string]string `json:"labels,omitempty"` + Labels *map[string]string `json:"labels,omitempty"` + NetworkArea *NetworkConfig `json:"networkArea,omitempty"` // The service plan identifier. PlanId string `json:"planId"` RoutingType RoutingType `json:"routingType"` @@ -167,6 +168,38 @@ func (o *CreateGatewayPayload) SetLabels(v map[string]string) { o.Labels = &v } +// GetNetworkArea returns the NetworkArea field value if set, zero value otherwise. +func (o *CreateGatewayPayload) GetNetworkArea() NetworkConfig { + if o == nil || IsNil(o.NetworkArea) { + var ret NetworkConfig + return ret + } + return *o.NetworkArea +} + +// GetNetworkAreaOk returns a tuple with the NetworkArea field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateGatewayPayload) GetNetworkAreaOk() (*NetworkConfig, bool) { + if o == nil || IsNil(o.NetworkArea) { + return nil, false + } + return o.NetworkArea, true +} + +// HasNetworkArea returns a boolean if a field has been set. +func (o *CreateGatewayPayload) HasNetworkArea() bool { + if o != nil && !IsNil(o.NetworkArea) { + return true + } + + return false +} + +// SetNetworkArea gets a reference to the given NetworkConfig and assigns it to the NetworkArea field. +func (o *CreateGatewayPayload) SetNetworkArea(v NetworkConfig) { + o.NetworkArea = &v +} + // GetPlanId returns the PlanId field value func (o *CreateGatewayPayload) GetPlanId() string { if o == nil { @@ -233,6 +266,9 @@ func (o CreateGatewayPayload) ToMap() (map[string]interface{}, error) { if !IsNil(o.Labels) { toSerialize["labels"] = o.Labels } + if !IsNil(o.NetworkArea) { + toSerialize["networkArea"] = o.NetworkArea + } toSerialize["planId"] = o.PlanId toSerialize["routingType"] = o.RoutingType @@ -285,6 +321,7 @@ func (o *CreateGatewayPayload) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "bgp") delete(additionalProperties, "displayName") delete(additionalProperties, "labels") + delete(additionalProperties, "networkArea") delete(additionalProperties, "planId") delete(additionalProperties, "routingType") o.AdditionalProperties = additionalProperties diff --git a/services/vpn/v1alpha1api/model_gateway.go b/services/vpn/v1alpha1api/model_gateway.go index 41212fece..329e5ee68 100644 --- a/services/vpn/v1alpha1api/model_gateway.go +++ b/services/vpn/v1alpha1api/model_gateway.go @@ -25,7 +25,8 @@ type Gateway struct { // A user-friendly name for the VPN gateway. DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$"` // Map of custom labels. Key and values must be a string with max 63 chars, start/end with alphanumeric. The key of a label follows the same rules as the `LabelValue` except that it cannot be empty. - Labels *map[string]string `json:"labels,omitempty"` + Labels *map[string]string `json:"labels,omitempty"` + NetworkArea *NetworkConfig `json:"networkArea,omitempty"` // The service plan identifier. PlanId string `json:"planId"` RoutingType RoutingType `json:"routingType"` @@ -167,6 +168,38 @@ func (o *Gateway) SetLabels(v map[string]string) { o.Labels = &v } +// GetNetworkArea returns the NetworkArea field value if set, zero value otherwise. +func (o *Gateway) GetNetworkArea() NetworkConfig { + if o == nil || IsNil(o.NetworkArea) { + var ret NetworkConfig + return ret + } + return *o.NetworkArea +} + +// GetNetworkAreaOk returns a tuple with the NetworkArea field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Gateway) GetNetworkAreaOk() (*NetworkConfig, bool) { + if o == nil || IsNil(o.NetworkArea) { + return nil, false + } + return o.NetworkArea, true +} + +// HasNetworkArea returns a boolean if a field has been set. +func (o *Gateway) HasNetworkArea() bool { + if o != nil && !IsNil(o.NetworkArea) { + return true + } + + return false +} + +// SetNetworkArea gets a reference to the given NetworkConfig and assigns it to the NetworkArea field. +func (o *Gateway) SetNetworkArea(v NetworkConfig) { + o.NetworkArea = &v +} + // GetPlanId returns the PlanId field value func (o *Gateway) GetPlanId() string { if o == nil { @@ -233,6 +266,9 @@ func (o Gateway) ToMap() (map[string]interface{}, error) { if !IsNil(o.Labels) { toSerialize["labels"] = o.Labels } + if !IsNil(o.NetworkArea) { + toSerialize["networkArea"] = o.NetworkArea + } toSerialize["planId"] = o.PlanId toSerialize["routingType"] = o.RoutingType @@ -285,6 +321,7 @@ func (o *Gateway) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "bgp") delete(additionalProperties, "displayName") delete(additionalProperties, "labels") + delete(additionalProperties, "networkArea") delete(additionalProperties, "planId") delete(additionalProperties, "routingType") o.AdditionalProperties = additionalProperties diff --git a/services/vpn/v1alpha1api/model_gateway_response.go b/services/vpn/v1alpha1api/model_gateway_response.go index e6cab23a7..b4038c68d 100644 --- a/services/vpn/v1alpha1api/model_gateway_response.go +++ b/services/vpn/v1alpha1api/model_gateway_response.go @@ -25,7 +25,8 @@ type GatewayResponse struct { // A user-friendly name for the VPN gateway. DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$"` // Map of custom labels. Key and values must be a string with max 63 chars, start/end with alphanumeric. The key of a label follows the same rules as the `LabelValue` except that it cannot be empty. - Labels *map[string]string `json:"labels,omitempty"` + Labels *map[string]string `json:"labels,omitempty"` + NetworkArea *NetworkConfig `json:"networkArea,omitempty"` // The service plan identifier. PlanId string `json:"planId"` RoutingType RoutingType `json:"routingType"` @@ -170,6 +171,38 @@ func (o *GatewayResponse) SetLabels(v map[string]string) { o.Labels = &v } +// GetNetworkArea returns the NetworkArea field value if set, zero value otherwise. +func (o *GatewayResponse) GetNetworkArea() NetworkConfig { + if o == nil || IsNil(o.NetworkArea) { + var ret NetworkConfig + return ret + } + return *o.NetworkArea +} + +// GetNetworkAreaOk returns a tuple with the NetworkArea field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GatewayResponse) GetNetworkAreaOk() (*NetworkConfig, bool) { + if o == nil || IsNil(o.NetworkArea) { + return nil, false + } + return o.NetworkArea, true +} + +// HasNetworkArea returns a boolean if a field has been set. +func (o *GatewayResponse) HasNetworkArea() bool { + if o != nil && !IsNil(o.NetworkArea) { + return true + } + + return false +} + +// SetNetworkArea gets a reference to the given NetworkConfig and assigns it to the NetworkArea field. +func (o *GatewayResponse) SetNetworkArea(v NetworkConfig) { + o.NetworkArea = &v +} + // GetPlanId returns the PlanId field value func (o *GatewayResponse) GetPlanId() string { if o == nil { @@ -300,6 +333,9 @@ func (o GatewayResponse) ToMap() (map[string]interface{}, error) { if !IsNil(o.Labels) { toSerialize["labels"] = o.Labels } + if !IsNil(o.NetworkArea) { + toSerialize["networkArea"] = o.NetworkArea + } toSerialize["planId"] = o.PlanId toSerialize["routingType"] = o.RoutingType if !IsNil(o.Id) { @@ -358,6 +394,7 @@ func (o *GatewayResponse) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "bgp") delete(additionalProperties, "displayName") delete(additionalProperties, "labels") + delete(additionalProperties, "networkArea") delete(additionalProperties, "planId") delete(additionalProperties, "routingType") delete(additionalProperties, "id") diff --git a/services/vpn/v1alpha1api/model_network_config.go b/services/vpn/v1alpha1api/model_network_config.go new file mode 100644 index 000000000..b83d9d00b --- /dev/null +++ b/services/vpn/v1alpha1api/model_network_config.go @@ -0,0 +1,192 @@ +/* +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" +) + +// checks if the NetworkConfig type satisfies the MappedNullable interface at compile time +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"` + // Custom routing table ID for the VPN gateway + RoutingTableId *string `json:"routingTableId,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _NetworkConfig NetworkConfig + +// NewNetworkConfig instantiates a new NetworkConfig 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 NewNetworkConfig() *NetworkConfig { + this := NetworkConfig{} + return &this +} + +// NewNetworkConfigWithDefaults instantiates a new NetworkConfig 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 NewNetworkConfigWithDefaults() *NetworkConfig { + this := NetworkConfig{} + return &this +} + +// GetPredefinedNetworkPrefix returns the PredefinedNetworkPrefix field value if set, zero value otherwise. +func (o *NetworkConfig) GetPredefinedNetworkPrefix() []string { + if o == nil || IsNil(o.PredefinedNetworkPrefix) { + var ret []string + return ret + } + 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) { + if o == nil || IsNil(o.PredefinedNetworkPrefix) { + return nil, false + } + return o.PredefinedNetworkPrefix, true +} + +// HasPredefinedNetworkPrefix returns a boolean if a field has been set. +func (o *NetworkConfig) HasPredefinedNetworkPrefix() bool { + if o != nil && !IsNil(o.PredefinedNetworkPrefix) { + return true + } + + 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 +} + +// GetRoutingTableId returns the RoutingTableId field value if set, zero value otherwise. +func (o *NetworkConfig) GetRoutingTableId() string { + if o == nil || IsNil(o.RoutingTableId) { + var ret string + return ret + } + return *o.RoutingTableId +} + +// GetRoutingTableIdOk returns a tuple with the RoutingTableId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkConfig) GetRoutingTableIdOk() (*string, bool) { + if o == nil || IsNil(o.RoutingTableId) { + return nil, false + } + return o.RoutingTableId, true +} + +// HasRoutingTableId returns a boolean if a field has been set. +func (o *NetworkConfig) HasRoutingTableId() bool { + if o != nil && !IsNil(o.RoutingTableId) { + return true + } + + return false +} + +// SetRoutingTableId gets a reference to the given string and assigns it to the RoutingTableId field. +func (o *NetworkConfig) SetRoutingTableId(v string) { + o.RoutingTableId = &v +} + +func (o NetworkConfig) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.PredefinedNetworkPrefix) { + toSerialize["predefinedNetworkPrefix"] = o.PredefinedNetworkPrefix + } + if !IsNil(o.RoutingTableId) { + toSerialize["routingTableId"] = o.RoutingTableId + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NetworkConfig) UnmarshalJSON(data []byte) (err error) { + varNetworkConfig := _NetworkConfig{} + + err = json.Unmarshal(data, &varNetworkConfig) + + if err != nil { + return err + } + + *o = NetworkConfig(varNetworkConfig) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "predefinedNetworkPrefix") + delete(additionalProperties, "routingTableId") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNetworkConfig struct { + value *NetworkConfig + isSet bool +} + +func (v NullableNetworkConfig) Get() *NetworkConfig { + return v.value +} + +func (v *NullableNetworkConfig) Set(val *NetworkConfig) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkConfig(val *NetworkConfig) *NullableNetworkConfig { + return &NullableNetworkConfig{value: val, isSet: true} +} + +func (v NullableNetworkConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/vpn/v1alpha1api/model_update_gateway_payload.go b/services/vpn/v1alpha1api/model_update_gateway_payload.go index 606a0c719..0a422e9b7 100644 --- a/services/vpn/v1alpha1api/model_update_gateway_payload.go +++ b/services/vpn/v1alpha1api/model_update_gateway_payload.go @@ -25,7 +25,8 @@ type UpdateGatewayPayload struct { // A user-friendly name for the VPN gateway. DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$"` // Map of custom labels. Key and values must be a string with max 63 chars, start/end with alphanumeric. The key of a label follows the same rules as the `LabelValue` except that it cannot be empty. - Labels *map[string]string `json:"labels,omitempty"` + Labels *map[string]string `json:"labels,omitempty"` + NetworkArea *NetworkConfig `json:"networkArea,omitempty"` // The service plan identifier. PlanId string `json:"planId"` RoutingType RoutingType `json:"routingType"` @@ -167,6 +168,38 @@ func (o *UpdateGatewayPayload) SetLabels(v map[string]string) { o.Labels = &v } +// GetNetworkArea returns the NetworkArea field value if set, zero value otherwise. +func (o *UpdateGatewayPayload) GetNetworkArea() NetworkConfig { + if o == nil || IsNil(o.NetworkArea) { + var ret NetworkConfig + return ret + } + return *o.NetworkArea +} + +// GetNetworkAreaOk returns a tuple with the NetworkArea field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateGatewayPayload) GetNetworkAreaOk() (*NetworkConfig, bool) { + if o == nil || IsNil(o.NetworkArea) { + return nil, false + } + return o.NetworkArea, true +} + +// HasNetworkArea returns a boolean if a field has been set. +func (o *UpdateGatewayPayload) HasNetworkArea() bool { + if o != nil && !IsNil(o.NetworkArea) { + return true + } + + return false +} + +// SetNetworkArea gets a reference to the given NetworkConfig and assigns it to the NetworkArea field. +func (o *UpdateGatewayPayload) SetNetworkArea(v NetworkConfig) { + o.NetworkArea = &v +} + // GetPlanId returns the PlanId field value func (o *UpdateGatewayPayload) GetPlanId() string { if o == nil { @@ -233,6 +266,9 @@ func (o UpdateGatewayPayload) ToMap() (map[string]interface{}, error) { if !IsNil(o.Labels) { toSerialize["labels"] = o.Labels } + if !IsNil(o.NetworkArea) { + toSerialize["networkArea"] = o.NetworkArea + } toSerialize["planId"] = o.PlanId toSerialize["routingType"] = o.RoutingType @@ -285,6 +321,7 @@ func (o *UpdateGatewayPayload) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "bgp") delete(additionalProperties, "displayName") delete(additionalProperties, "labels") + delete(additionalProperties, "networkArea") delete(additionalProperties, "planId") delete(additionalProperties, "routingType") o.AdditionalProperties = additionalProperties diff --git a/services/vpn/v1beta1api/model_create_gateway_payload.go b/services/vpn/v1beta1api/model_create_gateway_payload.go index 734acc063..9f54e1a42 100644 --- a/services/vpn/v1beta1api/model_create_gateway_payload.go +++ b/services/vpn/v1beta1api/model_create_gateway_payload.go @@ -25,7 +25,8 @@ type CreateGatewayPayload struct { // A user-friendly name for the VPN gateway. DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$"` // Map of custom labels. Key and values must be a string with max 63 chars, start/end with alphanumeric. The key of a label follows the same rules as the `LabelValue` except that it cannot be empty. - Labels *map[string]string `json:"labels,omitempty"` + Labels *map[string]string `json:"labels,omitempty"` + NetworkArea *NetworkConfig `json:"networkArea,omitempty"` // The service plan identifier. PlanId string `json:"planId"` RoutingType RoutingType `json:"routingType"` @@ -167,6 +168,38 @@ func (o *CreateGatewayPayload) SetLabels(v map[string]string) { o.Labels = &v } +// GetNetworkArea returns the NetworkArea field value if set, zero value otherwise. +func (o *CreateGatewayPayload) GetNetworkArea() NetworkConfig { + if o == nil || IsNil(o.NetworkArea) { + var ret NetworkConfig + return ret + } + return *o.NetworkArea +} + +// GetNetworkAreaOk returns a tuple with the NetworkArea field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateGatewayPayload) GetNetworkAreaOk() (*NetworkConfig, bool) { + if o == nil || IsNil(o.NetworkArea) { + return nil, false + } + return o.NetworkArea, true +} + +// HasNetworkArea returns a boolean if a field has been set. +func (o *CreateGatewayPayload) HasNetworkArea() bool { + if o != nil && !IsNil(o.NetworkArea) { + return true + } + + return false +} + +// SetNetworkArea gets a reference to the given NetworkConfig and assigns it to the NetworkArea field. +func (o *CreateGatewayPayload) SetNetworkArea(v NetworkConfig) { + o.NetworkArea = &v +} + // GetPlanId returns the PlanId field value func (o *CreateGatewayPayload) GetPlanId() string { if o == nil { @@ -233,6 +266,9 @@ func (o CreateGatewayPayload) ToMap() (map[string]interface{}, error) { if !IsNil(o.Labels) { toSerialize["labels"] = o.Labels } + if !IsNil(o.NetworkArea) { + toSerialize["networkArea"] = o.NetworkArea + } toSerialize["planId"] = o.PlanId toSerialize["routingType"] = o.RoutingType @@ -285,6 +321,7 @@ func (o *CreateGatewayPayload) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "bgp") delete(additionalProperties, "displayName") delete(additionalProperties, "labels") + delete(additionalProperties, "networkArea") delete(additionalProperties, "planId") delete(additionalProperties, "routingType") o.AdditionalProperties = additionalProperties diff --git a/services/vpn/v1beta1api/model_gateway.go b/services/vpn/v1beta1api/model_gateway.go index d100cd417..9b908b5a0 100644 --- a/services/vpn/v1beta1api/model_gateway.go +++ b/services/vpn/v1beta1api/model_gateway.go @@ -25,7 +25,8 @@ type Gateway struct { // A user-friendly name for the VPN gateway. DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$"` // Map of custom labels. Key and values must be a string with max 63 chars, start/end with alphanumeric. The key of a label follows the same rules as the `LabelValue` except that it cannot be empty. - Labels *map[string]string `json:"labels,omitempty"` + Labels *map[string]string `json:"labels,omitempty"` + NetworkArea *NetworkConfig `json:"networkArea,omitempty"` // The service plan identifier. PlanId string `json:"planId"` RoutingType RoutingType `json:"routingType"` @@ -167,6 +168,38 @@ func (o *Gateway) SetLabels(v map[string]string) { o.Labels = &v } +// GetNetworkArea returns the NetworkArea field value if set, zero value otherwise. +func (o *Gateway) GetNetworkArea() NetworkConfig { + if o == nil || IsNil(o.NetworkArea) { + var ret NetworkConfig + return ret + } + return *o.NetworkArea +} + +// GetNetworkAreaOk returns a tuple with the NetworkArea field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Gateway) GetNetworkAreaOk() (*NetworkConfig, bool) { + if o == nil || IsNil(o.NetworkArea) { + return nil, false + } + return o.NetworkArea, true +} + +// HasNetworkArea returns a boolean if a field has been set. +func (o *Gateway) HasNetworkArea() bool { + if o != nil && !IsNil(o.NetworkArea) { + return true + } + + return false +} + +// SetNetworkArea gets a reference to the given NetworkConfig and assigns it to the NetworkArea field. +func (o *Gateway) SetNetworkArea(v NetworkConfig) { + o.NetworkArea = &v +} + // GetPlanId returns the PlanId field value func (o *Gateway) GetPlanId() string { if o == nil { @@ -233,6 +266,9 @@ func (o Gateway) ToMap() (map[string]interface{}, error) { if !IsNil(o.Labels) { toSerialize["labels"] = o.Labels } + if !IsNil(o.NetworkArea) { + toSerialize["networkArea"] = o.NetworkArea + } toSerialize["planId"] = o.PlanId toSerialize["routingType"] = o.RoutingType @@ -285,6 +321,7 @@ func (o *Gateway) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "bgp") delete(additionalProperties, "displayName") delete(additionalProperties, "labels") + delete(additionalProperties, "networkArea") delete(additionalProperties, "planId") delete(additionalProperties, "routingType") o.AdditionalProperties = additionalProperties diff --git a/services/vpn/v1beta1api/model_gateway_response.go b/services/vpn/v1beta1api/model_gateway_response.go index 549bec031..1ccbe7028 100644 --- a/services/vpn/v1beta1api/model_gateway_response.go +++ b/services/vpn/v1beta1api/model_gateway_response.go @@ -25,7 +25,8 @@ type GatewayResponse struct { // A user-friendly name for the VPN gateway. DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$"` // Map of custom labels. Key and values must be a string with max 63 chars, start/end with alphanumeric. The key of a label follows the same rules as the `LabelValue` except that it cannot be empty. - Labels *map[string]string `json:"labels,omitempty"` + Labels *map[string]string `json:"labels,omitempty"` + NetworkArea *NetworkConfig `json:"networkArea,omitempty"` // The service plan identifier. PlanId string `json:"planId"` RoutingType RoutingType `json:"routingType"` @@ -170,6 +171,38 @@ func (o *GatewayResponse) SetLabels(v map[string]string) { o.Labels = &v } +// GetNetworkArea returns the NetworkArea field value if set, zero value otherwise. +func (o *GatewayResponse) GetNetworkArea() NetworkConfig { + if o == nil || IsNil(o.NetworkArea) { + var ret NetworkConfig + return ret + } + return *o.NetworkArea +} + +// GetNetworkAreaOk returns a tuple with the NetworkArea field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GatewayResponse) GetNetworkAreaOk() (*NetworkConfig, bool) { + if o == nil || IsNil(o.NetworkArea) { + return nil, false + } + return o.NetworkArea, true +} + +// HasNetworkArea returns a boolean if a field has been set. +func (o *GatewayResponse) HasNetworkArea() bool { + if o != nil && !IsNil(o.NetworkArea) { + return true + } + + return false +} + +// SetNetworkArea gets a reference to the given NetworkConfig and assigns it to the NetworkArea field. +func (o *GatewayResponse) SetNetworkArea(v NetworkConfig) { + o.NetworkArea = &v +} + // GetPlanId returns the PlanId field value func (o *GatewayResponse) GetPlanId() string { if o == nil { @@ -300,6 +333,9 @@ func (o GatewayResponse) ToMap() (map[string]interface{}, error) { if !IsNil(o.Labels) { toSerialize["labels"] = o.Labels } + if !IsNil(o.NetworkArea) { + toSerialize["networkArea"] = o.NetworkArea + } toSerialize["planId"] = o.PlanId toSerialize["routingType"] = o.RoutingType if !IsNil(o.Id) { @@ -358,6 +394,7 @@ func (o *GatewayResponse) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "bgp") delete(additionalProperties, "displayName") delete(additionalProperties, "labels") + delete(additionalProperties, "networkArea") delete(additionalProperties, "planId") delete(additionalProperties, "routingType") delete(additionalProperties, "id") diff --git a/services/vpn/v1beta1api/model_network_config.go b/services/vpn/v1beta1api/model_network_config.go new file mode 100644 index 000000000..046bdd371 --- /dev/null +++ b/services/vpn/v1beta1api/model_network_config.go @@ -0,0 +1,192 @@ +/* +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" +) + +// checks if the NetworkConfig type satisfies the MappedNullable interface at compile time +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"` + // Custom routing table ID for the VPN gateway + RoutingTableId *string `json:"routingTableId,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _NetworkConfig NetworkConfig + +// NewNetworkConfig instantiates a new NetworkConfig 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 NewNetworkConfig() *NetworkConfig { + this := NetworkConfig{} + return &this +} + +// NewNetworkConfigWithDefaults instantiates a new NetworkConfig 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 NewNetworkConfigWithDefaults() *NetworkConfig { + this := NetworkConfig{} + return &this +} + +// GetPredefinedNetworkPrefix returns the PredefinedNetworkPrefix field value if set, zero value otherwise. +func (o *NetworkConfig) GetPredefinedNetworkPrefix() []string { + if o == nil || IsNil(o.PredefinedNetworkPrefix) { + var ret []string + return ret + } + 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) { + if o == nil || IsNil(o.PredefinedNetworkPrefix) { + return nil, false + } + return o.PredefinedNetworkPrefix, true +} + +// HasPredefinedNetworkPrefix returns a boolean if a field has been set. +func (o *NetworkConfig) HasPredefinedNetworkPrefix() bool { + if o != nil && !IsNil(o.PredefinedNetworkPrefix) { + return true + } + + 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 +} + +// GetRoutingTableId returns the RoutingTableId field value if set, zero value otherwise. +func (o *NetworkConfig) GetRoutingTableId() string { + if o == nil || IsNil(o.RoutingTableId) { + var ret string + return ret + } + return *o.RoutingTableId +} + +// GetRoutingTableIdOk returns a tuple with the RoutingTableId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkConfig) GetRoutingTableIdOk() (*string, bool) { + if o == nil || IsNil(o.RoutingTableId) { + return nil, false + } + return o.RoutingTableId, true +} + +// HasRoutingTableId returns a boolean if a field has been set. +func (o *NetworkConfig) HasRoutingTableId() bool { + if o != nil && !IsNil(o.RoutingTableId) { + return true + } + + return false +} + +// SetRoutingTableId gets a reference to the given string and assigns it to the RoutingTableId field. +func (o *NetworkConfig) SetRoutingTableId(v string) { + o.RoutingTableId = &v +} + +func (o NetworkConfig) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.PredefinedNetworkPrefix) { + toSerialize["predefinedNetworkPrefix"] = o.PredefinedNetworkPrefix + } + if !IsNil(o.RoutingTableId) { + toSerialize["routingTableId"] = o.RoutingTableId + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NetworkConfig) UnmarshalJSON(data []byte) (err error) { + varNetworkConfig := _NetworkConfig{} + + err = json.Unmarshal(data, &varNetworkConfig) + + if err != nil { + return err + } + + *o = NetworkConfig(varNetworkConfig) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "predefinedNetworkPrefix") + delete(additionalProperties, "routingTableId") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNetworkConfig struct { + value *NetworkConfig + isSet bool +} + +func (v NullableNetworkConfig) Get() *NetworkConfig { + return v.value +} + +func (v *NullableNetworkConfig) Set(val *NetworkConfig) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkConfig(val *NetworkConfig) *NullableNetworkConfig { + return &NullableNetworkConfig{value: val, isSet: true} +} + +func (v NullableNetworkConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/vpn/v1beta1api/model_update_gateway_payload.go b/services/vpn/v1beta1api/model_update_gateway_payload.go index 44fb0f58c..6f4a72d58 100644 --- a/services/vpn/v1beta1api/model_update_gateway_payload.go +++ b/services/vpn/v1beta1api/model_update_gateway_payload.go @@ -25,7 +25,8 @@ type UpdateGatewayPayload struct { // A user-friendly name for the VPN gateway. DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$"` // Map of custom labels. Key and values must be a string with max 63 chars, start/end with alphanumeric. The key of a label follows the same rules as the `LabelValue` except that it cannot be empty. - Labels *map[string]string `json:"labels,omitempty"` + Labels *map[string]string `json:"labels,omitempty"` + NetworkArea *NetworkConfig `json:"networkArea,omitempty"` // The service plan identifier. PlanId string `json:"planId"` RoutingType RoutingType `json:"routingType"` @@ -167,6 +168,38 @@ func (o *UpdateGatewayPayload) SetLabels(v map[string]string) { o.Labels = &v } +// GetNetworkArea returns the NetworkArea field value if set, zero value otherwise. +func (o *UpdateGatewayPayload) GetNetworkArea() NetworkConfig { + if o == nil || IsNil(o.NetworkArea) { + var ret NetworkConfig + return ret + } + return *o.NetworkArea +} + +// GetNetworkAreaOk returns a tuple with the NetworkArea field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateGatewayPayload) GetNetworkAreaOk() (*NetworkConfig, bool) { + if o == nil || IsNil(o.NetworkArea) { + return nil, false + } + return o.NetworkArea, true +} + +// HasNetworkArea returns a boolean if a field has been set. +func (o *UpdateGatewayPayload) HasNetworkArea() bool { + if o != nil && !IsNil(o.NetworkArea) { + return true + } + + return false +} + +// SetNetworkArea gets a reference to the given NetworkConfig and assigns it to the NetworkArea field. +func (o *UpdateGatewayPayload) SetNetworkArea(v NetworkConfig) { + o.NetworkArea = &v +} + // GetPlanId returns the PlanId field value func (o *UpdateGatewayPayload) GetPlanId() string { if o == nil { @@ -233,6 +266,9 @@ func (o UpdateGatewayPayload) ToMap() (map[string]interface{}, error) { if !IsNil(o.Labels) { toSerialize["labels"] = o.Labels } + if !IsNil(o.NetworkArea) { + toSerialize["networkArea"] = o.NetworkArea + } toSerialize["planId"] = o.PlanId toSerialize["routingType"] = o.RoutingType @@ -285,6 +321,7 @@ func (o *UpdateGatewayPayload) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "bgp") delete(additionalProperties, "displayName") delete(additionalProperties, "labels") + delete(additionalProperties, "networkArea") delete(additionalProperties, "planId") delete(additionalProperties, "routingType") o.AdditionalProperties = additionalProperties