feat: auto generated files and new structure (#4)
Some checks failed
Publish / Check GoReleaser config (push) Successful in 4s
Release / goreleaser (push) Failing after 29s
Publish / Publish provider (push) Failing after 4m24s

## 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>
This commit is contained in:
Marcel S. Henselin 2026-01-29 14:10:25 +00:00 committed by Marcel_Henselin
parent 979220be66
commit 9f41c4da7f
Signed by: tf-provider.git.onstackit.cloud
GPG key ID: 6D7E8A1ED8955A9C
1283 changed files with 273211 additions and 4614 deletions

View file

@ -0,0 +1 @@
6.6.0

2916
pkg/vpnalpha/api_default.go Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,825 @@
/*
STACKIT VPN API
Testing DefaultApiService
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech);
package vpnalpha
import (
"context"
"encoding/json"
"net/http"
"net/http/httptest"
"net/url"
"strings"
"testing"
"github.com/stackitcloud/stackit-sdk-go/core/config"
)
func Test_vpnalpha_DefaultApiService(t *testing.T) {
t.Run("Test DefaultApiService CreateGatewayConnection", func(t *testing.T) {
_apiUrlPath := "/v1alpha1/projects/{projectId}/regions/{region}/gateways/{gatewayName}/connections"
projectIdValue := "projectId-value"
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
regionValue := Region("eu01")
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
gatewayNameValue := "gatewayName-value"
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"gatewayName"+"}", url.PathEscape(ParameterValueToString(gatewayNameValue, "gatewayName")), -1)
testDefaultApiServeMux := http.NewServeMux()
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
data := Connection{}
w.Header().Add("Content-Type", "application/json")
json.NewEncoder(w).Encode(data)
})
testServer := httptest.NewServer(testDefaultApiServeMux)
defer testServer.Close()
configuration := &config.Configuration{
DefaultHeader: make(map[string]string),
UserAgent: "OpenAPI-Generator/1.0.0/go",
Debug: false,
Region: "test_region",
Servers: config.ServerConfigurations{
{
URL: testServer.URL,
Description: "Localhost for vpnalpha_DefaultApi",
Variables: map[string]config.ServerVariable{
"region": {
DefaultValue: "test_region.",
EnumValues: []string{
"test_region.",
},
},
},
},
},
OperationServers: map[string]config.ServerConfigurations{},
}
apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication())
if err != nil {
t.Fatalf("creating API client: %v", err)
}
projectId := projectIdValue
region := regionValue
gatewayName := gatewayNameValue
resp, reqErr := apiClient.CreateGatewayConnection(context.Background(), projectId, region, gatewayName).Execute()
if reqErr != nil {
t.Fatalf("error in call: %v", reqErr)
}
if IsNil(resp) {
t.Fatalf("response not present")
}
})
t.Run("Test DefaultApiService CreateVPNGateway", func(t *testing.T) {
_apiUrlPath := "/v1alpha1/projects/{projectId}/regions/{region}/gateways"
projectIdValue := "projectId-value"
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
regionValue := Region("eu01")
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
testDefaultApiServeMux := http.NewServeMux()
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
data := Gateway{}
w.Header().Add("Content-Type", "application/json")
json.NewEncoder(w).Encode(data)
})
testServer := httptest.NewServer(testDefaultApiServeMux)
defer testServer.Close()
configuration := &config.Configuration{
DefaultHeader: make(map[string]string),
UserAgent: "OpenAPI-Generator/1.0.0/go",
Debug: false,
Region: "test_region",
Servers: config.ServerConfigurations{
{
URL: testServer.URL,
Description: "Localhost for vpnalpha_DefaultApi",
Variables: map[string]config.ServerVariable{
"region": {
DefaultValue: "test_region.",
EnumValues: []string{
"test_region.",
},
},
},
},
},
OperationServers: map[string]config.ServerConfigurations{},
}
apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication())
if err != nil {
t.Fatalf("creating API client: %v", err)
}
projectId := projectIdValue
region := regionValue
createVPNGatewayPayload := CreateVPNGatewayPayload{}
resp, reqErr := apiClient.CreateVPNGateway(context.Background(), projectId, region).CreateVPNGatewayPayload(createVPNGatewayPayload).Execute()
if reqErr != nil {
t.Fatalf("error in call: %v", reqErr)
}
if IsNil(resp) {
t.Fatalf("response not present")
}
})
t.Run("Test DefaultApiService DeleteGatewayConnection", func(t *testing.T) {
_apiUrlPath := "/v1alpha1/projects/{projectId}/regions/{region}/gateways/{gatewayName}/connections/{connectionName}"
projectIdValue := "projectId-value"
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
regionValue := Region("eu01")
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
gatewayNameValue := "gatewayName-value"
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"gatewayName"+"}", url.PathEscape(ParameterValueToString(gatewayNameValue, "gatewayName")), -1)
connectionNameValue := "connectionName-value"
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"connectionName"+"}", url.PathEscape(ParameterValueToString(connectionNameValue, "connectionName")), -1)
testDefaultApiServeMux := http.NewServeMux()
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
})
testServer := httptest.NewServer(testDefaultApiServeMux)
defer testServer.Close()
configuration := &config.Configuration{
DefaultHeader: make(map[string]string),
UserAgent: "OpenAPI-Generator/1.0.0/go",
Debug: false,
Region: "test_region",
Servers: config.ServerConfigurations{
{
URL: testServer.URL,
Description: "Localhost for vpnalpha_DefaultApi",
Variables: map[string]config.ServerVariable{
"region": {
DefaultValue: "test_region.",
EnumValues: []string{
"test_region.",
},
},
},
},
},
OperationServers: map[string]config.ServerConfigurations{},
}
apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication())
if err != nil {
t.Fatalf("creating API client: %v", err)
}
projectId := projectIdValue
region := regionValue
gatewayName := gatewayNameValue
connectionName := connectionNameValue
reqErr := apiClient.DeleteGatewayConnection(context.Background(), projectId, region, gatewayName, connectionName).Execute()
if reqErr != nil {
t.Fatalf("error in call: %v", reqErr)
}
})
t.Run("Test DefaultApiService DeleteVPNGateway", func(t *testing.T) {
_apiUrlPath := "/v1alpha1/projects/{projectId}/regions/{region}/gateways/{gatewayName}"
projectIdValue := "projectId-value"
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
regionValue := Region("eu01")
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
gatewayNameValue := "gatewayName-value"
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"gatewayName"+"}", url.PathEscape(ParameterValueToString(gatewayNameValue, "gatewayName")), -1)
testDefaultApiServeMux := http.NewServeMux()
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
})
testServer := httptest.NewServer(testDefaultApiServeMux)
defer testServer.Close()
configuration := &config.Configuration{
DefaultHeader: make(map[string]string),
UserAgent: "OpenAPI-Generator/1.0.0/go",
Debug: false,
Region: "test_region",
Servers: config.ServerConfigurations{
{
URL: testServer.URL,
Description: "Localhost for vpnalpha_DefaultApi",
Variables: map[string]config.ServerVariable{
"region": {
DefaultValue: "test_region.",
EnumValues: []string{
"test_region.",
},
},
},
},
},
OperationServers: map[string]config.ServerConfigurations{},
}
apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication())
if err != nil {
t.Fatalf("creating API client: %v", err)
}
projectId := projectIdValue
region := regionValue
gatewayName := gatewayNameValue
reqErr := apiClient.DeleteVPNGateway(context.Background(), projectId, region, gatewayName).Execute()
if reqErr != nil {
t.Fatalf("error in call: %v", reqErr)
}
})
t.Run("Test DefaultApiService GetGatewayConnection", func(t *testing.T) {
_apiUrlPath := "/v1alpha1/projects/{projectId}/regions/{region}/gateways/{gatewayName}/connections/{connectionName}"
projectIdValue := "projectId-value"
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
regionValue := Region("eu01")
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
gatewayNameValue := "gatewayName-value"
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"gatewayName"+"}", url.PathEscape(ParameterValueToString(gatewayNameValue, "gatewayName")), -1)
connectionNameValue := "connectionName-value"
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"connectionName"+"}", url.PathEscape(ParameterValueToString(connectionNameValue, "connectionName")), -1)
testDefaultApiServeMux := http.NewServeMux()
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
data := Connection{}
w.Header().Add("Content-Type", "application/json")
json.NewEncoder(w).Encode(data)
})
testServer := httptest.NewServer(testDefaultApiServeMux)
defer testServer.Close()
configuration := &config.Configuration{
DefaultHeader: make(map[string]string),
UserAgent: "OpenAPI-Generator/1.0.0/go",
Debug: false,
Region: "test_region",
Servers: config.ServerConfigurations{
{
URL: testServer.URL,
Description: "Localhost for vpnalpha_DefaultApi",
Variables: map[string]config.ServerVariable{
"region": {
DefaultValue: "test_region.",
EnumValues: []string{
"test_region.",
},
},
},
},
},
OperationServers: map[string]config.ServerConfigurations{},
}
apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication())
if err != nil {
t.Fatalf("creating API client: %v", err)
}
projectId := projectIdValue
region := regionValue
gatewayName := gatewayNameValue
connectionName := connectionNameValue
resp, reqErr := apiClient.GetGatewayConnection(context.Background(), projectId, region, gatewayName, connectionName).Execute()
if reqErr != nil {
t.Fatalf("error in call: %v", reqErr)
}
if IsNil(resp) {
t.Fatalf("response not present")
}
})
t.Run("Test DefaultApiService GetGatewayConnectionStatus", func(t *testing.T) {
_apiUrlPath := "/v1alpha1/projects/{projectId}/regions/{region}/gateways/{gatewayName}/connections/{connectionName}/status"
projectIdValue := "projectId-value"
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
regionValue := Region("eu01")
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
gatewayNameValue := "gatewayName-value"
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"gatewayName"+"}", url.PathEscape(ParameterValueToString(gatewayNameValue, "gatewayName")), -1)
connectionNameValue := "connectionName-value"
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"connectionName"+"}", url.PathEscape(ParameterValueToString(connectionNameValue, "connectionName")), -1)
testDefaultApiServeMux := http.NewServeMux()
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
data := ConnectionStatusResponse{}
w.Header().Add("Content-Type", "application/json")
json.NewEncoder(w).Encode(data)
})
testServer := httptest.NewServer(testDefaultApiServeMux)
defer testServer.Close()
configuration := &config.Configuration{
DefaultHeader: make(map[string]string),
UserAgent: "OpenAPI-Generator/1.0.0/go",
Debug: false,
Region: "test_region",
Servers: config.ServerConfigurations{
{
URL: testServer.URL,
Description: "Localhost for vpnalpha_DefaultApi",
Variables: map[string]config.ServerVariable{
"region": {
DefaultValue: "test_region.",
EnumValues: []string{
"test_region.",
},
},
},
},
},
OperationServers: map[string]config.ServerConfigurations{},
}
apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication())
if err != nil {
t.Fatalf("creating API client: %v", err)
}
projectId := projectIdValue
region := regionValue
gatewayName := gatewayNameValue
connectionName := connectionNameValue
resp, reqErr := apiClient.GetGatewayConnectionStatus(context.Background(), projectId, region, gatewayName, connectionName).Execute()
if reqErr != nil {
t.Fatalf("error in call: %v", reqErr)
}
if IsNil(resp) {
t.Fatalf("response not present")
}
})
t.Run("Test DefaultApiService GetVPNGateway", func(t *testing.T) {
_apiUrlPath := "/v1alpha1/projects/{projectId}/regions/{region}/gateways/{gatewayName}"
projectIdValue := "projectId-value"
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
regionValue := Region("eu01")
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
gatewayNameValue := "gatewayName-value"
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"gatewayName"+"}", url.PathEscape(ParameterValueToString(gatewayNameValue, "gatewayName")), -1)
testDefaultApiServeMux := http.NewServeMux()
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
data := Gateway{}
w.Header().Add("Content-Type", "application/json")
json.NewEncoder(w).Encode(data)
})
testServer := httptest.NewServer(testDefaultApiServeMux)
defer testServer.Close()
configuration := &config.Configuration{
DefaultHeader: make(map[string]string),
UserAgent: "OpenAPI-Generator/1.0.0/go",
Debug: false,
Region: "test_region",
Servers: config.ServerConfigurations{
{
URL: testServer.URL,
Description: "Localhost for vpnalpha_DefaultApi",
Variables: map[string]config.ServerVariable{
"region": {
DefaultValue: "test_region.",
EnumValues: []string{
"test_region.",
},
},
},
},
},
OperationServers: map[string]config.ServerConfigurations{},
}
apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication())
if err != nil {
t.Fatalf("creating API client: %v", err)
}
projectId := projectIdValue
region := regionValue
gatewayName := gatewayNameValue
resp, reqErr := apiClient.GetVPNGateway(context.Background(), projectId, region, gatewayName).Execute()
if reqErr != nil {
t.Fatalf("error in call: %v", reqErr)
}
if IsNil(resp) {
t.Fatalf("response not present")
}
})
t.Run("Test DefaultApiService GetVPNGatewayStatus", func(t *testing.T) {
_apiUrlPath := "/v1alpha1/projects/{projectId}/regions/{region}/gateways/{gatewayName}/status"
projectIdValue := "projectId-value"
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
regionValue := Region("eu01")
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
gatewayNameValue := "gatewayName-value"
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"gatewayName"+"}", url.PathEscape(ParameterValueToString(gatewayNameValue, "gatewayName")), -1)
testDefaultApiServeMux := http.NewServeMux()
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
data := GatewayStatusResponse{}
w.Header().Add("Content-Type", "application/json")
json.NewEncoder(w).Encode(data)
})
testServer := httptest.NewServer(testDefaultApiServeMux)
defer testServer.Close()
configuration := &config.Configuration{
DefaultHeader: make(map[string]string),
UserAgent: "OpenAPI-Generator/1.0.0/go",
Debug: false,
Region: "test_region",
Servers: config.ServerConfigurations{
{
URL: testServer.URL,
Description: "Localhost for vpnalpha_DefaultApi",
Variables: map[string]config.ServerVariable{
"region": {
DefaultValue: "test_region.",
EnumValues: []string{
"test_region.",
},
},
},
},
},
OperationServers: map[string]config.ServerConfigurations{},
}
apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication())
if err != nil {
t.Fatalf("creating API client: %v", err)
}
projectId := projectIdValue
region := regionValue
gatewayName := gatewayNameValue
resp, reqErr := apiClient.GetVPNGatewayStatus(context.Background(), projectId, region, gatewayName).Execute()
if reqErr != nil {
t.Fatalf("error in call: %v", reqErr)
}
if IsNil(resp) {
t.Fatalf("response not present")
}
})
t.Run("Test DefaultApiService ListGatewayConnections", func(t *testing.T) {
_apiUrlPath := "/v1alpha1/projects/{projectId}/regions/{region}/gateways/{gatewayName}/connections"
projectIdValue := "projectId-value"
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
regionValue := Region("eu01")
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
gatewayNameValue := "gatewayName-value"
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"gatewayName"+"}", url.PathEscape(ParameterValueToString(gatewayNameValue, "gatewayName")), -1)
testDefaultApiServeMux := http.NewServeMux()
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
data := ConnectionList{}
w.Header().Add("Content-Type", "application/json")
json.NewEncoder(w).Encode(data)
})
testServer := httptest.NewServer(testDefaultApiServeMux)
defer testServer.Close()
configuration := &config.Configuration{
DefaultHeader: make(map[string]string),
UserAgent: "OpenAPI-Generator/1.0.0/go",
Debug: false,
Region: "test_region",
Servers: config.ServerConfigurations{
{
URL: testServer.URL,
Description: "Localhost for vpnalpha_DefaultApi",
Variables: map[string]config.ServerVariable{
"region": {
DefaultValue: "test_region.",
EnumValues: []string{
"test_region.",
},
},
},
},
},
OperationServers: map[string]config.ServerConfigurations{},
}
apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication())
if err != nil {
t.Fatalf("creating API client: %v", err)
}
projectId := projectIdValue
region := regionValue
gatewayName := gatewayNameValue
resp, reqErr := apiClient.ListGatewayConnections(context.Background(), projectId, region, gatewayName).Execute()
if reqErr != nil {
t.Fatalf("error in call: %v", reqErr)
}
if IsNil(resp) {
t.Fatalf("response not present")
}
})
t.Run("Test DefaultApiService ListPlans", func(t *testing.T) {
_apiUrlPath := "/v1alpha1/regions/{region}/plans"
regionValue := Region("eu01")
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
testDefaultApiServeMux := http.NewServeMux()
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
data := PlanList{}
w.Header().Add("Content-Type", "application/json")
json.NewEncoder(w).Encode(data)
})
testServer := httptest.NewServer(testDefaultApiServeMux)
defer testServer.Close()
configuration := &config.Configuration{
DefaultHeader: make(map[string]string),
UserAgent: "OpenAPI-Generator/1.0.0/go",
Debug: false,
Region: "test_region",
Servers: config.ServerConfigurations{
{
URL: testServer.URL,
Description: "Localhost for vpnalpha_DefaultApi",
Variables: map[string]config.ServerVariable{
"region": {
DefaultValue: "test_region.",
EnumValues: []string{
"test_region.",
},
},
},
},
},
OperationServers: map[string]config.ServerConfigurations{},
}
apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication())
if err != nil {
t.Fatalf("creating API client: %v", err)
}
region := regionValue
resp, reqErr := apiClient.ListPlans(context.Background(), region).Execute()
if reqErr != nil {
t.Fatalf("error in call: %v", reqErr)
}
if IsNil(resp) {
t.Fatalf("response not present")
}
})
t.Run("Test DefaultApiService ListQuotas", func(t *testing.T) {
_apiUrlPath := "/v1alpha1/projects/{projectId}/regions/{region}/quotas"
projectIdValue := "projectId-value"
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
regionValue := Region("eu01")
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
testDefaultApiServeMux := http.NewServeMux()
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
data := QuotaListResponse{}
w.Header().Add("Content-Type", "application/json")
json.NewEncoder(w).Encode(data)
})
testServer := httptest.NewServer(testDefaultApiServeMux)
defer testServer.Close()
configuration := &config.Configuration{
DefaultHeader: make(map[string]string),
UserAgent: "OpenAPI-Generator/1.0.0/go",
Debug: false,
Region: "test_region",
Servers: config.ServerConfigurations{
{
URL: testServer.URL,
Description: "Localhost for vpnalpha_DefaultApi",
Variables: map[string]config.ServerVariable{
"region": {
DefaultValue: "test_region.",
EnumValues: []string{
"test_region.",
},
},
},
},
},
OperationServers: map[string]config.ServerConfigurations{},
}
apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication())
if err != nil {
t.Fatalf("creating API client: %v", err)
}
projectId := projectIdValue
region := regionValue
resp, reqErr := apiClient.ListQuotas(context.Background(), projectId, region).Execute()
if reqErr != nil {
t.Fatalf("error in call: %v", reqErr)
}
if IsNil(resp) {
t.Fatalf("response not present")
}
})
t.Run("Test DefaultApiService ListVPNGateways", func(t *testing.T) {
_apiUrlPath := "/v1alpha1/projects/{projectId}/regions/{region}/gateways"
projectIdValue := "projectId-value"
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
regionValue := Region("eu01")
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
testDefaultApiServeMux := http.NewServeMux()
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
data := GatewayList{}
w.Header().Add("Content-Type", "application/json")
json.NewEncoder(w).Encode(data)
})
testServer := httptest.NewServer(testDefaultApiServeMux)
defer testServer.Close()
configuration := &config.Configuration{
DefaultHeader: make(map[string]string),
UserAgent: "OpenAPI-Generator/1.0.0/go",
Debug: false,
Region: "test_region",
Servers: config.ServerConfigurations{
{
URL: testServer.URL,
Description: "Localhost for vpnalpha_DefaultApi",
Variables: map[string]config.ServerVariable{
"region": {
DefaultValue: "test_region.",
EnumValues: []string{
"test_region.",
},
},
},
},
},
OperationServers: map[string]config.ServerConfigurations{},
}
apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication())
if err != nil {
t.Fatalf("creating API client: %v", err)
}
projectId := projectIdValue
region := regionValue
resp, reqErr := apiClient.ListVPNGateways(context.Background(), projectId, region).Execute()
if reqErr != nil {
t.Fatalf("error in call: %v", reqErr)
}
if IsNil(resp) {
t.Fatalf("response not present")
}
})
t.Run("Test DefaultApiService UpdateGatewayConnection", func(t *testing.T) {
_apiUrlPath := "/v1alpha1/projects/{projectId}/regions/{region}/gateways/{gatewayName}/connections/{connectionName}"
projectIdValue := "projectId-value"
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
regionValue := Region("eu01")
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
gatewayNameValue := "gatewayName-value"
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"gatewayName"+"}", url.PathEscape(ParameterValueToString(gatewayNameValue, "gatewayName")), -1)
connectionNameValue := "connectionName-value"
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"connectionName"+"}", url.PathEscape(ParameterValueToString(connectionNameValue, "connectionName")), -1)
testDefaultApiServeMux := http.NewServeMux()
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
data := Connection{}
w.Header().Add("Content-Type", "application/json")
json.NewEncoder(w).Encode(data)
})
testServer := httptest.NewServer(testDefaultApiServeMux)
defer testServer.Close()
configuration := &config.Configuration{
DefaultHeader: make(map[string]string),
UserAgent: "OpenAPI-Generator/1.0.0/go",
Debug: false,
Region: "test_region",
Servers: config.ServerConfigurations{
{
URL: testServer.URL,
Description: "Localhost for vpnalpha_DefaultApi",
Variables: map[string]config.ServerVariable{
"region": {
DefaultValue: "test_region.",
EnumValues: []string{
"test_region.",
},
},
},
},
},
OperationServers: map[string]config.ServerConfigurations{},
}
apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication())
if err != nil {
t.Fatalf("creating API client: %v", err)
}
projectId := projectIdValue
region := regionValue
gatewayName := gatewayNameValue
connectionName := connectionNameValue
resp, reqErr := apiClient.UpdateGatewayConnection(context.Background(), projectId, region, gatewayName, connectionName).Execute()
if reqErr != nil {
t.Fatalf("error in call: %v", reqErr)
}
if IsNil(resp) {
t.Fatalf("response not present")
}
})
t.Run("Test DefaultApiService UpdateVPNGateway", func(t *testing.T) {
_apiUrlPath := "/v1alpha1/projects/{projectId}/regions/{region}/gateways/{gatewayName}"
projectIdValue := "projectId-value"
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
regionValue := Region("eu01")
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
gatewayNameValue := "gatewayName-value"
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"gatewayName"+"}", url.PathEscape(ParameterValueToString(gatewayNameValue, "gatewayName")), -1)
testDefaultApiServeMux := http.NewServeMux()
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
data := Gateway{}
w.Header().Add("Content-Type", "application/json")
json.NewEncoder(w).Encode(data)
})
testServer := httptest.NewServer(testDefaultApiServeMux)
defer testServer.Close()
configuration := &config.Configuration{
DefaultHeader: make(map[string]string),
UserAgent: "OpenAPI-Generator/1.0.0/go",
Debug: false,
Region: "test_region",
Servers: config.ServerConfigurations{
{
URL: testServer.URL,
Description: "Localhost for vpnalpha_DefaultApi",
Variables: map[string]config.ServerVariable{
"region": {
DefaultValue: "test_region.",
EnumValues: []string{
"test_region.",
},
},
},
},
},
OperationServers: map[string]config.ServerConfigurations{},
}
apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication())
if err != nil {
t.Fatalf("creating API client: %v", err)
}
projectId := projectIdValue
region := regionValue
gatewayName := gatewayNameValue
updateVPNGatewayPayload := UpdateVPNGatewayPayload{}
resp, reqErr := apiClient.UpdateVPNGateway(context.Background(), projectId, region, gatewayName).UpdateVPNGatewayPayload(updateVPNGatewayPayload).Execute()
if reqErr != nil {
t.Fatalf("error in call: %v", reqErr)
}
if IsNil(resp) {
t.Fatalf("response not present")
}
})
}

628
pkg/vpnalpha/client.go Normal file
View file

@ -0,0 +1,628 @@
/*
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 (
"bytes"
"context"
"encoding/json"
"encoding/xml"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
"net/http/httputil"
"net/url"
"os"
"path/filepath"
"reflect"
"regexp"
"strconv"
"strings"
"time"
"unicode/utf8"
"github.com/stackitcloud/stackit-sdk-go/core/auth"
"github.com/stackitcloud/stackit-sdk-go/core/config"
)
var (
jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`)
xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`)
queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`)
queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]")
)
// APIClient manages communication with the STACKIT VPN API API v1alpha1
// In most cases there should be only one, shared, APIClient.
type APIClient struct {
cfg *config.Configuration
common service // Reuse a single struct instead of allocating one for each service on the heap.
defaultApi *DefaultApiService
}
type service struct {
client DefaultApi
}
// NewAPIClient creates a new API client.
// Optionally receives configuration options
func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) {
cfg := NewConfiguration()
for _, option := range opts {
err := option(cfg)
if err != nil {
return nil, fmt.Errorf("configuring the client: %w", err)
}
}
err := config.ConfigureRegion(cfg)
if err != nil {
return nil, fmt.Errorf("configuring region: %w", err)
}
if cfg.HTTPClient == nil {
cfg.HTTPClient = &http.Client{}
}
authRoundTripper, err := auth.SetupAuth(cfg)
if err != nil {
return nil, fmt.Errorf("setting up authentication: %w", err)
}
roundTripper := authRoundTripper
if cfg.Middleware != nil {
roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...)
}
cfg.HTTPClient.Transport = roundTripper
c := &APIClient{}
c.cfg = cfg
c.common.client = c
c.defaultApi = (*DefaultApiService)(&c.common)
return c, nil
}
func atoi(in string) (int, error) {
return strconv.Atoi(in)
}
// selectHeaderContentType select a content type from the available list.
func selectHeaderContentType(contentTypes []string) string {
if len(contentTypes) == 0 {
return ""
}
if contains(contentTypes, "application/json") {
return "application/json"
}
return contentTypes[0] // use the first content type specified in 'consumes'
}
// selectHeaderAccept join all accept types and return
func selectHeaderAccept(accepts []string) string {
if len(accepts) == 0 {
return ""
}
if contains(accepts, "application/json") {
return "application/json"
}
return strings.Join(accepts, ",")
}
// contains is a case insensitive match, finding needle in a haystack
func contains(haystack []string, needle string) bool {
for _, a := range haystack {
if strings.EqualFold(a, needle) {
return true
}
}
return false
}
// Verify optional parameters are of the correct type.
func typeCheckParameter(obj interface{}, expected string, name string) error {
// Make sure there is an object.
if obj == nil {
return nil
}
// Check the type is as expected.
if reflect.TypeOf(obj).String() != expected {
return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String())
}
return nil
}
func ParameterValueToString(obj interface{}, key string) string {
if reflect.TypeOf(obj).Kind() != reflect.Ptr {
return fmt.Sprintf("%v", obj)
}
var param, ok = obj.(MappedNullable)
if !ok {
return ""
}
dataMap, err := param.ToMap()
if err != nil {
return ""
}
return fmt.Sprintf("%v", dataMap[key])
}
// parameterAddToHeaderOrQuery adds the provided object to the request header or url query
// supporting deep object syntax
func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) {
var v = reflect.ValueOf(obj)
var value = ""
if v == reflect.ValueOf(nil) {
value = "null"
} else {
switch v.Kind() {
case reflect.Invalid:
value = "invalid"
case reflect.Struct:
if t, ok := obj.(MappedNullable); ok {
dataMap, err := t.ToMap()
if err != nil {
return
}
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType)
return
}
if t, ok := obj.(time.Time); ok {
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType)
return
}
value = v.Type().String() + " value"
case reflect.Slice:
var indValue = reflect.ValueOf(obj)
if indValue == reflect.ValueOf(nil) {
return
}
var lenIndValue = indValue.Len()
for i := 0; i < lenIndValue; i++ {
var arrayValue = indValue.Index(i)
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, arrayValue.Interface(), collectionType)
}
return
case reflect.Map:
var indValue = reflect.ValueOf(obj)
if indValue == reflect.ValueOf(nil) {
return
}
iter := indValue.MapRange()
for iter.Next() {
k, v := iter.Key(), iter.Value()
parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), collectionType)
}
return
case reflect.Interface:
fallthrough
case reflect.Ptr:
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), collectionType)
return
case reflect.Int, reflect.Int8, reflect.Int16,
reflect.Int32, reflect.Int64:
value = strconv.FormatInt(v.Int(), 10)
case reflect.Uint, reflect.Uint8, reflect.Uint16,
reflect.Uint32, reflect.Uint64, reflect.Uintptr:
value = strconv.FormatUint(v.Uint(), 10)
case reflect.Float32, reflect.Float64:
value = strconv.FormatFloat(v.Float(), 'g', -1, 32)
case reflect.Bool:
value = strconv.FormatBool(v.Bool())
case reflect.String:
value = v.String()
default:
value = v.Type().String() + " value"
}
}
switch valuesMap := headerOrQueryParams.(type) {
case url.Values:
if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" {
valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value)
} else {
valuesMap.Add(keyPrefix, value)
}
break
case map[string]string:
valuesMap[keyPrefix] = value
break
}
}
// helper for converting interface{} parameters to json strings
func parameterToJson(obj interface{}) (string, error) {
jsonBuf, err := json.Marshal(obj)
if err != nil {
return "", err
}
return string(jsonBuf), err
}
// callAPI do the request.
func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) {
if c.cfg.Debug {
dump, err := httputil.DumpRequestOut(request, true)
if err != nil {
return nil, err
}
log.Printf("\n%s\n", string(dump))
}
resp, err := c.cfg.HTTPClient.Do(request)
if err != nil {
return resp, err
}
if c.cfg.Debug {
dump, err := httputil.DumpResponse(resp, true)
if err != nil {
return resp, err
}
log.Printf("\n%s\n", string(dump))
}
return resp, err
}
// Allow modification of underlying config for alternate implementations and testing
// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior
func (c *APIClient) GetConfig() *config.Configuration {
return c.cfg
}
type formFile struct {
fileBytes []byte
fileName string
formFileName string
}
// prepareRequest build the request
func (c *APIClient) prepareRequest(
ctx context.Context,
path string, method string,
postBody interface{},
headerParams map[string]string,
queryParams url.Values,
formParams url.Values,
formFiles []formFile) (localVarRequest *http.Request, err error) {
var body *bytes.Buffer
// Detect postBody type and post.
if !IsNil(postBody) {
contentType := headerParams["Content-Type"]
if contentType == "" {
contentType = detectContentType(postBody)
headerParams["Content-Type"] = contentType
}
body, err = setBody(postBody, contentType)
if err != nil {
return nil, err
}
}
// add form parameters and file if available.
if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) {
if body != nil {
return nil, fmt.Errorf("cannot specify postBody and multipart form at the same time.")
}
body = &bytes.Buffer{}
w := multipart.NewWriter(body)
for k, v := range formParams {
for _, iv := range v {
if strings.HasPrefix(k, "@") { // file
err = addFile(w, k[1:], iv)
if err != nil {
return nil, err
}
} else { // form value
w.WriteField(k, iv)
}
}
}
for _, formFile := range formFiles {
if len(formFile.fileBytes) > 0 && formFile.fileName != "" {
w.Boundary()
part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName))
if err != nil {
return nil, err
}
_, err = part.Write(formFile.fileBytes)
if err != nil {
return nil, err
}
}
}
// Set the Boundary in the Content-Type
headerParams["Content-Type"] = w.FormDataContentType()
// Set Content-Length
headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len())
w.Close()
}
if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 {
if body != nil {
return nil, fmt.Errorf("cannot specify postBody and x-www-form-urlencoded form at the same time.")
}
body = &bytes.Buffer{}
body.WriteString(formParams.Encode())
// Set Content-Length
headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len())
}
// Setup path and query parameters
url, err := url.Parse(path)
if err != nil {
return nil, err
}
// Override request host, if applicable
if c.cfg.Host != "" {
url.Host = c.cfg.Host
}
// Override request scheme, if applicable
if c.cfg.Scheme != "" {
url.Scheme = c.cfg.Scheme
}
// Adding Query Param
query := url.Query()
for k, v := range queryParams {
for _, iv := range v {
query.Add(k, iv)
}
}
// Encode the parameters.
url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string {
pieces := strings.Split(s, "=")
pieces[0] = queryDescape.Replace(pieces[0])
return strings.Join(pieces, "=")
})
// Generate a new request
if body != nil {
localVarRequest, err = http.NewRequest(method, url.String(), body)
} else {
localVarRequest, err = http.NewRequest(method, url.String(), nil)
}
if err != nil {
return nil, err
}
// add header parameters, if any
if len(headerParams) > 0 {
headers := http.Header{}
for h, v := range headerParams {
headers[h] = []string{v}
}
localVarRequest.Header = headers
}
// Add the user agent to the request.
localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent)
if ctx != nil {
// add context to the request
localVarRequest = localVarRequest.WithContext(ctx)
// Walk through any authentication.
}
for header, value := range c.cfg.DefaultHeader {
localVarRequest.Header.Add(header, value)
}
return localVarRequest, nil
}
func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) {
if len(b) == 0 {
return nil
}
if s, ok := v.(*string); ok {
*s = string(b)
return nil
}
if f, ok := v.(*os.File); ok {
f, err = os.CreateTemp("", "HttpClientFile")
if err != nil {
return
}
_, err = f.Write(b)
if err != nil {
return
}
_, err = f.Seek(0, io.SeekStart)
return
}
if f, ok := v.(**os.File); ok {
*f, err = os.CreateTemp("", "HttpClientFile")
if err != nil {
return
}
_, err = (*f).Write(b)
if err != nil {
return
}
_, err = (*f).Seek(0, io.SeekStart)
return
}
if xmlCheck.MatchString(contentType) {
if err = xml.Unmarshal(b, v); err != nil {
return err
}
return nil
}
if jsonCheck.MatchString(contentType) {
if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas
if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined
if err = unmarshalObj.UnmarshalJSON(b); err != nil {
return err
}
} else {
return fmt.Errorf("unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined")
}
} else if err = json.Unmarshal(b, v); err != nil { // simple model
return err
}
return nil
}
return fmt.Errorf("undefined response type")
}
// Add a file to the multipart request
func addFile(w *multipart.Writer, fieldName, path string) error {
file, err := os.Open(filepath.Clean(path))
if err != nil {
return err
}
defer file.Close()
part, err := w.CreateFormFile(fieldName, filepath.Base(path))
if err != nil {
return err
}
_, err = io.Copy(part, file)
return err
}
// A wrapper for strict JSON decoding
func newStrictDecoder(data []byte) *json.Decoder {
dec := json.NewDecoder(bytes.NewBuffer(data))
dec.DisallowUnknownFields()
return dec
}
// Set request body from an interface{}
func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) {
if bodyBuf == nil {
bodyBuf = &bytes.Buffer{}
}
if reader, ok := body.(io.Reader); ok {
_, err = bodyBuf.ReadFrom(reader)
} else if fp, ok := body.(*os.File); ok {
_, err = bodyBuf.ReadFrom(fp)
} else if b, ok := body.([]byte); ok {
_, err = bodyBuf.Write(b)
} else if s, ok := body.(string); ok {
_, err = bodyBuf.WriteString(s)
} else if s, ok := body.(*string); ok {
_, err = bodyBuf.WriteString(*s)
} else if jsonCheck.MatchString(contentType) {
err = json.NewEncoder(bodyBuf).Encode(body)
} else if xmlCheck.MatchString(contentType) {
err = xml.NewEncoder(bodyBuf).Encode(body)
}
if err != nil {
return nil, err
}
if bodyBuf.Len() == 0 {
err = fmt.Errorf("invalid body type %s", contentType)
return nil, err
}
return bodyBuf, nil
}
// detectContentType method is used to figure out `Request.Body` content type for request header
func detectContentType(body interface{}) string {
contentType := "text/plain; charset=utf-8"
kind := reflect.TypeOf(body).Kind()
switch kind {
case reflect.Struct, reflect.Map, reflect.Ptr:
contentType = "application/json; charset=utf-8"
case reflect.String:
contentType = "text/plain; charset=utf-8"
default:
if b, ok := body.([]byte); ok {
contentType = http.DetectContentType(b)
} else if kind == reflect.Slice {
contentType = "application/json; charset=utf-8"
}
}
return contentType
}
// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go
type cacheControl map[string]string
func parseCacheControl(headers http.Header) cacheControl {
cc := cacheControl{}
ccHeader := headers.Get("Cache-Control")
for _, part := range strings.Split(ccHeader, ",") {
part = strings.Trim(part, " ")
if part == "" {
continue
}
if strings.ContainsRune(part, '=') {
keyval := strings.Split(part, "=")
cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",")
} else {
cc[part] = ""
}
}
return cc
}
// CacheExpires helper function to determine remaining time before repeating a request.
func CacheExpires(r *http.Response) time.Time {
// Figure out when the cache expires.
var expires time.Time
now, err := time.Parse(time.RFC1123, r.Header.Get("date"))
if err != nil {
return time.Now()
}
respCacheControl := parseCacheControl(r.Header)
if maxAge, ok := respCacheControl["max-age"]; ok {
lifetime, err := time.ParseDuration(maxAge + "s")
if err != nil {
expires = now
} else {
expires = now.Add(lifetime)
}
} else {
expiresHeader := r.Header.Get("Expires")
if expiresHeader != "" {
expires, err = time.Parse(time.RFC1123, expiresHeader)
if err != nil {
expires = now
}
}
}
return expires
}
func strlen(s string) int {
return utf8.RuneCountInString(s)
}

View file

@ -0,0 +1,41 @@
/*
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 (
"github.com/stackitcloud/stackit-sdk-go/core/config"
)
// NewConfiguration returns a new Configuration object
func NewConfiguration() *config.Configuration {
cfg := &config.Configuration{
DefaultHeader: make(map[string]string),
UserAgent: "stackit-sdk-go/vpnalpha",
Debug: false,
Servers: config.ServerConfigurations{
{
URL: "https://vpn.api.{region}stackit.cloud",
Description: "No description provided",
Variables: map[string]config.ServerVariable{
"region": {
Description: "No description provided",
DefaultValue: "eu01.",
EnumValues: []string{
"eu01.",
},
},
},
},
},
OperationServers: map[string]config.ServerConfigurations{},
}
return cfg
}

View file

@ -0,0 +1,269 @@
/*
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 APIError type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &APIError{}
/*
types and functions for code
*/
// isInteger
type APIErrorGetCodeAttributeType = *int64
type APIErrorGetCodeArgType = int64
type APIErrorGetCodeRetType = int64
func getAPIErrorGetCodeAttributeTypeOk(arg APIErrorGetCodeAttributeType) (ret APIErrorGetCodeRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setAPIErrorGetCodeAttributeType(arg *APIErrorGetCodeAttributeType, val APIErrorGetCodeRetType) {
*arg = &val
}
/*
types and functions for details
*/
// isArray
type APIErrorGetDetailsAttributeType = *[]APIErrorDetail
type APIErrorGetDetailsArgType = []APIErrorDetail
type APIErrorGetDetailsRetType = []APIErrorDetail
func getAPIErrorGetDetailsAttributeTypeOk(arg APIErrorGetDetailsAttributeType) (ret APIErrorGetDetailsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setAPIErrorGetDetailsAttributeType(arg *APIErrorGetDetailsAttributeType, val APIErrorGetDetailsRetType) {
*arg = &val
}
/*
types and functions for message
*/
// isNotNullableString
type APIErrorGetMessageAttributeType = *string
func getAPIErrorGetMessageAttributeTypeOk(arg APIErrorGetMessageAttributeType) (ret APIErrorGetMessageRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setAPIErrorGetMessageAttributeType(arg *APIErrorGetMessageAttributeType, val APIErrorGetMessageRetType) {
*arg = &val
}
type APIErrorGetMessageArgType = string
type APIErrorGetMessageRetType = string
/*
types and functions for status
*/
// isNotNullableString
type APIErrorGetStatusAttributeType = *string
func getAPIErrorGetStatusAttributeTypeOk(arg APIErrorGetStatusAttributeType) (ret APIErrorGetStatusRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setAPIErrorGetStatusAttributeType(arg *APIErrorGetStatusAttributeType, val APIErrorGetStatusRetType) {
*arg = &val
}
type APIErrorGetStatusArgType = string
type APIErrorGetStatusRetType = string
// APIError struct for APIError
type APIError struct {
// The HTTP status code.
// Can be cast to int32 without loss of precision.
// REQUIRED
Code APIErrorGetCodeAttributeType `json:"code" required:"true"`
// Can contain more details on the error.
Details APIErrorGetDetailsAttributeType `json:"details,omitempty"`
// A message describing the error.
// REQUIRED
Message APIErrorGetMessageAttributeType `json:"message" required:"true"`
// The HTTP status code text.
Status APIErrorGetStatusAttributeType `json:"status,omitempty"`
}
type _APIError APIError
// NewAPIError instantiates a new APIError 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 NewAPIError(code APIErrorGetCodeArgType, message APIErrorGetMessageArgType) *APIError {
this := APIError{}
setAPIErrorGetCodeAttributeType(&this.Code, code)
setAPIErrorGetMessageAttributeType(&this.Message, message)
return &this
}
// NewAPIErrorWithDefaults instantiates a new APIError 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 NewAPIErrorWithDefaults() *APIError {
this := APIError{}
return &this
}
// GetCode returns the Code field value
func (o *APIError) GetCode() (ret APIErrorGetCodeRetType) {
ret, _ = o.GetCodeOk()
return ret
}
// GetCodeOk returns a tuple with the Code field value
// and a boolean to check if the value has been set.
func (o *APIError) GetCodeOk() (ret APIErrorGetCodeRetType, ok bool) {
return getAPIErrorGetCodeAttributeTypeOk(o.Code)
}
// SetCode sets field value
func (o *APIError) SetCode(v APIErrorGetCodeRetType) {
setAPIErrorGetCodeAttributeType(&o.Code, v)
}
// GetDetails returns the Details field value if set, zero value otherwise.
func (o *APIError) GetDetails() (res APIErrorGetDetailsRetType) {
res, _ = o.GetDetailsOk()
return
}
// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *APIError) GetDetailsOk() (ret APIErrorGetDetailsRetType, ok bool) {
return getAPIErrorGetDetailsAttributeTypeOk(o.Details)
}
// HasDetails returns a boolean if a field has been set.
func (o *APIError) HasDetails() bool {
_, ok := o.GetDetailsOk()
return ok
}
// SetDetails gets a reference to the given []APIErrorDetail and assigns it to the Details field.
func (o *APIError) SetDetails(v APIErrorGetDetailsRetType) {
setAPIErrorGetDetailsAttributeType(&o.Details, v)
}
// GetMessage returns the Message field value
func (o *APIError) GetMessage() (ret APIErrorGetMessageRetType) {
ret, _ = o.GetMessageOk()
return ret
}
// GetMessageOk returns a tuple with the Message field value
// and a boolean to check if the value has been set.
func (o *APIError) GetMessageOk() (ret APIErrorGetMessageRetType, ok bool) {
return getAPIErrorGetMessageAttributeTypeOk(o.Message)
}
// SetMessage sets field value
func (o *APIError) SetMessage(v APIErrorGetMessageRetType) {
setAPIErrorGetMessageAttributeType(&o.Message, v)
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *APIError) GetStatus() (res APIErrorGetStatusRetType) {
res, _ = o.GetStatusOk()
return
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *APIError) GetStatusOk() (ret APIErrorGetStatusRetType, ok bool) {
return getAPIErrorGetStatusAttributeTypeOk(o.Status)
}
// HasStatus returns a boolean if a field has been set.
func (o *APIError) HasStatus() bool {
_, ok := o.GetStatusOk()
return ok
}
// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *APIError) SetStatus(v APIErrorGetStatusRetType) {
setAPIErrorGetStatusAttributeType(&o.Status, v)
}
func (o APIError) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getAPIErrorGetCodeAttributeTypeOk(o.Code); ok {
toSerialize["Code"] = val
}
if val, ok := getAPIErrorGetDetailsAttributeTypeOk(o.Details); ok {
toSerialize["Details"] = val
}
if val, ok := getAPIErrorGetMessageAttributeTypeOk(o.Message); ok {
toSerialize["Message"] = val
}
if val, ok := getAPIErrorGetStatusAttributeTypeOk(o.Status); ok {
toSerialize["Status"] = val
}
return toSerialize, nil
}
type NullableAPIError struct {
value *APIError
isSet bool
}
func (v NullableAPIError) Get() *APIError {
return v.value
}
func (v *NullableAPIError) Set(val *APIError) {
v.value = val
v.isSet = true
}
func (v NullableAPIError) IsSet() bool {
return v.isSet
}
func (v *NullableAPIError) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAPIError(val *APIError) *NullableAPIError {
return &NullableAPIError{value: val, isSet: true}
}
func (v NullableAPIError) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAPIError) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,326 @@
/*
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"
"fmt"
)
// checks if the APIErrorDetail type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &APIErrorDetail{}
/*
types and functions for domain
*/
// isNotNullableString
type APIErrorDetailGetDomainAttributeType = *string
func getAPIErrorDetailGetDomainAttributeTypeOk(arg APIErrorDetailGetDomainAttributeType) (ret APIErrorDetailGetDomainRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setAPIErrorDetailGetDomainAttributeType(arg *APIErrorDetailGetDomainAttributeType, val APIErrorDetailGetDomainRetType) {
*arg = &val
}
type APIErrorDetailGetDomainArgType = string
type APIErrorDetailGetDomainRetType = string
/*
types and functions for metadata
*/
// isFreeform
type APIErrorDetailGetMetadataAttributeType = *map[string]interface{}
type APIErrorDetailGetMetadataArgType = map[string]interface{}
type APIErrorDetailGetMetadataRetType = map[string]interface{}
func getAPIErrorDetailGetMetadataAttributeTypeOk(arg APIErrorDetailGetMetadataAttributeType) (ret APIErrorDetailGetMetadataRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setAPIErrorDetailGetMetadataAttributeType(arg *APIErrorDetailGetMetadataAttributeType, val APIErrorDetailGetMetadataRetType) {
*arg = &val
}
/*
types and functions for reason
*/
// isEnum
// APIErrorDetailReason The reason why the error occurs.
// value type for enums
type APIErrorDetailReason string
// List of Reason
const (
APIERRORDETAILREASON_FIELD APIErrorDetailReason = "INVALID_FIELD"
APIERRORDETAILREASON_PATH_PARAMETER APIErrorDetailReason = "INVALID_PATH_PARAMETER"
)
// All allowed values of APIErrorDetail enum
var AllowedAPIErrorDetailReasonEnumValues = []APIErrorDetailReason{
"INVALID_FIELD",
"INVALID_PATH_PARAMETER",
}
func (v *APIErrorDetailReason) UnmarshalJSON(src []byte) error {
// use a type alias to prevent infinite recursion during unmarshal,
// see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers
type TmpJson APIErrorDetailReason
var value TmpJson
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
// Allow unmarshalling zero value for testing purposes
var zeroValue TmpJson
if value == zeroValue {
return nil
}
enumTypeValue := APIErrorDetailReason(value)
for _, existing := range AllowedAPIErrorDetailReasonEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid APIErrorDetail", value)
}
// NewAPIErrorDetailReasonFromValue returns a pointer to a valid APIErrorDetailReason
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewAPIErrorDetailReasonFromValue(v APIErrorDetailReason) (*APIErrorDetailReason, error) {
ev := APIErrorDetailReason(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for APIErrorDetailReason: valid values are %v", v, AllowedAPIErrorDetailReasonEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v APIErrorDetailReason) IsValid() bool {
for _, existing := range AllowedAPIErrorDetailReasonEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to ReasonReason value
func (v APIErrorDetailReason) Ptr() *APIErrorDetailReason {
return &v
}
type NullableAPIErrorDetailReason struct {
value *APIErrorDetailReason
isSet bool
}
func (v NullableAPIErrorDetailReason) Get() *APIErrorDetailReason {
return v.value
}
func (v *NullableAPIErrorDetailReason) Set(val *APIErrorDetailReason) {
v.value = val
v.isSet = true
}
func (v NullableAPIErrorDetailReason) IsSet() bool {
return v.isSet
}
func (v *NullableAPIErrorDetailReason) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAPIErrorDetailReason(val *APIErrorDetailReason) *NullableAPIErrorDetailReason {
return &NullableAPIErrorDetailReason{value: val, isSet: true}
}
func (v NullableAPIErrorDetailReason) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAPIErrorDetailReason) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type APIErrorDetailGetReasonAttributeType = *APIErrorDetailReason
type APIErrorDetailGetReasonArgType = APIErrorDetailReason
type APIErrorDetailGetReasonRetType = APIErrorDetailReason
func getAPIErrorDetailGetReasonAttributeTypeOk(arg APIErrorDetailGetReasonAttributeType) (ret APIErrorDetailGetReasonRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setAPIErrorDetailGetReasonAttributeType(arg *APIErrorDetailGetReasonAttributeType, val APIErrorDetailGetReasonRetType) {
*arg = &val
}
// APIErrorDetail struct for APIErrorDetail
type APIErrorDetail struct {
// The domain of the error source.
// REQUIRED
Domain APIErrorDetailGetDomainAttributeType `json:"domain" required:"true"`
// Metadata contains more information. For bad requests this would be field information.
Metadata APIErrorDetailGetMetadataAttributeType `json:"metadata,omitempty"`
// The reason why the error occurs.
// REQUIRED
Reason APIErrorDetailGetReasonAttributeType `json:"reason" required:"true"`
}
type _APIErrorDetail APIErrorDetail
// NewAPIErrorDetail instantiates a new APIErrorDetail 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 NewAPIErrorDetail(domain APIErrorDetailGetDomainArgType, reason APIErrorDetailGetReasonArgType) *APIErrorDetail {
this := APIErrorDetail{}
setAPIErrorDetailGetDomainAttributeType(&this.Domain, domain)
setAPIErrorDetailGetReasonAttributeType(&this.Reason, reason)
return &this
}
// NewAPIErrorDetailWithDefaults instantiates a new APIErrorDetail 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 NewAPIErrorDetailWithDefaults() *APIErrorDetail {
this := APIErrorDetail{}
var domain string = "vpn.access.stackit.cloud"
this.Domain = &domain
return &this
}
// GetDomain returns the Domain field value
func (o *APIErrorDetail) GetDomain() (ret APIErrorDetailGetDomainRetType) {
ret, _ = o.GetDomainOk()
return ret
}
// GetDomainOk returns a tuple with the Domain field value
// and a boolean to check if the value has been set.
func (o *APIErrorDetail) GetDomainOk() (ret APIErrorDetailGetDomainRetType, ok bool) {
return getAPIErrorDetailGetDomainAttributeTypeOk(o.Domain)
}
// SetDomain sets field value
func (o *APIErrorDetail) SetDomain(v APIErrorDetailGetDomainRetType) {
setAPIErrorDetailGetDomainAttributeType(&o.Domain, v)
}
// GetMetadata returns the Metadata field value if set, zero value otherwise.
func (o *APIErrorDetail) GetMetadata() (res APIErrorDetailGetMetadataRetType) {
res, _ = o.GetMetadataOk()
return
}
// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *APIErrorDetail) GetMetadataOk() (ret APIErrorDetailGetMetadataRetType, ok bool) {
return getAPIErrorDetailGetMetadataAttributeTypeOk(o.Metadata)
}
// HasMetadata returns a boolean if a field has been set.
func (o *APIErrorDetail) HasMetadata() bool {
_, ok := o.GetMetadataOk()
return ok
}
// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field.
func (o *APIErrorDetail) SetMetadata(v APIErrorDetailGetMetadataRetType) {
setAPIErrorDetailGetMetadataAttributeType(&o.Metadata, v)
}
// GetReason returns the Reason field value
func (o *APIErrorDetail) GetReason() (ret APIErrorDetailGetReasonRetType) {
ret, _ = o.GetReasonOk()
return ret
}
// GetReasonOk returns a tuple with the Reason field value
// and a boolean to check if the value has been set.
func (o *APIErrorDetail) GetReasonOk() (ret APIErrorDetailGetReasonRetType, ok bool) {
return getAPIErrorDetailGetReasonAttributeTypeOk(o.Reason)
}
// SetReason sets field value
func (o *APIErrorDetail) SetReason(v APIErrorDetailGetReasonRetType) {
setAPIErrorDetailGetReasonAttributeType(&o.Reason, v)
}
func (o APIErrorDetail) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getAPIErrorDetailGetDomainAttributeTypeOk(o.Domain); ok {
toSerialize["Domain"] = val
}
if val, ok := getAPIErrorDetailGetMetadataAttributeTypeOk(o.Metadata); ok {
toSerialize["Metadata"] = val
}
if val, ok := getAPIErrorDetailGetReasonAttributeTypeOk(o.Reason); ok {
toSerialize["Reason"] = val
}
return toSerialize, nil
}
type NullableAPIErrorDetail struct {
value *APIErrorDetail
isSet bool
}
func (v NullableAPIErrorDetail) Get() *APIErrorDetail {
return v.value
}
func (v *NullableAPIErrorDetail) Set(val *APIErrorDetail) {
v.value = val
v.isSet = true
}
func (v NullableAPIErrorDetail) IsSet() bool {
return v.isSet
}
func (v *NullableAPIErrorDetail) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAPIErrorDetail(val *APIErrorDetail) *NullableAPIErrorDetail {
return &NullableAPIErrorDetail{value: val, isSet: true}
}
func (v NullableAPIErrorDetail) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAPIErrorDetail) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,58 @@
/*
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 (
"testing"
)
// isEnum
func TestAPIErrorDetailReason_UnmarshalJSON(t *testing.T) {
type args struct {
src []byte
}
tests := []struct {
name string
args args
wantErr bool
}{
{
name: `success - possible enum value no. 1`,
args: args{
src: []byte(`"INVALID_FIELD"`),
},
wantErr: false,
},
{
name: `success - possible enum value no. 2`,
args: args{
src: []byte(`"INVALID_PATH_PARAMETER"`),
},
wantErr: false,
},
{
name: "fail",
args: args{
src: []byte("\"FOOBAR\""),
},
wantErr: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
v := APIErrorDetailReason("")
if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr {
t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}

View file

@ -0,0 +1,125 @@
/*
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 APIErrorResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &APIErrorResponse{}
/*
types and functions for error
*/
// isModel
type APIErrorResponseGetErrorAttributeType = *APIError
type APIErrorResponseGetErrorArgType = APIError
type APIErrorResponseGetErrorRetType = APIError
func getAPIErrorResponseGetErrorAttributeTypeOk(arg APIErrorResponseGetErrorAttributeType) (ret APIErrorResponseGetErrorRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setAPIErrorResponseGetErrorAttributeType(arg *APIErrorResponseGetErrorAttributeType, val APIErrorResponseGetErrorRetType) {
*arg = &val
}
// APIErrorResponse struct for APIErrorResponse
type APIErrorResponse struct {
// REQUIRED
Error APIErrorResponseGetErrorAttributeType `json:"error" required:"true"`
}
type _APIErrorResponse APIErrorResponse
// NewAPIErrorResponse instantiates a new APIErrorResponse 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 NewAPIErrorResponse(error_ APIErrorResponseGetErrorArgType) *APIErrorResponse {
this := APIErrorResponse{}
setAPIErrorResponseGetErrorAttributeType(&this.Error, error_)
return &this
}
// NewAPIErrorResponseWithDefaults instantiates a new APIErrorResponse 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 NewAPIErrorResponseWithDefaults() *APIErrorResponse {
this := APIErrorResponse{}
return &this
}
// GetError returns the Error field value
func (o *APIErrorResponse) GetError() (ret APIErrorResponseGetErrorRetType) {
ret, _ = o.GetErrorOk()
return ret
}
// GetErrorOk returns a tuple with the Error field value
// and a boolean to check if the value has been set.
func (o *APIErrorResponse) GetErrorOk() (ret APIErrorResponseGetErrorRetType, ok bool) {
return getAPIErrorResponseGetErrorAttributeTypeOk(o.Error)
}
// SetError sets field value
func (o *APIErrorResponse) SetError(v APIErrorResponseGetErrorRetType) {
setAPIErrorResponseGetErrorAttributeType(&o.Error, v)
}
func (o APIErrorResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getAPIErrorResponseGetErrorAttributeTypeOk(o.Error); ok {
toSerialize["Error"] = val
}
return toSerialize, nil
}
type NullableAPIErrorResponse struct {
value *APIErrorResponse
isSet bool
}
func (v NullableAPIErrorResponse) Get() *APIErrorResponse {
return v.value
}
func (v *NullableAPIErrorResponse) Set(val *APIErrorResponse) {
v.value = val
v.isSet = true
}
func (v NullableAPIErrorResponse) IsSet() bool {
return v.isSet
}
func (v *NullableAPIErrorResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAPIErrorResponse(val *APIErrorResponse) *NullableAPIErrorResponse {
return &NullableAPIErrorResponse{value: val, isSet: true}
}
func (v NullableAPIErrorResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAPIErrorResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,177 @@
/*
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)
}

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,174 @@
/*
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 BGPStatus type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BGPStatus{}
/*
types and functions for peers
*/
// isArray
type BGPStatusGetPeersAttributeType = *[]BGPStatusPeers
type BGPStatusGetPeersArgType = []BGPStatusPeers
type BGPStatusGetPeersRetType = []BGPStatusPeers
func getBGPStatusGetPeersAttributeTypeOk(arg BGPStatusGetPeersAttributeType) (ret BGPStatusGetPeersRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setBGPStatusGetPeersAttributeType(arg *BGPStatusGetPeersAttributeType, val BGPStatusGetPeersRetType) {
*arg = &val
}
/*
types and functions for routes
*/
// isArray
type BGPStatusGetRoutesAttributeType = *[]BGPStatusRoutes
type BGPStatusGetRoutesArgType = []BGPStatusRoutes
type BGPStatusGetRoutesRetType = []BGPStatusRoutes
func getBGPStatusGetRoutesAttributeTypeOk(arg BGPStatusGetRoutesAttributeType) (ret BGPStatusGetRoutesRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setBGPStatusGetRoutesAttributeType(arg *BGPStatusGetRoutesAttributeType, val BGPStatusGetRoutesRetType) {
*arg = &val
}
// BGPStatus struct for BGPStatus
type BGPStatus struct {
Peers BGPStatusGetPeersAttributeType `json:"peers,omitempty"`
Routes BGPStatusGetRoutesAttributeType `json:"routes,omitempty"`
}
// NewBGPStatus instantiates a new BGPStatus 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 NewBGPStatus() *BGPStatus {
this := BGPStatus{}
return &this
}
// NewBGPStatusWithDefaults instantiates a new BGPStatus 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 NewBGPStatusWithDefaults() *BGPStatus {
this := BGPStatus{}
return &this
}
// GetPeers returns the Peers field value if set, zero value otherwise.
func (o *BGPStatus) GetPeers() (res BGPStatusGetPeersRetType) {
res, _ = o.GetPeersOk()
return
}
// GetPeersOk returns a tuple with the Peers field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BGPStatus) GetPeersOk() (ret BGPStatusGetPeersRetType, ok bool) {
return getBGPStatusGetPeersAttributeTypeOk(o.Peers)
}
// HasPeers returns a boolean if a field has been set.
func (o *BGPStatus) HasPeers() bool {
_, ok := o.GetPeersOk()
return ok
}
// SetPeers gets a reference to the given []BGPStatusPeers and assigns it to the Peers field.
func (o *BGPStatus) SetPeers(v BGPStatusGetPeersRetType) {
setBGPStatusGetPeersAttributeType(&o.Peers, v)
}
// GetRoutes returns the Routes field value if set, zero value otherwise.
func (o *BGPStatus) GetRoutes() (res BGPStatusGetRoutesRetType) {
res, _ = o.GetRoutesOk()
return
}
// GetRoutesOk returns a tuple with the Routes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BGPStatus) GetRoutesOk() (ret BGPStatusGetRoutesRetType, ok bool) {
return getBGPStatusGetRoutesAttributeTypeOk(o.Routes)
}
// HasRoutes returns a boolean if a field has been set.
func (o *BGPStatus) HasRoutes() bool {
_, ok := o.GetRoutesOk()
return ok
}
// SetRoutes gets a reference to the given []BGPStatusRoutes and assigns it to the Routes field.
func (o *BGPStatus) SetRoutes(v BGPStatusGetRoutesRetType) {
setBGPStatusGetRoutesAttributeType(&o.Routes, v)
}
func (o BGPStatus) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getBGPStatusGetPeersAttributeTypeOk(o.Peers); ok {
toSerialize["Peers"] = val
}
if val, ok := getBGPStatusGetRoutesAttributeTypeOk(o.Routes); ok {
toSerialize["Routes"] = val
}
return toSerialize, nil
}
type NullableBGPStatus struct {
value *BGPStatus
isSet bool
}
func (v NullableBGPStatus) Get() *BGPStatus {
return v.value
}
func (v *NullableBGPStatus) Set(val *BGPStatus) {
v.value = val
v.isSet = true
}
func (v NullableBGPStatus) IsSet() bool {
return v.isSet
}
func (v *NullableBGPStatus) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBGPStatus(val *BGPStatus) *NullableBGPStatus {
return &NullableBGPStatus{value: val, isSet: true}
}
func (v NullableBGPStatus) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBGPStatus) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,386 @@
/*
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 BGPStatusPeers type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BGPStatusPeers{}
/*
types and functions for localAs
*/
// isNumber
type BGPStatusPeersGetLocalAsAttributeType = *float64
type BGPStatusPeersGetLocalAsArgType = float64
type BGPStatusPeersGetLocalAsRetType = float64
func getBGPStatusPeersGetLocalAsAttributeTypeOk(arg BGPStatusPeersGetLocalAsAttributeType) (ret BGPStatusPeersGetLocalAsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setBGPStatusPeersGetLocalAsAttributeType(arg *BGPStatusPeersGetLocalAsAttributeType, val BGPStatusPeersGetLocalAsRetType) {
*arg = &val
}
/*
types and functions for peerUptime
*/
// isNotNullableString
type BGPStatusPeersGetPeerUptimeAttributeType = *string
func getBGPStatusPeersGetPeerUptimeAttributeTypeOk(arg BGPStatusPeersGetPeerUptimeAttributeType) (ret BGPStatusPeersGetPeerUptimeRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setBGPStatusPeersGetPeerUptimeAttributeType(arg *BGPStatusPeersGetPeerUptimeAttributeType, val BGPStatusPeersGetPeerUptimeRetType) {
*arg = &val
}
type BGPStatusPeersGetPeerUptimeArgType = string
type BGPStatusPeersGetPeerUptimeRetType = string
/*
types and functions for pfxRcd
*/
// isNumber
type BGPStatusPeersGetPfxRcdAttributeType = *float64
type BGPStatusPeersGetPfxRcdArgType = float64
type BGPStatusPeersGetPfxRcdRetType = float64
func getBGPStatusPeersGetPfxRcdAttributeTypeOk(arg BGPStatusPeersGetPfxRcdAttributeType) (ret BGPStatusPeersGetPfxRcdRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setBGPStatusPeersGetPfxRcdAttributeType(arg *BGPStatusPeersGetPfxRcdAttributeType, val BGPStatusPeersGetPfxRcdRetType) {
*arg = &val
}
/*
types and functions for pfxSnt
*/
// isNumber
type BGPStatusPeersGetPfxSntAttributeType = *float64
type BGPStatusPeersGetPfxSntArgType = float64
type BGPStatusPeersGetPfxSntRetType = float64
func getBGPStatusPeersGetPfxSntAttributeTypeOk(arg BGPStatusPeersGetPfxSntAttributeType) (ret BGPStatusPeersGetPfxSntRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setBGPStatusPeersGetPfxSntAttributeType(arg *BGPStatusPeersGetPfxSntAttributeType, val BGPStatusPeersGetPfxSntRetType) {
*arg = &val
}
/*
types and functions for remoteAs
*/
// isNumber
type BGPStatusPeersGetRemoteAsAttributeType = *float64
type BGPStatusPeersGetRemoteAsArgType = float64
type BGPStatusPeersGetRemoteAsRetType = float64
func getBGPStatusPeersGetRemoteAsAttributeTypeOk(arg BGPStatusPeersGetRemoteAsAttributeType) (ret BGPStatusPeersGetRemoteAsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setBGPStatusPeersGetRemoteAsAttributeType(arg *BGPStatusPeersGetRemoteAsAttributeType, val BGPStatusPeersGetRemoteAsRetType) {
*arg = &val
}
/*
types and functions for remoteIP
*/
// isNotNullableString
type BGPStatusPeersGetRemoteIPAttributeType = *string
func getBGPStatusPeersGetRemoteIPAttributeTypeOk(arg BGPStatusPeersGetRemoteIPAttributeType) (ret BGPStatusPeersGetRemoteIPRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setBGPStatusPeersGetRemoteIPAttributeType(arg *BGPStatusPeersGetRemoteIPAttributeType, val BGPStatusPeersGetRemoteIPRetType) {
*arg = &val
}
type BGPStatusPeersGetRemoteIPArgType = string
type BGPStatusPeersGetRemoteIPRetType = string
/*
types and functions for state
*/
// isNotNullableString
type BGPStatusPeersGetStateAttributeType = *string
func getBGPStatusPeersGetStateAttributeTypeOk(arg BGPStatusPeersGetStateAttributeType) (ret BGPStatusPeersGetStateRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setBGPStatusPeersGetStateAttributeType(arg *BGPStatusPeersGetStateAttributeType, val BGPStatusPeersGetStateRetType) {
*arg = &val
}
type BGPStatusPeersGetStateArgType = string
type BGPStatusPeersGetStateRetType = string
// BGPStatusPeers struct for BGPStatusPeers
type BGPStatusPeers struct {
// REQUIRED
LocalAs BGPStatusPeersGetLocalAsAttributeType `json:"localAs" required:"true"`
// REQUIRED
PeerUptime BGPStatusPeersGetPeerUptimeAttributeType `json:"peerUptime" required:"true"`
// REQUIRED
PfxRcd BGPStatusPeersGetPfxRcdAttributeType `json:"pfxRcd" required:"true"`
// REQUIRED
PfxSnt BGPStatusPeersGetPfxSntAttributeType `json:"pfxSnt" required:"true"`
// REQUIRED
RemoteAs BGPStatusPeersGetRemoteAsAttributeType `json:"remoteAs" required:"true"`
// REQUIRED
RemoteIP BGPStatusPeersGetRemoteIPAttributeType `json:"remoteIP" required:"true"`
// REQUIRED
State BGPStatusPeersGetStateAttributeType `json:"state" required:"true"`
}
type _BGPStatusPeers BGPStatusPeers
// NewBGPStatusPeers instantiates a new BGPStatusPeers 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 NewBGPStatusPeers(localAs BGPStatusPeersGetLocalAsArgType, peerUptime BGPStatusPeersGetPeerUptimeArgType, pfxRcd BGPStatusPeersGetPfxRcdArgType, pfxSnt BGPStatusPeersGetPfxSntArgType, remoteAs BGPStatusPeersGetRemoteAsArgType, remoteIP BGPStatusPeersGetRemoteIPArgType, state BGPStatusPeersGetStateArgType) *BGPStatusPeers {
this := BGPStatusPeers{}
setBGPStatusPeersGetLocalAsAttributeType(&this.LocalAs, localAs)
setBGPStatusPeersGetPeerUptimeAttributeType(&this.PeerUptime, peerUptime)
setBGPStatusPeersGetPfxRcdAttributeType(&this.PfxRcd, pfxRcd)
setBGPStatusPeersGetPfxSntAttributeType(&this.PfxSnt, pfxSnt)
setBGPStatusPeersGetRemoteAsAttributeType(&this.RemoteAs, remoteAs)
setBGPStatusPeersGetRemoteIPAttributeType(&this.RemoteIP, remoteIP)
setBGPStatusPeersGetStateAttributeType(&this.State, state)
return &this
}
// NewBGPStatusPeersWithDefaults instantiates a new BGPStatusPeers 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 NewBGPStatusPeersWithDefaults() *BGPStatusPeers {
this := BGPStatusPeers{}
return &this
}
// GetLocalAs returns the LocalAs field value
func (o *BGPStatusPeers) GetLocalAs() (ret BGPStatusPeersGetLocalAsRetType) {
ret, _ = o.GetLocalAsOk()
return ret
}
// GetLocalAsOk returns a tuple with the LocalAs field value
// and a boolean to check if the value has been set.
func (o *BGPStatusPeers) GetLocalAsOk() (ret BGPStatusPeersGetLocalAsRetType, ok bool) {
return getBGPStatusPeersGetLocalAsAttributeTypeOk(o.LocalAs)
}
// SetLocalAs sets field value
func (o *BGPStatusPeers) SetLocalAs(v BGPStatusPeersGetLocalAsRetType) {
setBGPStatusPeersGetLocalAsAttributeType(&o.LocalAs, v)
}
// GetPeerUptime returns the PeerUptime field value
func (o *BGPStatusPeers) GetPeerUptime() (ret BGPStatusPeersGetPeerUptimeRetType) {
ret, _ = o.GetPeerUptimeOk()
return ret
}
// GetPeerUptimeOk returns a tuple with the PeerUptime field value
// and a boolean to check if the value has been set.
func (o *BGPStatusPeers) GetPeerUptimeOk() (ret BGPStatusPeersGetPeerUptimeRetType, ok bool) {
return getBGPStatusPeersGetPeerUptimeAttributeTypeOk(o.PeerUptime)
}
// SetPeerUptime sets field value
func (o *BGPStatusPeers) SetPeerUptime(v BGPStatusPeersGetPeerUptimeRetType) {
setBGPStatusPeersGetPeerUptimeAttributeType(&o.PeerUptime, v)
}
// GetPfxRcd returns the PfxRcd field value
func (o *BGPStatusPeers) GetPfxRcd() (ret BGPStatusPeersGetPfxRcdRetType) {
ret, _ = o.GetPfxRcdOk()
return ret
}
// GetPfxRcdOk returns a tuple with the PfxRcd field value
// and a boolean to check if the value has been set.
func (o *BGPStatusPeers) GetPfxRcdOk() (ret BGPStatusPeersGetPfxRcdRetType, ok bool) {
return getBGPStatusPeersGetPfxRcdAttributeTypeOk(o.PfxRcd)
}
// SetPfxRcd sets field value
func (o *BGPStatusPeers) SetPfxRcd(v BGPStatusPeersGetPfxRcdRetType) {
setBGPStatusPeersGetPfxRcdAttributeType(&o.PfxRcd, v)
}
// GetPfxSnt returns the PfxSnt field value
func (o *BGPStatusPeers) GetPfxSnt() (ret BGPStatusPeersGetPfxSntRetType) {
ret, _ = o.GetPfxSntOk()
return ret
}
// GetPfxSntOk returns a tuple with the PfxSnt field value
// and a boolean to check if the value has been set.
func (o *BGPStatusPeers) GetPfxSntOk() (ret BGPStatusPeersGetPfxSntRetType, ok bool) {
return getBGPStatusPeersGetPfxSntAttributeTypeOk(o.PfxSnt)
}
// SetPfxSnt sets field value
func (o *BGPStatusPeers) SetPfxSnt(v BGPStatusPeersGetPfxSntRetType) {
setBGPStatusPeersGetPfxSntAttributeType(&o.PfxSnt, v)
}
// GetRemoteAs returns the RemoteAs field value
func (o *BGPStatusPeers) GetRemoteAs() (ret BGPStatusPeersGetRemoteAsRetType) {
ret, _ = o.GetRemoteAsOk()
return ret
}
// GetRemoteAsOk returns a tuple with the RemoteAs field value
// and a boolean to check if the value has been set.
func (o *BGPStatusPeers) GetRemoteAsOk() (ret BGPStatusPeersGetRemoteAsRetType, ok bool) {
return getBGPStatusPeersGetRemoteAsAttributeTypeOk(o.RemoteAs)
}
// SetRemoteAs sets field value
func (o *BGPStatusPeers) SetRemoteAs(v BGPStatusPeersGetRemoteAsRetType) {
setBGPStatusPeersGetRemoteAsAttributeType(&o.RemoteAs, v)
}
// GetRemoteIP returns the RemoteIP field value
func (o *BGPStatusPeers) GetRemoteIP() (ret BGPStatusPeersGetRemoteIPRetType) {
ret, _ = o.GetRemoteIPOk()
return ret
}
// GetRemoteIPOk returns a tuple with the RemoteIP field value
// and a boolean to check if the value has been set.
func (o *BGPStatusPeers) GetRemoteIPOk() (ret BGPStatusPeersGetRemoteIPRetType, ok bool) {
return getBGPStatusPeersGetRemoteIPAttributeTypeOk(o.RemoteIP)
}
// SetRemoteIP sets field value
func (o *BGPStatusPeers) SetRemoteIP(v BGPStatusPeersGetRemoteIPRetType) {
setBGPStatusPeersGetRemoteIPAttributeType(&o.RemoteIP, v)
}
// GetState returns the State field value
func (o *BGPStatusPeers) GetState() (ret BGPStatusPeersGetStateRetType) {
ret, _ = o.GetStateOk()
return ret
}
// GetStateOk returns a tuple with the State field value
// and a boolean to check if the value has been set.
func (o *BGPStatusPeers) GetStateOk() (ret BGPStatusPeersGetStateRetType, ok bool) {
return getBGPStatusPeersGetStateAttributeTypeOk(o.State)
}
// SetState sets field value
func (o *BGPStatusPeers) SetState(v BGPStatusPeersGetStateRetType) {
setBGPStatusPeersGetStateAttributeType(&o.State, v)
}
func (o BGPStatusPeers) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getBGPStatusPeersGetLocalAsAttributeTypeOk(o.LocalAs); ok {
toSerialize["LocalAs"] = val
}
if val, ok := getBGPStatusPeersGetPeerUptimeAttributeTypeOk(o.PeerUptime); ok {
toSerialize["PeerUptime"] = val
}
if val, ok := getBGPStatusPeersGetPfxRcdAttributeTypeOk(o.PfxRcd); ok {
toSerialize["PfxRcd"] = val
}
if val, ok := getBGPStatusPeersGetPfxSntAttributeTypeOk(o.PfxSnt); ok {
toSerialize["PfxSnt"] = val
}
if val, ok := getBGPStatusPeersGetRemoteAsAttributeTypeOk(o.RemoteAs); ok {
toSerialize["RemoteAs"] = val
}
if val, ok := getBGPStatusPeersGetRemoteIPAttributeTypeOk(o.RemoteIP); ok {
toSerialize["RemoteIP"] = val
}
if val, ok := getBGPStatusPeersGetStateAttributeTypeOk(o.State); ok {
toSerialize["State"] = val
}
return toSerialize, nil
}
type NullableBGPStatusPeers struct {
value *BGPStatusPeers
isSet bool
}
func (v NullableBGPStatusPeers) Get() *BGPStatusPeers {
return v.value
}
func (v *NullableBGPStatusPeers) Set(val *BGPStatusPeers) {
v.value = val
v.isSet = true
}
func (v NullableBGPStatusPeers) IsSet() bool {
return v.isSet
}
func (v *NullableBGPStatusPeers) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBGPStatusPeers(val *BGPStatusPeers) *NullableBGPStatusPeers {
return &NullableBGPStatusPeers{value: val, isSet: true}
}
func (v NullableBGPStatusPeers) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBGPStatusPeers) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,301 @@
/*
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 BGPStatusRoutes type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BGPStatusRoutes{}
/*
types and functions for network
*/
// isNotNullableString
type BGPStatusRoutesGetNetworkAttributeType = *string
func getBGPStatusRoutesGetNetworkAttributeTypeOk(arg BGPStatusRoutesGetNetworkAttributeType) (ret BGPStatusRoutesGetNetworkRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setBGPStatusRoutesGetNetworkAttributeType(arg *BGPStatusRoutesGetNetworkAttributeType, val BGPStatusRoutesGetNetworkRetType) {
*arg = &val
}
type BGPStatusRoutesGetNetworkArgType = string
type BGPStatusRoutesGetNetworkRetType = string
/*
types and functions for origin
*/
// isNotNullableString
type BGPStatusRoutesGetOriginAttributeType = *string
func getBGPStatusRoutesGetOriginAttributeTypeOk(arg BGPStatusRoutesGetOriginAttributeType) (ret BGPStatusRoutesGetOriginRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setBGPStatusRoutesGetOriginAttributeType(arg *BGPStatusRoutesGetOriginAttributeType, val BGPStatusRoutesGetOriginRetType) {
*arg = &val
}
type BGPStatusRoutesGetOriginArgType = string
type BGPStatusRoutesGetOriginRetType = string
/*
types and functions for path
*/
// isNotNullableString
type BGPStatusRoutesGetPathAttributeType = *string
func getBGPStatusRoutesGetPathAttributeTypeOk(arg BGPStatusRoutesGetPathAttributeType) (ret BGPStatusRoutesGetPathRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setBGPStatusRoutesGetPathAttributeType(arg *BGPStatusRoutesGetPathAttributeType, val BGPStatusRoutesGetPathRetType) {
*arg = &val
}
type BGPStatusRoutesGetPathArgType = string
type BGPStatusRoutesGetPathRetType = string
/*
types and functions for peerId
*/
// isNotNullableString
type BGPStatusRoutesGetPeerIdAttributeType = *string
func getBGPStatusRoutesGetPeerIdAttributeTypeOk(arg BGPStatusRoutesGetPeerIdAttributeType) (ret BGPStatusRoutesGetPeerIdRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setBGPStatusRoutesGetPeerIdAttributeType(arg *BGPStatusRoutesGetPeerIdAttributeType, val BGPStatusRoutesGetPeerIdRetType) {
*arg = &val
}
type BGPStatusRoutesGetPeerIdArgType = string
type BGPStatusRoutesGetPeerIdRetType = string
/*
types and functions for weight
*/
// isNumber
type BGPStatusRoutesGetWeightAttributeType = *float64
type BGPStatusRoutesGetWeightArgType = float64
type BGPStatusRoutesGetWeightRetType = float64
func getBGPStatusRoutesGetWeightAttributeTypeOk(arg BGPStatusRoutesGetWeightAttributeType) (ret BGPStatusRoutesGetWeightRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setBGPStatusRoutesGetWeightAttributeType(arg *BGPStatusRoutesGetWeightAttributeType, val BGPStatusRoutesGetWeightRetType) {
*arg = &val
}
// BGPStatusRoutes struct for BGPStatusRoutes
type BGPStatusRoutes struct {
// REQUIRED
Network BGPStatusRoutesGetNetworkAttributeType `json:"network" required:"true"`
// REQUIRED
Origin BGPStatusRoutesGetOriginAttributeType `json:"origin" required:"true"`
// REQUIRED
Path BGPStatusRoutesGetPathAttributeType `json:"path" required:"true"`
// REQUIRED
PeerId BGPStatusRoutesGetPeerIdAttributeType `json:"peerId" required:"true"`
// REQUIRED
Weight BGPStatusRoutesGetWeightAttributeType `json:"weight" required:"true"`
}
type _BGPStatusRoutes BGPStatusRoutes
// NewBGPStatusRoutes instantiates a new BGPStatusRoutes 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 NewBGPStatusRoutes(network BGPStatusRoutesGetNetworkArgType, origin BGPStatusRoutesGetOriginArgType, path BGPStatusRoutesGetPathArgType, peerId BGPStatusRoutesGetPeerIdArgType, weight BGPStatusRoutesGetWeightArgType) *BGPStatusRoutes {
this := BGPStatusRoutes{}
setBGPStatusRoutesGetNetworkAttributeType(&this.Network, network)
setBGPStatusRoutesGetOriginAttributeType(&this.Origin, origin)
setBGPStatusRoutesGetPathAttributeType(&this.Path, path)
setBGPStatusRoutesGetPeerIdAttributeType(&this.PeerId, peerId)
setBGPStatusRoutesGetWeightAttributeType(&this.Weight, weight)
return &this
}
// NewBGPStatusRoutesWithDefaults instantiates a new BGPStatusRoutes 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 NewBGPStatusRoutesWithDefaults() *BGPStatusRoutes {
this := BGPStatusRoutes{}
return &this
}
// GetNetwork returns the Network field value
func (o *BGPStatusRoutes) GetNetwork() (ret BGPStatusRoutesGetNetworkRetType) {
ret, _ = o.GetNetworkOk()
return ret
}
// GetNetworkOk returns a tuple with the Network field value
// and a boolean to check if the value has been set.
func (o *BGPStatusRoutes) GetNetworkOk() (ret BGPStatusRoutesGetNetworkRetType, ok bool) {
return getBGPStatusRoutesGetNetworkAttributeTypeOk(o.Network)
}
// SetNetwork sets field value
func (o *BGPStatusRoutes) SetNetwork(v BGPStatusRoutesGetNetworkRetType) {
setBGPStatusRoutesGetNetworkAttributeType(&o.Network, v)
}
// GetOrigin returns the Origin field value
func (o *BGPStatusRoutes) GetOrigin() (ret BGPStatusRoutesGetOriginRetType) {
ret, _ = o.GetOriginOk()
return ret
}
// GetOriginOk returns a tuple with the Origin field value
// and a boolean to check if the value has been set.
func (o *BGPStatusRoutes) GetOriginOk() (ret BGPStatusRoutesGetOriginRetType, ok bool) {
return getBGPStatusRoutesGetOriginAttributeTypeOk(o.Origin)
}
// SetOrigin sets field value
func (o *BGPStatusRoutes) SetOrigin(v BGPStatusRoutesGetOriginRetType) {
setBGPStatusRoutesGetOriginAttributeType(&o.Origin, v)
}
// GetPath returns the Path field value
func (o *BGPStatusRoutes) GetPath() (ret BGPStatusRoutesGetPathRetType) {
ret, _ = o.GetPathOk()
return ret
}
// GetPathOk returns a tuple with the Path field value
// and a boolean to check if the value has been set.
func (o *BGPStatusRoutes) GetPathOk() (ret BGPStatusRoutesGetPathRetType, ok bool) {
return getBGPStatusRoutesGetPathAttributeTypeOk(o.Path)
}
// SetPath sets field value
func (o *BGPStatusRoutes) SetPath(v BGPStatusRoutesGetPathRetType) {
setBGPStatusRoutesGetPathAttributeType(&o.Path, v)
}
// GetPeerId returns the PeerId field value
func (o *BGPStatusRoutes) GetPeerId() (ret BGPStatusRoutesGetPeerIdRetType) {
ret, _ = o.GetPeerIdOk()
return ret
}
// GetPeerIdOk returns a tuple with the PeerId field value
// and a boolean to check if the value has been set.
func (o *BGPStatusRoutes) GetPeerIdOk() (ret BGPStatusRoutesGetPeerIdRetType, ok bool) {
return getBGPStatusRoutesGetPeerIdAttributeTypeOk(o.PeerId)
}
// SetPeerId sets field value
func (o *BGPStatusRoutes) SetPeerId(v BGPStatusRoutesGetPeerIdRetType) {
setBGPStatusRoutesGetPeerIdAttributeType(&o.PeerId, v)
}
// GetWeight returns the Weight field value
func (o *BGPStatusRoutes) GetWeight() (ret BGPStatusRoutesGetWeightRetType) {
ret, _ = o.GetWeightOk()
return ret
}
// GetWeightOk returns a tuple with the Weight field value
// and a boolean to check if the value has been set.
func (o *BGPStatusRoutes) GetWeightOk() (ret BGPStatusRoutesGetWeightRetType, ok bool) {
return getBGPStatusRoutesGetWeightAttributeTypeOk(o.Weight)
}
// SetWeight sets field value
func (o *BGPStatusRoutes) SetWeight(v BGPStatusRoutesGetWeightRetType) {
setBGPStatusRoutesGetWeightAttributeType(&o.Weight, v)
}
func (o BGPStatusRoutes) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getBGPStatusRoutesGetNetworkAttributeTypeOk(o.Network); ok {
toSerialize["Network"] = val
}
if val, ok := getBGPStatusRoutesGetOriginAttributeTypeOk(o.Origin); ok {
toSerialize["Origin"] = val
}
if val, ok := getBGPStatusRoutesGetPathAttributeTypeOk(o.Path); ok {
toSerialize["Path"] = val
}
if val, ok := getBGPStatusRoutesGetPeerIdAttributeTypeOk(o.PeerId); ok {
toSerialize["PeerId"] = val
}
if val, ok := getBGPStatusRoutesGetWeightAttributeTypeOk(o.Weight); ok {
toSerialize["Weight"] = val
}
return toSerialize, nil
}
type NullableBGPStatusRoutes struct {
value *BGPStatusRoutes
isSet bool
}
func (v NullableBGPStatusRoutes) Get() *BGPStatusRoutes {
return v.value
}
func (v *NullableBGPStatusRoutes) Set(val *BGPStatusRoutes) {
v.value = val
v.isSet = true
}
func (v NullableBGPStatusRoutes) IsSet() bool {
return v.isSet
}
func (v *NullableBGPStatusRoutes) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBGPStatusRoutes(val *BGPStatusRoutes) *NullableBGPStatusRoutes {
return &NullableBGPStatusRoutes{value: val, isSet: true}
}
func (v NullableBGPStatusRoutes) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBGPStatusRoutes) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,225 @@
/*
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 BGPTunnelConfig type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BGPTunnelConfig{}
/*
types and functions for localBgpAddress
*/
// isNotNullableString
type BGPTunnelConfigGetLocalBgpAddressAttributeType = *string
func getBGPTunnelConfigGetLocalBgpAddressAttributeTypeOk(arg BGPTunnelConfigGetLocalBgpAddressAttributeType) (ret BGPTunnelConfigGetLocalBgpAddressRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setBGPTunnelConfigGetLocalBgpAddressAttributeType(arg *BGPTunnelConfigGetLocalBgpAddressAttributeType, val BGPTunnelConfigGetLocalBgpAddressRetType) {
*arg = &val
}
type BGPTunnelConfigGetLocalBgpAddressArgType = string
type BGPTunnelConfigGetLocalBgpAddressRetType = string
/*
types and functions for remoteAsn
*/
// isInteger
type BGPTunnelConfigGetRemoteAsnAttributeType = *int64
type BGPTunnelConfigGetRemoteAsnArgType = int64
type BGPTunnelConfigGetRemoteAsnRetType = int64
func getBGPTunnelConfigGetRemoteAsnAttributeTypeOk(arg BGPTunnelConfigGetRemoteAsnAttributeType) (ret BGPTunnelConfigGetRemoteAsnRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setBGPTunnelConfigGetRemoteAsnAttributeType(arg *BGPTunnelConfigGetRemoteAsnAttributeType, val BGPTunnelConfigGetRemoteAsnRetType) {
*arg = &val
}
/*
types and functions for remoteBgpAddress
*/
// isNotNullableString
type BGPTunnelConfigGetRemoteBgpAddressAttributeType = *string
func getBGPTunnelConfigGetRemoteBgpAddressAttributeTypeOk(arg BGPTunnelConfigGetRemoteBgpAddressAttributeType) (ret BGPTunnelConfigGetRemoteBgpAddressRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setBGPTunnelConfigGetRemoteBgpAddressAttributeType(arg *BGPTunnelConfigGetRemoteBgpAddressAttributeType, val BGPTunnelConfigGetRemoteBgpAddressRetType) {
*arg = &val
}
type BGPTunnelConfigGetRemoteBgpAddressArgType = string
type BGPTunnelConfigGetRemoteBgpAddressRetType = string
// BGPTunnelConfig struct for BGPTunnelConfig
type BGPTunnelConfig struct {
LocalBgpAddress BGPTunnelConfigGetLocalBgpAddressAttributeType `json:"localBgpAddress,omitempty"`
// Remote ASN for Private Use (reserved by IANA) (required if enableBgp=true)
// Can be cast to int32 without loss of precision.
RemoteAsn BGPTunnelConfigGetRemoteAsnAttributeType `json:"remoteAsn,omitempty"`
RemoteBgpAddress BGPTunnelConfigGetRemoteBgpAddressAttributeType `json:"remoteBgpAddress,omitempty"`
}
// NewBGPTunnelConfig instantiates a new BGPTunnelConfig 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 NewBGPTunnelConfig() *BGPTunnelConfig {
this := BGPTunnelConfig{}
return &this
}
// NewBGPTunnelConfigWithDefaults instantiates a new BGPTunnelConfig 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 NewBGPTunnelConfigWithDefaults() *BGPTunnelConfig {
this := BGPTunnelConfig{}
return &this
}
// GetLocalBgpAddress returns the LocalBgpAddress field value if set, zero value otherwise.
func (o *BGPTunnelConfig) GetLocalBgpAddress() (res BGPTunnelConfigGetLocalBgpAddressRetType) {
res, _ = o.GetLocalBgpAddressOk()
return
}
// GetLocalBgpAddressOk returns a tuple with the LocalBgpAddress field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BGPTunnelConfig) GetLocalBgpAddressOk() (ret BGPTunnelConfigGetLocalBgpAddressRetType, ok bool) {
return getBGPTunnelConfigGetLocalBgpAddressAttributeTypeOk(o.LocalBgpAddress)
}
// HasLocalBgpAddress returns a boolean if a field has been set.
func (o *BGPTunnelConfig) HasLocalBgpAddress() bool {
_, ok := o.GetLocalBgpAddressOk()
return ok
}
// SetLocalBgpAddress gets a reference to the given string and assigns it to the LocalBgpAddress field.
func (o *BGPTunnelConfig) SetLocalBgpAddress(v BGPTunnelConfigGetLocalBgpAddressRetType) {
setBGPTunnelConfigGetLocalBgpAddressAttributeType(&o.LocalBgpAddress, v)
}
// GetRemoteAsn returns the RemoteAsn field value if set, zero value otherwise.
func (o *BGPTunnelConfig) GetRemoteAsn() (res BGPTunnelConfigGetRemoteAsnRetType) {
res, _ = o.GetRemoteAsnOk()
return
}
// GetRemoteAsnOk returns a tuple with the RemoteAsn field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BGPTunnelConfig) GetRemoteAsnOk() (ret BGPTunnelConfigGetRemoteAsnRetType, ok bool) {
return getBGPTunnelConfigGetRemoteAsnAttributeTypeOk(o.RemoteAsn)
}
// HasRemoteAsn returns a boolean if a field has been set.
func (o *BGPTunnelConfig) HasRemoteAsn() bool {
_, ok := o.GetRemoteAsnOk()
return ok
}
// SetRemoteAsn gets a reference to the given int64 and assigns it to the RemoteAsn field.
func (o *BGPTunnelConfig) SetRemoteAsn(v BGPTunnelConfigGetRemoteAsnRetType) {
setBGPTunnelConfigGetRemoteAsnAttributeType(&o.RemoteAsn, v)
}
// GetRemoteBgpAddress returns the RemoteBgpAddress field value if set, zero value otherwise.
func (o *BGPTunnelConfig) GetRemoteBgpAddress() (res BGPTunnelConfigGetRemoteBgpAddressRetType) {
res, _ = o.GetRemoteBgpAddressOk()
return
}
// GetRemoteBgpAddressOk returns a tuple with the RemoteBgpAddress field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BGPTunnelConfig) GetRemoteBgpAddressOk() (ret BGPTunnelConfigGetRemoteBgpAddressRetType, ok bool) {
return getBGPTunnelConfigGetRemoteBgpAddressAttributeTypeOk(o.RemoteBgpAddress)
}
// HasRemoteBgpAddress returns a boolean if a field has been set.
func (o *BGPTunnelConfig) HasRemoteBgpAddress() bool {
_, ok := o.GetRemoteBgpAddressOk()
return ok
}
// SetRemoteBgpAddress gets a reference to the given string and assigns it to the RemoteBgpAddress field.
func (o *BGPTunnelConfig) SetRemoteBgpAddress(v BGPTunnelConfigGetRemoteBgpAddressRetType) {
setBGPTunnelConfigGetRemoteBgpAddressAttributeType(&o.RemoteBgpAddress, v)
}
func (o BGPTunnelConfig) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getBGPTunnelConfigGetLocalBgpAddressAttributeTypeOk(o.LocalBgpAddress); ok {
toSerialize["LocalBgpAddress"] = val
}
if val, ok := getBGPTunnelConfigGetRemoteAsnAttributeTypeOk(o.RemoteAsn); ok {
toSerialize["RemoteAsn"] = val
}
if val, ok := getBGPTunnelConfigGetRemoteBgpAddressAttributeTypeOk(o.RemoteBgpAddress); ok {
toSerialize["RemoteBgpAddress"] = val
}
return toSerialize, nil
}
type NullableBGPTunnelConfig struct {
value *BGPTunnelConfig
isSet bool
}
func (v NullableBGPTunnelConfig) Get() *BGPTunnelConfig {
return v.value
}
func (v *NullableBGPTunnelConfig) Set(val *BGPTunnelConfig) {
v.value = val
v.isSet = true
}
func (v NullableBGPTunnelConfig) IsSet() bool {
return v.isSet
}
func (v *NullableBGPTunnelConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBGPTunnelConfig(val *BGPTunnelConfig) *NullableBGPTunnelConfig {
return &NullableBGPTunnelConfig{value: val, isSet: true}
}
func (v NullableBGPTunnelConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBGPTunnelConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,397 @@
/*
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 Connection type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Connection{}
/*
types and functions for enabled
*/
// isBoolean
type ConnectiongetEnabledAttributeType = *bool
type ConnectiongetEnabledArgType = bool
type ConnectiongetEnabledRetType = bool
func getConnectiongetEnabledAttributeTypeOk(arg ConnectiongetEnabledAttributeType) (ret ConnectiongetEnabledRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setConnectiongetEnabledAttributeType(arg *ConnectiongetEnabledAttributeType, val ConnectiongetEnabledRetType) {
*arg = &val
}
/*
types and functions for labels
*/
// isContainer
type ConnectionGetLabelsAttributeType = *map[string]string
type ConnectionGetLabelsArgType = map[string]string
type ConnectionGetLabelsRetType = map[string]string
func getConnectionGetLabelsAttributeTypeOk(arg ConnectionGetLabelsAttributeType) (ret ConnectionGetLabelsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setConnectionGetLabelsAttributeType(arg *ConnectionGetLabelsAttributeType, val ConnectionGetLabelsRetType) {
*arg = &val
}
/*
types and functions for localSubnets
*/
// isArray
type ConnectionGetLocalSubnetsAttributeType = *[]string
type ConnectionGetLocalSubnetsArgType = []string
type ConnectionGetLocalSubnetsRetType = []string
func getConnectionGetLocalSubnetsAttributeTypeOk(arg ConnectionGetLocalSubnetsAttributeType) (ret ConnectionGetLocalSubnetsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setConnectionGetLocalSubnetsAttributeType(arg *ConnectionGetLocalSubnetsAttributeType, val ConnectionGetLocalSubnetsRetType) {
*arg = &val
}
/*
types and functions for name
*/
// isNotNullableString
type ConnectionGetNameAttributeType = *string
func getConnectionGetNameAttributeTypeOk(arg ConnectionGetNameAttributeType) (ret ConnectionGetNameRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setConnectionGetNameAttributeType(arg *ConnectionGetNameAttributeType, val ConnectionGetNameRetType) {
*arg = &val
}
type ConnectionGetNameArgType = string
type ConnectionGetNameRetType = string
/*
types and functions for remoteSubnets
*/
// isArray
type ConnectionGetRemoteSubnetsAttributeType = *[]string
type ConnectionGetRemoteSubnetsArgType = []string
type ConnectionGetRemoteSubnetsRetType = []string
func getConnectionGetRemoteSubnetsAttributeTypeOk(arg ConnectionGetRemoteSubnetsAttributeType) (ret ConnectionGetRemoteSubnetsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setConnectionGetRemoteSubnetsAttributeType(arg *ConnectionGetRemoteSubnetsAttributeType, val ConnectionGetRemoteSubnetsRetType) {
*arg = &val
}
/*
types and functions for tunnel1
*/
// isModel
type ConnectionGetTunnel1AttributeType = *ConnectionRequestTunnel1
type ConnectionGetTunnel1ArgType = ConnectionRequestTunnel1
type ConnectionGetTunnel1RetType = ConnectionRequestTunnel1
func getConnectionGetTunnel1AttributeTypeOk(arg ConnectionGetTunnel1AttributeType) (ret ConnectionGetTunnel1RetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setConnectionGetTunnel1AttributeType(arg *ConnectionGetTunnel1AttributeType, val ConnectionGetTunnel1RetType) {
*arg = &val
}
/*
types and functions for tunnel2
*/
// isModel
type ConnectionGetTunnel2AttributeType = *ConnectionRequestTunnel1
type ConnectionGetTunnel2ArgType = ConnectionRequestTunnel1
type ConnectionGetTunnel2RetType = ConnectionRequestTunnel1
func getConnectionGetTunnel2AttributeTypeOk(arg ConnectionGetTunnel2AttributeType) (ret ConnectionGetTunnel2RetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setConnectionGetTunnel2AttributeType(arg *ConnectionGetTunnel2AttributeType, val ConnectionGetTunnel2RetType) {
*arg = &val
}
// Connection struct for Connection
type Connection struct {
// This flag decides whether this connection should be enabled or disabled
Enabled ConnectiongetEnabledAttributeType `json:"enabled,omitempty"`
// Map of custom labels. Key and values must be max 63 chars, start/end with alphanumeric.
Labels ConnectionGetLabelsAttributeType `json:"labels,omitempty"`
// List of local subnets (IPv4 CIDR).
// REQUIRED
LocalSubnets ConnectionGetLocalSubnetsAttributeType `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 ConnectionGetNameAttributeType `json:"name" required:"true"`
// List of remote subnets (IPv4 CIDR).
// REQUIRED
RemoteSubnets ConnectionGetRemoteSubnetsAttributeType `json:"remoteSubnets" required:"true"`
// REQUIRED
Tunnel1 ConnectionGetTunnel1AttributeType `json:"tunnel1" required:"true"`
// REQUIRED
Tunnel2 ConnectionGetTunnel2AttributeType `json:"tunnel2" required:"true"`
}
type _Connection Connection
// NewConnection instantiates a new Connection 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 NewConnection(localSubnets ConnectionGetLocalSubnetsArgType, name ConnectionGetNameArgType, remoteSubnets ConnectionGetRemoteSubnetsArgType, tunnel1 ConnectionGetTunnel1ArgType, tunnel2 ConnectionGetTunnel2ArgType) *Connection {
this := Connection{}
setConnectionGetLocalSubnetsAttributeType(&this.LocalSubnets, localSubnets)
setConnectionGetNameAttributeType(&this.Name, name)
setConnectionGetRemoteSubnetsAttributeType(&this.RemoteSubnets, remoteSubnets)
setConnectionGetTunnel1AttributeType(&this.Tunnel1, tunnel1)
setConnectionGetTunnel2AttributeType(&this.Tunnel2, tunnel2)
return &this
}
// NewConnectionWithDefaults instantiates a new Connection 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 NewConnectionWithDefaults() *Connection {
this := Connection{}
return &this
}
// GetEnabled returns the Enabled field value if set, zero value otherwise.
func (o *Connection) GetEnabled() (res ConnectiongetEnabledRetType) {
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 *Connection) GetEnabledOk() (ret ConnectiongetEnabledRetType, ok bool) {
return getConnectiongetEnabledAttributeTypeOk(o.Enabled)
}
// HasEnabled returns a boolean if a field has been set.
func (o *Connection) HasEnabled() bool {
_, ok := o.GetEnabledOk()
return ok
}
// SetEnabled gets a reference to the given bool and assigns it to the Enabled field.
func (o *Connection) SetEnabled(v ConnectiongetEnabledRetType) {
setConnectiongetEnabledAttributeType(&o.Enabled, v)
}
// GetLabels returns the Labels field value if set, zero value otherwise.
func (o *Connection) GetLabels() (res ConnectionGetLabelsRetType) {
res, _ = o.GetLabelsOk()
return
}
// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Connection) GetLabelsOk() (ret ConnectionGetLabelsRetType, ok bool) {
return getConnectionGetLabelsAttributeTypeOk(o.Labels)
}
// HasLabels returns a boolean if a field has been set.
func (o *Connection) HasLabels() bool {
_, ok := o.GetLabelsOk()
return ok
}
// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field.
func (o *Connection) SetLabels(v ConnectionGetLabelsRetType) {
setConnectionGetLabelsAttributeType(&o.Labels, v)
}
// GetLocalSubnets returns the LocalSubnets field value
func (o *Connection) GetLocalSubnets() (ret ConnectionGetLocalSubnetsRetType) {
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 *Connection) GetLocalSubnetsOk() (ret ConnectionGetLocalSubnetsRetType, ok bool) {
return getConnectionGetLocalSubnetsAttributeTypeOk(o.LocalSubnets)
}
// SetLocalSubnets sets field value
func (o *Connection) SetLocalSubnets(v ConnectionGetLocalSubnetsRetType) {
setConnectionGetLocalSubnetsAttributeType(&o.LocalSubnets, v)
}
// GetName returns the Name field value
func (o *Connection) GetName() (ret ConnectionGetNameRetType) {
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 *Connection) GetNameOk() (ret ConnectionGetNameRetType, ok bool) {
return getConnectionGetNameAttributeTypeOk(o.Name)
}
// SetName sets field value
func (o *Connection) SetName(v ConnectionGetNameRetType) {
setConnectionGetNameAttributeType(&o.Name, v)
}
// GetRemoteSubnets returns the RemoteSubnets field value
func (o *Connection) GetRemoteSubnets() (ret ConnectionGetRemoteSubnetsRetType) {
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 *Connection) GetRemoteSubnetsOk() (ret ConnectionGetRemoteSubnetsRetType, ok bool) {
return getConnectionGetRemoteSubnetsAttributeTypeOk(o.RemoteSubnets)
}
// SetRemoteSubnets sets field value
func (o *Connection) SetRemoteSubnets(v ConnectionGetRemoteSubnetsRetType) {
setConnectionGetRemoteSubnetsAttributeType(&o.RemoteSubnets, v)
}
// GetTunnel1 returns the Tunnel1 field value
func (o *Connection) GetTunnel1() (ret ConnectionGetTunnel1RetType) {
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 *Connection) GetTunnel1Ok() (ret ConnectionGetTunnel1RetType, ok bool) {
return getConnectionGetTunnel1AttributeTypeOk(o.Tunnel1)
}
// SetTunnel1 sets field value
func (o *Connection) SetTunnel1(v ConnectionGetTunnel1RetType) {
setConnectionGetTunnel1AttributeType(&o.Tunnel1, v)
}
// GetTunnel2 returns the Tunnel2 field value
func (o *Connection) GetTunnel2() (ret ConnectionGetTunnel2RetType) {
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 *Connection) GetTunnel2Ok() (ret ConnectionGetTunnel2RetType, ok bool) {
return getConnectionGetTunnel2AttributeTypeOk(o.Tunnel2)
}
// SetTunnel2 sets field value
func (o *Connection) SetTunnel2(v ConnectionGetTunnel2RetType) {
setConnectionGetTunnel2AttributeType(&o.Tunnel2, v)
}
func (o Connection) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getConnectiongetEnabledAttributeTypeOk(o.Enabled); ok {
toSerialize["Enabled"] = val
}
if val, ok := getConnectionGetLabelsAttributeTypeOk(o.Labels); ok {
toSerialize["Labels"] = val
}
if val, ok := getConnectionGetLocalSubnetsAttributeTypeOk(o.LocalSubnets); ok {
toSerialize["LocalSubnets"] = val
}
if val, ok := getConnectionGetNameAttributeTypeOk(o.Name); ok {
toSerialize["Name"] = val
}
if val, ok := getConnectionGetRemoteSubnetsAttributeTypeOk(o.RemoteSubnets); ok {
toSerialize["RemoteSubnets"] = val
}
if val, ok := getConnectionGetTunnel1AttributeTypeOk(o.Tunnel1); ok {
toSerialize["Tunnel1"] = val
}
if val, ok := getConnectionGetTunnel2AttributeTypeOk(o.Tunnel2); ok {
toSerialize["Tunnel2"] = val
}
return toSerialize, nil
}
type NullableConnection struct {
value *Connection
isSet bool
}
func (v NullableConnection) Get() *Connection {
return v.value
}
func (v *NullableConnection) Set(val *Connection) {
v.value = val
v.isSet = true
}
func (v NullableConnection) IsSet() bool {
return v.isSet
}
func (v *NullableConnection) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableConnection(val *Connection) *NullableConnection {
return &NullableConnection{value: val, isSet: true}
}
func (v NullableConnection) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableConnection) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,125 @@
/*
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 ConnectionList type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ConnectionList{}
/*
types and functions for connections
*/
// isArray
type ConnectionListGetConnectionsAttributeType = *[]Connection
type ConnectionListGetConnectionsArgType = []Connection
type ConnectionListGetConnectionsRetType = []Connection
func getConnectionListGetConnectionsAttributeTypeOk(arg ConnectionListGetConnectionsAttributeType) (ret ConnectionListGetConnectionsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setConnectionListGetConnectionsAttributeType(arg *ConnectionListGetConnectionsAttributeType, val ConnectionListGetConnectionsRetType) {
*arg = &val
}
// ConnectionList struct for ConnectionList
type ConnectionList struct {
// REQUIRED
Connections ConnectionListGetConnectionsAttributeType `json:"connections" required:"true"`
}
type _ConnectionList ConnectionList
// NewConnectionList instantiates a new ConnectionList 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 NewConnectionList(connections ConnectionListGetConnectionsArgType) *ConnectionList {
this := ConnectionList{}
setConnectionListGetConnectionsAttributeType(&this.Connections, connections)
return &this
}
// NewConnectionListWithDefaults instantiates a new ConnectionList 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 NewConnectionListWithDefaults() *ConnectionList {
this := ConnectionList{}
return &this
}
// GetConnections returns the Connections field value
func (o *ConnectionList) GetConnections() (ret ConnectionListGetConnectionsRetType) {
ret, _ = o.GetConnectionsOk()
return ret
}
// GetConnectionsOk returns a tuple with the Connections field value
// and a boolean to check if the value has been set.
func (o *ConnectionList) GetConnectionsOk() (ret ConnectionListGetConnectionsRetType, ok bool) {
return getConnectionListGetConnectionsAttributeTypeOk(o.Connections)
}
// SetConnections sets field value
func (o *ConnectionList) SetConnections(v ConnectionListGetConnectionsRetType) {
setConnectionListGetConnectionsAttributeType(&o.Connections, v)
}
func (o ConnectionList) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getConnectionListGetConnectionsAttributeTypeOk(o.Connections); ok {
toSerialize["Connections"] = val
}
return toSerialize, nil
}
type NullableConnectionList struct {
value *ConnectionList
isSet bool
}
func (v NullableConnectionList) Get() *ConnectionList {
return v.value
}
func (v *NullableConnectionList) Set(val *ConnectionList) {
v.value = val
v.isSet = true
}
func (v NullableConnectionList) IsSet() bool {
return v.isSet
}
func (v *NullableConnectionList) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableConnectionList(val *ConnectionList) *NullableConnectionList {
return &NullableConnectionList{value: val, isSet: true}
}
func (v NullableConnectionList) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableConnectionList) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,397 @@
/*
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 ConnectionRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ConnectionRequest{}
/*
types and functions for enabled
*/
// isBoolean
type ConnectionRequestgetEnabledAttributeType = *bool
type ConnectionRequestgetEnabledArgType = bool
type ConnectionRequestgetEnabledRetType = bool
func getConnectionRequestgetEnabledAttributeTypeOk(arg ConnectionRequestgetEnabledAttributeType) (ret ConnectionRequestgetEnabledRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setConnectionRequestgetEnabledAttributeType(arg *ConnectionRequestgetEnabledAttributeType, val ConnectionRequestgetEnabledRetType) {
*arg = &val
}
/*
types and functions for labels
*/
// isContainer
type ConnectionRequestGetLabelsAttributeType = *map[string]string
type ConnectionRequestGetLabelsArgType = map[string]string
type ConnectionRequestGetLabelsRetType = map[string]string
func getConnectionRequestGetLabelsAttributeTypeOk(arg ConnectionRequestGetLabelsAttributeType) (ret ConnectionRequestGetLabelsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setConnectionRequestGetLabelsAttributeType(arg *ConnectionRequestGetLabelsAttributeType, val ConnectionRequestGetLabelsRetType) {
*arg = &val
}
/*
types and functions for localSubnets
*/
// isArray
type ConnectionRequestGetLocalSubnetsAttributeType = *[]string
type ConnectionRequestGetLocalSubnetsArgType = []string
type ConnectionRequestGetLocalSubnetsRetType = []string
func getConnectionRequestGetLocalSubnetsAttributeTypeOk(arg ConnectionRequestGetLocalSubnetsAttributeType) (ret ConnectionRequestGetLocalSubnetsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setConnectionRequestGetLocalSubnetsAttributeType(arg *ConnectionRequestGetLocalSubnetsAttributeType, val ConnectionRequestGetLocalSubnetsRetType) {
*arg = &val
}
/*
types and functions for name
*/
// isNotNullableString
type ConnectionRequestGetNameAttributeType = *string
func getConnectionRequestGetNameAttributeTypeOk(arg ConnectionRequestGetNameAttributeType) (ret ConnectionRequestGetNameRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setConnectionRequestGetNameAttributeType(arg *ConnectionRequestGetNameAttributeType, val ConnectionRequestGetNameRetType) {
*arg = &val
}
type ConnectionRequestGetNameArgType = string
type ConnectionRequestGetNameRetType = string
/*
types and functions for remoteSubnets
*/
// isArray
type ConnectionRequestGetRemoteSubnetsAttributeType = *[]string
type ConnectionRequestGetRemoteSubnetsArgType = []string
type ConnectionRequestGetRemoteSubnetsRetType = []string
func getConnectionRequestGetRemoteSubnetsAttributeTypeOk(arg ConnectionRequestGetRemoteSubnetsAttributeType) (ret ConnectionRequestGetRemoteSubnetsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setConnectionRequestGetRemoteSubnetsAttributeType(arg *ConnectionRequestGetRemoteSubnetsAttributeType, val ConnectionRequestGetRemoteSubnetsRetType) {
*arg = &val
}
/*
types and functions for tunnel1
*/
// isModel
type ConnectionRequestGetTunnel1AttributeType = *ConnectionRequestTunnel1
type ConnectionRequestGetTunnel1ArgType = ConnectionRequestTunnel1
type ConnectionRequestGetTunnel1RetType = ConnectionRequestTunnel1
func getConnectionRequestGetTunnel1AttributeTypeOk(arg ConnectionRequestGetTunnel1AttributeType) (ret ConnectionRequestGetTunnel1RetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setConnectionRequestGetTunnel1AttributeType(arg *ConnectionRequestGetTunnel1AttributeType, val ConnectionRequestGetTunnel1RetType) {
*arg = &val
}
/*
types and functions for tunnel2
*/
// isModel
type ConnectionRequestGetTunnel2AttributeType = *ConnectionRequestTunnel1
type ConnectionRequestGetTunnel2ArgType = ConnectionRequestTunnel1
type ConnectionRequestGetTunnel2RetType = ConnectionRequestTunnel1
func getConnectionRequestGetTunnel2AttributeTypeOk(arg ConnectionRequestGetTunnel2AttributeType) (ret ConnectionRequestGetTunnel2RetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setConnectionRequestGetTunnel2AttributeType(arg *ConnectionRequestGetTunnel2AttributeType, val ConnectionRequestGetTunnel2RetType) {
*arg = &val
}
// ConnectionRequest struct for ConnectionRequest
type ConnectionRequest struct {
// This flag decides whether this connection should be enabled or disabled
Enabled ConnectionRequestgetEnabledAttributeType `json:"enabled,omitempty"`
// Map of custom labels. Key and values must be max 63 chars, start/end with alphanumeric.
Labels ConnectionRequestGetLabelsAttributeType `json:"labels,omitempty"`
// List of local subnets (IPv4 CIDR).
// REQUIRED
LocalSubnets ConnectionRequestGetLocalSubnetsAttributeType `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 ConnectionRequestGetNameAttributeType `json:"name" required:"true"`
// List of remote subnets (IPv4 CIDR).
// REQUIRED
RemoteSubnets ConnectionRequestGetRemoteSubnetsAttributeType `json:"remoteSubnets" required:"true"`
// REQUIRED
Tunnel1 ConnectionRequestGetTunnel1AttributeType `json:"tunnel1" required:"true"`
// REQUIRED
Tunnel2 ConnectionRequestGetTunnel2AttributeType `json:"tunnel2" required:"true"`
}
type _ConnectionRequest ConnectionRequest
// NewConnectionRequest instantiates a new ConnectionRequest 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 NewConnectionRequest(localSubnets ConnectionRequestGetLocalSubnetsArgType, name ConnectionRequestGetNameArgType, remoteSubnets ConnectionRequestGetRemoteSubnetsArgType, tunnel1 ConnectionRequestGetTunnel1ArgType, tunnel2 ConnectionRequestGetTunnel2ArgType) *ConnectionRequest {
this := ConnectionRequest{}
setConnectionRequestGetLocalSubnetsAttributeType(&this.LocalSubnets, localSubnets)
setConnectionRequestGetNameAttributeType(&this.Name, name)
setConnectionRequestGetRemoteSubnetsAttributeType(&this.RemoteSubnets, remoteSubnets)
setConnectionRequestGetTunnel1AttributeType(&this.Tunnel1, tunnel1)
setConnectionRequestGetTunnel2AttributeType(&this.Tunnel2, tunnel2)
return &this
}
// NewConnectionRequestWithDefaults instantiates a new ConnectionRequest 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 NewConnectionRequestWithDefaults() *ConnectionRequest {
this := ConnectionRequest{}
return &this
}
// GetEnabled returns the Enabled field value if set, zero value otherwise.
func (o *ConnectionRequest) GetEnabled() (res ConnectionRequestgetEnabledRetType) {
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 *ConnectionRequest) GetEnabledOk() (ret ConnectionRequestgetEnabledRetType, ok bool) {
return getConnectionRequestgetEnabledAttributeTypeOk(o.Enabled)
}
// HasEnabled returns a boolean if a field has been set.
func (o *ConnectionRequest) HasEnabled() bool {
_, ok := o.GetEnabledOk()
return ok
}
// SetEnabled gets a reference to the given bool and assigns it to the Enabled field.
func (o *ConnectionRequest) SetEnabled(v ConnectionRequestgetEnabledRetType) {
setConnectionRequestgetEnabledAttributeType(&o.Enabled, v)
}
// GetLabels returns the Labels field value if set, zero value otherwise.
func (o *ConnectionRequest) GetLabels() (res ConnectionRequestGetLabelsRetType) {
res, _ = o.GetLabelsOk()
return
}
// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ConnectionRequest) GetLabelsOk() (ret ConnectionRequestGetLabelsRetType, ok bool) {
return getConnectionRequestGetLabelsAttributeTypeOk(o.Labels)
}
// HasLabels returns a boolean if a field has been set.
func (o *ConnectionRequest) HasLabels() bool {
_, ok := o.GetLabelsOk()
return ok
}
// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field.
func (o *ConnectionRequest) SetLabels(v ConnectionRequestGetLabelsRetType) {
setConnectionRequestGetLabelsAttributeType(&o.Labels, v)
}
// GetLocalSubnets returns the LocalSubnets field value
func (o *ConnectionRequest) GetLocalSubnets() (ret ConnectionRequestGetLocalSubnetsRetType) {
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 *ConnectionRequest) GetLocalSubnetsOk() (ret ConnectionRequestGetLocalSubnetsRetType, ok bool) {
return getConnectionRequestGetLocalSubnetsAttributeTypeOk(o.LocalSubnets)
}
// SetLocalSubnets sets field value
func (o *ConnectionRequest) SetLocalSubnets(v ConnectionRequestGetLocalSubnetsRetType) {
setConnectionRequestGetLocalSubnetsAttributeType(&o.LocalSubnets, v)
}
// GetName returns the Name field value
func (o *ConnectionRequest) GetName() (ret ConnectionRequestGetNameRetType) {
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 *ConnectionRequest) GetNameOk() (ret ConnectionRequestGetNameRetType, ok bool) {
return getConnectionRequestGetNameAttributeTypeOk(o.Name)
}
// SetName sets field value
func (o *ConnectionRequest) SetName(v ConnectionRequestGetNameRetType) {
setConnectionRequestGetNameAttributeType(&o.Name, v)
}
// GetRemoteSubnets returns the RemoteSubnets field value
func (o *ConnectionRequest) GetRemoteSubnets() (ret ConnectionRequestGetRemoteSubnetsRetType) {
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 *ConnectionRequest) GetRemoteSubnetsOk() (ret ConnectionRequestGetRemoteSubnetsRetType, ok bool) {
return getConnectionRequestGetRemoteSubnetsAttributeTypeOk(o.RemoteSubnets)
}
// SetRemoteSubnets sets field value
func (o *ConnectionRequest) SetRemoteSubnets(v ConnectionRequestGetRemoteSubnetsRetType) {
setConnectionRequestGetRemoteSubnetsAttributeType(&o.RemoteSubnets, v)
}
// GetTunnel1 returns the Tunnel1 field value
func (o *ConnectionRequest) GetTunnel1() (ret ConnectionRequestGetTunnel1RetType) {
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 *ConnectionRequest) GetTunnel1Ok() (ret ConnectionRequestGetTunnel1RetType, ok bool) {
return getConnectionRequestGetTunnel1AttributeTypeOk(o.Tunnel1)
}
// SetTunnel1 sets field value
func (o *ConnectionRequest) SetTunnel1(v ConnectionRequestGetTunnel1RetType) {
setConnectionRequestGetTunnel1AttributeType(&o.Tunnel1, v)
}
// GetTunnel2 returns the Tunnel2 field value
func (o *ConnectionRequest) GetTunnel2() (ret ConnectionRequestGetTunnel2RetType) {
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 *ConnectionRequest) GetTunnel2Ok() (ret ConnectionRequestGetTunnel2RetType, ok bool) {
return getConnectionRequestGetTunnel2AttributeTypeOk(o.Tunnel2)
}
// SetTunnel2 sets field value
func (o *ConnectionRequest) SetTunnel2(v ConnectionRequestGetTunnel2RetType) {
setConnectionRequestGetTunnel2AttributeType(&o.Tunnel2, v)
}
func (o ConnectionRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getConnectionRequestgetEnabledAttributeTypeOk(o.Enabled); ok {
toSerialize["Enabled"] = val
}
if val, ok := getConnectionRequestGetLabelsAttributeTypeOk(o.Labels); ok {
toSerialize["Labels"] = val
}
if val, ok := getConnectionRequestGetLocalSubnetsAttributeTypeOk(o.LocalSubnets); ok {
toSerialize["LocalSubnets"] = val
}
if val, ok := getConnectionRequestGetNameAttributeTypeOk(o.Name); ok {
toSerialize["Name"] = val
}
if val, ok := getConnectionRequestGetRemoteSubnetsAttributeTypeOk(o.RemoteSubnets); ok {
toSerialize["RemoteSubnets"] = val
}
if val, ok := getConnectionRequestGetTunnel1AttributeTypeOk(o.Tunnel1); ok {
toSerialize["Tunnel1"] = val
}
if val, ok := getConnectionRequestGetTunnel2AttributeTypeOk(o.Tunnel2); ok {
toSerialize["Tunnel2"] = val
}
return toSerialize, nil
}
type NullableConnectionRequest struct {
value *ConnectionRequest
isSet bool
}
func (v NullableConnectionRequest) Get() *ConnectionRequest {
return v.value
}
func (v *NullableConnectionRequest) Set(val *ConnectionRequest) {
v.value = val
v.isSet = true
}
func (v NullableConnectionRequest) IsSet() bool {
return v.isSet
}
func (v *NullableConnectionRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableConnectionRequest(val *ConnectionRequest) *NullableConnectionRequest {
return &NullableConnectionRequest{value: val, isSet: true}
}
func (v NullableConnectionRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableConnectionRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,308 @@
/*
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 ConnectionRequestTunnel1 type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ConnectionRequestTunnel1{}
/*
types and functions for bgpTunnelConfig
*/
// isModel
type ConnectionRequestTunnel1GetBgpTunnelConfigAttributeType = *BGPTunnelConfig
type ConnectionRequestTunnel1GetBgpTunnelConfigArgType = BGPTunnelConfig
type ConnectionRequestTunnel1GetBgpTunnelConfigRetType = BGPTunnelConfig
func getConnectionRequestTunnel1GetBgpTunnelConfigAttributeTypeOk(arg ConnectionRequestTunnel1GetBgpTunnelConfigAttributeType) (ret ConnectionRequestTunnel1GetBgpTunnelConfigRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setConnectionRequestTunnel1GetBgpTunnelConfigAttributeType(arg *ConnectionRequestTunnel1GetBgpTunnelConfigAttributeType, val ConnectionRequestTunnel1GetBgpTunnelConfigRetType) {
*arg = &val
}
/*
types and functions for phase1
*/
// isModel
type ConnectionRequestTunnel1GetPhase1AttributeType = *TunnelConfigurationPhase1
type ConnectionRequestTunnel1GetPhase1ArgType = TunnelConfigurationPhase1
type ConnectionRequestTunnel1GetPhase1RetType = TunnelConfigurationPhase1
func getConnectionRequestTunnel1GetPhase1AttributeTypeOk(arg ConnectionRequestTunnel1GetPhase1AttributeType) (ret ConnectionRequestTunnel1GetPhase1RetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setConnectionRequestTunnel1GetPhase1AttributeType(arg *ConnectionRequestTunnel1GetPhase1AttributeType, val ConnectionRequestTunnel1GetPhase1RetType) {
*arg = &val
}
/*
types and functions for phase2
*/
// isModel
type ConnectionRequestTunnel1GetPhase2AttributeType = *TunnelConfigurationPhase2
type ConnectionRequestTunnel1GetPhase2ArgType = TunnelConfigurationPhase2
type ConnectionRequestTunnel1GetPhase2RetType = TunnelConfigurationPhase2
func getConnectionRequestTunnel1GetPhase2AttributeTypeOk(arg ConnectionRequestTunnel1GetPhase2AttributeType) (ret ConnectionRequestTunnel1GetPhase2RetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setConnectionRequestTunnel1GetPhase2AttributeType(arg *ConnectionRequestTunnel1GetPhase2AttributeType, val ConnectionRequestTunnel1GetPhase2RetType) {
*arg = &val
}
/*
types and functions for preSharedKey
*/
// isNotNullableString
type ConnectionRequestTunnel1GetPreSharedKeyAttributeType = *string
func getConnectionRequestTunnel1GetPreSharedKeyAttributeTypeOk(arg ConnectionRequestTunnel1GetPreSharedKeyAttributeType) (ret ConnectionRequestTunnel1GetPreSharedKeyRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setConnectionRequestTunnel1GetPreSharedKeyAttributeType(arg *ConnectionRequestTunnel1GetPreSharedKeyAttributeType, val ConnectionRequestTunnel1GetPreSharedKeyRetType) {
*arg = &val
}
type ConnectionRequestTunnel1GetPreSharedKeyArgType = string
type ConnectionRequestTunnel1GetPreSharedKeyRetType = string
/*
types and functions for remoteAddress
*/
// isNotNullableString
type ConnectionRequestTunnel1GetRemoteAddressAttributeType = *string
func getConnectionRequestTunnel1GetRemoteAddressAttributeTypeOk(arg ConnectionRequestTunnel1GetRemoteAddressAttributeType) (ret ConnectionRequestTunnel1GetRemoteAddressRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setConnectionRequestTunnel1GetRemoteAddressAttributeType(arg *ConnectionRequestTunnel1GetRemoteAddressAttributeType, val ConnectionRequestTunnel1GetRemoteAddressRetType) {
*arg = &val
}
type ConnectionRequestTunnel1GetRemoteAddressArgType = string
type ConnectionRequestTunnel1GetRemoteAddressRetType = string
// ConnectionRequestTunnel1 struct for ConnectionRequestTunnel1
type ConnectionRequestTunnel1 struct {
BgpTunnelConfig ConnectionRequestTunnel1GetBgpTunnelConfigAttributeType `json:"bgpTunnelConfig,omitempty"`
// REQUIRED
Phase1 ConnectionRequestTunnel1GetPhase1AttributeType `json:"phase1" required:"true"`
// REQUIRED
Phase2 ConnectionRequestTunnel1GetPhase2AttributeType `json:"phase2" required:"true"`
// A Pre-Shared Key for authentication. Required in create-requests, optional in update-requests and omitted in every response.
PreSharedKey ConnectionRequestTunnel1GetPreSharedKeyAttributeType `json:"preSharedKey,omitempty"`
// REQUIRED
RemoteAddress ConnectionRequestTunnel1GetRemoteAddressAttributeType `json:"remoteAddress" required:"true"`
}
type _ConnectionRequestTunnel1 ConnectionRequestTunnel1
// NewConnectionRequestTunnel1 instantiates a new ConnectionRequestTunnel1 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 NewConnectionRequestTunnel1(phase1 ConnectionRequestTunnel1GetPhase1ArgType, phase2 ConnectionRequestTunnel1GetPhase2ArgType, remoteAddress ConnectionRequestTunnel1GetRemoteAddressArgType) *ConnectionRequestTunnel1 {
this := ConnectionRequestTunnel1{}
setConnectionRequestTunnel1GetPhase1AttributeType(&this.Phase1, phase1)
setConnectionRequestTunnel1GetPhase2AttributeType(&this.Phase2, phase2)
setConnectionRequestTunnel1GetRemoteAddressAttributeType(&this.RemoteAddress, remoteAddress)
return &this
}
// NewConnectionRequestTunnel1WithDefaults instantiates a new ConnectionRequestTunnel1 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 NewConnectionRequestTunnel1WithDefaults() *ConnectionRequestTunnel1 {
this := ConnectionRequestTunnel1{}
return &this
}
// GetBgpTunnelConfig returns the BgpTunnelConfig field value if set, zero value otherwise.
func (o *ConnectionRequestTunnel1) GetBgpTunnelConfig() (res ConnectionRequestTunnel1GetBgpTunnelConfigRetType) {
res, _ = o.GetBgpTunnelConfigOk()
return
}
// GetBgpTunnelConfigOk returns a tuple with the BgpTunnelConfig field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ConnectionRequestTunnel1) GetBgpTunnelConfigOk() (ret ConnectionRequestTunnel1GetBgpTunnelConfigRetType, ok bool) {
return getConnectionRequestTunnel1GetBgpTunnelConfigAttributeTypeOk(o.BgpTunnelConfig)
}
// HasBgpTunnelConfig returns a boolean if a field has been set.
func (o *ConnectionRequestTunnel1) HasBgpTunnelConfig() bool {
_, ok := o.GetBgpTunnelConfigOk()
return ok
}
// SetBgpTunnelConfig gets a reference to the given BGPTunnelConfig and assigns it to the BgpTunnelConfig field.
func (o *ConnectionRequestTunnel1) SetBgpTunnelConfig(v ConnectionRequestTunnel1GetBgpTunnelConfigRetType) {
setConnectionRequestTunnel1GetBgpTunnelConfigAttributeType(&o.BgpTunnelConfig, v)
}
// GetPhase1 returns the Phase1 field value
func (o *ConnectionRequestTunnel1) GetPhase1() (ret ConnectionRequestTunnel1GetPhase1RetType) {
ret, _ = o.GetPhase1Ok()
return ret
}
// GetPhase1Ok returns a tuple with the Phase1 field value
// and a boolean to check if the value has been set.
func (o *ConnectionRequestTunnel1) GetPhase1Ok() (ret ConnectionRequestTunnel1GetPhase1RetType, ok bool) {
return getConnectionRequestTunnel1GetPhase1AttributeTypeOk(o.Phase1)
}
// SetPhase1 sets field value
func (o *ConnectionRequestTunnel1) SetPhase1(v ConnectionRequestTunnel1GetPhase1RetType) {
setConnectionRequestTunnel1GetPhase1AttributeType(&o.Phase1, v)
}
// GetPhase2 returns the Phase2 field value
func (o *ConnectionRequestTunnel1) GetPhase2() (ret ConnectionRequestTunnel1GetPhase2RetType) {
ret, _ = o.GetPhase2Ok()
return ret
}
// GetPhase2Ok returns a tuple with the Phase2 field value
// and a boolean to check if the value has been set.
func (o *ConnectionRequestTunnel1) GetPhase2Ok() (ret ConnectionRequestTunnel1GetPhase2RetType, ok bool) {
return getConnectionRequestTunnel1GetPhase2AttributeTypeOk(o.Phase2)
}
// SetPhase2 sets field value
func (o *ConnectionRequestTunnel1) SetPhase2(v ConnectionRequestTunnel1GetPhase2RetType) {
setConnectionRequestTunnel1GetPhase2AttributeType(&o.Phase2, v)
}
// GetPreSharedKey returns the PreSharedKey field value if set, zero value otherwise.
func (o *ConnectionRequestTunnel1) GetPreSharedKey() (res ConnectionRequestTunnel1GetPreSharedKeyRetType) {
res, _ = o.GetPreSharedKeyOk()
return
}
// GetPreSharedKeyOk returns a tuple with the PreSharedKey field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ConnectionRequestTunnel1) GetPreSharedKeyOk() (ret ConnectionRequestTunnel1GetPreSharedKeyRetType, ok bool) {
return getConnectionRequestTunnel1GetPreSharedKeyAttributeTypeOk(o.PreSharedKey)
}
// HasPreSharedKey returns a boolean if a field has been set.
func (o *ConnectionRequestTunnel1) HasPreSharedKey() bool {
_, ok := o.GetPreSharedKeyOk()
return ok
}
// SetPreSharedKey gets a reference to the given string and assigns it to the PreSharedKey field.
func (o *ConnectionRequestTunnel1) SetPreSharedKey(v ConnectionRequestTunnel1GetPreSharedKeyRetType) {
setConnectionRequestTunnel1GetPreSharedKeyAttributeType(&o.PreSharedKey, v)
}
// GetRemoteAddress returns the RemoteAddress field value
func (o *ConnectionRequestTunnel1) GetRemoteAddress() (ret ConnectionRequestTunnel1GetRemoteAddressRetType) {
ret, _ = o.GetRemoteAddressOk()
return ret
}
// GetRemoteAddressOk returns a tuple with the RemoteAddress field value
// and a boolean to check if the value has been set.
func (o *ConnectionRequestTunnel1) GetRemoteAddressOk() (ret ConnectionRequestTunnel1GetRemoteAddressRetType, ok bool) {
return getConnectionRequestTunnel1GetRemoteAddressAttributeTypeOk(o.RemoteAddress)
}
// SetRemoteAddress sets field value
func (o *ConnectionRequestTunnel1) SetRemoteAddress(v ConnectionRequestTunnel1GetRemoteAddressRetType) {
setConnectionRequestTunnel1GetRemoteAddressAttributeType(&o.RemoteAddress, v)
}
func (o ConnectionRequestTunnel1) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getConnectionRequestTunnel1GetBgpTunnelConfigAttributeTypeOk(o.BgpTunnelConfig); ok {
toSerialize["BgpTunnelConfig"] = val
}
if val, ok := getConnectionRequestTunnel1GetPhase1AttributeTypeOk(o.Phase1); ok {
toSerialize["Phase1"] = val
}
if val, ok := getConnectionRequestTunnel1GetPhase2AttributeTypeOk(o.Phase2); ok {
toSerialize["Phase2"] = val
}
if val, ok := getConnectionRequestTunnel1GetPreSharedKeyAttributeTypeOk(o.PreSharedKey); ok {
toSerialize["PreSharedKey"] = val
}
if val, ok := getConnectionRequestTunnel1GetRemoteAddressAttributeTypeOk(o.RemoteAddress); ok {
toSerialize["RemoteAddress"] = val
}
return toSerialize, nil
}
type NullableConnectionRequestTunnel1 struct {
value *ConnectionRequestTunnel1
isSet bool
}
func (v NullableConnectionRequestTunnel1) Get() *ConnectionRequestTunnel1 {
return v.value
}
func (v *NullableConnectionRequestTunnel1) Set(val *ConnectionRequestTunnel1) {
v.value = val
v.isSet = true
}
func (v NullableConnectionRequestTunnel1) IsSet() bool {
return v.isSet
}
func (v *NullableConnectionRequestTunnel1) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableConnectionRequestTunnel1(val *ConnectionRequestTunnel1) *NullableConnectionRequestTunnel1 {
return &NullableConnectionRequestTunnel1{value: val, isSet: true}
}
func (v NullableConnectionRequestTunnel1) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableConnectionRequestTunnel1) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,223 @@
/*
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 ConnectionStatusResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ConnectionStatusResponse{}
/*
types and functions for enabled
*/
// isBoolean
type ConnectionStatusResponsegetEnabledAttributeType = *bool
type ConnectionStatusResponsegetEnabledArgType = bool
type ConnectionStatusResponsegetEnabledRetType = bool
func getConnectionStatusResponsegetEnabledAttributeTypeOk(arg ConnectionStatusResponsegetEnabledAttributeType) (ret ConnectionStatusResponsegetEnabledRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setConnectionStatusResponsegetEnabledAttributeType(arg *ConnectionStatusResponsegetEnabledAttributeType, val ConnectionStatusResponsegetEnabledRetType) {
*arg = &val
}
/*
types and functions for name
*/
// isNotNullableString
type ConnectionStatusResponseGetNameAttributeType = *string
func getConnectionStatusResponseGetNameAttributeTypeOk(arg ConnectionStatusResponseGetNameAttributeType) (ret ConnectionStatusResponseGetNameRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setConnectionStatusResponseGetNameAttributeType(arg *ConnectionStatusResponseGetNameAttributeType, val ConnectionStatusResponseGetNameRetType) {
*arg = &val
}
type ConnectionStatusResponseGetNameArgType = string
type ConnectionStatusResponseGetNameRetType = string
/*
types and functions for tunnels
*/
// isArray
type ConnectionStatusResponseGetTunnelsAttributeType = *[]TunnelStatus
type ConnectionStatusResponseGetTunnelsArgType = []TunnelStatus
type ConnectionStatusResponseGetTunnelsRetType = []TunnelStatus
func getConnectionStatusResponseGetTunnelsAttributeTypeOk(arg ConnectionStatusResponseGetTunnelsAttributeType) (ret ConnectionStatusResponseGetTunnelsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setConnectionStatusResponseGetTunnelsAttributeType(arg *ConnectionStatusResponseGetTunnelsAttributeType, val ConnectionStatusResponseGetTunnelsRetType) {
*arg = &val
}
// ConnectionStatusResponse struct for ConnectionStatusResponse
type ConnectionStatusResponse struct {
Enabled ConnectionStatusResponsegetEnabledAttributeType `json:"enabled,omitempty"`
// The name of the connection.
Name ConnectionStatusResponseGetNameAttributeType `json:"name,omitempty"`
Tunnels ConnectionStatusResponseGetTunnelsAttributeType `json:"tunnels,omitempty"`
}
// NewConnectionStatusResponse instantiates a new ConnectionStatusResponse 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 NewConnectionStatusResponse() *ConnectionStatusResponse {
this := ConnectionStatusResponse{}
return &this
}
// NewConnectionStatusResponseWithDefaults instantiates a new ConnectionStatusResponse 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 NewConnectionStatusResponseWithDefaults() *ConnectionStatusResponse {
this := ConnectionStatusResponse{}
return &this
}
// GetEnabled returns the Enabled field value if set, zero value otherwise.
func (o *ConnectionStatusResponse) GetEnabled() (res ConnectionStatusResponsegetEnabledRetType) {
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 *ConnectionStatusResponse) GetEnabledOk() (ret ConnectionStatusResponsegetEnabledRetType, ok bool) {
return getConnectionStatusResponsegetEnabledAttributeTypeOk(o.Enabled)
}
// HasEnabled returns a boolean if a field has been set.
func (o *ConnectionStatusResponse) HasEnabled() bool {
_, ok := o.GetEnabledOk()
return ok
}
// SetEnabled gets a reference to the given bool and assigns it to the Enabled field.
func (o *ConnectionStatusResponse) SetEnabled(v ConnectionStatusResponsegetEnabledRetType) {
setConnectionStatusResponsegetEnabledAttributeType(&o.Enabled, v)
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *ConnectionStatusResponse) GetName() (res ConnectionStatusResponseGetNameRetType) {
res, _ = o.GetNameOk()
return
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ConnectionStatusResponse) GetNameOk() (ret ConnectionStatusResponseGetNameRetType, ok bool) {
return getConnectionStatusResponseGetNameAttributeTypeOk(o.Name)
}
// HasName returns a boolean if a field has been set.
func (o *ConnectionStatusResponse) HasName() bool {
_, ok := o.GetNameOk()
return ok
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *ConnectionStatusResponse) SetName(v ConnectionStatusResponseGetNameRetType) {
setConnectionStatusResponseGetNameAttributeType(&o.Name, v)
}
// GetTunnels returns the Tunnels field value if set, zero value otherwise.
func (o *ConnectionStatusResponse) GetTunnels() (res ConnectionStatusResponseGetTunnelsRetType) {
res, _ = o.GetTunnelsOk()
return
}
// GetTunnelsOk returns a tuple with the Tunnels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ConnectionStatusResponse) GetTunnelsOk() (ret ConnectionStatusResponseGetTunnelsRetType, ok bool) {
return getConnectionStatusResponseGetTunnelsAttributeTypeOk(o.Tunnels)
}
// HasTunnels returns a boolean if a field has been set.
func (o *ConnectionStatusResponse) HasTunnels() bool {
_, ok := o.GetTunnelsOk()
return ok
}
// SetTunnels gets a reference to the given []TunnelStatus and assigns it to the Tunnels field.
func (o *ConnectionStatusResponse) SetTunnels(v ConnectionStatusResponseGetTunnelsRetType) {
setConnectionStatusResponseGetTunnelsAttributeType(&o.Tunnels, v)
}
func (o ConnectionStatusResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getConnectionStatusResponsegetEnabledAttributeTypeOk(o.Enabled); ok {
toSerialize["Enabled"] = val
}
if val, ok := getConnectionStatusResponseGetNameAttributeTypeOk(o.Name); ok {
toSerialize["Name"] = val
}
if val, ok := getConnectionStatusResponseGetTunnelsAttributeTypeOk(o.Tunnels); ok {
toSerialize["Tunnels"] = val
}
return toSerialize, nil
}
type NullableConnectionStatusResponse struct {
value *ConnectionStatusResponse
isSet bool
}
func (v NullableConnectionStatusResponse) Get() *ConnectionStatusResponse {
return v.value
}
func (v *NullableConnectionStatusResponse) Set(val *ConnectionStatusResponse) {
v.value = val
v.isSet = true
}
func (v NullableConnectionStatusResponse) IsSet() bool {
return v.isSet
}
func (v *NullableConnectionStatusResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableConnectionStatusResponse(val *ConnectionStatusResponse) *NullableConnectionStatusResponse {
return &NullableConnectionStatusResponse{value: val, isSet: true}
}
func (v NullableConnectionStatusResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableConnectionStatusResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,397 @@
/*
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 CreateGatewayConnectionPayload type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CreateGatewayConnectionPayload{}
/*
types and functions for enabled
*/
// isBoolean
type CreateGatewayConnectionPayloadgetEnabledAttributeType = *bool
type CreateGatewayConnectionPayloadgetEnabledArgType = bool
type CreateGatewayConnectionPayloadgetEnabledRetType = bool
func getCreateGatewayConnectionPayloadgetEnabledAttributeTypeOk(arg CreateGatewayConnectionPayloadgetEnabledAttributeType) (ret CreateGatewayConnectionPayloadgetEnabledRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateGatewayConnectionPayloadgetEnabledAttributeType(arg *CreateGatewayConnectionPayloadgetEnabledAttributeType, val CreateGatewayConnectionPayloadgetEnabledRetType) {
*arg = &val
}
/*
types and functions for labels
*/
// isContainer
type CreateGatewayConnectionPayloadGetLabelsAttributeType = *map[string]string
type CreateGatewayConnectionPayloadGetLabelsArgType = map[string]string
type CreateGatewayConnectionPayloadGetLabelsRetType = map[string]string
func getCreateGatewayConnectionPayloadGetLabelsAttributeTypeOk(arg CreateGatewayConnectionPayloadGetLabelsAttributeType) (ret CreateGatewayConnectionPayloadGetLabelsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateGatewayConnectionPayloadGetLabelsAttributeType(arg *CreateGatewayConnectionPayloadGetLabelsAttributeType, val CreateGatewayConnectionPayloadGetLabelsRetType) {
*arg = &val
}
/*
types and functions for localSubnets
*/
// isArray
type CreateGatewayConnectionPayloadGetLocalSubnetsAttributeType = *[]string
type CreateGatewayConnectionPayloadGetLocalSubnetsArgType = []string
type CreateGatewayConnectionPayloadGetLocalSubnetsRetType = []string
func getCreateGatewayConnectionPayloadGetLocalSubnetsAttributeTypeOk(arg CreateGatewayConnectionPayloadGetLocalSubnetsAttributeType) (ret CreateGatewayConnectionPayloadGetLocalSubnetsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateGatewayConnectionPayloadGetLocalSubnetsAttributeType(arg *CreateGatewayConnectionPayloadGetLocalSubnetsAttributeType, val CreateGatewayConnectionPayloadGetLocalSubnetsRetType) {
*arg = &val
}
/*
types and functions for name
*/
// isNotNullableString
type CreateGatewayConnectionPayloadGetNameAttributeType = *string
func getCreateGatewayConnectionPayloadGetNameAttributeTypeOk(arg CreateGatewayConnectionPayloadGetNameAttributeType) (ret CreateGatewayConnectionPayloadGetNameRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateGatewayConnectionPayloadGetNameAttributeType(arg *CreateGatewayConnectionPayloadGetNameAttributeType, val CreateGatewayConnectionPayloadGetNameRetType) {
*arg = &val
}
type CreateGatewayConnectionPayloadGetNameArgType = string
type CreateGatewayConnectionPayloadGetNameRetType = string
/*
types and functions for remoteSubnets
*/
// isArray
type CreateGatewayConnectionPayloadGetRemoteSubnetsAttributeType = *[]string
type CreateGatewayConnectionPayloadGetRemoteSubnetsArgType = []string
type CreateGatewayConnectionPayloadGetRemoteSubnetsRetType = []string
func getCreateGatewayConnectionPayloadGetRemoteSubnetsAttributeTypeOk(arg CreateGatewayConnectionPayloadGetRemoteSubnetsAttributeType) (ret CreateGatewayConnectionPayloadGetRemoteSubnetsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateGatewayConnectionPayloadGetRemoteSubnetsAttributeType(arg *CreateGatewayConnectionPayloadGetRemoteSubnetsAttributeType, val CreateGatewayConnectionPayloadGetRemoteSubnetsRetType) {
*arg = &val
}
/*
types and functions for tunnel1
*/
// isModel
type CreateGatewayConnectionPayloadGetTunnel1AttributeType = *ConnectionRequestTunnel1
type CreateGatewayConnectionPayloadGetTunnel1ArgType = ConnectionRequestTunnel1
type CreateGatewayConnectionPayloadGetTunnel1RetType = ConnectionRequestTunnel1
func getCreateGatewayConnectionPayloadGetTunnel1AttributeTypeOk(arg CreateGatewayConnectionPayloadGetTunnel1AttributeType) (ret CreateGatewayConnectionPayloadGetTunnel1RetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateGatewayConnectionPayloadGetTunnel1AttributeType(arg *CreateGatewayConnectionPayloadGetTunnel1AttributeType, val CreateGatewayConnectionPayloadGetTunnel1RetType) {
*arg = &val
}
/*
types and functions for tunnel2
*/
// isModel
type CreateGatewayConnectionPayloadGetTunnel2AttributeType = *ConnectionRequestTunnel1
type CreateGatewayConnectionPayloadGetTunnel2ArgType = ConnectionRequestTunnel1
type CreateGatewayConnectionPayloadGetTunnel2RetType = ConnectionRequestTunnel1
func getCreateGatewayConnectionPayloadGetTunnel2AttributeTypeOk(arg CreateGatewayConnectionPayloadGetTunnel2AttributeType) (ret CreateGatewayConnectionPayloadGetTunnel2RetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateGatewayConnectionPayloadGetTunnel2AttributeType(arg *CreateGatewayConnectionPayloadGetTunnel2AttributeType, val CreateGatewayConnectionPayloadGetTunnel2RetType) {
*arg = &val
}
// CreateGatewayConnectionPayload struct for CreateGatewayConnectionPayload
type CreateGatewayConnectionPayload struct {
// This flag decides whether this connection should be enabled or disabled
Enabled CreateGatewayConnectionPayloadgetEnabledAttributeType `json:"enabled,omitempty"`
// Map of custom labels. Key and values must be max 63 chars, start/end with alphanumeric.
Labels CreateGatewayConnectionPayloadGetLabelsAttributeType `json:"labels,omitempty"`
// List of local subnets (IPv4 CIDR).
// REQUIRED
LocalSubnets CreateGatewayConnectionPayloadGetLocalSubnetsAttributeType `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 CreateGatewayConnectionPayloadGetNameAttributeType `json:"name" required:"true"`
// List of remote subnets (IPv4 CIDR).
// REQUIRED
RemoteSubnets CreateGatewayConnectionPayloadGetRemoteSubnetsAttributeType `json:"remoteSubnets" required:"true"`
// REQUIRED
Tunnel1 CreateGatewayConnectionPayloadGetTunnel1AttributeType `json:"tunnel1" required:"true"`
// REQUIRED
Tunnel2 CreateGatewayConnectionPayloadGetTunnel2AttributeType `json:"tunnel2" required:"true"`
}
type _CreateGatewayConnectionPayload CreateGatewayConnectionPayload
// NewCreateGatewayConnectionPayload instantiates a new CreateGatewayConnectionPayload 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 NewCreateGatewayConnectionPayload(localSubnets CreateGatewayConnectionPayloadGetLocalSubnetsArgType, name CreateGatewayConnectionPayloadGetNameArgType, remoteSubnets CreateGatewayConnectionPayloadGetRemoteSubnetsArgType, tunnel1 CreateGatewayConnectionPayloadGetTunnel1ArgType, tunnel2 CreateGatewayConnectionPayloadGetTunnel2ArgType) *CreateGatewayConnectionPayload {
this := CreateGatewayConnectionPayload{}
setCreateGatewayConnectionPayloadGetLocalSubnetsAttributeType(&this.LocalSubnets, localSubnets)
setCreateGatewayConnectionPayloadGetNameAttributeType(&this.Name, name)
setCreateGatewayConnectionPayloadGetRemoteSubnetsAttributeType(&this.RemoteSubnets, remoteSubnets)
setCreateGatewayConnectionPayloadGetTunnel1AttributeType(&this.Tunnel1, tunnel1)
setCreateGatewayConnectionPayloadGetTunnel2AttributeType(&this.Tunnel2, tunnel2)
return &this
}
// NewCreateGatewayConnectionPayloadWithDefaults instantiates a new CreateGatewayConnectionPayload 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 NewCreateGatewayConnectionPayloadWithDefaults() *CreateGatewayConnectionPayload {
this := CreateGatewayConnectionPayload{}
return &this
}
// GetEnabled returns the Enabled field value if set, zero value otherwise.
func (o *CreateGatewayConnectionPayload) GetEnabled() (res CreateGatewayConnectionPayloadgetEnabledRetType) {
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 *CreateGatewayConnectionPayload) GetEnabledOk() (ret CreateGatewayConnectionPayloadgetEnabledRetType, ok bool) {
return getCreateGatewayConnectionPayloadgetEnabledAttributeTypeOk(o.Enabled)
}
// HasEnabled returns a boolean if a field has been set.
func (o *CreateGatewayConnectionPayload) HasEnabled() bool {
_, ok := o.GetEnabledOk()
return ok
}
// SetEnabled gets a reference to the given bool and assigns it to the Enabled field.
func (o *CreateGatewayConnectionPayload) SetEnabled(v CreateGatewayConnectionPayloadgetEnabledRetType) {
setCreateGatewayConnectionPayloadgetEnabledAttributeType(&o.Enabled, v)
}
// GetLabels returns the Labels field value if set, zero value otherwise.
func (o *CreateGatewayConnectionPayload) GetLabels() (res CreateGatewayConnectionPayloadGetLabelsRetType) {
res, _ = o.GetLabelsOk()
return
}
// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateGatewayConnectionPayload) GetLabelsOk() (ret CreateGatewayConnectionPayloadGetLabelsRetType, ok bool) {
return getCreateGatewayConnectionPayloadGetLabelsAttributeTypeOk(o.Labels)
}
// HasLabels returns a boolean if a field has been set.
func (o *CreateGatewayConnectionPayload) HasLabels() bool {
_, ok := o.GetLabelsOk()
return ok
}
// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field.
func (o *CreateGatewayConnectionPayload) SetLabels(v CreateGatewayConnectionPayloadGetLabelsRetType) {
setCreateGatewayConnectionPayloadGetLabelsAttributeType(&o.Labels, v)
}
// GetLocalSubnets returns the LocalSubnets field value
func (o *CreateGatewayConnectionPayload) GetLocalSubnets() (ret CreateGatewayConnectionPayloadGetLocalSubnetsRetType) {
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 *CreateGatewayConnectionPayload) GetLocalSubnetsOk() (ret CreateGatewayConnectionPayloadGetLocalSubnetsRetType, ok bool) {
return getCreateGatewayConnectionPayloadGetLocalSubnetsAttributeTypeOk(o.LocalSubnets)
}
// SetLocalSubnets sets field value
func (o *CreateGatewayConnectionPayload) SetLocalSubnets(v CreateGatewayConnectionPayloadGetLocalSubnetsRetType) {
setCreateGatewayConnectionPayloadGetLocalSubnetsAttributeType(&o.LocalSubnets, v)
}
// GetName returns the Name field value
func (o *CreateGatewayConnectionPayload) GetName() (ret CreateGatewayConnectionPayloadGetNameRetType) {
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 *CreateGatewayConnectionPayload) GetNameOk() (ret CreateGatewayConnectionPayloadGetNameRetType, ok bool) {
return getCreateGatewayConnectionPayloadGetNameAttributeTypeOk(o.Name)
}
// SetName sets field value
func (o *CreateGatewayConnectionPayload) SetName(v CreateGatewayConnectionPayloadGetNameRetType) {
setCreateGatewayConnectionPayloadGetNameAttributeType(&o.Name, v)
}
// GetRemoteSubnets returns the RemoteSubnets field value
func (o *CreateGatewayConnectionPayload) GetRemoteSubnets() (ret CreateGatewayConnectionPayloadGetRemoteSubnetsRetType) {
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 *CreateGatewayConnectionPayload) GetRemoteSubnetsOk() (ret CreateGatewayConnectionPayloadGetRemoteSubnetsRetType, ok bool) {
return getCreateGatewayConnectionPayloadGetRemoteSubnetsAttributeTypeOk(o.RemoteSubnets)
}
// SetRemoteSubnets sets field value
func (o *CreateGatewayConnectionPayload) SetRemoteSubnets(v CreateGatewayConnectionPayloadGetRemoteSubnetsRetType) {
setCreateGatewayConnectionPayloadGetRemoteSubnetsAttributeType(&o.RemoteSubnets, v)
}
// GetTunnel1 returns the Tunnel1 field value
func (o *CreateGatewayConnectionPayload) GetTunnel1() (ret CreateGatewayConnectionPayloadGetTunnel1RetType) {
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 *CreateGatewayConnectionPayload) GetTunnel1Ok() (ret CreateGatewayConnectionPayloadGetTunnel1RetType, ok bool) {
return getCreateGatewayConnectionPayloadGetTunnel1AttributeTypeOk(o.Tunnel1)
}
// SetTunnel1 sets field value
func (o *CreateGatewayConnectionPayload) SetTunnel1(v CreateGatewayConnectionPayloadGetTunnel1RetType) {
setCreateGatewayConnectionPayloadGetTunnel1AttributeType(&o.Tunnel1, v)
}
// GetTunnel2 returns the Tunnel2 field value
func (o *CreateGatewayConnectionPayload) GetTunnel2() (ret CreateGatewayConnectionPayloadGetTunnel2RetType) {
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 *CreateGatewayConnectionPayload) GetTunnel2Ok() (ret CreateGatewayConnectionPayloadGetTunnel2RetType, ok bool) {
return getCreateGatewayConnectionPayloadGetTunnel2AttributeTypeOk(o.Tunnel2)
}
// SetTunnel2 sets field value
func (o *CreateGatewayConnectionPayload) SetTunnel2(v CreateGatewayConnectionPayloadGetTunnel2RetType) {
setCreateGatewayConnectionPayloadGetTunnel2AttributeType(&o.Tunnel2, v)
}
func (o CreateGatewayConnectionPayload) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getCreateGatewayConnectionPayloadgetEnabledAttributeTypeOk(o.Enabled); ok {
toSerialize["Enabled"] = val
}
if val, ok := getCreateGatewayConnectionPayloadGetLabelsAttributeTypeOk(o.Labels); ok {
toSerialize["Labels"] = val
}
if val, ok := getCreateGatewayConnectionPayloadGetLocalSubnetsAttributeTypeOk(o.LocalSubnets); ok {
toSerialize["LocalSubnets"] = val
}
if val, ok := getCreateGatewayConnectionPayloadGetNameAttributeTypeOk(o.Name); ok {
toSerialize["Name"] = val
}
if val, ok := getCreateGatewayConnectionPayloadGetRemoteSubnetsAttributeTypeOk(o.RemoteSubnets); ok {
toSerialize["RemoteSubnets"] = val
}
if val, ok := getCreateGatewayConnectionPayloadGetTunnel1AttributeTypeOk(o.Tunnel1); ok {
toSerialize["Tunnel1"] = val
}
if val, ok := getCreateGatewayConnectionPayloadGetTunnel2AttributeTypeOk(o.Tunnel2); ok {
toSerialize["Tunnel2"] = val
}
return toSerialize, nil
}
type NullableCreateGatewayConnectionPayload struct {
value *CreateGatewayConnectionPayload
isSet bool
}
func (v NullableCreateGatewayConnectionPayload) Get() *CreateGatewayConnectionPayload {
return v.value
}
func (v *NullableCreateGatewayConnectionPayload) Set(val *CreateGatewayConnectionPayload) {
v.value = val
v.isSet = true
}
func (v NullableCreateGatewayConnectionPayload) IsSet() bool {
return v.isSet
}
func (v *NullableCreateGatewayConnectionPayload) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCreateGatewayConnectionPayload(val *CreateGatewayConnectionPayload) *NullableCreateGatewayConnectionPayload {
return &NullableCreateGatewayConnectionPayload{value: val, isSet: true}
}
func (v NullableCreateGatewayConnectionPayload) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCreateGatewayConnectionPayload) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,358 @@
/*
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 CreateVPNGatewayPayload type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CreateVPNGatewayPayload{}
/*
types and functions for availabilityZones
*/
// isModel
type CreateVPNGatewayPayloadGetAvailabilityZonesAttributeType = *CreateVPNGatewayPayloadAvailabilityZones
type CreateVPNGatewayPayloadGetAvailabilityZonesArgType = CreateVPNGatewayPayloadAvailabilityZones
type CreateVPNGatewayPayloadGetAvailabilityZonesRetType = CreateVPNGatewayPayloadAvailabilityZones
func getCreateVPNGatewayPayloadGetAvailabilityZonesAttributeTypeOk(arg CreateVPNGatewayPayloadGetAvailabilityZonesAttributeType) (ret CreateVPNGatewayPayloadGetAvailabilityZonesRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateVPNGatewayPayloadGetAvailabilityZonesAttributeType(arg *CreateVPNGatewayPayloadGetAvailabilityZonesAttributeType, val CreateVPNGatewayPayloadGetAvailabilityZonesRetType) {
*arg = &val
}
/*
types and functions for bgpEnabled
*/
// isBoolean
type CreateVPNGatewayPayloadgetBgpEnabledAttributeType = *bool
type CreateVPNGatewayPayloadgetBgpEnabledArgType = bool
type CreateVPNGatewayPayloadgetBgpEnabledRetType = bool
func getCreateVPNGatewayPayloadgetBgpEnabledAttributeTypeOk(arg CreateVPNGatewayPayloadgetBgpEnabledAttributeType) (ret CreateVPNGatewayPayloadgetBgpEnabledRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateVPNGatewayPayloadgetBgpEnabledAttributeType(arg *CreateVPNGatewayPayloadgetBgpEnabledAttributeType, val CreateVPNGatewayPayloadgetBgpEnabledRetType) {
*arg = &val
}
/*
types and functions for bgpGatewayConfig
*/
// isModel
type CreateVPNGatewayPayloadGetBgpGatewayConfigAttributeType = *BGPGatewayConfig
type CreateVPNGatewayPayloadGetBgpGatewayConfigArgType = BGPGatewayConfig
type CreateVPNGatewayPayloadGetBgpGatewayConfigRetType = BGPGatewayConfig
func getCreateVPNGatewayPayloadGetBgpGatewayConfigAttributeTypeOk(arg CreateVPNGatewayPayloadGetBgpGatewayConfigAttributeType) (ret CreateVPNGatewayPayloadGetBgpGatewayConfigRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateVPNGatewayPayloadGetBgpGatewayConfigAttributeType(arg *CreateVPNGatewayPayloadGetBgpGatewayConfigAttributeType, val CreateVPNGatewayPayloadGetBgpGatewayConfigRetType) {
*arg = &val
}
/*
types and functions for labels
*/
// isContainer
type CreateVPNGatewayPayloadGetLabelsAttributeType = *map[string]string
type CreateVPNGatewayPayloadGetLabelsArgType = map[string]string
type CreateVPNGatewayPayloadGetLabelsRetType = map[string]string
func getCreateVPNGatewayPayloadGetLabelsAttributeTypeOk(arg CreateVPNGatewayPayloadGetLabelsAttributeType) (ret CreateVPNGatewayPayloadGetLabelsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateVPNGatewayPayloadGetLabelsAttributeType(arg *CreateVPNGatewayPayloadGetLabelsAttributeType, val CreateVPNGatewayPayloadGetLabelsRetType) {
*arg = &val
}
/*
types and functions for name
*/
// isNotNullableString
type CreateVPNGatewayPayloadGetNameAttributeType = *string
func getCreateVPNGatewayPayloadGetNameAttributeTypeOk(arg CreateVPNGatewayPayloadGetNameAttributeType) (ret CreateVPNGatewayPayloadGetNameRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateVPNGatewayPayloadGetNameAttributeType(arg *CreateVPNGatewayPayloadGetNameAttributeType, val CreateVPNGatewayPayloadGetNameRetType) {
*arg = &val
}
type CreateVPNGatewayPayloadGetNameArgType = string
type CreateVPNGatewayPayloadGetNameRetType = string
/*
types and functions for planId
*/
// isNotNullableString
type CreateVPNGatewayPayloadGetPlanIdAttributeType = *string
func getCreateVPNGatewayPayloadGetPlanIdAttributeTypeOk(arg CreateVPNGatewayPayloadGetPlanIdAttributeType) (ret CreateVPNGatewayPayloadGetPlanIdRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateVPNGatewayPayloadGetPlanIdAttributeType(arg *CreateVPNGatewayPayloadGetPlanIdAttributeType, val CreateVPNGatewayPayloadGetPlanIdRetType) {
*arg = &val
}
type CreateVPNGatewayPayloadGetPlanIdArgType = string
type CreateVPNGatewayPayloadGetPlanIdRetType = string
// CreateVPNGatewayPayload struct for CreateVPNGatewayPayload
type CreateVPNGatewayPayload struct {
// REQUIRED
AvailabilityZones CreateVPNGatewayPayloadGetAvailabilityZonesAttributeType `json:"availabilityZones" required:"true"`
// Enable BGP routing. (This will require a BGPGatewayConfig and also a BGPTunnelConfig for each Tunnel in each Connection)
BgpEnabled CreateVPNGatewayPayloadgetBgpEnabledAttributeType `json:"bgpEnabled,omitempty"`
BgpGatewayConfig CreateVPNGatewayPayloadGetBgpGatewayConfigAttributeType `json:"bgpGatewayConfig,omitempty"`
// Map of custom labels. Key and values must be max 63 chars, start/end with alphanumeric.
Labels CreateVPNGatewayPayloadGetLabelsAttributeType `json:"labels,omitempty"`
// The name of the VPN gateway. Maximum 20 characters (only alphanumeric and hyphens allowed). Not changeable after creation.
// REQUIRED
Name CreateVPNGatewayPayloadGetNameAttributeType `json:"name" required:"true"`
// Service Plan to configure the limits of the VPN. Currently supported plans are p50, p100, p200. This list can change in the future where plan ids will be removed and new plans by added. That is the reason this is not an enum.
// REQUIRED
PlanId CreateVPNGatewayPayloadGetPlanIdAttributeType `json:"planId" required:"true"`
}
type _CreateVPNGatewayPayload CreateVPNGatewayPayload
// NewCreateVPNGatewayPayload instantiates a new CreateVPNGatewayPayload 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 NewCreateVPNGatewayPayload(availabilityZones CreateVPNGatewayPayloadGetAvailabilityZonesArgType, name CreateVPNGatewayPayloadGetNameArgType, planId CreateVPNGatewayPayloadGetPlanIdArgType) *CreateVPNGatewayPayload {
this := CreateVPNGatewayPayload{}
setCreateVPNGatewayPayloadGetAvailabilityZonesAttributeType(&this.AvailabilityZones, availabilityZones)
setCreateVPNGatewayPayloadGetNameAttributeType(&this.Name, name)
setCreateVPNGatewayPayloadGetPlanIdAttributeType(&this.PlanId, planId)
return &this
}
// NewCreateVPNGatewayPayloadWithDefaults instantiates a new CreateVPNGatewayPayload 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 NewCreateVPNGatewayPayloadWithDefaults() *CreateVPNGatewayPayload {
this := CreateVPNGatewayPayload{}
return &this
}
// GetAvailabilityZones returns the AvailabilityZones field value
func (o *CreateVPNGatewayPayload) GetAvailabilityZones() (ret CreateVPNGatewayPayloadGetAvailabilityZonesRetType) {
ret, _ = o.GetAvailabilityZonesOk()
return ret
}
// GetAvailabilityZonesOk returns a tuple with the AvailabilityZones field value
// and a boolean to check if the value has been set.
func (o *CreateVPNGatewayPayload) GetAvailabilityZonesOk() (ret CreateVPNGatewayPayloadGetAvailabilityZonesRetType, ok bool) {
return getCreateVPNGatewayPayloadGetAvailabilityZonesAttributeTypeOk(o.AvailabilityZones)
}
// SetAvailabilityZones sets field value
func (o *CreateVPNGatewayPayload) SetAvailabilityZones(v CreateVPNGatewayPayloadGetAvailabilityZonesRetType) {
setCreateVPNGatewayPayloadGetAvailabilityZonesAttributeType(&o.AvailabilityZones, v)
}
// GetBgpEnabled returns the BgpEnabled field value if set, zero value otherwise.
func (o *CreateVPNGatewayPayload) GetBgpEnabled() (res CreateVPNGatewayPayloadgetBgpEnabledRetType) {
res, _ = o.GetBgpEnabledOk()
return
}
// GetBgpEnabledOk returns a tuple with the BgpEnabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateVPNGatewayPayload) GetBgpEnabledOk() (ret CreateVPNGatewayPayloadgetBgpEnabledRetType, ok bool) {
return getCreateVPNGatewayPayloadgetBgpEnabledAttributeTypeOk(o.BgpEnabled)
}
// HasBgpEnabled returns a boolean if a field has been set.
func (o *CreateVPNGatewayPayload) HasBgpEnabled() bool {
_, ok := o.GetBgpEnabledOk()
return ok
}
// SetBgpEnabled gets a reference to the given bool and assigns it to the BgpEnabled field.
func (o *CreateVPNGatewayPayload) SetBgpEnabled(v CreateVPNGatewayPayloadgetBgpEnabledRetType) {
setCreateVPNGatewayPayloadgetBgpEnabledAttributeType(&o.BgpEnabled, v)
}
// GetBgpGatewayConfig returns the BgpGatewayConfig field value if set, zero value otherwise.
func (o *CreateVPNGatewayPayload) GetBgpGatewayConfig() (res CreateVPNGatewayPayloadGetBgpGatewayConfigRetType) {
res, _ = o.GetBgpGatewayConfigOk()
return
}
// GetBgpGatewayConfigOk returns a tuple with the BgpGatewayConfig field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateVPNGatewayPayload) GetBgpGatewayConfigOk() (ret CreateVPNGatewayPayloadGetBgpGatewayConfigRetType, ok bool) {
return getCreateVPNGatewayPayloadGetBgpGatewayConfigAttributeTypeOk(o.BgpGatewayConfig)
}
// HasBgpGatewayConfig returns a boolean if a field has been set.
func (o *CreateVPNGatewayPayload) HasBgpGatewayConfig() bool {
_, ok := o.GetBgpGatewayConfigOk()
return ok
}
// SetBgpGatewayConfig gets a reference to the given BGPGatewayConfig and assigns it to the BgpGatewayConfig field.
func (o *CreateVPNGatewayPayload) SetBgpGatewayConfig(v CreateVPNGatewayPayloadGetBgpGatewayConfigRetType) {
setCreateVPNGatewayPayloadGetBgpGatewayConfigAttributeType(&o.BgpGatewayConfig, v)
}
// GetLabels returns the Labels field value if set, zero value otherwise.
func (o *CreateVPNGatewayPayload) GetLabels() (res CreateVPNGatewayPayloadGetLabelsRetType) {
res, _ = o.GetLabelsOk()
return
}
// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateVPNGatewayPayload) GetLabelsOk() (ret CreateVPNGatewayPayloadGetLabelsRetType, ok bool) {
return getCreateVPNGatewayPayloadGetLabelsAttributeTypeOk(o.Labels)
}
// HasLabels returns a boolean if a field has been set.
func (o *CreateVPNGatewayPayload) HasLabels() bool {
_, ok := o.GetLabelsOk()
return ok
}
// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field.
func (o *CreateVPNGatewayPayload) SetLabels(v CreateVPNGatewayPayloadGetLabelsRetType) {
setCreateVPNGatewayPayloadGetLabelsAttributeType(&o.Labels, v)
}
// GetName returns the Name field value
func (o *CreateVPNGatewayPayload) GetName() (ret CreateVPNGatewayPayloadGetNameRetType) {
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 *CreateVPNGatewayPayload) GetNameOk() (ret CreateVPNGatewayPayloadGetNameRetType, ok bool) {
return getCreateVPNGatewayPayloadGetNameAttributeTypeOk(o.Name)
}
// SetName sets field value
func (o *CreateVPNGatewayPayload) SetName(v CreateVPNGatewayPayloadGetNameRetType) {
setCreateVPNGatewayPayloadGetNameAttributeType(&o.Name, v)
}
// GetPlanId returns the PlanId field value
func (o *CreateVPNGatewayPayload) GetPlanId() (ret CreateVPNGatewayPayloadGetPlanIdRetType) {
ret, _ = o.GetPlanIdOk()
return ret
}
// GetPlanIdOk returns a tuple with the PlanId field value
// and a boolean to check if the value has been set.
func (o *CreateVPNGatewayPayload) GetPlanIdOk() (ret CreateVPNGatewayPayloadGetPlanIdRetType, ok bool) {
return getCreateVPNGatewayPayloadGetPlanIdAttributeTypeOk(o.PlanId)
}
// SetPlanId sets field value
func (o *CreateVPNGatewayPayload) SetPlanId(v CreateVPNGatewayPayloadGetPlanIdRetType) {
setCreateVPNGatewayPayloadGetPlanIdAttributeType(&o.PlanId, v)
}
func (o CreateVPNGatewayPayload) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getCreateVPNGatewayPayloadGetAvailabilityZonesAttributeTypeOk(o.AvailabilityZones); ok {
toSerialize["AvailabilityZones"] = val
}
if val, ok := getCreateVPNGatewayPayloadgetBgpEnabledAttributeTypeOk(o.BgpEnabled); ok {
toSerialize["BgpEnabled"] = val
}
if val, ok := getCreateVPNGatewayPayloadGetBgpGatewayConfigAttributeTypeOk(o.BgpGatewayConfig); ok {
toSerialize["BgpGatewayConfig"] = val
}
if val, ok := getCreateVPNGatewayPayloadGetLabelsAttributeTypeOk(o.Labels); ok {
toSerialize["Labels"] = val
}
if val, ok := getCreateVPNGatewayPayloadGetNameAttributeTypeOk(o.Name); ok {
toSerialize["Name"] = val
}
if val, ok := getCreateVPNGatewayPayloadGetPlanIdAttributeTypeOk(o.PlanId); ok {
toSerialize["PlanId"] = val
}
return toSerialize, nil
}
type NullableCreateVPNGatewayPayload struct {
value *CreateVPNGatewayPayload
isSet bool
}
func (v NullableCreateVPNGatewayPayload) Get() *CreateVPNGatewayPayload {
return v.value
}
func (v *NullableCreateVPNGatewayPayload) Set(val *CreateVPNGatewayPayload) {
v.value = val
v.isSet = true
}
func (v NullableCreateVPNGatewayPayload) IsSet() bool {
return v.isSet
}
func (v *NullableCreateVPNGatewayPayload) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCreateVPNGatewayPayload(val *CreateVPNGatewayPayload) *NullableCreateVPNGatewayPayload {
return &NullableCreateVPNGatewayPayload{value: val, isSet: true}
}
func (v NullableCreateVPNGatewayPayload) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCreateVPNGatewayPayload) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,172 @@
/*
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 CreateVPNGatewayPayloadAvailabilityZones type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CreateVPNGatewayPayloadAvailabilityZones{}
/*
types and functions for tunnel1
*/
// isNotNullableString
type CreateVPNGatewayPayloadAvailabilityZonesGetTunnel1AttributeType = *string
func getCreateVPNGatewayPayloadAvailabilityZonesGetTunnel1AttributeTypeOk(arg CreateVPNGatewayPayloadAvailabilityZonesGetTunnel1AttributeType) (ret CreateVPNGatewayPayloadAvailabilityZonesGetTunnel1RetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateVPNGatewayPayloadAvailabilityZonesGetTunnel1AttributeType(arg *CreateVPNGatewayPayloadAvailabilityZonesGetTunnel1AttributeType, val CreateVPNGatewayPayloadAvailabilityZonesGetTunnel1RetType) {
*arg = &val
}
type CreateVPNGatewayPayloadAvailabilityZonesGetTunnel1ArgType = string
type CreateVPNGatewayPayloadAvailabilityZonesGetTunnel1RetType = string
/*
types and functions for tunnel2
*/
// isNotNullableString
type CreateVPNGatewayPayloadAvailabilityZonesGetTunnel2AttributeType = *string
func getCreateVPNGatewayPayloadAvailabilityZonesGetTunnel2AttributeTypeOk(arg CreateVPNGatewayPayloadAvailabilityZonesGetTunnel2AttributeType) (ret CreateVPNGatewayPayloadAvailabilityZonesGetTunnel2RetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateVPNGatewayPayloadAvailabilityZonesGetTunnel2AttributeType(arg *CreateVPNGatewayPayloadAvailabilityZonesGetTunnel2AttributeType, val CreateVPNGatewayPayloadAvailabilityZonesGetTunnel2RetType) {
*arg = &val
}
type CreateVPNGatewayPayloadAvailabilityZonesGetTunnel2ArgType = string
type CreateVPNGatewayPayloadAvailabilityZonesGetTunnel2RetType = string
// CreateVPNGatewayPayloadAvailabilityZones struct for CreateVPNGatewayPayloadAvailabilityZones
type CreateVPNGatewayPayloadAvailabilityZones struct {
// Object that represents an availability zone.
// REQUIRED
Tunnel1 CreateVPNGatewayPayloadAvailabilityZonesGetTunnel1AttributeType `json:"tunnel1" required:"true"`
// Object that represents an availability zone.
// REQUIRED
Tunnel2 CreateVPNGatewayPayloadAvailabilityZonesGetTunnel2AttributeType `json:"tunnel2" required:"true"`
}
type _CreateVPNGatewayPayloadAvailabilityZones CreateVPNGatewayPayloadAvailabilityZones
// NewCreateVPNGatewayPayloadAvailabilityZones instantiates a new CreateVPNGatewayPayloadAvailabilityZones 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 NewCreateVPNGatewayPayloadAvailabilityZones(tunnel1 CreateVPNGatewayPayloadAvailabilityZonesGetTunnel1ArgType, tunnel2 CreateVPNGatewayPayloadAvailabilityZonesGetTunnel2ArgType) *CreateVPNGatewayPayloadAvailabilityZones {
this := CreateVPNGatewayPayloadAvailabilityZones{}
setCreateVPNGatewayPayloadAvailabilityZonesGetTunnel1AttributeType(&this.Tunnel1, tunnel1)
setCreateVPNGatewayPayloadAvailabilityZonesGetTunnel2AttributeType(&this.Tunnel2, tunnel2)
return &this
}
// NewCreateVPNGatewayPayloadAvailabilityZonesWithDefaults instantiates a new CreateVPNGatewayPayloadAvailabilityZones 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 NewCreateVPNGatewayPayloadAvailabilityZonesWithDefaults() *CreateVPNGatewayPayloadAvailabilityZones {
this := CreateVPNGatewayPayloadAvailabilityZones{}
return &this
}
// GetTunnel1 returns the Tunnel1 field value
func (o *CreateVPNGatewayPayloadAvailabilityZones) GetTunnel1() (ret CreateVPNGatewayPayloadAvailabilityZonesGetTunnel1RetType) {
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 *CreateVPNGatewayPayloadAvailabilityZones) GetTunnel1Ok() (ret CreateVPNGatewayPayloadAvailabilityZonesGetTunnel1RetType, ok bool) {
return getCreateVPNGatewayPayloadAvailabilityZonesGetTunnel1AttributeTypeOk(o.Tunnel1)
}
// SetTunnel1 sets field value
func (o *CreateVPNGatewayPayloadAvailabilityZones) SetTunnel1(v CreateVPNGatewayPayloadAvailabilityZonesGetTunnel1RetType) {
setCreateVPNGatewayPayloadAvailabilityZonesGetTunnel1AttributeType(&o.Tunnel1, v)
}
// GetTunnel2 returns the Tunnel2 field value
func (o *CreateVPNGatewayPayloadAvailabilityZones) GetTunnel2() (ret CreateVPNGatewayPayloadAvailabilityZonesGetTunnel2RetType) {
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 *CreateVPNGatewayPayloadAvailabilityZones) GetTunnel2Ok() (ret CreateVPNGatewayPayloadAvailabilityZonesGetTunnel2RetType, ok bool) {
return getCreateVPNGatewayPayloadAvailabilityZonesGetTunnel2AttributeTypeOk(o.Tunnel2)
}
// SetTunnel2 sets field value
func (o *CreateVPNGatewayPayloadAvailabilityZones) SetTunnel2(v CreateVPNGatewayPayloadAvailabilityZonesGetTunnel2RetType) {
setCreateVPNGatewayPayloadAvailabilityZonesGetTunnel2AttributeType(&o.Tunnel2, v)
}
func (o CreateVPNGatewayPayloadAvailabilityZones) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getCreateVPNGatewayPayloadAvailabilityZonesGetTunnel1AttributeTypeOk(o.Tunnel1); ok {
toSerialize["Tunnel1"] = val
}
if val, ok := getCreateVPNGatewayPayloadAvailabilityZonesGetTunnel2AttributeTypeOk(o.Tunnel2); ok {
toSerialize["Tunnel2"] = val
}
return toSerialize, nil
}
type NullableCreateVPNGatewayPayloadAvailabilityZones struct {
value *CreateVPNGatewayPayloadAvailabilityZones
isSet bool
}
func (v NullableCreateVPNGatewayPayloadAvailabilityZones) Get() *CreateVPNGatewayPayloadAvailabilityZones {
return v.value
}
func (v *NullableCreateVPNGatewayPayloadAvailabilityZones) Set(val *CreateVPNGatewayPayloadAvailabilityZones) {
v.value = val
v.isSet = true
}
func (v NullableCreateVPNGatewayPayloadAvailabilityZones) IsSet() bool {
return v.isSet
}
func (v *NullableCreateVPNGatewayPayloadAvailabilityZones) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCreateVPNGatewayPayloadAvailabilityZones(val *CreateVPNGatewayPayloadAvailabilityZones) *NullableCreateVPNGatewayPayloadAvailabilityZones {
return &NullableCreateVPNGatewayPayloadAvailabilityZones{value: val, isSet: true}
}
func (v NullableCreateVPNGatewayPayloadAvailabilityZones) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCreateVPNGatewayPayloadAvailabilityZones) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,454 @@
/*
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 Gateway type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Gateway{}
/*
types and functions for region
*/
// isEnumRef
type GatewayGetRegionAttributeType = *Region
type GatewayGetRegionArgType = Region
type GatewayGetRegionRetType = Region
func getGatewayGetRegionAttributeTypeOk(arg GatewayGetRegionAttributeType) (ret GatewayGetRegionRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewayGetRegionAttributeType(arg *GatewayGetRegionAttributeType, val GatewayGetRegionRetType) {
*arg = &val
}
/*
types and functions for state
*/
// isEnumRef
type GatewayGetStateAttributeType = *GatewayStatus
type GatewayGetStateArgType = GatewayStatus
type GatewayGetStateRetType = GatewayStatus
func getGatewayGetStateAttributeTypeOk(arg GatewayGetStateAttributeType) (ret GatewayGetStateRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewayGetStateAttributeType(arg *GatewayGetStateAttributeType, val GatewayGetStateRetType) {
*arg = &val
}
/*
types and functions for availabilityZones
*/
// isModel
type GatewayGetAvailabilityZonesAttributeType = *CreateVPNGatewayPayloadAvailabilityZones
type GatewayGetAvailabilityZonesArgType = CreateVPNGatewayPayloadAvailabilityZones
type GatewayGetAvailabilityZonesRetType = CreateVPNGatewayPayloadAvailabilityZones
func getGatewayGetAvailabilityZonesAttributeTypeOk(arg GatewayGetAvailabilityZonesAttributeType) (ret GatewayGetAvailabilityZonesRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewayGetAvailabilityZonesAttributeType(arg *GatewayGetAvailabilityZonesAttributeType, val GatewayGetAvailabilityZonesRetType) {
*arg = &val
}
/*
types and functions for bgpEnabled
*/
// isBoolean
type GatewaygetBgpEnabledAttributeType = *bool
type GatewaygetBgpEnabledArgType = bool
type GatewaygetBgpEnabledRetType = bool
func getGatewaygetBgpEnabledAttributeTypeOk(arg GatewaygetBgpEnabledAttributeType) (ret GatewaygetBgpEnabledRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewaygetBgpEnabledAttributeType(arg *GatewaygetBgpEnabledAttributeType, val GatewaygetBgpEnabledRetType) {
*arg = &val
}
/*
types and functions for bgpGatewayConfig
*/
// isModel
type GatewayGetBgpGatewayConfigAttributeType = *BGPGatewayConfig
type GatewayGetBgpGatewayConfigArgType = BGPGatewayConfig
type GatewayGetBgpGatewayConfigRetType = BGPGatewayConfig
func getGatewayGetBgpGatewayConfigAttributeTypeOk(arg GatewayGetBgpGatewayConfigAttributeType) (ret GatewayGetBgpGatewayConfigRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewayGetBgpGatewayConfigAttributeType(arg *GatewayGetBgpGatewayConfigAttributeType, val GatewayGetBgpGatewayConfigRetType) {
*arg = &val
}
/*
types and functions for labels
*/
// isContainer
type GatewayGetLabelsAttributeType = *map[string]string
type GatewayGetLabelsArgType = map[string]string
type GatewayGetLabelsRetType = map[string]string
func getGatewayGetLabelsAttributeTypeOk(arg GatewayGetLabelsAttributeType) (ret GatewayGetLabelsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewayGetLabelsAttributeType(arg *GatewayGetLabelsAttributeType, val GatewayGetLabelsRetType) {
*arg = &val
}
/*
types and functions for name
*/
// isNotNullableString
type GatewayGetNameAttributeType = *string
func getGatewayGetNameAttributeTypeOk(arg GatewayGetNameAttributeType) (ret GatewayGetNameRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewayGetNameAttributeType(arg *GatewayGetNameAttributeType, val GatewayGetNameRetType) {
*arg = &val
}
type GatewayGetNameArgType = string
type GatewayGetNameRetType = string
/*
types and functions for planId
*/
// isNotNullableString
type GatewayGetPlanIdAttributeType = *string
func getGatewayGetPlanIdAttributeTypeOk(arg GatewayGetPlanIdAttributeType) (ret GatewayGetPlanIdRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewayGetPlanIdAttributeType(arg *GatewayGetPlanIdAttributeType, val GatewayGetPlanIdRetType) {
*arg = &val
}
type GatewayGetPlanIdArgType = string
type GatewayGetPlanIdRetType = string
// Gateway struct for Gateway
type Gateway struct {
Region GatewayGetRegionAttributeType `json:"region,omitempty"`
State GatewayGetStateAttributeType `json:"state,omitempty"`
// REQUIRED
AvailabilityZones GatewayGetAvailabilityZonesAttributeType `json:"availabilityZones" required:"true"`
// Enable BGP routing. (This will require a BGPGatewayConfig and also a BGPTunnelConfig for each Tunnel in each Connection)
BgpEnabled GatewaygetBgpEnabledAttributeType `json:"bgpEnabled,omitempty"`
BgpGatewayConfig GatewayGetBgpGatewayConfigAttributeType `json:"bgpGatewayConfig,omitempty"`
// Map of custom labels. Key and values must be max 63 chars, start/end with alphanumeric.
Labels GatewayGetLabelsAttributeType `json:"labels,omitempty"`
// The name of the VPN gateway. Maximum 20 characters (only alphanumeric and hyphens allowed). Not changeable after creation.
// REQUIRED
Name GatewayGetNameAttributeType `json:"name" required:"true"`
// Service Plan to configure the limits of the VPN. Currently supported plans are p50, p100, p200. This list can change in the future where plan ids will be removed and new plans by added. That is the reason this is not an enum.
// REQUIRED
PlanId GatewayGetPlanIdAttributeType `json:"planId" required:"true"`
}
type _Gateway Gateway
// NewGateway instantiates a new Gateway 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 NewGateway(availabilityZones GatewayGetAvailabilityZonesArgType, name GatewayGetNameArgType, planId GatewayGetPlanIdArgType) *Gateway {
this := Gateway{}
setGatewayGetAvailabilityZonesAttributeType(&this.AvailabilityZones, availabilityZones)
setGatewayGetNameAttributeType(&this.Name, name)
setGatewayGetPlanIdAttributeType(&this.PlanId, planId)
return &this
}
// NewGatewayWithDefaults instantiates a new Gateway 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 NewGatewayWithDefaults() *Gateway {
this := Gateway{}
var region Region = REGION_EU01
this.Region = &region
return &this
}
// GetRegion returns the Region field value if set, zero value otherwise.
func (o *Gateway) GetRegion() (res GatewayGetRegionRetType) {
res, _ = o.GetRegionOk()
return
}
// GetRegionOk returns a tuple with the Region field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Gateway) GetRegionOk() (ret GatewayGetRegionRetType, ok bool) {
return getGatewayGetRegionAttributeTypeOk(o.Region)
}
// HasRegion returns a boolean if a field has been set.
func (o *Gateway) HasRegion() bool {
_, ok := o.GetRegionOk()
return ok
}
// SetRegion gets a reference to the given Region and assigns it to the Region field.
func (o *Gateway) SetRegion(v GatewayGetRegionRetType) {
setGatewayGetRegionAttributeType(&o.Region, v)
}
// GetState returns the State field value if set, zero value otherwise.
func (o *Gateway) GetState() (res GatewayGetStateRetType) {
res, _ = o.GetStateOk()
return
}
// GetStateOk returns a tuple with the State field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Gateway) GetStateOk() (ret GatewayGetStateRetType, ok bool) {
return getGatewayGetStateAttributeTypeOk(o.State)
}
// HasState returns a boolean if a field has been set.
func (o *Gateway) HasState() bool {
_, ok := o.GetStateOk()
return ok
}
// SetState gets a reference to the given GatewayStatus and assigns it to the State field.
func (o *Gateway) SetState(v GatewayGetStateRetType) {
setGatewayGetStateAttributeType(&o.State, v)
}
// GetAvailabilityZones returns the AvailabilityZones field value
func (o *Gateway) GetAvailabilityZones() (ret GatewayGetAvailabilityZonesRetType) {
ret, _ = o.GetAvailabilityZonesOk()
return ret
}
// GetAvailabilityZonesOk returns a tuple with the AvailabilityZones field value
// and a boolean to check if the value has been set.
func (o *Gateway) GetAvailabilityZonesOk() (ret GatewayGetAvailabilityZonesRetType, ok bool) {
return getGatewayGetAvailabilityZonesAttributeTypeOk(o.AvailabilityZones)
}
// SetAvailabilityZones sets field value
func (o *Gateway) SetAvailabilityZones(v GatewayGetAvailabilityZonesRetType) {
setGatewayGetAvailabilityZonesAttributeType(&o.AvailabilityZones, v)
}
// GetBgpEnabled returns the BgpEnabled field value if set, zero value otherwise.
func (o *Gateway) GetBgpEnabled() (res GatewaygetBgpEnabledRetType) {
res, _ = o.GetBgpEnabledOk()
return
}
// GetBgpEnabledOk returns a tuple with the BgpEnabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Gateway) GetBgpEnabledOk() (ret GatewaygetBgpEnabledRetType, ok bool) {
return getGatewaygetBgpEnabledAttributeTypeOk(o.BgpEnabled)
}
// HasBgpEnabled returns a boolean if a field has been set.
func (o *Gateway) HasBgpEnabled() bool {
_, ok := o.GetBgpEnabledOk()
return ok
}
// SetBgpEnabled gets a reference to the given bool and assigns it to the BgpEnabled field.
func (o *Gateway) SetBgpEnabled(v GatewaygetBgpEnabledRetType) {
setGatewaygetBgpEnabledAttributeType(&o.BgpEnabled, v)
}
// GetBgpGatewayConfig returns the BgpGatewayConfig field value if set, zero value otherwise.
func (o *Gateway) GetBgpGatewayConfig() (res GatewayGetBgpGatewayConfigRetType) {
res, _ = o.GetBgpGatewayConfigOk()
return
}
// GetBgpGatewayConfigOk returns a tuple with the BgpGatewayConfig field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Gateway) GetBgpGatewayConfigOk() (ret GatewayGetBgpGatewayConfigRetType, ok bool) {
return getGatewayGetBgpGatewayConfigAttributeTypeOk(o.BgpGatewayConfig)
}
// HasBgpGatewayConfig returns a boolean if a field has been set.
func (o *Gateway) HasBgpGatewayConfig() bool {
_, ok := o.GetBgpGatewayConfigOk()
return ok
}
// SetBgpGatewayConfig gets a reference to the given BGPGatewayConfig and assigns it to the BgpGatewayConfig field.
func (o *Gateway) SetBgpGatewayConfig(v GatewayGetBgpGatewayConfigRetType) {
setGatewayGetBgpGatewayConfigAttributeType(&o.BgpGatewayConfig, v)
}
// GetLabels returns the Labels field value if set, zero value otherwise.
func (o *Gateway) GetLabels() (res GatewayGetLabelsRetType) {
res, _ = o.GetLabelsOk()
return
}
// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Gateway) GetLabelsOk() (ret GatewayGetLabelsRetType, ok bool) {
return getGatewayGetLabelsAttributeTypeOk(o.Labels)
}
// HasLabels returns a boolean if a field has been set.
func (o *Gateway) HasLabels() bool {
_, ok := o.GetLabelsOk()
return ok
}
// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field.
func (o *Gateway) SetLabels(v GatewayGetLabelsRetType) {
setGatewayGetLabelsAttributeType(&o.Labels, v)
}
// GetName returns the Name field value
func (o *Gateway) GetName() (ret GatewayGetNameRetType) {
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 *Gateway) GetNameOk() (ret GatewayGetNameRetType, ok bool) {
return getGatewayGetNameAttributeTypeOk(o.Name)
}
// SetName sets field value
func (o *Gateway) SetName(v GatewayGetNameRetType) {
setGatewayGetNameAttributeType(&o.Name, v)
}
// GetPlanId returns the PlanId field value
func (o *Gateway) GetPlanId() (ret GatewayGetPlanIdRetType) {
ret, _ = o.GetPlanIdOk()
return ret
}
// GetPlanIdOk returns a tuple with the PlanId field value
// and a boolean to check if the value has been set.
func (o *Gateway) GetPlanIdOk() (ret GatewayGetPlanIdRetType, ok bool) {
return getGatewayGetPlanIdAttributeTypeOk(o.PlanId)
}
// SetPlanId sets field value
func (o *Gateway) SetPlanId(v GatewayGetPlanIdRetType) {
setGatewayGetPlanIdAttributeType(&o.PlanId, v)
}
func (o Gateway) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getGatewayGetRegionAttributeTypeOk(o.Region); ok {
toSerialize["Region"] = val
}
if val, ok := getGatewayGetStateAttributeTypeOk(o.State); ok {
toSerialize["State"] = val
}
if val, ok := getGatewayGetAvailabilityZonesAttributeTypeOk(o.AvailabilityZones); ok {
toSerialize["AvailabilityZones"] = val
}
if val, ok := getGatewaygetBgpEnabledAttributeTypeOk(o.BgpEnabled); ok {
toSerialize["BgpEnabled"] = val
}
if val, ok := getGatewayGetBgpGatewayConfigAttributeTypeOk(o.BgpGatewayConfig); ok {
toSerialize["BgpGatewayConfig"] = val
}
if val, ok := getGatewayGetLabelsAttributeTypeOk(o.Labels); ok {
toSerialize["Labels"] = val
}
if val, ok := getGatewayGetNameAttributeTypeOk(o.Name); ok {
toSerialize["Name"] = val
}
if val, ok := getGatewayGetPlanIdAttributeTypeOk(o.PlanId); ok {
toSerialize["PlanId"] = val
}
return toSerialize, nil
}
type NullableGateway struct {
value *Gateway
isSet bool
}
func (v NullableGateway) Get() *Gateway {
return v.value
}
func (v *NullableGateway) Set(val *Gateway) {
v.value = val
v.isSet = true
}
func (v NullableGateway) IsSet() bool {
return v.isSet
}
func (v *NullableGateway) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGateway(val *Gateway) *NullableGateway {
return &NullableGateway{value: val, isSet: true}
}
func (v NullableGateway) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGateway) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,125 @@
/*
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 GatewayList type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GatewayList{}
/*
types and functions for gateways
*/
// isArray
type GatewayListGetGatewaysAttributeType = *[]GatewayWithStatus
type GatewayListGetGatewaysArgType = []GatewayWithStatus
type GatewayListGetGatewaysRetType = []GatewayWithStatus
func getGatewayListGetGatewaysAttributeTypeOk(arg GatewayListGetGatewaysAttributeType) (ret GatewayListGetGatewaysRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewayListGetGatewaysAttributeType(arg *GatewayListGetGatewaysAttributeType, val GatewayListGetGatewaysRetType) {
*arg = &val
}
// GatewayList struct for GatewayList
type GatewayList struct {
// REQUIRED
Gateways GatewayListGetGatewaysAttributeType `json:"gateways" required:"true"`
}
type _GatewayList GatewayList
// NewGatewayList instantiates a new GatewayList 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 NewGatewayList(gateways GatewayListGetGatewaysArgType) *GatewayList {
this := GatewayList{}
setGatewayListGetGatewaysAttributeType(&this.Gateways, gateways)
return &this
}
// NewGatewayListWithDefaults instantiates a new GatewayList 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 NewGatewayListWithDefaults() *GatewayList {
this := GatewayList{}
return &this
}
// GetGateways returns the Gateways field value
func (o *GatewayList) GetGateways() (ret GatewayListGetGatewaysRetType) {
ret, _ = o.GetGatewaysOk()
return ret
}
// GetGatewaysOk returns a tuple with the Gateways field value
// and a boolean to check if the value has been set.
func (o *GatewayList) GetGatewaysOk() (ret GatewayListGetGatewaysRetType, ok bool) {
return getGatewayListGetGatewaysAttributeTypeOk(o.Gateways)
}
// SetGateways sets field value
func (o *GatewayList) SetGateways(v GatewayListGetGatewaysRetType) {
setGatewayListGetGatewaysAttributeType(&o.Gateways, v)
}
func (o GatewayList) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getGatewayListGetGatewaysAttributeTypeOk(o.Gateways); ok {
toSerialize["Gateways"] = val
}
return toSerialize, nil
}
type NullableGatewayList struct {
value *GatewayList
isSet bool
}
func (v NullableGatewayList) Get() *GatewayList {
return v.value
}
func (v *NullableGatewayList) Set(val *GatewayList) {
v.value = val
v.isSet = true
}
func (v NullableGatewayList) IsSet() bool {
return v.isSet
}
func (v *NullableGatewayList) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGatewayList(val *GatewayList) *NullableGatewayList {
return &NullableGatewayList{value: val, isSet: true}
}
func (v NullableGatewayList) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGatewayList) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,358 @@
/*
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 GatewayRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GatewayRequest{}
/*
types and functions for availabilityZones
*/
// isModel
type GatewayRequestGetAvailabilityZonesAttributeType = *CreateVPNGatewayPayloadAvailabilityZones
type GatewayRequestGetAvailabilityZonesArgType = CreateVPNGatewayPayloadAvailabilityZones
type GatewayRequestGetAvailabilityZonesRetType = CreateVPNGatewayPayloadAvailabilityZones
func getGatewayRequestGetAvailabilityZonesAttributeTypeOk(arg GatewayRequestGetAvailabilityZonesAttributeType) (ret GatewayRequestGetAvailabilityZonesRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewayRequestGetAvailabilityZonesAttributeType(arg *GatewayRequestGetAvailabilityZonesAttributeType, val GatewayRequestGetAvailabilityZonesRetType) {
*arg = &val
}
/*
types and functions for bgpEnabled
*/
// isBoolean
type GatewayRequestgetBgpEnabledAttributeType = *bool
type GatewayRequestgetBgpEnabledArgType = bool
type GatewayRequestgetBgpEnabledRetType = bool
func getGatewayRequestgetBgpEnabledAttributeTypeOk(arg GatewayRequestgetBgpEnabledAttributeType) (ret GatewayRequestgetBgpEnabledRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewayRequestgetBgpEnabledAttributeType(arg *GatewayRequestgetBgpEnabledAttributeType, val GatewayRequestgetBgpEnabledRetType) {
*arg = &val
}
/*
types and functions for bgpGatewayConfig
*/
// isModel
type GatewayRequestGetBgpGatewayConfigAttributeType = *BGPGatewayConfig
type GatewayRequestGetBgpGatewayConfigArgType = BGPGatewayConfig
type GatewayRequestGetBgpGatewayConfigRetType = BGPGatewayConfig
func getGatewayRequestGetBgpGatewayConfigAttributeTypeOk(arg GatewayRequestGetBgpGatewayConfigAttributeType) (ret GatewayRequestGetBgpGatewayConfigRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewayRequestGetBgpGatewayConfigAttributeType(arg *GatewayRequestGetBgpGatewayConfigAttributeType, val GatewayRequestGetBgpGatewayConfigRetType) {
*arg = &val
}
/*
types and functions for labels
*/
// isContainer
type GatewayRequestGetLabelsAttributeType = *map[string]string
type GatewayRequestGetLabelsArgType = map[string]string
type GatewayRequestGetLabelsRetType = map[string]string
func getGatewayRequestGetLabelsAttributeTypeOk(arg GatewayRequestGetLabelsAttributeType) (ret GatewayRequestGetLabelsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewayRequestGetLabelsAttributeType(arg *GatewayRequestGetLabelsAttributeType, val GatewayRequestGetLabelsRetType) {
*arg = &val
}
/*
types and functions for name
*/
// isNotNullableString
type GatewayRequestGetNameAttributeType = *string
func getGatewayRequestGetNameAttributeTypeOk(arg GatewayRequestGetNameAttributeType) (ret GatewayRequestGetNameRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewayRequestGetNameAttributeType(arg *GatewayRequestGetNameAttributeType, val GatewayRequestGetNameRetType) {
*arg = &val
}
type GatewayRequestGetNameArgType = string
type GatewayRequestGetNameRetType = string
/*
types and functions for planId
*/
// isNotNullableString
type GatewayRequestGetPlanIdAttributeType = *string
func getGatewayRequestGetPlanIdAttributeTypeOk(arg GatewayRequestGetPlanIdAttributeType) (ret GatewayRequestGetPlanIdRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewayRequestGetPlanIdAttributeType(arg *GatewayRequestGetPlanIdAttributeType, val GatewayRequestGetPlanIdRetType) {
*arg = &val
}
type GatewayRequestGetPlanIdArgType = string
type GatewayRequestGetPlanIdRetType = string
// GatewayRequest struct for GatewayRequest
type GatewayRequest struct {
// REQUIRED
AvailabilityZones GatewayRequestGetAvailabilityZonesAttributeType `json:"availabilityZones" required:"true"`
// Enable BGP routing. (This will require a BGPGatewayConfig and also a BGPTunnelConfig for each Tunnel in each Connection)
BgpEnabled GatewayRequestgetBgpEnabledAttributeType `json:"bgpEnabled,omitempty"`
BgpGatewayConfig GatewayRequestGetBgpGatewayConfigAttributeType `json:"bgpGatewayConfig,omitempty"`
// Map of custom labels. Key and values must be max 63 chars, start/end with alphanumeric.
Labels GatewayRequestGetLabelsAttributeType `json:"labels,omitempty"`
// The name of the VPN gateway. Maximum 20 characters (only alphanumeric and hyphens allowed). Not changeable after creation.
// REQUIRED
Name GatewayRequestGetNameAttributeType `json:"name" required:"true"`
// Service Plan to configure the limits of the VPN. Currently supported plans are p50, p100, p200. This list can change in the future where plan ids will be removed and new plans by added. That is the reason this is not an enum.
// REQUIRED
PlanId GatewayRequestGetPlanIdAttributeType `json:"planId" required:"true"`
}
type _GatewayRequest GatewayRequest
// NewGatewayRequest instantiates a new GatewayRequest 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 NewGatewayRequest(availabilityZones GatewayRequestGetAvailabilityZonesArgType, name GatewayRequestGetNameArgType, planId GatewayRequestGetPlanIdArgType) *GatewayRequest {
this := GatewayRequest{}
setGatewayRequestGetAvailabilityZonesAttributeType(&this.AvailabilityZones, availabilityZones)
setGatewayRequestGetNameAttributeType(&this.Name, name)
setGatewayRequestGetPlanIdAttributeType(&this.PlanId, planId)
return &this
}
// NewGatewayRequestWithDefaults instantiates a new GatewayRequest 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 NewGatewayRequestWithDefaults() *GatewayRequest {
this := GatewayRequest{}
return &this
}
// GetAvailabilityZones returns the AvailabilityZones field value
func (o *GatewayRequest) GetAvailabilityZones() (ret GatewayRequestGetAvailabilityZonesRetType) {
ret, _ = o.GetAvailabilityZonesOk()
return ret
}
// GetAvailabilityZonesOk returns a tuple with the AvailabilityZones field value
// and a boolean to check if the value has been set.
func (o *GatewayRequest) GetAvailabilityZonesOk() (ret GatewayRequestGetAvailabilityZonesRetType, ok bool) {
return getGatewayRequestGetAvailabilityZonesAttributeTypeOk(o.AvailabilityZones)
}
// SetAvailabilityZones sets field value
func (o *GatewayRequest) SetAvailabilityZones(v GatewayRequestGetAvailabilityZonesRetType) {
setGatewayRequestGetAvailabilityZonesAttributeType(&o.AvailabilityZones, v)
}
// GetBgpEnabled returns the BgpEnabled field value if set, zero value otherwise.
func (o *GatewayRequest) GetBgpEnabled() (res GatewayRequestgetBgpEnabledRetType) {
res, _ = o.GetBgpEnabledOk()
return
}
// GetBgpEnabledOk returns a tuple with the BgpEnabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GatewayRequest) GetBgpEnabledOk() (ret GatewayRequestgetBgpEnabledRetType, ok bool) {
return getGatewayRequestgetBgpEnabledAttributeTypeOk(o.BgpEnabled)
}
// HasBgpEnabled returns a boolean if a field has been set.
func (o *GatewayRequest) HasBgpEnabled() bool {
_, ok := o.GetBgpEnabledOk()
return ok
}
// SetBgpEnabled gets a reference to the given bool and assigns it to the BgpEnabled field.
func (o *GatewayRequest) SetBgpEnabled(v GatewayRequestgetBgpEnabledRetType) {
setGatewayRequestgetBgpEnabledAttributeType(&o.BgpEnabled, v)
}
// GetBgpGatewayConfig returns the BgpGatewayConfig field value if set, zero value otherwise.
func (o *GatewayRequest) GetBgpGatewayConfig() (res GatewayRequestGetBgpGatewayConfigRetType) {
res, _ = o.GetBgpGatewayConfigOk()
return
}
// GetBgpGatewayConfigOk returns a tuple with the BgpGatewayConfig field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GatewayRequest) GetBgpGatewayConfigOk() (ret GatewayRequestGetBgpGatewayConfigRetType, ok bool) {
return getGatewayRequestGetBgpGatewayConfigAttributeTypeOk(o.BgpGatewayConfig)
}
// HasBgpGatewayConfig returns a boolean if a field has been set.
func (o *GatewayRequest) HasBgpGatewayConfig() bool {
_, ok := o.GetBgpGatewayConfigOk()
return ok
}
// SetBgpGatewayConfig gets a reference to the given BGPGatewayConfig and assigns it to the BgpGatewayConfig field.
func (o *GatewayRequest) SetBgpGatewayConfig(v GatewayRequestGetBgpGatewayConfigRetType) {
setGatewayRequestGetBgpGatewayConfigAttributeType(&o.BgpGatewayConfig, v)
}
// GetLabels returns the Labels field value if set, zero value otherwise.
func (o *GatewayRequest) GetLabels() (res GatewayRequestGetLabelsRetType) {
res, _ = o.GetLabelsOk()
return
}
// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GatewayRequest) GetLabelsOk() (ret GatewayRequestGetLabelsRetType, ok bool) {
return getGatewayRequestGetLabelsAttributeTypeOk(o.Labels)
}
// HasLabels returns a boolean if a field has been set.
func (o *GatewayRequest) HasLabels() bool {
_, ok := o.GetLabelsOk()
return ok
}
// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field.
func (o *GatewayRequest) SetLabels(v GatewayRequestGetLabelsRetType) {
setGatewayRequestGetLabelsAttributeType(&o.Labels, v)
}
// GetName returns the Name field value
func (o *GatewayRequest) GetName() (ret GatewayRequestGetNameRetType) {
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 *GatewayRequest) GetNameOk() (ret GatewayRequestGetNameRetType, ok bool) {
return getGatewayRequestGetNameAttributeTypeOk(o.Name)
}
// SetName sets field value
func (o *GatewayRequest) SetName(v GatewayRequestGetNameRetType) {
setGatewayRequestGetNameAttributeType(&o.Name, v)
}
// GetPlanId returns the PlanId field value
func (o *GatewayRequest) GetPlanId() (ret GatewayRequestGetPlanIdRetType) {
ret, _ = o.GetPlanIdOk()
return ret
}
// GetPlanIdOk returns a tuple with the PlanId field value
// and a boolean to check if the value has been set.
func (o *GatewayRequest) GetPlanIdOk() (ret GatewayRequestGetPlanIdRetType, ok bool) {
return getGatewayRequestGetPlanIdAttributeTypeOk(o.PlanId)
}
// SetPlanId sets field value
func (o *GatewayRequest) SetPlanId(v GatewayRequestGetPlanIdRetType) {
setGatewayRequestGetPlanIdAttributeType(&o.PlanId, v)
}
func (o GatewayRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getGatewayRequestGetAvailabilityZonesAttributeTypeOk(o.AvailabilityZones); ok {
toSerialize["AvailabilityZones"] = val
}
if val, ok := getGatewayRequestgetBgpEnabledAttributeTypeOk(o.BgpEnabled); ok {
toSerialize["BgpEnabled"] = val
}
if val, ok := getGatewayRequestGetBgpGatewayConfigAttributeTypeOk(o.BgpGatewayConfig); ok {
toSerialize["BgpGatewayConfig"] = val
}
if val, ok := getGatewayRequestGetLabelsAttributeTypeOk(o.Labels); ok {
toSerialize["Labels"] = val
}
if val, ok := getGatewayRequestGetNameAttributeTypeOk(o.Name); ok {
toSerialize["Name"] = val
}
if val, ok := getGatewayRequestGetPlanIdAttributeTypeOk(o.PlanId); ok {
toSerialize["PlanId"] = val
}
return toSerialize, nil
}
type NullableGatewayRequest struct {
value *GatewayRequest
isSet bool
}
func (v NullableGatewayRequest) Get() *GatewayRequest {
return v.value
}
func (v *NullableGatewayRequest) Set(val *GatewayRequest) {
v.value = val
v.isSet = true
}
func (v NullableGatewayRequest) IsSet() bool {
return v.isSet
}
func (v *NullableGatewayRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGatewayRequest(val *GatewayRequest) *NullableGatewayRequest {
return &NullableGatewayRequest{value: val, isSet: true}
}
func (v NullableGatewayRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGatewayRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,119 @@
/*
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"
"fmt"
)
// GatewayStatus Describes the status of the surrounding infrastructure.
type GatewayStatus string
// List of GatewayStatus
const (
GATEWAYSTATUS_PENDING GatewayStatus = "PENDING"
GATEWAYSTATUS_READY GatewayStatus = "READY"
GATEWAYSTATUS_ERROR GatewayStatus = "ERROR"
GATEWAYSTATUS_DELETING GatewayStatus = "DELETING"
)
// All allowed values of GatewayStatus enum
var AllowedGatewayStatusEnumValues = []GatewayStatus{
"PENDING",
"READY",
"ERROR",
"DELETING",
}
func (v *GatewayStatus) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
// Allow unmarshalling zero value for testing purposes
var zeroValue string
if value == zeroValue {
return nil
}
enumTypeValue := GatewayStatus(value)
for _, existing := range AllowedGatewayStatusEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid GatewayStatus", value)
}
// NewGatewayStatusFromValue returns a pointer to a valid GatewayStatus
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewGatewayStatusFromValue(v string) (*GatewayStatus, error) {
ev := GatewayStatus(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for GatewayStatus: valid values are %v", v, AllowedGatewayStatusEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v GatewayStatus) IsValid() bool {
for _, existing := range AllowedGatewayStatusEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to GatewayStatus value
func (v GatewayStatus) Ptr() *GatewayStatus {
return &v
}
type NullableGatewayStatus struct {
value *GatewayStatus
isSet bool
}
func (v NullableGatewayStatus) Get() *GatewayStatus {
return v.value
}
func (v *NullableGatewayStatus) Set(val *GatewayStatus) {
v.value = val
v.isSet = true
}
func (v NullableGatewayStatus) IsSet() bool {
return v.isSet
}
func (v *NullableGatewayStatus) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGatewayStatus(val *GatewayStatus) *NullableGatewayStatus {
return &NullableGatewayStatus{value: val, isSet: true}
}
func (v NullableGatewayStatus) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGatewayStatus) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,223 @@
/*
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 GatewayStatusResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GatewayStatusResponse{}
/*
types and functions for gatewayName
*/
// isNotNullableString
type GatewayStatusResponseGetGatewayNameAttributeType = *string
func getGatewayStatusResponseGetGatewayNameAttributeTypeOk(arg GatewayStatusResponseGetGatewayNameAttributeType) (ret GatewayStatusResponseGetGatewayNameRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewayStatusResponseGetGatewayNameAttributeType(arg *GatewayStatusResponseGetGatewayNameAttributeType, val GatewayStatusResponseGetGatewayNameRetType) {
*arg = &val
}
type GatewayStatusResponseGetGatewayNameArgType = string
type GatewayStatusResponseGetGatewayNameRetType = string
/*
types and functions for gatewayStatus
*/
// isEnumRef
type GatewayStatusResponseGetGatewayStatusAttributeType = *GatewayStatus
type GatewayStatusResponseGetGatewayStatusArgType = GatewayStatus
type GatewayStatusResponseGetGatewayStatusRetType = GatewayStatus
func getGatewayStatusResponseGetGatewayStatusAttributeTypeOk(arg GatewayStatusResponseGetGatewayStatusAttributeType) (ret GatewayStatusResponseGetGatewayStatusRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewayStatusResponseGetGatewayStatusAttributeType(arg *GatewayStatusResponseGetGatewayStatusAttributeType, val GatewayStatusResponseGetGatewayStatusRetType) {
*arg = &val
}
/*
types and functions for tunnels
*/
// isArray
type GatewayStatusResponseGetTunnelsAttributeType = *[]VPNTunnels
type GatewayStatusResponseGetTunnelsArgType = []VPNTunnels
type GatewayStatusResponseGetTunnelsRetType = []VPNTunnels
func getGatewayStatusResponseGetTunnelsAttributeTypeOk(arg GatewayStatusResponseGetTunnelsAttributeType) (ret GatewayStatusResponseGetTunnelsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewayStatusResponseGetTunnelsAttributeType(arg *GatewayStatusResponseGetTunnelsAttributeType, val GatewayStatusResponseGetTunnelsRetType) {
*arg = &val
}
// GatewayStatusResponse struct for GatewayStatusResponse
type GatewayStatusResponse struct {
// VPN name
GatewayName GatewayStatusResponseGetGatewayNameAttributeType `json:"gatewayName,omitempty"`
GatewayStatus GatewayStatusResponseGetGatewayStatusAttributeType `json:"gatewayStatus,omitempty"`
Tunnels GatewayStatusResponseGetTunnelsAttributeType `json:"tunnels,omitempty"`
}
// NewGatewayStatusResponse instantiates a new GatewayStatusResponse 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 NewGatewayStatusResponse() *GatewayStatusResponse {
this := GatewayStatusResponse{}
return &this
}
// NewGatewayStatusResponseWithDefaults instantiates a new GatewayStatusResponse 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 NewGatewayStatusResponseWithDefaults() *GatewayStatusResponse {
this := GatewayStatusResponse{}
return &this
}
// GetGatewayName returns the GatewayName field value if set, zero value otherwise.
func (o *GatewayStatusResponse) GetGatewayName() (res GatewayStatusResponseGetGatewayNameRetType) {
res, _ = o.GetGatewayNameOk()
return
}
// GetGatewayNameOk returns a tuple with the GatewayName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GatewayStatusResponse) GetGatewayNameOk() (ret GatewayStatusResponseGetGatewayNameRetType, ok bool) {
return getGatewayStatusResponseGetGatewayNameAttributeTypeOk(o.GatewayName)
}
// HasGatewayName returns a boolean if a field has been set.
func (o *GatewayStatusResponse) HasGatewayName() bool {
_, ok := o.GetGatewayNameOk()
return ok
}
// SetGatewayName gets a reference to the given string and assigns it to the GatewayName field.
func (o *GatewayStatusResponse) SetGatewayName(v GatewayStatusResponseGetGatewayNameRetType) {
setGatewayStatusResponseGetGatewayNameAttributeType(&o.GatewayName, v)
}
// GetGatewayStatus returns the GatewayStatus field value if set, zero value otherwise.
func (o *GatewayStatusResponse) GetGatewayStatus() (res GatewayStatusResponseGetGatewayStatusRetType) {
res, _ = o.GetGatewayStatusOk()
return
}
// GetGatewayStatusOk returns a tuple with the GatewayStatus field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GatewayStatusResponse) GetGatewayStatusOk() (ret GatewayStatusResponseGetGatewayStatusRetType, ok bool) {
return getGatewayStatusResponseGetGatewayStatusAttributeTypeOk(o.GatewayStatus)
}
// HasGatewayStatus returns a boolean if a field has been set.
func (o *GatewayStatusResponse) HasGatewayStatus() bool {
_, ok := o.GetGatewayStatusOk()
return ok
}
// SetGatewayStatus gets a reference to the given GatewayStatus and assigns it to the GatewayStatus field.
func (o *GatewayStatusResponse) SetGatewayStatus(v GatewayStatusResponseGetGatewayStatusRetType) {
setGatewayStatusResponseGetGatewayStatusAttributeType(&o.GatewayStatus, v)
}
// GetTunnels returns the Tunnels field value if set, zero value otherwise.
func (o *GatewayStatusResponse) GetTunnels() (res GatewayStatusResponseGetTunnelsRetType) {
res, _ = o.GetTunnelsOk()
return
}
// GetTunnelsOk returns a tuple with the Tunnels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GatewayStatusResponse) GetTunnelsOk() (ret GatewayStatusResponseGetTunnelsRetType, ok bool) {
return getGatewayStatusResponseGetTunnelsAttributeTypeOk(o.Tunnels)
}
// HasTunnels returns a boolean if a field has been set.
func (o *GatewayStatusResponse) HasTunnels() bool {
_, ok := o.GetTunnelsOk()
return ok
}
// SetTunnels gets a reference to the given []VPNTunnels and assigns it to the Tunnels field.
func (o *GatewayStatusResponse) SetTunnels(v GatewayStatusResponseGetTunnelsRetType) {
setGatewayStatusResponseGetTunnelsAttributeType(&o.Tunnels, v)
}
func (o GatewayStatusResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getGatewayStatusResponseGetGatewayNameAttributeTypeOk(o.GatewayName); ok {
toSerialize["GatewayName"] = val
}
if val, ok := getGatewayStatusResponseGetGatewayStatusAttributeTypeOk(o.GatewayStatus); ok {
toSerialize["GatewayStatus"] = val
}
if val, ok := getGatewayStatusResponseGetTunnelsAttributeTypeOk(o.Tunnels); ok {
toSerialize["Tunnels"] = val
}
return toSerialize, nil
}
type NullableGatewayStatusResponse struct {
value *GatewayStatusResponse
isSet bool
}
func (v NullableGatewayStatusResponse) Get() *GatewayStatusResponse {
return v.value
}
func (v *NullableGatewayStatusResponse) Set(val *GatewayStatusResponse) {
v.value = val
v.isSet = true
}
func (v NullableGatewayStatusResponse) IsSet() bool {
return v.isSet
}
func (v *NullableGatewayStatusResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGatewayStatusResponse(val *GatewayStatusResponse) *NullableGatewayStatusResponse {
return &NullableGatewayStatusResponse{value: val, isSet: true}
}
func (v NullableGatewayStatusResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGatewayStatusResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,407 @@
/*
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 GatewayWithStatus type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GatewayWithStatus{}
/*
types and functions for region
*/
// isEnumRef
type GatewayWithStatusGetRegionAttributeType = *Region
type GatewayWithStatusGetRegionArgType = Region
type GatewayWithStatusGetRegionRetType = Region
func getGatewayWithStatusGetRegionAttributeTypeOk(arg GatewayWithStatusGetRegionAttributeType) (ret GatewayWithStatusGetRegionRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewayWithStatusGetRegionAttributeType(arg *GatewayWithStatusGetRegionAttributeType, val GatewayWithStatusGetRegionRetType) {
*arg = &val
}
/*
types and functions for availabilityZones
*/
// isModel
type GatewayWithStatusGetAvailabilityZonesAttributeType = *CreateVPNGatewayPayloadAvailabilityZones
type GatewayWithStatusGetAvailabilityZonesArgType = CreateVPNGatewayPayloadAvailabilityZones
type GatewayWithStatusGetAvailabilityZonesRetType = CreateVPNGatewayPayloadAvailabilityZones
func getGatewayWithStatusGetAvailabilityZonesAttributeTypeOk(arg GatewayWithStatusGetAvailabilityZonesAttributeType) (ret GatewayWithStatusGetAvailabilityZonesRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewayWithStatusGetAvailabilityZonesAttributeType(arg *GatewayWithStatusGetAvailabilityZonesAttributeType, val GatewayWithStatusGetAvailabilityZonesRetType) {
*arg = &val
}
/*
types and functions for bgpEnabled
*/
// isBoolean
type GatewayWithStatusgetBgpEnabledAttributeType = *bool
type GatewayWithStatusgetBgpEnabledArgType = bool
type GatewayWithStatusgetBgpEnabledRetType = bool
func getGatewayWithStatusgetBgpEnabledAttributeTypeOk(arg GatewayWithStatusgetBgpEnabledAttributeType) (ret GatewayWithStatusgetBgpEnabledRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewayWithStatusgetBgpEnabledAttributeType(arg *GatewayWithStatusgetBgpEnabledAttributeType, val GatewayWithStatusgetBgpEnabledRetType) {
*arg = &val
}
/*
types and functions for bgpGatewayConfig
*/
// isModel
type GatewayWithStatusGetBgpGatewayConfigAttributeType = *BGPGatewayConfig
type GatewayWithStatusGetBgpGatewayConfigArgType = BGPGatewayConfig
type GatewayWithStatusGetBgpGatewayConfigRetType = BGPGatewayConfig
func getGatewayWithStatusGetBgpGatewayConfigAttributeTypeOk(arg GatewayWithStatusGetBgpGatewayConfigAttributeType) (ret GatewayWithStatusGetBgpGatewayConfigRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewayWithStatusGetBgpGatewayConfigAttributeType(arg *GatewayWithStatusGetBgpGatewayConfigAttributeType, val GatewayWithStatusGetBgpGatewayConfigRetType) {
*arg = &val
}
/*
types and functions for labels
*/
// isContainer
type GatewayWithStatusGetLabelsAttributeType = *map[string]string
type GatewayWithStatusGetLabelsArgType = map[string]string
type GatewayWithStatusGetLabelsRetType = map[string]string
func getGatewayWithStatusGetLabelsAttributeTypeOk(arg GatewayWithStatusGetLabelsAttributeType) (ret GatewayWithStatusGetLabelsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewayWithStatusGetLabelsAttributeType(arg *GatewayWithStatusGetLabelsAttributeType, val GatewayWithStatusGetLabelsRetType) {
*arg = &val
}
/*
types and functions for name
*/
// isNotNullableString
type GatewayWithStatusGetNameAttributeType = *string
func getGatewayWithStatusGetNameAttributeTypeOk(arg GatewayWithStatusGetNameAttributeType) (ret GatewayWithStatusGetNameRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewayWithStatusGetNameAttributeType(arg *GatewayWithStatusGetNameAttributeType, val GatewayWithStatusGetNameRetType) {
*arg = &val
}
type GatewayWithStatusGetNameArgType = string
type GatewayWithStatusGetNameRetType = string
/*
types and functions for planId
*/
// isNotNullableString
type GatewayWithStatusGetPlanIdAttributeType = *string
func getGatewayWithStatusGetPlanIdAttributeTypeOk(arg GatewayWithStatusGetPlanIdAttributeType) (ret GatewayWithStatusGetPlanIdRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewayWithStatusGetPlanIdAttributeType(arg *GatewayWithStatusGetPlanIdAttributeType, val GatewayWithStatusGetPlanIdRetType) {
*arg = &val
}
type GatewayWithStatusGetPlanIdArgType = string
type GatewayWithStatusGetPlanIdRetType = string
// GatewayWithStatus struct for GatewayWithStatus
type GatewayWithStatus struct {
Region GatewayWithStatusGetRegionAttributeType `json:"region,omitempty"`
// REQUIRED
AvailabilityZones GatewayWithStatusGetAvailabilityZonesAttributeType `json:"availabilityZones" required:"true"`
// Enable BGP routing. (This will require a BGPGatewayConfig and also a BGPTunnelConfig for each Tunnel in each Connection)
BgpEnabled GatewayWithStatusgetBgpEnabledAttributeType `json:"bgpEnabled,omitempty"`
BgpGatewayConfig GatewayWithStatusGetBgpGatewayConfigAttributeType `json:"bgpGatewayConfig,omitempty"`
// Map of custom labels. Key and values must be max 63 chars, start/end with alphanumeric.
Labels GatewayWithStatusGetLabelsAttributeType `json:"labels,omitempty"`
// The name of the VPN gateway. Maximum 20 characters (only alphanumeric and hyphens allowed). Not changeable after creation.
// REQUIRED
Name GatewayWithStatusGetNameAttributeType `json:"name" required:"true"`
// Service Plan to configure the limits of the VPN. Currently supported plans are p50, p100, p200. This list can change in the future where plan ids will be removed and new plans by added. That is the reason this is not an enum.
// REQUIRED
PlanId GatewayWithStatusGetPlanIdAttributeType `json:"planId" required:"true"`
}
type _GatewayWithStatus GatewayWithStatus
// NewGatewayWithStatus instantiates a new GatewayWithStatus 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 NewGatewayWithStatus(availabilityZones GatewayWithStatusGetAvailabilityZonesArgType, name GatewayWithStatusGetNameArgType, planId GatewayWithStatusGetPlanIdArgType) *GatewayWithStatus {
this := GatewayWithStatus{}
setGatewayWithStatusGetAvailabilityZonesAttributeType(&this.AvailabilityZones, availabilityZones)
setGatewayWithStatusGetNameAttributeType(&this.Name, name)
setGatewayWithStatusGetPlanIdAttributeType(&this.PlanId, planId)
return &this
}
// NewGatewayWithStatusWithDefaults instantiates a new GatewayWithStatus 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 NewGatewayWithStatusWithDefaults() *GatewayWithStatus {
this := GatewayWithStatus{}
var region Region = REGION_EU01
this.Region = &region
return &this
}
// GetRegion returns the Region field value if set, zero value otherwise.
func (o *GatewayWithStatus) GetRegion() (res GatewayWithStatusGetRegionRetType) {
res, _ = o.GetRegionOk()
return
}
// GetRegionOk returns a tuple with the Region field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GatewayWithStatus) GetRegionOk() (ret GatewayWithStatusGetRegionRetType, ok bool) {
return getGatewayWithStatusGetRegionAttributeTypeOk(o.Region)
}
// HasRegion returns a boolean if a field has been set.
func (o *GatewayWithStatus) HasRegion() bool {
_, ok := o.GetRegionOk()
return ok
}
// SetRegion gets a reference to the given Region and assigns it to the Region field.
func (o *GatewayWithStatus) SetRegion(v GatewayWithStatusGetRegionRetType) {
setGatewayWithStatusGetRegionAttributeType(&o.Region, v)
}
// GetAvailabilityZones returns the AvailabilityZones field value
func (o *GatewayWithStatus) GetAvailabilityZones() (ret GatewayWithStatusGetAvailabilityZonesRetType) {
ret, _ = o.GetAvailabilityZonesOk()
return ret
}
// GetAvailabilityZonesOk returns a tuple with the AvailabilityZones field value
// and a boolean to check if the value has been set.
func (o *GatewayWithStatus) GetAvailabilityZonesOk() (ret GatewayWithStatusGetAvailabilityZonesRetType, ok bool) {
return getGatewayWithStatusGetAvailabilityZonesAttributeTypeOk(o.AvailabilityZones)
}
// SetAvailabilityZones sets field value
func (o *GatewayWithStatus) SetAvailabilityZones(v GatewayWithStatusGetAvailabilityZonesRetType) {
setGatewayWithStatusGetAvailabilityZonesAttributeType(&o.AvailabilityZones, v)
}
// GetBgpEnabled returns the BgpEnabled field value if set, zero value otherwise.
func (o *GatewayWithStatus) GetBgpEnabled() (res GatewayWithStatusgetBgpEnabledRetType) {
res, _ = o.GetBgpEnabledOk()
return
}
// GetBgpEnabledOk returns a tuple with the BgpEnabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GatewayWithStatus) GetBgpEnabledOk() (ret GatewayWithStatusgetBgpEnabledRetType, ok bool) {
return getGatewayWithStatusgetBgpEnabledAttributeTypeOk(o.BgpEnabled)
}
// HasBgpEnabled returns a boolean if a field has been set.
func (o *GatewayWithStatus) HasBgpEnabled() bool {
_, ok := o.GetBgpEnabledOk()
return ok
}
// SetBgpEnabled gets a reference to the given bool and assigns it to the BgpEnabled field.
func (o *GatewayWithStatus) SetBgpEnabled(v GatewayWithStatusgetBgpEnabledRetType) {
setGatewayWithStatusgetBgpEnabledAttributeType(&o.BgpEnabled, v)
}
// GetBgpGatewayConfig returns the BgpGatewayConfig field value if set, zero value otherwise.
func (o *GatewayWithStatus) GetBgpGatewayConfig() (res GatewayWithStatusGetBgpGatewayConfigRetType) {
res, _ = o.GetBgpGatewayConfigOk()
return
}
// GetBgpGatewayConfigOk returns a tuple with the BgpGatewayConfig field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GatewayWithStatus) GetBgpGatewayConfigOk() (ret GatewayWithStatusGetBgpGatewayConfigRetType, ok bool) {
return getGatewayWithStatusGetBgpGatewayConfigAttributeTypeOk(o.BgpGatewayConfig)
}
// HasBgpGatewayConfig returns a boolean if a field has been set.
func (o *GatewayWithStatus) HasBgpGatewayConfig() bool {
_, ok := o.GetBgpGatewayConfigOk()
return ok
}
// SetBgpGatewayConfig gets a reference to the given BGPGatewayConfig and assigns it to the BgpGatewayConfig field.
func (o *GatewayWithStatus) SetBgpGatewayConfig(v GatewayWithStatusGetBgpGatewayConfigRetType) {
setGatewayWithStatusGetBgpGatewayConfigAttributeType(&o.BgpGatewayConfig, v)
}
// GetLabels returns the Labels field value if set, zero value otherwise.
func (o *GatewayWithStatus) GetLabels() (res GatewayWithStatusGetLabelsRetType) {
res, _ = o.GetLabelsOk()
return
}
// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GatewayWithStatus) GetLabelsOk() (ret GatewayWithStatusGetLabelsRetType, ok bool) {
return getGatewayWithStatusGetLabelsAttributeTypeOk(o.Labels)
}
// HasLabels returns a boolean if a field has been set.
func (o *GatewayWithStatus) HasLabels() bool {
_, ok := o.GetLabelsOk()
return ok
}
// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field.
func (o *GatewayWithStatus) SetLabels(v GatewayWithStatusGetLabelsRetType) {
setGatewayWithStatusGetLabelsAttributeType(&o.Labels, v)
}
// GetName returns the Name field value
func (o *GatewayWithStatus) GetName() (ret GatewayWithStatusGetNameRetType) {
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 *GatewayWithStatus) GetNameOk() (ret GatewayWithStatusGetNameRetType, ok bool) {
return getGatewayWithStatusGetNameAttributeTypeOk(o.Name)
}
// SetName sets field value
func (o *GatewayWithStatus) SetName(v GatewayWithStatusGetNameRetType) {
setGatewayWithStatusGetNameAttributeType(&o.Name, v)
}
// GetPlanId returns the PlanId field value
func (o *GatewayWithStatus) GetPlanId() (ret GatewayWithStatusGetPlanIdRetType) {
ret, _ = o.GetPlanIdOk()
return ret
}
// GetPlanIdOk returns a tuple with the PlanId field value
// and a boolean to check if the value has been set.
func (o *GatewayWithStatus) GetPlanIdOk() (ret GatewayWithStatusGetPlanIdRetType, ok bool) {
return getGatewayWithStatusGetPlanIdAttributeTypeOk(o.PlanId)
}
// SetPlanId sets field value
func (o *GatewayWithStatus) SetPlanId(v GatewayWithStatusGetPlanIdRetType) {
setGatewayWithStatusGetPlanIdAttributeType(&o.PlanId, v)
}
func (o GatewayWithStatus) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getGatewayWithStatusGetRegionAttributeTypeOk(o.Region); ok {
toSerialize["Region"] = val
}
if val, ok := getGatewayWithStatusGetAvailabilityZonesAttributeTypeOk(o.AvailabilityZones); ok {
toSerialize["AvailabilityZones"] = val
}
if val, ok := getGatewayWithStatusgetBgpEnabledAttributeTypeOk(o.BgpEnabled); ok {
toSerialize["BgpEnabled"] = val
}
if val, ok := getGatewayWithStatusGetBgpGatewayConfigAttributeTypeOk(o.BgpGatewayConfig); ok {
toSerialize["BgpGatewayConfig"] = val
}
if val, ok := getGatewayWithStatusGetLabelsAttributeTypeOk(o.Labels); ok {
toSerialize["Labels"] = val
}
if val, ok := getGatewayWithStatusGetNameAttributeTypeOk(o.Name); ok {
toSerialize["Name"] = val
}
if val, ok := getGatewayWithStatusGetPlanIdAttributeTypeOk(o.PlanId); ok {
toSerialize["PlanId"] = val
}
return toSerialize, nil
}
type NullableGatewayWithStatus struct {
value *GatewayWithStatus
isSet bool
}
func (v NullableGatewayWithStatus) Get() *GatewayWithStatus {
return v.value
}
func (v *NullableGatewayWithStatus) Set(val *GatewayWithStatus) {
v.value = val
v.isSet = true
}
func (v NullableGatewayWithStatus) IsSet() bool {
return v.isSet
}
func (v *NullableGatewayWithStatus) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGatewayWithStatus(val *GatewayWithStatus) *NullableGatewayWithStatus {
return &NullableGatewayWithStatus{value: val, isSet: true}
}
func (v NullableGatewayWithStatus) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGatewayWithStatus) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,400 @@
/*
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 GatewaysResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GatewaysResponse{}
/*
types and functions for state
*/
// isEnumRef
type GatewaysResponseGetStateAttributeType = *GatewayStatus
type GatewaysResponseGetStateArgType = GatewayStatus
type GatewaysResponseGetStateRetType = GatewayStatus
func getGatewaysResponseGetStateAttributeTypeOk(arg GatewaysResponseGetStateAttributeType) (ret GatewaysResponseGetStateRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewaysResponseGetStateAttributeType(arg *GatewaysResponseGetStateAttributeType, val GatewaysResponseGetStateRetType) {
*arg = &val
}
/*
types and functions for availabilityZones
*/
// isModel
type GatewaysResponseGetAvailabilityZonesAttributeType = *CreateVPNGatewayPayloadAvailabilityZones
type GatewaysResponseGetAvailabilityZonesArgType = CreateVPNGatewayPayloadAvailabilityZones
type GatewaysResponseGetAvailabilityZonesRetType = CreateVPNGatewayPayloadAvailabilityZones
func getGatewaysResponseGetAvailabilityZonesAttributeTypeOk(arg GatewaysResponseGetAvailabilityZonesAttributeType) (ret GatewaysResponseGetAvailabilityZonesRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewaysResponseGetAvailabilityZonesAttributeType(arg *GatewaysResponseGetAvailabilityZonesAttributeType, val GatewaysResponseGetAvailabilityZonesRetType) {
*arg = &val
}
/*
types and functions for bgpEnabled
*/
// isBoolean
type GatewaysResponsegetBgpEnabledAttributeType = *bool
type GatewaysResponsegetBgpEnabledArgType = bool
type GatewaysResponsegetBgpEnabledRetType = bool
func getGatewaysResponsegetBgpEnabledAttributeTypeOk(arg GatewaysResponsegetBgpEnabledAttributeType) (ret GatewaysResponsegetBgpEnabledRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewaysResponsegetBgpEnabledAttributeType(arg *GatewaysResponsegetBgpEnabledAttributeType, val GatewaysResponsegetBgpEnabledRetType) {
*arg = &val
}
/*
types and functions for bgpGatewayConfig
*/
// isModel
type GatewaysResponseGetBgpGatewayConfigAttributeType = *BGPGatewayConfig
type GatewaysResponseGetBgpGatewayConfigArgType = BGPGatewayConfig
type GatewaysResponseGetBgpGatewayConfigRetType = BGPGatewayConfig
func getGatewaysResponseGetBgpGatewayConfigAttributeTypeOk(arg GatewaysResponseGetBgpGatewayConfigAttributeType) (ret GatewaysResponseGetBgpGatewayConfigRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewaysResponseGetBgpGatewayConfigAttributeType(arg *GatewaysResponseGetBgpGatewayConfigAttributeType, val GatewaysResponseGetBgpGatewayConfigRetType) {
*arg = &val
}
/*
types and functions for labels
*/
// isContainer
type GatewaysResponseGetLabelsAttributeType = *map[string]string
type GatewaysResponseGetLabelsArgType = map[string]string
type GatewaysResponseGetLabelsRetType = map[string]string
func getGatewaysResponseGetLabelsAttributeTypeOk(arg GatewaysResponseGetLabelsAttributeType) (ret GatewaysResponseGetLabelsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewaysResponseGetLabelsAttributeType(arg *GatewaysResponseGetLabelsAttributeType, val GatewaysResponseGetLabelsRetType) {
*arg = &val
}
/*
types and functions for name
*/
// isNotNullableString
type GatewaysResponseGetNameAttributeType = *string
func getGatewaysResponseGetNameAttributeTypeOk(arg GatewaysResponseGetNameAttributeType) (ret GatewaysResponseGetNameRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewaysResponseGetNameAttributeType(arg *GatewaysResponseGetNameAttributeType, val GatewaysResponseGetNameRetType) {
*arg = &val
}
type GatewaysResponseGetNameArgType = string
type GatewaysResponseGetNameRetType = string
/*
types and functions for planId
*/
// isNotNullableString
type GatewaysResponseGetPlanIdAttributeType = *string
func getGatewaysResponseGetPlanIdAttributeTypeOk(arg GatewaysResponseGetPlanIdAttributeType) (ret GatewaysResponseGetPlanIdRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setGatewaysResponseGetPlanIdAttributeType(arg *GatewaysResponseGetPlanIdAttributeType, val GatewaysResponseGetPlanIdRetType) {
*arg = &val
}
type GatewaysResponseGetPlanIdArgType = string
type GatewaysResponseGetPlanIdRetType = string
// GatewaysResponse struct for GatewaysResponse
type GatewaysResponse struct {
// REQUIRED
State GatewaysResponseGetStateAttributeType `json:"state" required:"true"`
// REQUIRED
AvailabilityZones GatewaysResponseGetAvailabilityZonesAttributeType `json:"availabilityZones" required:"true"`
// Enable BGP routing. (This will require a BGPGatewayConfig and also a BGPTunnelConfig for each Tunnel in each Connection)
BgpEnabled GatewaysResponsegetBgpEnabledAttributeType `json:"bgpEnabled,omitempty"`
BgpGatewayConfig GatewaysResponseGetBgpGatewayConfigAttributeType `json:"bgpGatewayConfig,omitempty"`
// Map of custom labels. Key and values must be max 63 chars, start/end with alphanumeric.
Labels GatewaysResponseGetLabelsAttributeType `json:"labels,omitempty"`
// The name of the VPN gateway. Maximum 20 characters (only alphanumeric and hyphens allowed). Not changeable after creation.
// REQUIRED
Name GatewaysResponseGetNameAttributeType `json:"name" required:"true"`
// Service Plan to configure the limits of the VPN. Currently supported plans are p50, p100, p200. This list can change in the future where plan ids will be removed and new plans by added. That is the reason this is not an enum.
// REQUIRED
PlanId GatewaysResponseGetPlanIdAttributeType `json:"planId" required:"true"`
}
type _GatewaysResponse GatewaysResponse
// NewGatewaysResponse instantiates a new GatewaysResponse 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 NewGatewaysResponse(state GatewaysResponseGetStateArgType, availabilityZones GatewaysResponseGetAvailabilityZonesArgType, name GatewaysResponseGetNameArgType, planId GatewaysResponseGetPlanIdArgType) *GatewaysResponse {
this := GatewaysResponse{}
setGatewaysResponseGetAvailabilityZonesAttributeType(&this.AvailabilityZones, availabilityZones)
setGatewaysResponseGetNameAttributeType(&this.Name, name)
setGatewaysResponseGetPlanIdAttributeType(&this.PlanId, planId)
return &this
}
// NewGatewaysResponseWithDefaults instantiates a new GatewaysResponse 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 NewGatewaysResponseWithDefaults() *GatewaysResponse {
this := GatewaysResponse{}
return &this
}
// GetState returns the State field value
func (o *GatewaysResponse) GetState() (ret GatewaysResponseGetStateRetType) {
ret, _ = o.GetStateOk()
return ret
}
// GetStateOk returns a tuple with the State field value
// and a boolean to check if the value has been set.
func (o *GatewaysResponse) GetStateOk() (ret GatewaysResponseGetStateRetType, ok bool) {
return getGatewaysResponseGetStateAttributeTypeOk(o.State)
}
// SetState sets field value
func (o *GatewaysResponse) SetState(v GatewaysResponseGetStateRetType) {
setGatewaysResponseGetStateAttributeType(&o.State, v)
}
// GetAvailabilityZones returns the AvailabilityZones field value
func (o *GatewaysResponse) GetAvailabilityZones() (ret GatewaysResponseGetAvailabilityZonesRetType) {
ret, _ = o.GetAvailabilityZonesOk()
return ret
}
// GetAvailabilityZonesOk returns a tuple with the AvailabilityZones field value
// and a boolean to check if the value has been set.
func (o *GatewaysResponse) GetAvailabilityZonesOk() (ret GatewaysResponseGetAvailabilityZonesRetType, ok bool) {
return getGatewaysResponseGetAvailabilityZonesAttributeTypeOk(o.AvailabilityZones)
}
// SetAvailabilityZones sets field value
func (o *GatewaysResponse) SetAvailabilityZones(v GatewaysResponseGetAvailabilityZonesRetType) {
setGatewaysResponseGetAvailabilityZonesAttributeType(&o.AvailabilityZones, v)
}
// GetBgpEnabled returns the BgpEnabled field value if set, zero value otherwise.
func (o *GatewaysResponse) GetBgpEnabled() (res GatewaysResponsegetBgpEnabledRetType) {
res, _ = o.GetBgpEnabledOk()
return
}
// GetBgpEnabledOk returns a tuple with the BgpEnabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GatewaysResponse) GetBgpEnabledOk() (ret GatewaysResponsegetBgpEnabledRetType, ok bool) {
return getGatewaysResponsegetBgpEnabledAttributeTypeOk(o.BgpEnabled)
}
// HasBgpEnabled returns a boolean if a field has been set.
func (o *GatewaysResponse) HasBgpEnabled() bool {
_, ok := o.GetBgpEnabledOk()
return ok
}
// SetBgpEnabled gets a reference to the given bool and assigns it to the BgpEnabled field.
func (o *GatewaysResponse) SetBgpEnabled(v GatewaysResponsegetBgpEnabledRetType) {
setGatewaysResponsegetBgpEnabledAttributeType(&o.BgpEnabled, v)
}
// GetBgpGatewayConfig returns the BgpGatewayConfig field value if set, zero value otherwise.
func (o *GatewaysResponse) GetBgpGatewayConfig() (res GatewaysResponseGetBgpGatewayConfigRetType) {
res, _ = o.GetBgpGatewayConfigOk()
return
}
// GetBgpGatewayConfigOk returns a tuple with the BgpGatewayConfig field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GatewaysResponse) GetBgpGatewayConfigOk() (ret GatewaysResponseGetBgpGatewayConfigRetType, ok bool) {
return getGatewaysResponseGetBgpGatewayConfigAttributeTypeOk(o.BgpGatewayConfig)
}
// HasBgpGatewayConfig returns a boolean if a field has been set.
func (o *GatewaysResponse) HasBgpGatewayConfig() bool {
_, ok := o.GetBgpGatewayConfigOk()
return ok
}
// SetBgpGatewayConfig gets a reference to the given BGPGatewayConfig and assigns it to the BgpGatewayConfig field.
func (o *GatewaysResponse) SetBgpGatewayConfig(v GatewaysResponseGetBgpGatewayConfigRetType) {
setGatewaysResponseGetBgpGatewayConfigAttributeType(&o.BgpGatewayConfig, v)
}
// GetLabels returns the Labels field value if set, zero value otherwise.
func (o *GatewaysResponse) GetLabels() (res GatewaysResponseGetLabelsRetType) {
res, _ = o.GetLabelsOk()
return
}
// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GatewaysResponse) GetLabelsOk() (ret GatewaysResponseGetLabelsRetType, ok bool) {
return getGatewaysResponseGetLabelsAttributeTypeOk(o.Labels)
}
// HasLabels returns a boolean if a field has been set.
func (o *GatewaysResponse) HasLabels() bool {
_, ok := o.GetLabelsOk()
return ok
}
// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field.
func (o *GatewaysResponse) SetLabels(v GatewaysResponseGetLabelsRetType) {
setGatewaysResponseGetLabelsAttributeType(&o.Labels, v)
}
// GetName returns the Name field value
func (o *GatewaysResponse) GetName() (ret GatewaysResponseGetNameRetType) {
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 *GatewaysResponse) GetNameOk() (ret GatewaysResponseGetNameRetType, ok bool) {
return getGatewaysResponseGetNameAttributeTypeOk(o.Name)
}
// SetName sets field value
func (o *GatewaysResponse) SetName(v GatewaysResponseGetNameRetType) {
setGatewaysResponseGetNameAttributeType(&o.Name, v)
}
// GetPlanId returns the PlanId field value
func (o *GatewaysResponse) GetPlanId() (ret GatewaysResponseGetPlanIdRetType) {
ret, _ = o.GetPlanIdOk()
return ret
}
// GetPlanIdOk returns a tuple with the PlanId field value
// and a boolean to check if the value has been set.
func (o *GatewaysResponse) GetPlanIdOk() (ret GatewaysResponseGetPlanIdRetType, ok bool) {
return getGatewaysResponseGetPlanIdAttributeTypeOk(o.PlanId)
}
// SetPlanId sets field value
func (o *GatewaysResponse) SetPlanId(v GatewaysResponseGetPlanIdRetType) {
setGatewaysResponseGetPlanIdAttributeType(&o.PlanId, v)
}
func (o GatewaysResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getGatewaysResponseGetStateAttributeTypeOk(o.State); ok {
toSerialize["State"] = val
}
if val, ok := getGatewaysResponseGetAvailabilityZonesAttributeTypeOk(o.AvailabilityZones); ok {
toSerialize["AvailabilityZones"] = val
}
if val, ok := getGatewaysResponsegetBgpEnabledAttributeTypeOk(o.BgpEnabled); ok {
toSerialize["BgpEnabled"] = val
}
if val, ok := getGatewaysResponseGetBgpGatewayConfigAttributeTypeOk(o.BgpGatewayConfig); ok {
toSerialize["BgpGatewayConfig"] = val
}
if val, ok := getGatewaysResponseGetLabelsAttributeTypeOk(o.Labels); ok {
toSerialize["Labels"] = val
}
if val, ok := getGatewaysResponseGetNameAttributeTypeOk(o.Name); ok {
toSerialize["Name"] = val
}
if val, ok := getGatewaysResponseGetPlanIdAttributeTypeOk(o.PlanId); ok {
toSerialize["PlanId"] = val
}
return toSerialize, nil
}
type NullableGatewaysResponse struct {
value *GatewaysResponse
isSet bool
}
func (v NullableGatewaysResponse) Get() *GatewaysResponse {
return v.value
}
func (v *NullableGatewaysResponse) Set(val *GatewaysResponse) {
v.value = val
v.isSet = true
}
func (v NullableGatewaysResponse) IsSet() bool {
return v.isSet
}
func (v *NullableGatewaysResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGatewaysResponse(val *GatewaysResponse) *NullableGatewaysResponse {
return &NullableGatewaysResponse{value: val, isSet: true}
}
func (v NullableGatewaysResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGatewaysResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,11 @@
/*
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

216
pkg/vpnalpha/model_phase.go Normal file
View file

@ -0,0 +1,216 @@
/*
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 Phase type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Phase{}
/*
types and functions for dhGroups
*/
// isArray
type PhaseGetDhGroupsAttributeType = *[]string
type PhaseGetDhGroupsArgType = []string
type PhaseGetDhGroupsRetType = []string
func getPhaseGetDhGroupsAttributeTypeOk(arg PhaseGetDhGroupsAttributeType) (ret PhaseGetDhGroupsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setPhaseGetDhGroupsAttributeType(arg *PhaseGetDhGroupsAttributeType, val PhaseGetDhGroupsRetType) {
*arg = &val
}
/*
types and functions for encryptionAlgorithms
*/
// isArray
type PhaseGetEncryptionAlgorithmsAttributeType = *[]string
type PhaseGetEncryptionAlgorithmsArgType = []string
type PhaseGetEncryptionAlgorithmsRetType = []string
func getPhaseGetEncryptionAlgorithmsAttributeTypeOk(arg PhaseGetEncryptionAlgorithmsAttributeType) (ret PhaseGetEncryptionAlgorithmsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setPhaseGetEncryptionAlgorithmsAttributeType(arg *PhaseGetEncryptionAlgorithmsAttributeType, val PhaseGetEncryptionAlgorithmsRetType) {
*arg = &val
}
/*
types and functions for integrityAlgorithms
*/
// isArray
type PhaseGetIntegrityAlgorithmsAttributeType = *[]string
type PhaseGetIntegrityAlgorithmsArgType = []string
type PhaseGetIntegrityAlgorithmsRetType = []string
func getPhaseGetIntegrityAlgorithmsAttributeTypeOk(arg PhaseGetIntegrityAlgorithmsAttributeType) (ret PhaseGetIntegrityAlgorithmsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setPhaseGetIntegrityAlgorithmsAttributeType(arg *PhaseGetIntegrityAlgorithmsAttributeType, val PhaseGetIntegrityAlgorithmsRetType) {
*arg = &val
}
// Phase struct for Phase
type Phase struct {
// The Diffie-Hellman Group. Required, except if AEAD algorithms are selected.
DhGroups PhaseGetDhGroupsAttributeType `json:"dhGroups,omitempty"`
// REQUIRED
EncryptionAlgorithms PhaseGetEncryptionAlgorithmsAttributeType `json:"encryptionAlgorithms" required:"true"`
// REQUIRED
IntegrityAlgorithms PhaseGetIntegrityAlgorithmsAttributeType `json:"integrityAlgorithms" required:"true"`
}
type _Phase Phase
// NewPhase instantiates a new Phase 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 NewPhase(encryptionAlgorithms PhaseGetEncryptionAlgorithmsArgType, integrityAlgorithms PhaseGetIntegrityAlgorithmsArgType) *Phase {
this := Phase{}
setPhaseGetEncryptionAlgorithmsAttributeType(&this.EncryptionAlgorithms, encryptionAlgorithms)
setPhaseGetIntegrityAlgorithmsAttributeType(&this.IntegrityAlgorithms, integrityAlgorithms)
return &this
}
// NewPhaseWithDefaults instantiates a new Phase 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 NewPhaseWithDefaults() *Phase {
this := Phase{}
return &this
}
// GetDhGroups returns the DhGroups field value if set, zero value otherwise.
func (o *Phase) GetDhGroups() (res PhaseGetDhGroupsRetType) {
res, _ = o.GetDhGroupsOk()
return
}
// GetDhGroupsOk returns a tuple with the DhGroups field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Phase) GetDhGroupsOk() (ret PhaseGetDhGroupsRetType, ok bool) {
return getPhaseGetDhGroupsAttributeTypeOk(o.DhGroups)
}
// HasDhGroups returns a boolean if a field has been set.
func (o *Phase) HasDhGroups() bool {
_, ok := o.GetDhGroupsOk()
return ok
}
// SetDhGroups gets a reference to the given []string and assigns it to the DhGroups field.
func (o *Phase) SetDhGroups(v PhaseGetDhGroupsRetType) {
setPhaseGetDhGroupsAttributeType(&o.DhGroups, v)
}
// GetEncryptionAlgorithms returns the EncryptionAlgorithms field value
func (o *Phase) GetEncryptionAlgorithms() (ret PhaseGetEncryptionAlgorithmsRetType) {
ret, _ = o.GetEncryptionAlgorithmsOk()
return ret
}
// GetEncryptionAlgorithmsOk returns a tuple with the EncryptionAlgorithms field value
// and a boolean to check if the value has been set.
func (o *Phase) GetEncryptionAlgorithmsOk() (ret PhaseGetEncryptionAlgorithmsRetType, ok bool) {
return getPhaseGetEncryptionAlgorithmsAttributeTypeOk(o.EncryptionAlgorithms)
}
// SetEncryptionAlgorithms sets field value
func (o *Phase) SetEncryptionAlgorithms(v PhaseGetEncryptionAlgorithmsRetType) {
setPhaseGetEncryptionAlgorithmsAttributeType(&o.EncryptionAlgorithms, v)
}
// GetIntegrityAlgorithms returns the IntegrityAlgorithms field value
func (o *Phase) GetIntegrityAlgorithms() (ret PhaseGetIntegrityAlgorithmsRetType) {
ret, _ = o.GetIntegrityAlgorithmsOk()
return ret
}
// GetIntegrityAlgorithmsOk returns a tuple with the IntegrityAlgorithms field value
// and a boolean to check if the value has been set.
func (o *Phase) GetIntegrityAlgorithmsOk() (ret PhaseGetIntegrityAlgorithmsRetType, ok bool) {
return getPhaseGetIntegrityAlgorithmsAttributeTypeOk(o.IntegrityAlgorithms)
}
// SetIntegrityAlgorithms sets field value
func (o *Phase) SetIntegrityAlgorithms(v PhaseGetIntegrityAlgorithmsRetType) {
setPhaseGetIntegrityAlgorithmsAttributeType(&o.IntegrityAlgorithms, v)
}
func (o Phase) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getPhaseGetDhGroupsAttributeTypeOk(o.DhGroups); ok {
toSerialize["DhGroups"] = val
}
if val, ok := getPhaseGetEncryptionAlgorithmsAttributeTypeOk(o.EncryptionAlgorithms); ok {
toSerialize["EncryptionAlgorithms"] = val
}
if val, ok := getPhaseGetIntegrityAlgorithmsAttributeTypeOk(o.IntegrityAlgorithms); ok {
toSerialize["IntegrityAlgorithms"] = val
}
return toSerialize, nil
}
type NullablePhase struct {
value *Phase
isSet bool
}
func (v NullablePhase) Get() *Phase {
return v.value
}
func (v *NullablePhase) Set(val *Phase) {
v.value = val
v.isSet = true
}
func (v NullablePhase) IsSet() bool {
return v.isSet
}
func (v *NullablePhase) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePhase(val *Phase) *NullablePhase {
return &NullablePhase{value: val, isSet: true}
}
func (v NullablePhase) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePhase) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,275 @@
/*
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 Phase1Status type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Phase1Status{}
/*
types and functions for dhGroup
*/
// isNotNullableString
type Phase1StatusGetDhGroupAttributeType = *string
func getPhase1StatusGetDhGroupAttributeTypeOk(arg Phase1StatusGetDhGroupAttributeType) (ret Phase1StatusGetDhGroupRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setPhase1StatusGetDhGroupAttributeType(arg *Phase1StatusGetDhGroupAttributeType, val Phase1StatusGetDhGroupRetType) {
*arg = &val
}
type Phase1StatusGetDhGroupArgType = string
type Phase1StatusGetDhGroupRetType = string
/*
types and functions for encryptionAlgorithm
*/
// isNotNullableString
type Phase1StatusGetEncryptionAlgorithmAttributeType = *string
func getPhase1StatusGetEncryptionAlgorithmAttributeTypeOk(arg Phase1StatusGetEncryptionAlgorithmAttributeType) (ret Phase1StatusGetEncryptionAlgorithmRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setPhase1StatusGetEncryptionAlgorithmAttributeType(arg *Phase1StatusGetEncryptionAlgorithmAttributeType, val Phase1StatusGetEncryptionAlgorithmRetType) {
*arg = &val
}
type Phase1StatusGetEncryptionAlgorithmArgType = string
type Phase1StatusGetEncryptionAlgorithmRetType = string
/*
types and functions for integrityAlgorithm
*/
// isNotNullableString
type Phase1StatusGetIntegrityAlgorithmAttributeType = *string
func getPhase1StatusGetIntegrityAlgorithmAttributeTypeOk(arg Phase1StatusGetIntegrityAlgorithmAttributeType) (ret Phase1StatusGetIntegrityAlgorithmRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setPhase1StatusGetIntegrityAlgorithmAttributeType(arg *Phase1StatusGetIntegrityAlgorithmAttributeType, val Phase1StatusGetIntegrityAlgorithmRetType) {
*arg = &val
}
type Phase1StatusGetIntegrityAlgorithmArgType = string
type Phase1StatusGetIntegrityAlgorithmRetType = string
/*
types and functions for state
*/
// isNotNullableString
type Phase1StatusGetStateAttributeType = *string
func getPhase1StatusGetStateAttributeTypeOk(arg Phase1StatusGetStateAttributeType) (ret Phase1StatusGetStateRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setPhase1StatusGetStateAttributeType(arg *Phase1StatusGetStateAttributeType, val Phase1StatusGetStateRetType) {
*arg = &val
}
type Phase1StatusGetStateArgType = string
type Phase1StatusGetStateRetType = string
// Phase1Status struct for Phase1Status
type Phase1Status struct {
// Negotiated Diffie-Hellman Group
DhGroup Phase1StatusGetDhGroupAttributeType `json:"dhGroup,omitempty"`
// Negotiated encryption algorithm.
EncryptionAlgorithm Phase1StatusGetEncryptionAlgorithmAttributeType `json:"encryptionAlgorithm,omitempty"`
// Negotiated integrity algorithm or pseudo-random-function.
IntegrityAlgorithm Phase1StatusGetIntegrityAlgorithmAttributeType `json:"integrityAlgorithm,omitempty"`
State Phase1StatusGetStateAttributeType `json:"state,omitempty"`
}
// NewPhase1Status instantiates a new Phase1Status 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 NewPhase1Status() *Phase1Status {
this := Phase1Status{}
return &this
}
// NewPhase1StatusWithDefaults instantiates a new Phase1Status 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 NewPhase1StatusWithDefaults() *Phase1Status {
this := Phase1Status{}
return &this
}
// GetDhGroup returns the DhGroup field value if set, zero value otherwise.
func (o *Phase1Status) GetDhGroup() (res Phase1StatusGetDhGroupRetType) {
res, _ = o.GetDhGroupOk()
return
}
// GetDhGroupOk returns a tuple with the DhGroup field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Phase1Status) GetDhGroupOk() (ret Phase1StatusGetDhGroupRetType, ok bool) {
return getPhase1StatusGetDhGroupAttributeTypeOk(o.DhGroup)
}
// HasDhGroup returns a boolean if a field has been set.
func (o *Phase1Status) HasDhGroup() bool {
_, ok := o.GetDhGroupOk()
return ok
}
// SetDhGroup gets a reference to the given string and assigns it to the DhGroup field.
func (o *Phase1Status) SetDhGroup(v Phase1StatusGetDhGroupRetType) {
setPhase1StatusGetDhGroupAttributeType(&o.DhGroup, v)
}
// GetEncryptionAlgorithm returns the EncryptionAlgorithm field value if set, zero value otherwise.
func (o *Phase1Status) GetEncryptionAlgorithm() (res Phase1StatusGetEncryptionAlgorithmRetType) {
res, _ = o.GetEncryptionAlgorithmOk()
return
}
// GetEncryptionAlgorithmOk returns a tuple with the EncryptionAlgorithm field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Phase1Status) GetEncryptionAlgorithmOk() (ret Phase1StatusGetEncryptionAlgorithmRetType, ok bool) {
return getPhase1StatusGetEncryptionAlgorithmAttributeTypeOk(o.EncryptionAlgorithm)
}
// HasEncryptionAlgorithm returns a boolean if a field has been set.
func (o *Phase1Status) HasEncryptionAlgorithm() bool {
_, ok := o.GetEncryptionAlgorithmOk()
return ok
}
// SetEncryptionAlgorithm gets a reference to the given string and assigns it to the EncryptionAlgorithm field.
func (o *Phase1Status) SetEncryptionAlgorithm(v Phase1StatusGetEncryptionAlgorithmRetType) {
setPhase1StatusGetEncryptionAlgorithmAttributeType(&o.EncryptionAlgorithm, v)
}
// GetIntegrityAlgorithm returns the IntegrityAlgorithm field value if set, zero value otherwise.
func (o *Phase1Status) GetIntegrityAlgorithm() (res Phase1StatusGetIntegrityAlgorithmRetType) {
res, _ = o.GetIntegrityAlgorithmOk()
return
}
// GetIntegrityAlgorithmOk returns a tuple with the IntegrityAlgorithm field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Phase1Status) GetIntegrityAlgorithmOk() (ret Phase1StatusGetIntegrityAlgorithmRetType, ok bool) {
return getPhase1StatusGetIntegrityAlgorithmAttributeTypeOk(o.IntegrityAlgorithm)
}
// HasIntegrityAlgorithm returns a boolean if a field has been set.
func (o *Phase1Status) HasIntegrityAlgorithm() bool {
_, ok := o.GetIntegrityAlgorithmOk()
return ok
}
// SetIntegrityAlgorithm gets a reference to the given string and assigns it to the IntegrityAlgorithm field.
func (o *Phase1Status) SetIntegrityAlgorithm(v Phase1StatusGetIntegrityAlgorithmRetType) {
setPhase1StatusGetIntegrityAlgorithmAttributeType(&o.IntegrityAlgorithm, v)
}
// GetState returns the State field value if set, zero value otherwise.
func (o *Phase1Status) GetState() (res Phase1StatusGetStateRetType) {
res, _ = o.GetStateOk()
return
}
// GetStateOk returns a tuple with the State field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Phase1Status) GetStateOk() (ret Phase1StatusGetStateRetType, ok bool) {
return getPhase1StatusGetStateAttributeTypeOk(o.State)
}
// HasState returns a boolean if a field has been set.
func (o *Phase1Status) HasState() bool {
_, ok := o.GetStateOk()
return ok
}
// SetState gets a reference to the given string and assigns it to the State field.
func (o *Phase1Status) SetState(v Phase1StatusGetStateRetType) {
setPhase1StatusGetStateAttributeType(&o.State, v)
}
func (o Phase1Status) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getPhase1StatusGetDhGroupAttributeTypeOk(o.DhGroup); ok {
toSerialize["DhGroup"] = val
}
if val, ok := getPhase1StatusGetEncryptionAlgorithmAttributeTypeOk(o.EncryptionAlgorithm); ok {
toSerialize["EncryptionAlgorithm"] = val
}
if val, ok := getPhase1StatusGetIntegrityAlgorithmAttributeTypeOk(o.IntegrityAlgorithm); ok {
toSerialize["IntegrityAlgorithm"] = val
}
if val, ok := getPhase1StatusGetStateAttributeTypeOk(o.State); ok {
toSerialize["State"] = val
}
return toSerialize, nil
}
type NullablePhase1Status struct {
value *Phase1Status
isSet bool
}
func (v NullablePhase1Status) Get() *Phase1Status {
return v.value
}
func (v *NullablePhase1Status) Set(val *Phase1Status) {
v.value = val
v.isSet = true
}
func (v NullablePhase1Status) IsSet() bool {
return v.isSet
}
func (v *NullablePhase1Status) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePhase1Status(val *Phase1Status) *NullablePhase1Status {
return &NullablePhase1Status{value: val, isSet: true}
}
func (v NullablePhase1Status) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePhase1Status) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,567 @@
/*
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 Phase2Status type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Phase2Status{}
/*
types and functions for bytesIn
*/
// isNotNullableString
type Phase2StatusGetBytesInAttributeType = *string
func getPhase2StatusGetBytesInAttributeTypeOk(arg Phase2StatusGetBytesInAttributeType) (ret Phase2StatusGetBytesInRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setPhase2StatusGetBytesInAttributeType(arg *Phase2StatusGetBytesInAttributeType, val Phase2StatusGetBytesInRetType) {
*arg = &val
}
type Phase2StatusGetBytesInArgType = string
type Phase2StatusGetBytesInRetType = string
/*
types and functions for bytesOut
*/
// isNotNullableString
type Phase2StatusGetBytesOutAttributeType = *string
func getPhase2StatusGetBytesOutAttributeTypeOk(arg Phase2StatusGetBytesOutAttributeType) (ret Phase2StatusGetBytesOutRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setPhase2StatusGetBytesOutAttributeType(arg *Phase2StatusGetBytesOutAttributeType, val Phase2StatusGetBytesOutRetType) {
*arg = &val
}
type Phase2StatusGetBytesOutArgType = string
type Phase2StatusGetBytesOutRetType = string
/*
types and functions for dhGroup
*/
// isNotNullableString
type Phase2StatusGetDhGroupAttributeType = *string
func getPhase2StatusGetDhGroupAttributeTypeOk(arg Phase2StatusGetDhGroupAttributeType) (ret Phase2StatusGetDhGroupRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setPhase2StatusGetDhGroupAttributeType(arg *Phase2StatusGetDhGroupAttributeType, val Phase2StatusGetDhGroupRetType) {
*arg = &val
}
type Phase2StatusGetDhGroupArgType = string
type Phase2StatusGetDhGroupRetType = string
/*
types and functions for encap
*/
// isNotNullableString
type Phase2StatusGetEncapAttributeType = *string
func getPhase2StatusGetEncapAttributeTypeOk(arg Phase2StatusGetEncapAttributeType) (ret Phase2StatusGetEncapRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setPhase2StatusGetEncapAttributeType(arg *Phase2StatusGetEncapAttributeType, val Phase2StatusGetEncapRetType) {
*arg = &val
}
type Phase2StatusGetEncapArgType = string
type Phase2StatusGetEncapRetType = string
/*
types and functions for encryptionAlgorithm
*/
// isNotNullableString
type Phase2StatusGetEncryptionAlgorithmAttributeType = *string
func getPhase2StatusGetEncryptionAlgorithmAttributeTypeOk(arg Phase2StatusGetEncryptionAlgorithmAttributeType) (ret Phase2StatusGetEncryptionAlgorithmRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setPhase2StatusGetEncryptionAlgorithmAttributeType(arg *Phase2StatusGetEncryptionAlgorithmAttributeType, val Phase2StatusGetEncryptionAlgorithmRetType) {
*arg = &val
}
type Phase2StatusGetEncryptionAlgorithmArgType = string
type Phase2StatusGetEncryptionAlgorithmRetType = string
/*
types and functions for integrityAlgorithm
*/
// isNotNullableString
type Phase2StatusGetIntegrityAlgorithmAttributeType = *string
func getPhase2StatusGetIntegrityAlgorithmAttributeTypeOk(arg Phase2StatusGetIntegrityAlgorithmAttributeType) (ret Phase2StatusGetIntegrityAlgorithmRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setPhase2StatusGetIntegrityAlgorithmAttributeType(arg *Phase2StatusGetIntegrityAlgorithmAttributeType, val Phase2StatusGetIntegrityAlgorithmRetType) {
*arg = &val
}
type Phase2StatusGetIntegrityAlgorithmArgType = string
type Phase2StatusGetIntegrityAlgorithmRetType = string
/*
types and functions for packetsIn
*/
// isNotNullableString
type Phase2StatusGetPacketsInAttributeType = *string
func getPhase2StatusGetPacketsInAttributeTypeOk(arg Phase2StatusGetPacketsInAttributeType) (ret Phase2StatusGetPacketsInRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setPhase2StatusGetPacketsInAttributeType(arg *Phase2StatusGetPacketsInAttributeType, val Phase2StatusGetPacketsInRetType) {
*arg = &val
}
type Phase2StatusGetPacketsInArgType = string
type Phase2StatusGetPacketsInRetType = string
/*
types and functions for packetsOut
*/
// isNotNullableString
type Phase2StatusGetPacketsOutAttributeType = *string
func getPhase2StatusGetPacketsOutAttributeTypeOk(arg Phase2StatusGetPacketsOutAttributeType) (ret Phase2StatusGetPacketsOutRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setPhase2StatusGetPacketsOutAttributeType(arg *Phase2StatusGetPacketsOutAttributeType, val Phase2StatusGetPacketsOutRetType) {
*arg = &val
}
type Phase2StatusGetPacketsOutArgType = string
type Phase2StatusGetPacketsOutRetType = string
/*
types and functions for protocol
*/
// isNotNullableString
type Phase2StatusGetProtocolAttributeType = *string
func getPhase2StatusGetProtocolAttributeTypeOk(arg Phase2StatusGetProtocolAttributeType) (ret Phase2StatusGetProtocolRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setPhase2StatusGetProtocolAttributeType(arg *Phase2StatusGetProtocolAttributeType, val Phase2StatusGetProtocolRetType) {
*arg = &val
}
type Phase2StatusGetProtocolArgType = string
type Phase2StatusGetProtocolRetType = string
/*
types and functions for state
*/
// isNotNullableString
type Phase2StatusGetStateAttributeType = *string
func getPhase2StatusGetStateAttributeTypeOk(arg Phase2StatusGetStateAttributeType) (ret Phase2StatusGetStateRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setPhase2StatusGetStateAttributeType(arg *Phase2StatusGetStateAttributeType, val Phase2StatusGetStateRetType) {
*arg = &val
}
type Phase2StatusGetStateArgType = string
type Phase2StatusGetStateRetType = string
// Phase2Status struct for Phase2Status
type Phase2Status struct {
// Bytes received.
BytesIn Phase2StatusGetBytesInAttributeType `json:"bytesIn,omitempty"`
// Bytes sent.
BytesOut Phase2StatusGetBytesOutAttributeType `json:"bytesOut,omitempty"`
// Negotiated Diffie-Hellman Group
DhGroup Phase2StatusGetDhGroupAttributeType `json:"dhGroup,omitempty"`
Encap Phase2StatusGetEncapAttributeType `json:"encap,omitempty"`
// Negotiated encryption algorithm.
EncryptionAlgorithm Phase2StatusGetEncryptionAlgorithmAttributeType `json:"encryptionAlgorithm,omitempty"`
// Negotiated integrity algorithm or pseudo-random-function.
IntegrityAlgorithm Phase2StatusGetIntegrityAlgorithmAttributeType `json:"integrityAlgorithm,omitempty"`
// Packets received.
PacketsIn Phase2StatusGetPacketsInAttributeType `json:"packetsIn,omitempty"`
// Packets sent.
PacketsOut Phase2StatusGetPacketsOutAttributeType `json:"packetsOut,omitempty"`
Protocol Phase2StatusGetProtocolAttributeType `json:"protocol,omitempty"`
State Phase2StatusGetStateAttributeType `json:"state,omitempty"`
}
// NewPhase2Status instantiates a new Phase2Status 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 NewPhase2Status() *Phase2Status {
this := Phase2Status{}
return &this
}
// NewPhase2StatusWithDefaults instantiates a new Phase2Status 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 NewPhase2StatusWithDefaults() *Phase2Status {
this := Phase2Status{}
return &this
}
// GetBytesIn returns the BytesIn field value if set, zero value otherwise.
func (o *Phase2Status) GetBytesIn() (res Phase2StatusGetBytesInRetType) {
res, _ = o.GetBytesInOk()
return
}
// GetBytesInOk returns a tuple with the BytesIn field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Phase2Status) GetBytesInOk() (ret Phase2StatusGetBytesInRetType, ok bool) {
return getPhase2StatusGetBytesInAttributeTypeOk(o.BytesIn)
}
// HasBytesIn returns a boolean if a field has been set.
func (o *Phase2Status) HasBytesIn() bool {
_, ok := o.GetBytesInOk()
return ok
}
// SetBytesIn gets a reference to the given string and assigns it to the BytesIn field.
func (o *Phase2Status) SetBytesIn(v Phase2StatusGetBytesInRetType) {
setPhase2StatusGetBytesInAttributeType(&o.BytesIn, v)
}
// GetBytesOut returns the BytesOut field value if set, zero value otherwise.
func (o *Phase2Status) GetBytesOut() (res Phase2StatusGetBytesOutRetType) {
res, _ = o.GetBytesOutOk()
return
}
// GetBytesOutOk returns a tuple with the BytesOut field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Phase2Status) GetBytesOutOk() (ret Phase2StatusGetBytesOutRetType, ok bool) {
return getPhase2StatusGetBytesOutAttributeTypeOk(o.BytesOut)
}
// HasBytesOut returns a boolean if a field has been set.
func (o *Phase2Status) HasBytesOut() bool {
_, ok := o.GetBytesOutOk()
return ok
}
// SetBytesOut gets a reference to the given string and assigns it to the BytesOut field.
func (o *Phase2Status) SetBytesOut(v Phase2StatusGetBytesOutRetType) {
setPhase2StatusGetBytesOutAttributeType(&o.BytesOut, v)
}
// GetDhGroup returns the DhGroup field value if set, zero value otherwise.
func (o *Phase2Status) GetDhGroup() (res Phase2StatusGetDhGroupRetType) {
res, _ = o.GetDhGroupOk()
return
}
// GetDhGroupOk returns a tuple with the DhGroup field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Phase2Status) GetDhGroupOk() (ret Phase2StatusGetDhGroupRetType, ok bool) {
return getPhase2StatusGetDhGroupAttributeTypeOk(o.DhGroup)
}
// HasDhGroup returns a boolean if a field has been set.
func (o *Phase2Status) HasDhGroup() bool {
_, ok := o.GetDhGroupOk()
return ok
}
// SetDhGroup gets a reference to the given string and assigns it to the DhGroup field.
func (o *Phase2Status) SetDhGroup(v Phase2StatusGetDhGroupRetType) {
setPhase2StatusGetDhGroupAttributeType(&o.DhGroup, v)
}
// GetEncap returns the Encap field value if set, zero value otherwise.
func (o *Phase2Status) GetEncap() (res Phase2StatusGetEncapRetType) {
res, _ = o.GetEncapOk()
return
}
// GetEncapOk returns a tuple with the Encap field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Phase2Status) GetEncapOk() (ret Phase2StatusGetEncapRetType, ok bool) {
return getPhase2StatusGetEncapAttributeTypeOk(o.Encap)
}
// HasEncap returns a boolean if a field has been set.
func (o *Phase2Status) HasEncap() bool {
_, ok := o.GetEncapOk()
return ok
}
// SetEncap gets a reference to the given string and assigns it to the Encap field.
func (o *Phase2Status) SetEncap(v Phase2StatusGetEncapRetType) {
setPhase2StatusGetEncapAttributeType(&o.Encap, v)
}
// GetEncryptionAlgorithm returns the EncryptionAlgorithm field value if set, zero value otherwise.
func (o *Phase2Status) GetEncryptionAlgorithm() (res Phase2StatusGetEncryptionAlgorithmRetType) {
res, _ = o.GetEncryptionAlgorithmOk()
return
}
// GetEncryptionAlgorithmOk returns a tuple with the EncryptionAlgorithm field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Phase2Status) GetEncryptionAlgorithmOk() (ret Phase2StatusGetEncryptionAlgorithmRetType, ok bool) {
return getPhase2StatusGetEncryptionAlgorithmAttributeTypeOk(o.EncryptionAlgorithm)
}
// HasEncryptionAlgorithm returns a boolean if a field has been set.
func (o *Phase2Status) HasEncryptionAlgorithm() bool {
_, ok := o.GetEncryptionAlgorithmOk()
return ok
}
// SetEncryptionAlgorithm gets a reference to the given string and assigns it to the EncryptionAlgorithm field.
func (o *Phase2Status) SetEncryptionAlgorithm(v Phase2StatusGetEncryptionAlgorithmRetType) {
setPhase2StatusGetEncryptionAlgorithmAttributeType(&o.EncryptionAlgorithm, v)
}
// GetIntegrityAlgorithm returns the IntegrityAlgorithm field value if set, zero value otherwise.
func (o *Phase2Status) GetIntegrityAlgorithm() (res Phase2StatusGetIntegrityAlgorithmRetType) {
res, _ = o.GetIntegrityAlgorithmOk()
return
}
// GetIntegrityAlgorithmOk returns a tuple with the IntegrityAlgorithm field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Phase2Status) GetIntegrityAlgorithmOk() (ret Phase2StatusGetIntegrityAlgorithmRetType, ok bool) {
return getPhase2StatusGetIntegrityAlgorithmAttributeTypeOk(o.IntegrityAlgorithm)
}
// HasIntegrityAlgorithm returns a boolean if a field has been set.
func (o *Phase2Status) HasIntegrityAlgorithm() bool {
_, ok := o.GetIntegrityAlgorithmOk()
return ok
}
// SetIntegrityAlgorithm gets a reference to the given string and assigns it to the IntegrityAlgorithm field.
func (o *Phase2Status) SetIntegrityAlgorithm(v Phase2StatusGetIntegrityAlgorithmRetType) {
setPhase2StatusGetIntegrityAlgorithmAttributeType(&o.IntegrityAlgorithm, v)
}
// GetPacketsIn returns the PacketsIn field value if set, zero value otherwise.
func (o *Phase2Status) GetPacketsIn() (res Phase2StatusGetPacketsInRetType) {
res, _ = o.GetPacketsInOk()
return
}
// GetPacketsInOk returns a tuple with the PacketsIn field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Phase2Status) GetPacketsInOk() (ret Phase2StatusGetPacketsInRetType, ok bool) {
return getPhase2StatusGetPacketsInAttributeTypeOk(o.PacketsIn)
}
// HasPacketsIn returns a boolean if a field has been set.
func (o *Phase2Status) HasPacketsIn() bool {
_, ok := o.GetPacketsInOk()
return ok
}
// SetPacketsIn gets a reference to the given string and assigns it to the PacketsIn field.
func (o *Phase2Status) SetPacketsIn(v Phase2StatusGetPacketsInRetType) {
setPhase2StatusGetPacketsInAttributeType(&o.PacketsIn, v)
}
// GetPacketsOut returns the PacketsOut field value if set, zero value otherwise.
func (o *Phase2Status) GetPacketsOut() (res Phase2StatusGetPacketsOutRetType) {
res, _ = o.GetPacketsOutOk()
return
}
// GetPacketsOutOk returns a tuple with the PacketsOut field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Phase2Status) GetPacketsOutOk() (ret Phase2StatusGetPacketsOutRetType, ok bool) {
return getPhase2StatusGetPacketsOutAttributeTypeOk(o.PacketsOut)
}
// HasPacketsOut returns a boolean if a field has been set.
func (o *Phase2Status) HasPacketsOut() bool {
_, ok := o.GetPacketsOutOk()
return ok
}
// SetPacketsOut gets a reference to the given string and assigns it to the PacketsOut field.
func (o *Phase2Status) SetPacketsOut(v Phase2StatusGetPacketsOutRetType) {
setPhase2StatusGetPacketsOutAttributeType(&o.PacketsOut, v)
}
// GetProtocol returns the Protocol field value if set, zero value otherwise.
func (o *Phase2Status) GetProtocol() (res Phase2StatusGetProtocolRetType) {
res, _ = o.GetProtocolOk()
return
}
// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Phase2Status) GetProtocolOk() (ret Phase2StatusGetProtocolRetType, ok bool) {
return getPhase2StatusGetProtocolAttributeTypeOk(o.Protocol)
}
// HasProtocol returns a boolean if a field has been set.
func (o *Phase2Status) HasProtocol() bool {
_, ok := o.GetProtocolOk()
return ok
}
// SetProtocol gets a reference to the given string and assigns it to the Protocol field.
func (o *Phase2Status) SetProtocol(v Phase2StatusGetProtocolRetType) {
setPhase2StatusGetProtocolAttributeType(&o.Protocol, v)
}
// GetState returns the State field value if set, zero value otherwise.
func (o *Phase2Status) GetState() (res Phase2StatusGetStateRetType) {
res, _ = o.GetStateOk()
return
}
// GetStateOk returns a tuple with the State field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Phase2Status) GetStateOk() (ret Phase2StatusGetStateRetType, ok bool) {
return getPhase2StatusGetStateAttributeTypeOk(o.State)
}
// HasState returns a boolean if a field has been set.
func (o *Phase2Status) HasState() bool {
_, ok := o.GetStateOk()
return ok
}
// SetState gets a reference to the given string and assigns it to the State field.
func (o *Phase2Status) SetState(v Phase2StatusGetStateRetType) {
setPhase2StatusGetStateAttributeType(&o.State, v)
}
func (o Phase2Status) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getPhase2StatusGetBytesInAttributeTypeOk(o.BytesIn); ok {
toSerialize["BytesIn"] = val
}
if val, ok := getPhase2StatusGetBytesOutAttributeTypeOk(o.BytesOut); ok {
toSerialize["BytesOut"] = val
}
if val, ok := getPhase2StatusGetDhGroupAttributeTypeOk(o.DhGroup); ok {
toSerialize["DhGroup"] = val
}
if val, ok := getPhase2StatusGetEncapAttributeTypeOk(o.Encap); ok {
toSerialize["Encap"] = val
}
if val, ok := getPhase2StatusGetEncryptionAlgorithmAttributeTypeOk(o.EncryptionAlgorithm); ok {
toSerialize["EncryptionAlgorithm"] = val
}
if val, ok := getPhase2StatusGetIntegrityAlgorithmAttributeTypeOk(o.IntegrityAlgorithm); ok {
toSerialize["IntegrityAlgorithm"] = val
}
if val, ok := getPhase2StatusGetPacketsInAttributeTypeOk(o.PacketsIn); ok {
toSerialize["PacketsIn"] = val
}
if val, ok := getPhase2StatusGetPacketsOutAttributeTypeOk(o.PacketsOut); ok {
toSerialize["PacketsOut"] = val
}
if val, ok := getPhase2StatusGetProtocolAttributeTypeOk(o.Protocol); ok {
toSerialize["Protocol"] = val
}
if val, ok := getPhase2StatusGetStateAttributeTypeOk(o.State); ok {
toSerialize["State"] = val
}
return toSerialize, nil
}
type NullablePhase2Status struct {
value *Phase2Status
isSet bool
}
func (v NullablePhase2Status) Get() *Phase2Status {
return v.value
}
func (v *NullablePhase2Status) Set(val *Phase2Status) {
v.value = val
v.isSet = true
}
func (v NullablePhase2Status) IsSet() bool {
return v.isSet
}
func (v *NullablePhase2Status) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePhase2Status(val *Phase2Status) *NullablePhase2Status {
return &NullablePhase2Status{value: val, isSet: true}
}
func (v NullablePhase2Status) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePhase2Status) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,11 @@
/*
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

527
pkg/vpnalpha/model_plan.go Normal file
View file

@ -0,0 +1,527 @@
/*
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"
"fmt"
)
// checks if the Plan type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Plan{}
/*
types and functions for maxBandwidth
*/
// isInteger
type PlanGetMaxBandwidthAttributeType = *int64
type PlanGetMaxBandwidthArgType = int64
type PlanGetMaxBandwidthRetType = int64
func getPlanGetMaxBandwidthAttributeTypeOk(arg PlanGetMaxBandwidthAttributeType) (ret PlanGetMaxBandwidthRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setPlanGetMaxBandwidthAttributeType(arg *PlanGetMaxBandwidthAttributeType, val PlanGetMaxBandwidthRetType) {
*arg = &val
}
/*
types and functions for maxConnections
*/
// isInteger
type PlanGetMaxConnectionsAttributeType = *int64
type PlanGetMaxConnectionsArgType = int64
type PlanGetMaxConnectionsRetType = int64
func getPlanGetMaxConnectionsAttributeTypeOk(arg PlanGetMaxConnectionsAttributeType) (ret PlanGetMaxConnectionsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setPlanGetMaxConnectionsAttributeType(arg *PlanGetMaxConnectionsAttributeType, val PlanGetMaxConnectionsRetType) {
*arg = &val
}
/*
types and functions for name
*/
// isNotNullableString
type PlanGetNameAttributeType = *string
func getPlanGetNameAttributeTypeOk(arg PlanGetNameAttributeType) (ret PlanGetNameRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setPlanGetNameAttributeType(arg *PlanGetNameAttributeType, val PlanGetNameRetType) {
*arg = &val
}
type PlanGetNameArgType = string
type PlanGetNameRetType = string
/*
types and functions for planId
*/
// isNotNullableString
type PlanGetPlanIdAttributeType = *string
func getPlanGetPlanIdAttributeTypeOk(arg PlanGetPlanIdAttributeType) (ret PlanGetPlanIdRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setPlanGetPlanIdAttributeType(arg *PlanGetPlanIdAttributeType, val PlanGetPlanIdRetType) {
*arg = &val
}
type PlanGetPlanIdArgType = string
type PlanGetPlanIdRetType = string
/*
types and functions for region
*/
// isNotNullableString
type PlanGetRegionAttributeType = *string
func getPlanGetRegionAttributeTypeOk(arg PlanGetRegionAttributeType) (ret PlanGetRegionRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setPlanGetRegionAttributeType(arg *PlanGetRegionAttributeType, val PlanGetRegionRetType) {
*arg = &val
}
type PlanGetRegionArgType = string
type PlanGetRegionRetType = string
/*
types and functions for sku
*/
// isNotNullableString
type PlanGetSkuAttributeType = *string
func getPlanGetSkuAttributeTypeOk(arg PlanGetSkuAttributeType) (ret PlanGetSkuRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setPlanGetSkuAttributeType(arg *PlanGetSkuAttributeType, val PlanGetSkuRetType) {
*arg = &val
}
type PlanGetSkuArgType = string
type PlanGetSkuRetType = string
/*
types and functions for type
*/
// isEnum
// PlanTypes Service plan type
// value type for enums
type PlanTypes string
// List of Type
const (
PLANTYPE_HIGH_AVAILABILITY PlanTypes = "high-availability"
PLANTYPE_SINGLE PlanTypes = "single"
)
// All allowed values of Plan enum
var AllowedPlanTypesEnumValues = []PlanTypes{
"high-availability",
"single",
}
func (v *PlanTypes) UnmarshalJSON(src []byte) error {
// use a type alias to prevent infinite recursion during unmarshal,
// see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers
type TmpJson PlanTypes
var value TmpJson
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
// Allow unmarshalling zero value for testing purposes
var zeroValue TmpJson
if value == zeroValue {
return nil
}
enumTypeValue := PlanTypes(value)
for _, existing := range AllowedPlanTypesEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid Plan", value)
}
// NewPlanTypesFromValue returns a pointer to a valid PlanTypes
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewPlanTypesFromValue(v PlanTypes) (*PlanTypes, error) {
ev := PlanTypes(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for PlanTypes: valid values are %v", v, AllowedPlanTypesEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v PlanTypes) IsValid() bool {
for _, existing := range AllowedPlanTypesEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to TypeTypes value
func (v PlanTypes) Ptr() *PlanTypes {
return &v
}
type NullablePlanTypes struct {
value *PlanTypes
isSet bool
}
func (v NullablePlanTypes) Get() *PlanTypes {
return v.value
}
func (v *NullablePlanTypes) Set(val *PlanTypes) {
v.value = val
v.isSet = true
}
func (v NullablePlanTypes) IsSet() bool {
return v.isSet
}
func (v *NullablePlanTypes) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePlanTypes(val *PlanTypes) *NullablePlanTypes {
return &NullablePlanTypes{value: val, isSet: true}
}
func (v NullablePlanTypes) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePlanTypes) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type PlanGetTypeAttributeType = *PlanTypes
type PlanGetTypeArgType = PlanTypes
type PlanGetTypeRetType = PlanTypes
func getPlanGetTypeAttributeTypeOk(arg PlanGetTypeAttributeType) (ret PlanGetTypeRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setPlanGetTypeAttributeType(arg *PlanGetTypeAttributeType, val PlanGetTypeRetType) {
*arg = &val
}
// Plan struct for Plan
type Plan struct {
// Maximum bandwidth of a VPN instance.
// Can be cast to int32 without loss of precision.
MaxBandwidth PlanGetMaxBandwidthAttributeType `json:"maxBandwidth,omitempty"`
// Maximum concurrent connections of a VPN Gateway.
// Can be cast to int32 without loss of precision.
MaxConnections PlanGetMaxConnectionsAttributeType `json:"maxConnections,omitempty"`
// Service plan name
Name PlanGetNameAttributeType `json:"name,omitempty"`
// Service plan identifier
PlanId PlanGetPlanIdAttributeType `json:"planId,omitempty"`
// Region (read-only)
Region PlanGetRegionAttributeType `json:"region,omitempty"`
// Plan SKU
Sku PlanGetSkuAttributeType `json:"sku,omitempty"`
// Service plan type
Type PlanGetTypeAttributeType `json:"type,omitempty"`
}
// NewPlan instantiates a new Plan 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 NewPlan() *Plan {
this := Plan{}
return &this
}
// NewPlanWithDefaults instantiates a new Plan 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 NewPlanWithDefaults() *Plan {
this := Plan{}
return &this
}
// GetMaxBandwidth returns the MaxBandwidth field value if set, zero value otherwise.
func (o *Plan) GetMaxBandwidth() (res PlanGetMaxBandwidthRetType) {
res, _ = o.GetMaxBandwidthOk()
return
}
// GetMaxBandwidthOk returns a tuple with the MaxBandwidth field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Plan) GetMaxBandwidthOk() (ret PlanGetMaxBandwidthRetType, ok bool) {
return getPlanGetMaxBandwidthAttributeTypeOk(o.MaxBandwidth)
}
// HasMaxBandwidth returns a boolean if a field has been set.
func (o *Plan) HasMaxBandwidth() bool {
_, ok := o.GetMaxBandwidthOk()
return ok
}
// SetMaxBandwidth gets a reference to the given int64 and assigns it to the MaxBandwidth field.
func (o *Plan) SetMaxBandwidth(v PlanGetMaxBandwidthRetType) {
setPlanGetMaxBandwidthAttributeType(&o.MaxBandwidth, v)
}
// GetMaxConnections returns the MaxConnections field value if set, zero value otherwise.
func (o *Plan) GetMaxConnections() (res PlanGetMaxConnectionsRetType) {
res, _ = o.GetMaxConnectionsOk()
return
}
// GetMaxConnectionsOk returns a tuple with the MaxConnections field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Plan) GetMaxConnectionsOk() (ret PlanGetMaxConnectionsRetType, ok bool) {
return getPlanGetMaxConnectionsAttributeTypeOk(o.MaxConnections)
}
// HasMaxConnections returns a boolean if a field has been set.
func (o *Plan) HasMaxConnections() bool {
_, ok := o.GetMaxConnectionsOk()
return ok
}
// SetMaxConnections gets a reference to the given int64 and assigns it to the MaxConnections field.
func (o *Plan) SetMaxConnections(v PlanGetMaxConnectionsRetType) {
setPlanGetMaxConnectionsAttributeType(&o.MaxConnections, v)
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *Plan) GetName() (res PlanGetNameRetType) {
res, _ = o.GetNameOk()
return
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Plan) GetNameOk() (ret PlanGetNameRetType, ok bool) {
return getPlanGetNameAttributeTypeOk(o.Name)
}
// HasName returns a boolean if a field has been set.
func (o *Plan) HasName() bool {
_, ok := o.GetNameOk()
return ok
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *Plan) SetName(v PlanGetNameRetType) {
setPlanGetNameAttributeType(&o.Name, v)
}
// GetPlanId returns the PlanId field value if set, zero value otherwise.
func (o *Plan) GetPlanId() (res PlanGetPlanIdRetType) {
res, _ = o.GetPlanIdOk()
return
}
// GetPlanIdOk returns a tuple with the PlanId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Plan) GetPlanIdOk() (ret PlanGetPlanIdRetType, ok bool) {
return getPlanGetPlanIdAttributeTypeOk(o.PlanId)
}
// HasPlanId returns a boolean if a field has been set.
func (o *Plan) HasPlanId() bool {
_, ok := o.GetPlanIdOk()
return ok
}
// SetPlanId gets a reference to the given string and assigns it to the PlanId field.
func (o *Plan) SetPlanId(v PlanGetPlanIdRetType) {
setPlanGetPlanIdAttributeType(&o.PlanId, v)
}
// GetRegion returns the Region field value if set, zero value otherwise.
func (o *Plan) GetRegion() (res PlanGetRegionRetType) {
res, _ = o.GetRegionOk()
return
}
// GetRegionOk returns a tuple with the Region field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Plan) GetRegionOk() (ret PlanGetRegionRetType, ok bool) {
return getPlanGetRegionAttributeTypeOk(o.Region)
}
// HasRegion returns a boolean if a field has been set.
func (o *Plan) HasRegion() bool {
_, ok := o.GetRegionOk()
return ok
}
// SetRegion gets a reference to the given string and assigns it to the Region field.
func (o *Plan) SetRegion(v PlanGetRegionRetType) {
setPlanGetRegionAttributeType(&o.Region, v)
}
// GetSku returns the Sku field value if set, zero value otherwise.
func (o *Plan) GetSku() (res PlanGetSkuRetType) {
res, _ = o.GetSkuOk()
return
}
// GetSkuOk returns a tuple with the Sku field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Plan) GetSkuOk() (ret PlanGetSkuRetType, ok bool) {
return getPlanGetSkuAttributeTypeOk(o.Sku)
}
// HasSku returns a boolean if a field has been set.
func (o *Plan) HasSku() bool {
_, ok := o.GetSkuOk()
return ok
}
// SetSku gets a reference to the given string and assigns it to the Sku field.
func (o *Plan) SetSku(v PlanGetSkuRetType) {
setPlanGetSkuAttributeType(&o.Sku, v)
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *Plan) GetType() (res PlanGetTypeRetType) {
res, _ = o.GetTypeOk()
return
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Plan) GetTypeOk() (ret PlanGetTypeRetType, ok bool) {
return getPlanGetTypeAttributeTypeOk(o.Type)
}
// HasType returns a boolean if a field has been set.
func (o *Plan) HasType() bool {
_, ok := o.GetTypeOk()
return ok
}
// SetType gets a reference to the given string and assigns it to the Type field.
func (o *Plan) SetType(v PlanGetTypeRetType) {
setPlanGetTypeAttributeType(&o.Type, v)
}
func (o Plan) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getPlanGetMaxBandwidthAttributeTypeOk(o.MaxBandwidth); ok {
toSerialize["MaxBandwidth"] = val
}
if val, ok := getPlanGetMaxConnectionsAttributeTypeOk(o.MaxConnections); ok {
toSerialize["MaxConnections"] = val
}
if val, ok := getPlanGetNameAttributeTypeOk(o.Name); ok {
toSerialize["Name"] = val
}
if val, ok := getPlanGetPlanIdAttributeTypeOk(o.PlanId); ok {
toSerialize["PlanId"] = val
}
if val, ok := getPlanGetRegionAttributeTypeOk(o.Region); ok {
toSerialize["Region"] = val
}
if val, ok := getPlanGetSkuAttributeTypeOk(o.Sku); ok {
toSerialize["Sku"] = val
}
if val, ok := getPlanGetTypeAttributeTypeOk(o.Type); ok {
toSerialize["Type"] = val
}
return toSerialize, nil
}
type NullablePlan struct {
value *Plan
isSet bool
}
func (v NullablePlan) Get() *Plan {
return v.value
}
func (v *NullablePlan) Set(val *Plan) {
v.value = val
v.isSet = true
}
func (v NullablePlan) IsSet() bool {
return v.isSet
}
func (v *NullablePlan) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePlan(val *Plan) *NullablePlan {
return &NullablePlan{value: val, isSet: true}
}
func (v NullablePlan) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePlan) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,223 @@
/*
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 PlanList type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PlanList{}
/*
types and functions for defaultPlanId
*/
// isNotNullableString
type PlanListGetDefaultPlanIdAttributeType = *string
func getPlanListGetDefaultPlanIdAttributeTypeOk(arg PlanListGetDefaultPlanIdAttributeType) (ret PlanListGetDefaultPlanIdRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setPlanListGetDefaultPlanIdAttributeType(arg *PlanListGetDefaultPlanIdAttributeType, val PlanListGetDefaultPlanIdRetType) {
*arg = &val
}
type PlanListGetDefaultPlanIdArgType = string
type PlanListGetDefaultPlanIdRetType = string
/*
types and functions for plans
*/
// isArray
type PlanListGetPlansAttributeType = *[]Plan
type PlanListGetPlansArgType = []Plan
type PlanListGetPlansRetType = []Plan
func getPlanListGetPlansAttributeTypeOk(arg PlanListGetPlansAttributeType) (ret PlanListGetPlansRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setPlanListGetPlansAttributeType(arg *PlanListGetPlansAttributeType, val PlanListGetPlansRetType) {
*arg = &val
}
/*
types and functions for tunnel
*/
// isModel
type PlanListGetTunnelAttributeType = *VPNTunnelPlan
type PlanListGetTunnelArgType = VPNTunnelPlan
type PlanListGetTunnelRetType = VPNTunnelPlan
func getPlanListGetTunnelAttributeTypeOk(arg PlanListGetTunnelAttributeType) (ret PlanListGetTunnelRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setPlanListGetTunnelAttributeType(arg *PlanListGetTunnelAttributeType, val PlanListGetTunnelRetType) {
*arg = &val
}
// PlanList struct for PlanList
type PlanList struct {
// Default Plan ID for the current region
DefaultPlanId PlanListGetDefaultPlanIdAttributeType `json:"defaultPlanId,omitempty"`
Plans PlanListGetPlansAttributeType `json:"plans,omitempty"`
Tunnel PlanListGetTunnelAttributeType `json:"tunnel,omitempty"`
}
// NewPlanList instantiates a new PlanList 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 NewPlanList() *PlanList {
this := PlanList{}
return &this
}
// NewPlanListWithDefaults instantiates a new PlanList 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 NewPlanListWithDefaults() *PlanList {
this := PlanList{}
return &this
}
// GetDefaultPlanId returns the DefaultPlanId field value if set, zero value otherwise.
func (o *PlanList) GetDefaultPlanId() (res PlanListGetDefaultPlanIdRetType) {
res, _ = o.GetDefaultPlanIdOk()
return
}
// GetDefaultPlanIdOk returns a tuple with the DefaultPlanId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlanList) GetDefaultPlanIdOk() (ret PlanListGetDefaultPlanIdRetType, ok bool) {
return getPlanListGetDefaultPlanIdAttributeTypeOk(o.DefaultPlanId)
}
// HasDefaultPlanId returns a boolean if a field has been set.
func (o *PlanList) HasDefaultPlanId() bool {
_, ok := o.GetDefaultPlanIdOk()
return ok
}
// SetDefaultPlanId gets a reference to the given string and assigns it to the DefaultPlanId field.
func (o *PlanList) SetDefaultPlanId(v PlanListGetDefaultPlanIdRetType) {
setPlanListGetDefaultPlanIdAttributeType(&o.DefaultPlanId, v)
}
// GetPlans returns the Plans field value if set, zero value otherwise.
func (o *PlanList) GetPlans() (res PlanListGetPlansRetType) {
res, _ = o.GetPlansOk()
return
}
// GetPlansOk returns a tuple with the Plans field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlanList) GetPlansOk() (ret PlanListGetPlansRetType, ok bool) {
return getPlanListGetPlansAttributeTypeOk(o.Plans)
}
// HasPlans returns a boolean if a field has been set.
func (o *PlanList) HasPlans() bool {
_, ok := o.GetPlansOk()
return ok
}
// SetPlans gets a reference to the given []Plan and assigns it to the Plans field.
func (o *PlanList) SetPlans(v PlanListGetPlansRetType) {
setPlanListGetPlansAttributeType(&o.Plans, v)
}
// GetTunnel returns the Tunnel field value if set, zero value otherwise.
func (o *PlanList) GetTunnel() (res PlanListGetTunnelRetType) {
res, _ = o.GetTunnelOk()
return
}
// GetTunnelOk returns a tuple with the Tunnel field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlanList) GetTunnelOk() (ret PlanListGetTunnelRetType, ok bool) {
return getPlanListGetTunnelAttributeTypeOk(o.Tunnel)
}
// HasTunnel returns a boolean if a field has been set.
func (o *PlanList) HasTunnel() bool {
_, ok := o.GetTunnelOk()
return ok
}
// SetTunnel gets a reference to the given VPNTunnelPlan and assigns it to the Tunnel field.
func (o *PlanList) SetTunnel(v PlanListGetTunnelRetType) {
setPlanListGetTunnelAttributeType(&o.Tunnel, v)
}
func (o PlanList) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getPlanListGetDefaultPlanIdAttributeTypeOk(o.DefaultPlanId); ok {
toSerialize["DefaultPlanId"] = val
}
if val, ok := getPlanListGetPlansAttributeTypeOk(o.Plans); ok {
toSerialize["Plans"] = val
}
if val, ok := getPlanListGetTunnelAttributeTypeOk(o.Tunnel); ok {
toSerialize["Tunnel"] = val
}
return toSerialize, nil
}
type NullablePlanList struct {
value *PlanList
isSet bool
}
func (v NullablePlanList) Get() *PlanList {
return v.value
}
func (v *NullablePlanList) Set(val *PlanList) {
v.value = val
v.isSet = true
}
func (v NullablePlanList) IsSet() bool {
return v.isSet
}
func (v *NullablePlanList) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePlanList(val *PlanList) *NullablePlanList {
return &NullablePlanList{value: val, isSet: true}
}
func (v NullablePlanList) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePlanList) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,58 @@
/*
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 (
"testing"
)
// isEnum
func TestPlanTypes_UnmarshalJSON(t *testing.T) {
type args struct {
src []byte
}
tests := []struct {
name string
args args
wantErr bool
}{
{
name: `success - possible enum value no. 1`,
args: args{
src: []byte(`"high-availability"`),
},
wantErr: false,
},
{
name: `success - possible enum value no. 2`,
args: args{
src: []byte(`"single"`),
},
wantErr: false,
},
{
name: "fail",
args: args{
src: []byte("\"FOOBAR\""),
},
wantErr: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
v := PlanTypes("")
if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr {
t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}

168
pkg/vpnalpha/model_quota.go Normal file
View file

@ -0,0 +1,168 @@
/*
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 Quota type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Quota{}
/*
types and functions for limit
*/
// isInteger
type QuotaGetLimitAttributeType = *int64
type QuotaGetLimitArgType = int64
type QuotaGetLimitRetType = int64
func getQuotaGetLimitAttributeTypeOk(arg QuotaGetLimitAttributeType) (ret QuotaGetLimitRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setQuotaGetLimitAttributeType(arg *QuotaGetLimitAttributeType, val QuotaGetLimitRetType) {
*arg = &val
}
/*
types and functions for usage
*/
// isInteger
type QuotaGetUsageAttributeType = *int64
type QuotaGetUsageArgType = int64
type QuotaGetUsageRetType = int64
func getQuotaGetUsageAttributeTypeOk(arg QuotaGetUsageAttributeType) (ret QuotaGetUsageRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setQuotaGetUsageAttributeType(arg *QuotaGetUsageAttributeType, val QuotaGetUsageRetType) {
*arg = &val
}
// Quota struct for Quota
type Quota struct {
// REQUIRED
Limit QuotaGetLimitAttributeType `json:"limit" required:"true"`
// REQUIRED
Usage QuotaGetUsageAttributeType `json:"usage" required:"true"`
}
type _Quota Quota
// NewQuota instantiates a new Quota 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 NewQuota(limit QuotaGetLimitArgType, usage QuotaGetUsageArgType) *Quota {
this := Quota{}
setQuotaGetLimitAttributeType(&this.Limit, limit)
setQuotaGetUsageAttributeType(&this.Usage, usage)
return &this
}
// NewQuotaWithDefaults instantiates a new Quota 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 NewQuotaWithDefaults() *Quota {
this := Quota{}
return &this
}
// GetLimit returns the Limit field value
func (o *Quota) GetLimit() (ret QuotaGetLimitRetType) {
ret, _ = o.GetLimitOk()
return ret
}
// GetLimitOk returns a tuple with the Limit field value
// and a boolean to check if the value has been set.
func (o *Quota) GetLimitOk() (ret QuotaGetLimitRetType, ok bool) {
return getQuotaGetLimitAttributeTypeOk(o.Limit)
}
// SetLimit sets field value
func (o *Quota) SetLimit(v QuotaGetLimitRetType) {
setQuotaGetLimitAttributeType(&o.Limit, v)
}
// GetUsage returns the Usage field value
func (o *Quota) GetUsage() (ret QuotaGetUsageRetType) {
ret, _ = o.GetUsageOk()
return ret
}
// GetUsageOk returns a tuple with the Usage field value
// and a boolean to check if the value has been set.
func (o *Quota) GetUsageOk() (ret QuotaGetUsageRetType, ok bool) {
return getQuotaGetUsageAttributeTypeOk(o.Usage)
}
// SetUsage sets field value
func (o *Quota) SetUsage(v QuotaGetUsageRetType) {
setQuotaGetUsageAttributeType(&o.Usage, v)
}
func (o Quota) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getQuotaGetLimitAttributeTypeOk(o.Limit); ok {
toSerialize["Limit"] = val
}
if val, ok := getQuotaGetUsageAttributeTypeOk(o.Usage); ok {
toSerialize["Usage"] = val
}
return toSerialize, nil
}
type NullableQuota struct {
value *Quota
isSet bool
}
func (v NullableQuota) Get() *Quota {
return v.value
}
func (v *NullableQuota) Set(val *Quota) {
v.value = val
v.isSet = true
}
func (v NullableQuota) IsSet() bool {
return v.isSet
}
func (v *NullableQuota) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableQuota(val *Quota) *NullableQuota {
return &NullableQuota{value: val, isSet: true}
}
func (v NullableQuota) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableQuota) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,125 @@
/*
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 QuotaList type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &QuotaList{}
/*
types and functions for gateways
*/
// isModel
type QuotaListGetGatewaysAttributeType = *QuotaListGateways
type QuotaListGetGatewaysArgType = QuotaListGateways
type QuotaListGetGatewaysRetType = QuotaListGateways
func getQuotaListGetGatewaysAttributeTypeOk(arg QuotaListGetGatewaysAttributeType) (ret QuotaListGetGatewaysRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setQuotaListGetGatewaysAttributeType(arg *QuotaListGetGatewaysAttributeType, val QuotaListGetGatewaysRetType) {
*arg = &val
}
// QuotaList struct for QuotaList
type QuotaList struct {
// REQUIRED
Gateways QuotaListGetGatewaysAttributeType `json:"gateways" required:"true"`
}
type _QuotaList QuotaList
// NewQuotaList instantiates a new QuotaList 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 NewQuotaList(gateways QuotaListGetGatewaysArgType) *QuotaList {
this := QuotaList{}
setQuotaListGetGatewaysAttributeType(&this.Gateways, gateways)
return &this
}
// NewQuotaListWithDefaults instantiates a new QuotaList 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 NewQuotaListWithDefaults() *QuotaList {
this := QuotaList{}
return &this
}
// GetGateways returns the Gateways field value
func (o *QuotaList) GetGateways() (ret QuotaListGetGatewaysRetType) {
ret, _ = o.GetGatewaysOk()
return ret
}
// GetGatewaysOk returns a tuple with the Gateways field value
// and a boolean to check if the value has been set.
func (o *QuotaList) GetGatewaysOk() (ret QuotaListGetGatewaysRetType, ok bool) {
return getQuotaListGetGatewaysAttributeTypeOk(o.Gateways)
}
// SetGateways sets field value
func (o *QuotaList) SetGateways(v QuotaListGetGatewaysRetType) {
setQuotaListGetGatewaysAttributeType(&o.Gateways, v)
}
func (o QuotaList) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getQuotaListGetGatewaysAttributeTypeOk(o.Gateways); ok {
toSerialize["Gateways"] = val
}
return toSerialize, nil
}
type NullableQuotaList struct {
value *QuotaList
isSet bool
}
func (v NullableQuotaList) Get() *QuotaList {
return v.value
}
func (v *NullableQuotaList) Set(val *QuotaList) {
v.value = val
v.isSet = true
}
func (v NullableQuotaList) IsSet() bool {
return v.isSet
}
func (v *NullableQuotaList) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableQuotaList(val *QuotaList) *NullableQuotaList {
return &NullableQuotaList{value: val, isSet: true}
}
func (v NullableQuotaList) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableQuotaList) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,168 @@
/*
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 QuotaListGateways type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &QuotaListGateways{}
/*
types and functions for limit
*/
// isInteger
type QuotaListGatewaysGetLimitAttributeType = *int64
type QuotaListGatewaysGetLimitArgType = int64
type QuotaListGatewaysGetLimitRetType = int64
func getQuotaListGatewaysGetLimitAttributeTypeOk(arg QuotaListGatewaysGetLimitAttributeType) (ret QuotaListGatewaysGetLimitRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setQuotaListGatewaysGetLimitAttributeType(arg *QuotaListGatewaysGetLimitAttributeType, val QuotaListGatewaysGetLimitRetType) {
*arg = &val
}
/*
types and functions for usage
*/
// isInteger
type QuotaListGatewaysGetUsageAttributeType = *int64
type QuotaListGatewaysGetUsageArgType = int64
type QuotaListGatewaysGetUsageRetType = int64
func getQuotaListGatewaysGetUsageAttributeTypeOk(arg QuotaListGatewaysGetUsageAttributeType) (ret QuotaListGatewaysGetUsageRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setQuotaListGatewaysGetUsageAttributeType(arg *QuotaListGatewaysGetUsageAttributeType, val QuotaListGatewaysGetUsageRetType) {
*arg = &val
}
// QuotaListGateways The number of gateways.
type QuotaListGateways struct {
// REQUIRED
Limit QuotaListGatewaysGetLimitAttributeType `json:"limit" required:"true"`
// REQUIRED
Usage QuotaListGatewaysGetUsageAttributeType `json:"usage" required:"true"`
}
type _QuotaListGateways QuotaListGateways
// NewQuotaListGateways instantiates a new QuotaListGateways 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 NewQuotaListGateways(limit QuotaListGatewaysGetLimitArgType, usage QuotaListGatewaysGetUsageArgType) *QuotaListGateways {
this := QuotaListGateways{}
setQuotaListGatewaysGetLimitAttributeType(&this.Limit, limit)
setQuotaListGatewaysGetUsageAttributeType(&this.Usage, usage)
return &this
}
// NewQuotaListGatewaysWithDefaults instantiates a new QuotaListGateways 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 NewQuotaListGatewaysWithDefaults() *QuotaListGateways {
this := QuotaListGateways{}
return &this
}
// GetLimit returns the Limit field value
func (o *QuotaListGateways) GetLimit() (ret QuotaListGatewaysGetLimitRetType) {
ret, _ = o.GetLimitOk()
return ret
}
// GetLimitOk returns a tuple with the Limit field value
// and a boolean to check if the value has been set.
func (o *QuotaListGateways) GetLimitOk() (ret QuotaListGatewaysGetLimitRetType, ok bool) {
return getQuotaListGatewaysGetLimitAttributeTypeOk(o.Limit)
}
// SetLimit sets field value
func (o *QuotaListGateways) SetLimit(v QuotaListGatewaysGetLimitRetType) {
setQuotaListGatewaysGetLimitAttributeType(&o.Limit, v)
}
// GetUsage returns the Usage field value
func (o *QuotaListGateways) GetUsage() (ret QuotaListGatewaysGetUsageRetType) {
ret, _ = o.GetUsageOk()
return ret
}
// GetUsageOk returns a tuple with the Usage field value
// and a boolean to check if the value has been set.
func (o *QuotaListGateways) GetUsageOk() (ret QuotaListGatewaysGetUsageRetType, ok bool) {
return getQuotaListGatewaysGetUsageAttributeTypeOk(o.Usage)
}
// SetUsage sets field value
func (o *QuotaListGateways) SetUsage(v QuotaListGatewaysGetUsageRetType) {
setQuotaListGatewaysGetUsageAttributeType(&o.Usage, v)
}
func (o QuotaListGateways) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getQuotaListGatewaysGetLimitAttributeTypeOk(o.Limit); ok {
toSerialize["Limit"] = val
}
if val, ok := getQuotaListGatewaysGetUsageAttributeTypeOk(o.Usage); ok {
toSerialize["Usage"] = val
}
return toSerialize, nil
}
type NullableQuotaListGateways struct {
value *QuotaListGateways
isSet bool
}
func (v NullableQuotaListGateways) Get() *QuotaListGateways {
return v.value
}
func (v *NullableQuotaListGateways) Set(val *QuotaListGateways) {
v.value = val
v.isSet = true
}
func (v NullableQuotaListGateways) IsSet() bool {
return v.isSet
}
func (v *NullableQuotaListGateways) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableQuotaListGateways(val *QuotaListGateways) *NullableQuotaListGateways {
return &NullableQuotaListGateways{value: val, isSet: true}
}
func (v NullableQuotaListGateways) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableQuotaListGateways) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,125 @@
/*
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 QuotaListResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &QuotaListResponse{}
/*
types and functions for quotas
*/
// isModel
type QuotaListResponseGetQuotasAttributeType = *QuotaList
type QuotaListResponseGetQuotasArgType = QuotaList
type QuotaListResponseGetQuotasRetType = QuotaList
func getQuotaListResponseGetQuotasAttributeTypeOk(arg QuotaListResponseGetQuotasAttributeType) (ret QuotaListResponseGetQuotasRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setQuotaListResponseGetQuotasAttributeType(arg *QuotaListResponseGetQuotasAttributeType, val QuotaListResponseGetQuotasRetType) {
*arg = &val
}
// QuotaListResponse struct for QuotaListResponse
type QuotaListResponse struct {
// REQUIRED
Quotas QuotaListResponseGetQuotasAttributeType `json:"quotas" required:"true"`
}
type _QuotaListResponse QuotaListResponse
// NewQuotaListResponse instantiates a new QuotaListResponse 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 NewQuotaListResponse(quotas QuotaListResponseGetQuotasArgType) *QuotaListResponse {
this := QuotaListResponse{}
setQuotaListResponseGetQuotasAttributeType(&this.Quotas, quotas)
return &this
}
// NewQuotaListResponseWithDefaults instantiates a new QuotaListResponse 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 NewQuotaListResponseWithDefaults() *QuotaListResponse {
this := QuotaListResponse{}
return &this
}
// GetQuotas returns the Quotas field value
func (o *QuotaListResponse) GetQuotas() (ret QuotaListResponseGetQuotasRetType) {
ret, _ = o.GetQuotasOk()
return ret
}
// GetQuotasOk returns a tuple with the Quotas field value
// and a boolean to check if the value has been set.
func (o *QuotaListResponse) GetQuotasOk() (ret QuotaListResponseGetQuotasRetType, ok bool) {
return getQuotaListResponseGetQuotasAttributeTypeOk(o.Quotas)
}
// SetQuotas sets field value
func (o *QuotaListResponse) SetQuotas(v QuotaListResponseGetQuotasRetType) {
setQuotaListResponseGetQuotasAttributeType(&o.Quotas, v)
}
func (o QuotaListResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getQuotaListResponseGetQuotasAttributeTypeOk(o.Quotas); ok {
toSerialize["Quotas"] = val
}
return toSerialize, nil
}
type NullableQuotaListResponse struct {
value *QuotaListResponse
isSet bool
}
func (v NullableQuotaListResponse) Get() *QuotaListResponse {
return v.value
}
func (v *NullableQuotaListResponse) Set(val *QuotaListResponse) {
v.value = val
v.isSet = true
}
func (v NullableQuotaListResponse) IsSet() bool {
return v.isSet
}
func (v *NullableQuotaListResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableQuotaListResponse(val *QuotaListResponse) *NullableQuotaListResponse {
return &NullableQuotaListResponse{value: val, isSet: true}
}
func (v NullableQuotaListResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableQuotaListResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,115 @@
/*
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"
"fmt"
)
// Region The region in which the resource is located.
type Region string
// List of Region
const (
REGION_EU01 Region = "eu01"
REGION_EU02 Region = "eu02"
)
// All allowed values of Region enum
var AllowedRegionEnumValues = []Region{
"eu01",
"eu02",
}
func (v *Region) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
// Allow unmarshalling zero value for testing purposes
var zeroValue string
if value == zeroValue {
return nil
}
enumTypeValue := Region(value)
for _, existing := range AllowedRegionEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid Region", value)
}
// NewRegionFromValue returns a pointer to a valid Region
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewRegionFromValue(v string) (*Region, error) {
ev := Region(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for Region: valid values are %v", v, AllowedRegionEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v Region) IsValid() bool {
for _, existing := range AllowedRegionEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to Region value
func (v Region) Ptr() *Region {
return &v
}
type NullableRegion struct {
value *Region
isSet bool
}
func (v NullableRegion) Get() *Region {
return v.value
}
func (v *NullableRegion) Set(val *Region) {
v.value = val
v.isSet = true
}
func (v NullableRegion) IsSet() bool {
return v.isSet
}
func (v *NullableRegion) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableRegion(val *Region) *NullableRegion {
return &NullableRegion{value: val, isSet: true}
}
func (v NullableRegion) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableRegion) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,308 @@
/*
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 TunnelConfiguration type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TunnelConfiguration{}
/*
types and functions for bgpTunnelConfig
*/
// isModel
type TunnelConfigurationGetBgpTunnelConfigAttributeType = *BGPTunnelConfig
type TunnelConfigurationGetBgpTunnelConfigArgType = BGPTunnelConfig
type TunnelConfigurationGetBgpTunnelConfigRetType = BGPTunnelConfig
func getTunnelConfigurationGetBgpTunnelConfigAttributeTypeOk(arg TunnelConfigurationGetBgpTunnelConfigAttributeType) (ret TunnelConfigurationGetBgpTunnelConfigRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelConfigurationGetBgpTunnelConfigAttributeType(arg *TunnelConfigurationGetBgpTunnelConfigAttributeType, val TunnelConfigurationGetBgpTunnelConfigRetType) {
*arg = &val
}
/*
types and functions for phase1
*/
// isModel
type TunnelConfigurationGetPhase1AttributeType = *TunnelConfigurationPhase1
type TunnelConfigurationGetPhase1ArgType = TunnelConfigurationPhase1
type TunnelConfigurationGetPhase1RetType = TunnelConfigurationPhase1
func getTunnelConfigurationGetPhase1AttributeTypeOk(arg TunnelConfigurationGetPhase1AttributeType) (ret TunnelConfigurationGetPhase1RetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelConfigurationGetPhase1AttributeType(arg *TunnelConfigurationGetPhase1AttributeType, val TunnelConfigurationGetPhase1RetType) {
*arg = &val
}
/*
types and functions for phase2
*/
// isModel
type TunnelConfigurationGetPhase2AttributeType = *TunnelConfigurationPhase2
type TunnelConfigurationGetPhase2ArgType = TunnelConfigurationPhase2
type TunnelConfigurationGetPhase2RetType = TunnelConfigurationPhase2
func getTunnelConfigurationGetPhase2AttributeTypeOk(arg TunnelConfigurationGetPhase2AttributeType) (ret TunnelConfigurationGetPhase2RetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelConfigurationGetPhase2AttributeType(arg *TunnelConfigurationGetPhase2AttributeType, val TunnelConfigurationGetPhase2RetType) {
*arg = &val
}
/*
types and functions for preSharedKey
*/
// isNotNullableString
type TunnelConfigurationGetPreSharedKeyAttributeType = *string
func getTunnelConfigurationGetPreSharedKeyAttributeTypeOk(arg TunnelConfigurationGetPreSharedKeyAttributeType) (ret TunnelConfigurationGetPreSharedKeyRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelConfigurationGetPreSharedKeyAttributeType(arg *TunnelConfigurationGetPreSharedKeyAttributeType, val TunnelConfigurationGetPreSharedKeyRetType) {
*arg = &val
}
type TunnelConfigurationGetPreSharedKeyArgType = string
type TunnelConfigurationGetPreSharedKeyRetType = string
/*
types and functions for remoteAddress
*/
// isNotNullableString
type TunnelConfigurationGetRemoteAddressAttributeType = *string
func getTunnelConfigurationGetRemoteAddressAttributeTypeOk(arg TunnelConfigurationGetRemoteAddressAttributeType) (ret TunnelConfigurationGetRemoteAddressRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelConfigurationGetRemoteAddressAttributeType(arg *TunnelConfigurationGetRemoteAddressAttributeType, val TunnelConfigurationGetRemoteAddressRetType) {
*arg = &val
}
type TunnelConfigurationGetRemoteAddressArgType = string
type TunnelConfigurationGetRemoteAddressRetType = string
// TunnelConfiguration struct for TunnelConfiguration
type TunnelConfiguration struct {
BgpTunnelConfig TunnelConfigurationGetBgpTunnelConfigAttributeType `json:"bgpTunnelConfig,omitempty"`
// REQUIRED
Phase1 TunnelConfigurationGetPhase1AttributeType `json:"phase1" required:"true"`
// REQUIRED
Phase2 TunnelConfigurationGetPhase2AttributeType `json:"phase2" required:"true"`
// A Pre-Shared Key for authentication. Required in create-requests, optional in update-requests and omitted in every response.
PreSharedKey TunnelConfigurationGetPreSharedKeyAttributeType `json:"preSharedKey,omitempty"`
// REQUIRED
RemoteAddress TunnelConfigurationGetRemoteAddressAttributeType `json:"remoteAddress" required:"true"`
}
type _TunnelConfiguration TunnelConfiguration
// NewTunnelConfiguration instantiates a new TunnelConfiguration 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 NewTunnelConfiguration(phase1 TunnelConfigurationGetPhase1ArgType, phase2 TunnelConfigurationGetPhase2ArgType, remoteAddress TunnelConfigurationGetRemoteAddressArgType) *TunnelConfiguration {
this := TunnelConfiguration{}
setTunnelConfigurationGetPhase1AttributeType(&this.Phase1, phase1)
setTunnelConfigurationGetPhase2AttributeType(&this.Phase2, phase2)
setTunnelConfigurationGetRemoteAddressAttributeType(&this.RemoteAddress, remoteAddress)
return &this
}
// NewTunnelConfigurationWithDefaults instantiates a new TunnelConfiguration 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 NewTunnelConfigurationWithDefaults() *TunnelConfiguration {
this := TunnelConfiguration{}
return &this
}
// GetBgpTunnelConfig returns the BgpTunnelConfig field value if set, zero value otherwise.
func (o *TunnelConfiguration) GetBgpTunnelConfig() (res TunnelConfigurationGetBgpTunnelConfigRetType) {
res, _ = o.GetBgpTunnelConfigOk()
return
}
// GetBgpTunnelConfigOk returns a tuple with the BgpTunnelConfig field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TunnelConfiguration) GetBgpTunnelConfigOk() (ret TunnelConfigurationGetBgpTunnelConfigRetType, ok bool) {
return getTunnelConfigurationGetBgpTunnelConfigAttributeTypeOk(o.BgpTunnelConfig)
}
// HasBgpTunnelConfig returns a boolean if a field has been set.
func (o *TunnelConfiguration) HasBgpTunnelConfig() bool {
_, ok := o.GetBgpTunnelConfigOk()
return ok
}
// SetBgpTunnelConfig gets a reference to the given BGPTunnelConfig and assigns it to the BgpTunnelConfig field.
func (o *TunnelConfiguration) SetBgpTunnelConfig(v TunnelConfigurationGetBgpTunnelConfigRetType) {
setTunnelConfigurationGetBgpTunnelConfigAttributeType(&o.BgpTunnelConfig, v)
}
// GetPhase1 returns the Phase1 field value
func (o *TunnelConfiguration) GetPhase1() (ret TunnelConfigurationGetPhase1RetType) {
ret, _ = o.GetPhase1Ok()
return ret
}
// GetPhase1Ok returns a tuple with the Phase1 field value
// and a boolean to check if the value has been set.
func (o *TunnelConfiguration) GetPhase1Ok() (ret TunnelConfigurationGetPhase1RetType, ok bool) {
return getTunnelConfigurationGetPhase1AttributeTypeOk(o.Phase1)
}
// SetPhase1 sets field value
func (o *TunnelConfiguration) SetPhase1(v TunnelConfigurationGetPhase1RetType) {
setTunnelConfigurationGetPhase1AttributeType(&o.Phase1, v)
}
// GetPhase2 returns the Phase2 field value
func (o *TunnelConfiguration) GetPhase2() (ret TunnelConfigurationGetPhase2RetType) {
ret, _ = o.GetPhase2Ok()
return ret
}
// GetPhase2Ok returns a tuple with the Phase2 field value
// and a boolean to check if the value has been set.
func (o *TunnelConfiguration) GetPhase2Ok() (ret TunnelConfigurationGetPhase2RetType, ok bool) {
return getTunnelConfigurationGetPhase2AttributeTypeOk(o.Phase2)
}
// SetPhase2 sets field value
func (o *TunnelConfiguration) SetPhase2(v TunnelConfigurationGetPhase2RetType) {
setTunnelConfigurationGetPhase2AttributeType(&o.Phase2, v)
}
// GetPreSharedKey returns the PreSharedKey field value if set, zero value otherwise.
func (o *TunnelConfiguration) GetPreSharedKey() (res TunnelConfigurationGetPreSharedKeyRetType) {
res, _ = o.GetPreSharedKeyOk()
return
}
// GetPreSharedKeyOk returns a tuple with the PreSharedKey field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TunnelConfiguration) GetPreSharedKeyOk() (ret TunnelConfigurationGetPreSharedKeyRetType, ok bool) {
return getTunnelConfigurationGetPreSharedKeyAttributeTypeOk(o.PreSharedKey)
}
// HasPreSharedKey returns a boolean if a field has been set.
func (o *TunnelConfiguration) HasPreSharedKey() bool {
_, ok := o.GetPreSharedKeyOk()
return ok
}
// SetPreSharedKey gets a reference to the given string and assigns it to the PreSharedKey field.
func (o *TunnelConfiguration) SetPreSharedKey(v TunnelConfigurationGetPreSharedKeyRetType) {
setTunnelConfigurationGetPreSharedKeyAttributeType(&o.PreSharedKey, v)
}
// GetRemoteAddress returns the RemoteAddress field value
func (o *TunnelConfiguration) GetRemoteAddress() (ret TunnelConfigurationGetRemoteAddressRetType) {
ret, _ = o.GetRemoteAddressOk()
return ret
}
// GetRemoteAddressOk returns a tuple with the RemoteAddress field value
// and a boolean to check if the value has been set.
func (o *TunnelConfiguration) GetRemoteAddressOk() (ret TunnelConfigurationGetRemoteAddressRetType, ok bool) {
return getTunnelConfigurationGetRemoteAddressAttributeTypeOk(o.RemoteAddress)
}
// SetRemoteAddress sets field value
func (o *TunnelConfiguration) SetRemoteAddress(v TunnelConfigurationGetRemoteAddressRetType) {
setTunnelConfigurationGetRemoteAddressAttributeType(&o.RemoteAddress, v)
}
func (o TunnelConfiguration) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getTunnelConfigurationGetBgpTunnelConfigAttributeTypeOk(o.BgpTunnelConfig); ok {
toSerialize["BgpTunnelConfig"] = val
}
if val, ok := getTunnelConfigurationGetPhase1AttributeTypeOk(o.Phase1); ok {
toSerialize["Phase1"] = val
}
if val, ok := getTunnelConfigurationGetPhase2AttributeTypeOk(o.Phase2); ok {
toSerialize["Phase2"] = val
}
if val, ok := getTunnelConfigurationGetPreSharedKeyAttributeTypeOk(o.PreSharedKey); ok {
toSerialize["PreSharedKey"] = val
}
if val, ok := getTunnelConfigurationGetRemoteAddressAttributeTypeOk(o.RemoteAddress); ok {
toSerialize["RemoteAddress"] = val
}
return toSerialize, nil
}
type NullableTunnelConfiguration struct {
value *TunnelConfiguration
isSet bool
}
func (v NullableTunnelConfiguration) Get() *TunnelConfiguration {
return v.value
}
func (v *NullableTunnelConfiguration) Set(val *TunnelConfiguration) {
v.value = val
v.isSet = true
}
func (v NullableTunnelConfiguration) IsSet() bool {
return v.isSet
}
func (v *NullableTunnelConfiguration) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTunnelConfiguration(val *TunnelConfiguration) *NullableTunnelConfiguration {
return &NullableTunnelConfiguration{value: val, isSet: true}
}
func (v NullableTunnelConfiguration) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTunnelConfiguration) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,267 @@
/*
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 TunnelConfigurationPhase1 type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TunnelConfigurationPhase1{}
/*
types and functions for dhGroups
*/
// isArray
type TunnelConfigurationPhase1GetDhGroupsAttributeType = *[]string
type TunnelConfigurationPhase1GetDhGroupsArgType = []string
type TunnelConfigurationPhase1GetDhGroupsRetType = []string
func getTunnelConfigurationPhase1GetDhGroupsAttributeTypeOk(arg TunnelConfigurationPhase1GetDhGroupsAttributeType) (ret TunnelConfigurationPhase1GetDhGroupsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelConfigurationPhase1GetDhGroupsAttributeType(arg *TunnelConfigurationPhase1GetDhGroupsAttributeType, val TunnelConfigurationPhase1GetDhGroupsRetType) {
*arg = &val
}
/*
types and functions for encryptionAlgorithms
*/
// isArray
type TunnelConfigurationPhase1GetEncryptionAlgorithmsAttributeType = *[]string
type TunnelConfigurationPhase1GetEncryptionAlgorithmsArgType = []string
type TunnelConfigurationPhase1GetEncryptionAlgorithmsRetType = []string
func getTunnelConfigurationPhase1GetEncryptionAlgorithmsAttributeTypeOk(arg TunnelConfigurationPhase1GetEncryptionAlgorithmsAttributeType) (ret TunnelConfigurationPhase1GetEncryptionAlgorithmsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelConfigurationPhase1GetEncryptionAlgorithmsAttributeType(arg *TunnelConfigurationPhase1GetEncryptionAlgorithmsAttributeType, val TunnelConfigurationPhase1GetEncryptionAlgorithmsRetType) {
*arg = &val
}
/*
types and functions for integrityAlgorithms
*/
// isArray
type TunnelConfigurationPhase1GetIntegrityAlgorithmsAttributeType = *[]string
type TunnelConfigurationPhase1GetIntegrityAlgorithmsArgType = []string
type TunnelConfigurationPhase1GetIntegrityAlgorithmsRetType = []string
func getTunnelConfigurationPhase1GetIntegrityAlgorithmsAttributeTypeOk(arg TunnelConfigurationPhase1GetIntegrityAlgorithmsAttributeType) (ret TunnelConfigurationPhase1GetIntegrityAlgorithmsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelConfigurationPhase1GetIntegrityAlgorithmsAttributeType(arg *TunnelConfigurationPhase1GetIntegrityAlgorithmsAttributeType, val TunnelConfigurationPhase1GetIntegrityAlgorithmsRetType) {
*arg = &val
}
/*
types and functions for rekeyTime
*/
// isInteger
type TunnelConfigurationPhase1GetRekeyTimeAttributeType = *int64
type TunnelConfigurationPhase1GetRekeyTimeArgType = int64
type TunnelConfigurationPhase1GetRekeyTimeRetType = int64
func getTunnelConfigurationPhase1GetRekeyTimeAttributeTypeOk(arg TunnelConfigurationPhase1GetRekeyTimeAttributeType) (ret TunnelConfigurationPhase1GetRekeyTimeRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelConfigurationPhase1GetRekeyTimeAttributeType(arg *TunnelConfigurationPhase1GetRekeyTimeAttributeType, val TunnelConfigurationPhase1GetRekeyTimeRetType) {
*arg = &val
}
// TunnelConfigurationPhase1 struct for TunnelConfigurationPhase1
type TunnelConfigurationPhase1 struct {
// The Diffie-Hellman Group. Required, except if AEAD algorithms are selected.
DhGroups TunnelConfigurationPhase1GetDhGroupsAttributeType `json:"dhGroups,omitempty"`
// REQUIRED
EncryptionAlgorithms TunnelConfigurationPhase1GetEncryptionAlgorithmsAttributeType `json:"encryptionAlgorithms" required:"true"`
// REQUIRED
IntegrityAlgorithms TunnelConfigurationPhase1GetIntegrityAlgorithmsAttributeType `json:"integrityAlgorithms" required:"true"`
// Time to schedule a IKE re-keying (in seconds).
// Can be cast to int32 without loss of precision.
RekeyTime TunnelConfigurationPhase1GetRekeyTimeAttributeType `json:"rekeyTime,omitempty"`
}
type _TunnelConfigurationPhase1 TunnelConfigurationPhase1
// NewTunnelConfigurationPhase1 instantiates a new TunnelConfigurationPhase1 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 NewTunnelConfigurationPhase1(encryptionAlgorithms TunnelConfigurationPhase1GetEncryptionAlgorithmsArgType, integrityAlgorithms TunnelConfigurationPhase1GetIntegrityAlgorithmsArgType) *TunnelConfigurationPhase1 {
this := TunnelConfigurationPhase1{}
setTunnelConfigurationPhase1GetEncryptionAlgorithmsAttributeType(&this.EncryptionAlgorithms, encryptionAlgorithms)
setTunnelConfigurationPhase1GetIntegrityAlgorithmsAttributeType(&this.IntegrityAlgorithms, integrityAlgorithms)
return &this
}
// NewTunnelConfigurationPhase1WithDefaults instantiates a new TunnelConfigurationPhase1 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 NewTunnelConfigurationPhase1WithDefaults() *TunnelConfigurationPhase1 {
this := TunnelConfigurationPhase1{}
var rekeyTime int64 = 14400
this.RekeyTime = &rekeyTime
return &this
}
// GetDhGroups returns the DhGroups field value if set, zero value otherwise.
func (o *TunnelConfigurationPhase1) GetDhGroups() (res TunnelConfigurationPhase1GetDhGroupsRetType) {
res, _ = o.GetDhGroupsOk()
return
}
// GetDhGroupsOk returns a tuple with the DhGroups field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TunnelConfigurationPhase1) GetDhGroupsOk() (ret TunnelConfigurationPhase1GetDhGroupsRetType, ok bool) {
return getTunnelConfigurationPhase1GetDhGroupsAttributeTypeOk(o.DhGroups)
}
// HasDhGroups returns a boolean if a field has been set.
func (o *TunnelConfigurationPhase1) HasDhGroups() bool {
_, ok := o.GetDhGroupsOk()
return ok
}
// SetDhGroups gets a reference to the given []string and assigns it to the DhGroups field.
func (o *TunnelConfigurationPhase1) SetDhGroups(v TunnelConfigurationPhase1GetDhGroupsRetType) {
setTunnelConfigurationPhase1GetDhGroupsAttributeType(&o.DhGroups, v)
}
// GetEncryptionAlgorithms returns the EncryptionAlgorithms field value
func (o *TunnelConfigurationPhase1) GetEncryptionAlgorithms() (ret TunnelConfigurationPhase1GetEncryptionAlgorithmsRetType) {
ret, _ = o.GetEncryptionAlgorithmsOk()
return ret
}
// GetEncryptionAlgorithmsOk returns a tuple with the EncryptionAlgorithms field value
// and a boolean to check if the value has been set.
func (o *TunnelConfigurationPhase1) GetEncryptionAlgorithmsOk() (ret TunnelConfigurationPhase1GetEncryptionAlgorithmsRetType, ok bool) {
return getTunnelConfigurationPhase1GetEncryptionAlgorithmsAttributeTypeOk(o.EncryptionAlgorithms)
}
// SetEncryptionAlgorithms sets field value
func (o *TunnelConfigurationPhase1) SetEncryptionAlgorithms(v TunnelConfigurationPhase1GetEncryptionAlgorithmsRetType) {
setTunnelConfigurationPhase1GetEncryptionAlgorithmsAttributeType(&o.EncryptionAlgorithms, v)
}
// GetIntegrityAlgorithms returns the IntegrityAlgorithms field value
func (o *TunnelConfigurationPhase1) GetIntegrityAlgorithms() (ret TunnelConfigurationPhase1GetIntegrityAlgorithmsRetType) {
ret, _ = o.GetIntegrityAlgorithmsOk()
return ret
}
// GetIntegrityAlgorithmsOk returns a tuple with the IntegrityAlgorithms field value
// and a boolean to check if the value has been set.
func (o *TunnelConfigurationPhase1) GetIntegrityAlgorithmsOk() (ret TunnelConfigurationPhase1GetIntegrityAlgorithmsRetType, ok bool) {
return getTunnelConfigurationPhase1GetIntegrityAlgorithmsAttributeTypeOk(o.IntegrityAlgorithms)
}
// SetIntegrityAlgorithms sets field value
func (o *TunnelConfigurationPhase1) SetIntegrityAlgorithms(v TunnelConfigurationPhase1GetIntegrityAlgorithmsRetType) {
setTunnelConfigurationPhase1GetIntegrityAlgorithmsAttributeType(&o.IntegrityAlgorithms, v)
}
// GetRekeyTime returns the RekeyTime field value if set, zero value otherwise.
func (o *TunnelConfigurationPhase1) GetRekeyTime() (res TunnelConfigurationPhase1GetRekeyTimeRetType) {
res, _ = o.GetRekeyTimeOk()
return
}
// GetRekeyTimeOk returns a tuple with the RekeyTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TunnelConfigurationPhase1) GetRekeyTimeOk() (ret TunnelConfigurationPhase1GetRekeyTimeRetType, ok bool) {
return getTunnelConfigurationPhase1GetRekeyTimeAttributeTypeOk(o.RekeyTime)
}
// HasRekeyTime returns a boolean if a field has been set.
func (o *TunnelConfigurationPhase1) HasRekeyTime() bool {
_, ok := o.GetRekeyTimeOk()
return ok
}
// SetRekeyTime gets a reference to the given int64 and assigns it to the RekeyTime field.
func (o *TunnelConfigurationPhase1) SetRekeyTime(v TunnelConfigurationPhase1GetRekeyTimeRetType) {
setTunnelConfigurationPhase1GetRekeyTimeAttributeType(&o.RekeyTime, v)
}
func (o TunnelConfigurationPhase1) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getTunnelConfigurationPhase1GetDhGroupsAttributeTypeOk(o.DhGroups); ok {
toSerialize["DhGroups"] = val
}
if val, ok := getTunnelConfigurationPhase1GetEncryptionAlgorithmsAttributeTypeOk(o.EncryptionAlgorithms); ok {
toSerialize["EncryptionAlgorithms"] = val
}
if val, ok := getTunnelConfigurationPhase1GetIntegrityAlgorithmsAttributeTypeOk(o.IntegrityAlgorithms); ok {
toSerialize["IntegrityAlgorithms"] = val
}
if val, ok := getTunnelConfigurationPhase1GetRekeyTimeAttributeTypeOk(o.RekeyTime); ok {
toSerialize["RekeyTime"] = val
}
return toSerialize, nil
}
type NullableTunnelConfigurationPhase1 struct {
value *TunnelConfigurationPhase1
isSet bool
}
func (v NullableTunnelConfigurationPhase1) Get() *TunnelConfigurationPhase1 {
return v.value
}
func (v *NullableTunnelConfigurationPhase1) Set(val *TunnelConfigurationPhase1) {
v.value = val
v.isSet = true
}
func (v NullableTunnelConfigurationPhase1) IsSet() bool {
return v.isSet
}
func (v *NullableTunnelConfigurationPhase1) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTunnelConfigurationPhase1(val *TunnelConfigurationPhase1) *NullableTunnelConfigurationPhase1 {
return &NullableTunnelConfigurationPhase1{value: val, isSet: true}
}
func (v NullableTunnelConfigurationPhase1) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTunnelConfigurationPhase1) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,131 @@
/*
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 TunnelConfigurationPhase1AllOf type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TunnelConfigurationPhase1AllOf{}
/*
types and functions for rekeyTime
*/
// isInteger
type TunnelConfigurationPhase1AllOfGetRekeyTimeAttributeType = *int64
type TunnelConfigurationPhase1AllOfGetRekeyTimeArgType = int64
type TunnelConfigurationPhase1AllOfGetRekeyTimeRetType = int64
func getTunnelConfigurationPhase1AllOfGetRekeyTimeAttributeTypeOk(arg TunnelConfigurationPhase1AllOfGetRekeyTimeAttributeType) (ret TunnelConfigurationPhase1AllOfGetRekeyTimeRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelConfigurationPhase1AllOfGetRekeyTimeAttributeType(arg *TunnelConfigurationPhase1AllOfGetRekeyTimeAttributeType, val TunnelConfigurationPhase1AllOfGetRekeyTimeRetType) {
*arg = &val
}
// TunnelConfigurationPhase1AllOf struct for TunnelConfigurationPhase1AllOf
type TunnelConfigurationPhase1AllOf struct {
// Time to schedule a IKE re-keying (in seconds).
// Can be cast to int32 without loss of precision.
RekeyTime TunnelConfigurationPhase1AllOfGetRekeyTimeAttributeType `json:"rekeyTime,omitempty"`
}
// NewTunnelConfigurationPhase1AllOf instantiates a new TunnelConfigurationPhase1AllOf 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 NewTunnelConfigurationPhase1AllOf() *TunnelConfigurationPhase1AllOf {
this := TunnelConfigurationPhase1AllOf{}
return &this
}
// NewTunnelConfigurationPhase1AllOfWithDefaults instantiates a new TunnelConfigurationPhase1AllOf 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 NewTunnelConfigurationPhase1AllOfWithDefaults() *TunnelConfigurationPhase1AllOf {
this := TunnelConfigurationPhase1AllOf{}
var rekeyTime int64 = 14400
this.RekeyTime = &rekeyTime
return &this
}
// GetRekeyTime returns the RekeyTime field value if set, zero value otherwise.
func (o *TunnelConfigurationPhase1AllOf) GetRekeyTime() (res TunnelConfigurationPhase1AllOfGetRekeyTimeRetType) {
res, _ = o.GetRekeyTimeOk()
return
}
// GetRekeyTimeOk returns a tuple with the RekeyTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TunnelConfigurationPhase1AllOf) GetRekeyTimeOk() (ret TunnelConfigurationPhase1AllOfGetRekeyTimeRetType, ok bool) {
return getTunnelConfigurationPhase1AllOfGetRekeyTimeAttributeTypeOk(o.RekeyTime)
}
// HasRekeyTime returns a boolean if a field has been set.
func (o *TunnelConfigurationPhase1AllOf) HasRekeyTime() bool {
_, ok := o.GetRekeyTimeOk()
return ok
}
// SetRekeyTime gets a reference to the given int64 and assigns it to the RekeyTime field.
func (o *TunnelConfigurationPhase1AllOf) SetRekeyTime(v TunnelConfigurationPhase1AllOfGetRekeyTimeRetType) {
setTunnelConfigurationPhase1AllOfGetRekeyTimeAttributeType(&o.RekeyTime, v)
}
func (o TunnelConfigurationPhase1AllOf) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getTunnelConfigurationPhase1AllOfGetRekeyTimeAttributeTypeOk(o.RekeyTime); ok {
toSerialize["RekeyTime"] = val
}
return toSerialize, nil
}
type NullableTunnelConfigurationPhase1AllOf struct {
value *TunnelConfigurationPhase1AllOf
isSet bool
}
func (v NullableTunnelConfigurationPhase1AllOf) Get() *TunnelConfigurationPhase1AllOf {
return v.value
}
func (v *NullableTunnelConfigurationPhase1AllOf) Set(val *TunnelConfigurationPhase1AllOf) {
v.value = val
v.isSet = true
}
func (v NullableTunnelConfigurationPhase1AllOf) IsSet() bool {
return v.isSet
}
func (v *NullableTunnelConfigurationPhase1AllOf) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTunnelConfigurationPhase1AllOf(val *TunnelConfigurationPhase1AllOf) *NullableTunnelConfigurationPhase1AllOf {
return &NullableTunnelConfigurationPhase1AllOf{value: val, isSet: true}
}
func (v NullableTunnelConfigurationPhase1AllOf) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTunnelConfigurationPhase1AllOf) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,582 @@
/*
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"
"fmt"
)
// checks if the TunnelConfigurationPhase2 type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TunnelConfigurationPhase2{}
/*
types and functions for dhGroups
*/
// isArray
type TunnelConfigurationPhase2GetDhGroupsAttributeType = *[]string
type TunnelConfigurationPhase2GetDhGroupsArgType = []string
type TunnelConfigurationPhase2GetDhGroupsRetType = []string
func getTunnelConfigurationPhase2GetDhGroupsAttributeTypeOk(arg TunnelConfigurationPhase2GetDhGroupsAttributeType) (ret TunnelConfigurationPhase2GetDhGroupsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelConfigurationPhase2GetDhGroupsAttributeType(arg *TunnelConfigurationPhase2GetDhGroupsAttributeType, val TunnelConfigurationPhase2GetDhGroupsRetType) {
*arg = &val
}
/*
types and functions for encryptionAlgorithms
*/
// isArray
type TunnelConfigurationPhase2GetEncryptionAlgorithmsAttributeType = *[]string
type TunnelConfigurationPhase2GetEncryptionAlgorithmsArgType = []string
type TunnelConfigurationPhase2GetEncryptionAlgorithmsRetType = []string
func getTunnelConfigurationPhase2GetEncryptionAlgorithmsAttributeTypeOk(arg TunnelConfigurationPhase2GetEncryptionAlgorithmsAttributeType) (ret TunnelConfigurationPhase2GetEncryptionAlgorithmsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelConfigurationPhase2GetEncryptionAlgorithmsAttributeType(arg *TunnelConfigurationPhase2GetEncryptionAlgorithmsAttributeType, val TunnelConfigurationPhase2GetEncryptionAlgorithmsRetType) {
*arg = &val
}
/*
types and functions for integrityAlgorithms
*/
// isArray
type TunnelConfigurationPhase2GetIntegrityAlgorithmsAttributeType = *[]string
type TunnelConfigurationPhase2GetIntegrityAlgorithmsArgType = []string
type TunnelConfigurationPhase2GetIntegrityAlgorithmsRetType = []string
func getTunnelConfigurationPhase2GetIntegrityAlgorithmsAttributeTypeOk(arg TunnelConfigurationPhase2GetIntegrityAlgorithmsAttributeType) (ret TunnelConfigurationPhase2GetIntegrityAlgorithmsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelConfigurationPhase2GetIntegrityAlgorithmsAttributeType(arg *TunnelConfigurationPhase2GetIntegrityAlgorithmsAttributeType, val TunnelConfigurationPhase2GetIntegrityAlgorithmsRetType) {
*arg = &val
}
/*
types and functions for dpdAction
*/
// isEnum
// TunnelConfigurationPhase2DpdAction Action to perform for this CHILD_SA on DPD timeout. \"clear\": Closes the CHILD_SA and does not take further action. \"trap\": installs a trap policy which will catch matching traffic and tries to re-negotiate the tunnel on-demand). \"restart\": immediately tries to re-negotiate the CILD_SA under a fresh IKE_SA.
// value type for enums
type TunnelConfigurationPhase2DpdAction string
// List of DpdAction
const (
TUNNELCONFIGURATIONPHASE2DPD_ACTION_CLEAR TunnelConfigurationPhase2DpdAction = "clear"
TUNNELCONFIGURATIONPHASE2DPD_ACTION_TRAP TunnelConfigurationPhase2DpdAction = "trap"
TUNNELCONFIGURATIONPHASE2DPD_ACTION_RESTART TunnelConfigurationPhase2DpdAction = "restart"
)
// All allowed values of TunnelConfigurationPhase2 enum
var AllowedTunnelConfigurationPhase2DpdActionEnumValues = []TunnelConfigurationPhase2DpdAction{
"clear",
"trap",
"restart",
}
func (v *TunnelConfigurationPhase2DpdAction) UnmarshalJSON(src []byte) error {
// use a type alias to prevent infinite recursion during unmarshal,
// see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers
type TmpJson TunnelConfigurationPhase2DpdAction
var value TmpJson
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
// Allow unmarshalling zero value for testing purposes
var zeroValue TmpJson
if value == zeroValue {
return nil
}
enumTypeValue := TunnelConfigurationPhase2DpdAction(value)
for _, existing := range AllowedTunnelConfigurationPhase2DpdActionEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid TunnelConfigurationPhase2", value)
}
// NewTunnelConfigurationPhase2DpdActionFromValue returns a pointer to a valid TunnelConfigurationPhase2DpdAction
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewTunnelConfigurationPhase2DpdActionFromValue(v TunnelConfigurationPhase2DpdAction) (*TunnelConfigurationPhase2DpdAction, error) {
ev := TunnelConfigurationPhase2DpdAction(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for TunnelConfigurationPhase2DpdAction: valid values are %v", v, AllowedTunnelConfigurationPhase2DpdActionEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v TunnelConfigurationPhase2DpdAction) IsValid() bool {
for _, existing := range AllowedTunnelConfigurationPhase2DpdActionEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to DpdActionDpdAction value
func (v TunnelConfigurationPhase2DpdAction) Ptr() *TunnelConfigurationPhase2DpdAction {
return &v
}
type NullableTunnelConfigurationPhase2DpdAction struct {
value *TunnelConfigurationPhase2DpdAction
isSet bool
}
func (v NullableTunnelConfigurationPhase2DpdAction) Get() *TunnelConfigurationPhase2DpdAction {
return v.value
}
func (v *NullableTunnelConfigurationPhase2DpdAction) Set(val *TunnelConfigurationPhase2DpdAction) {
v.value = val
v.isSet = true
}
func (v NullableTunnelConfigurationPhase2DpdAction) IsSet() bool {
return v.isSet
}
func (v *NullableTunnelConfigurationPhase2DpdAction) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTunnelConfigurationPhase2DpdAction(val *TunnelConfigurationPhase2DpdAction) *NullableTunnelConfigurationPhase2DpdAction {
return &NullableTunnelConfigurationPhase2DpdAction{value: val, isSet: true}
}
func (v NullableTunnelConfigurationPhase2DpdAction) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTunnelConfigurationPhase2DpdAction) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type TunnelConfigurationPhase2GetDpdActionAttributeType = *TunnelConfigurationPhase2DpdAction
type TunnelConfigurationPhase2GetDpdActionArgType = TunnelConfigurationPhase2DpdAction
type TunnelConfigurationPhase2GetDpdActionRetType = TunnelConfigurationPhase2DpdAction
func getTunnelConfigurationPhase2GetDpdActionAttributeTypeOk(arg TunnelConfigurationPhase2GetDpdActionAttributeType) (ret TunnelConfigurationPhase2GetDpdActionRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelConfigurationPhase2GetDpdActionAttributeType(arg *TunnelConfigurationPhase2GetDpdActionAttributeType, val TunnelConfigurationPhase2GetDpdActionRetType) {
*arg = &val
}
/*
types and functions for rekeyTime
*/
// isInteger
type TunnelConfigurationPhase2GetRekeyTimeAttributeType = *int64
type TunnelConfigurationPhase2GetRekeyTimeArgType = int64
type TunnelConfigurationPhase2GetRekeyTimeRetType = int64
func getTunnelConfigurationPhase2GetRekeyTimeAttributeTypeOk(arg TunnelConfigurationPhase2GetRekeyTimeAttributeType) (ret TunnelConfigurationPhase2GetRekeyTimeRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelConfigurationPhase2GetRekeyTimeAttributeType(arg *TunnelConfigurationPhase2GetRekeyTimeAttributeType, val TunnelConfigurationPhase2GetRekeyTimeRetType) {
*arg = &val
}
/*
types and functions for startAction
*/
// isEnum
// TunnelConfigurationPhase2StartAction Action to perform after loading the connection configuration. \"none\": The connection will be loaded but needs to be manually initiated. \"trap\": installs a trap policy which triggers the tunnel as soon as matching traffic has been detected. \"start\": initiates the connection actively. \"start|stop\": Immediately initiate a connection for which trap policies have been installed.
// value type for enums
type TunnelConfigurationPhase2StartAction string
// List of StartAction
const (
TUNNELCONFIGURATIONPHASE2START_ACTION_NONE TunnelConfigurationPhase2StartAction = "none"
TUNNELCONFIGURATIONPHASE2START_ACTION_TRAP TunnelConfigurationPhase2StartAction = "trap"
TUNNELCONFIGURATIONPHASE2START_ACTION_START TunnelConfigurationPhase2StartAction = "start"
TUNNELCONFIGURATIONPHASE2START_ACTION_TRAP_START TunnelConfigurationPhase2StartAction = "trap|start"
)
// All allowed values of TunnelConfigurationPhase2 enum
var AllowedTunnelConfigurationPhase2StartActionEnumValues = []TunnelConfigurationPhase2StartAction{
"none",
"trap",
"start",
"trap|start",
}
func (v *TunnelConfigurationPhase2StartAction) UnmarshalJSON(src []byte) error {
// use a type alias to prevent infinite recursion during unmarshal,
// see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers
type TmpJson TunnelConfigurationPhase2StartAction
var value TmpJson
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
// Allow unmarshalling zero value for testing purposes
var zeroValue TmpJson
if value == zeroValue {
return nil
}
enumTypeValue := TunnelConfigurationPhase2StartAction(value)
for _, existing := range AllowedTunnelConfigurationPhase2StartActionEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid TunnelConfigurationPhase2", value)
}
// NewTunnelConfigurationPhase2StartActionFromValue returns a pointer to a valid TunnelConfigurationPhase2StartAction
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewTunnelConfigurationPhase2StartActionFromValue(v TunnelConfigurationPhase2StartAction) (*TunnelConfigurationPhase2StartAction, error) {
ev := TunnelConfigurationPhase2StartAction(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for TunnelConfigurationPhase2StartAction: valid values are %v", v, AllowedTunnelConfigurationPhase2StartActionEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v TunnelConfigurationPhase2StartAction) IsValid() bool {
for _, existing := range AllowedTunnelConfigurationPhase2StartActionEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to StartActionStartAction value
func (v TunnelConfigurationPhase2StartAction) Ptr() *TunnelConfigurationPhase2StartAction {
return &v
}
type NullableTunnelConfigurationPhase2StartAction struct {
value *TunnelConfigurationPhase2StartAction
isSet bool
}
func (v NullableTunnelConfigurationPhase2StartAction) Get() *TunnelConfigurationPhase2StartAction {
return v.value
}
func (v *NullableTunnelConfigurationPhase2StartAction) Set(val *TunnelConfigurationPhase2StartAction) {
v.value = val
v.isSet = true
}
func (v NullableTunnelConfigurationPhase2StartAction) IsSet() bool {
return v.isSet
}
func (v *NullableTunnelConfigurationPhase2StartAction) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTunnelConfigurationPhase2StartAction(val *TunnelConfigurationPhase2StartAction) *NullableTunnelConfigurationPhase2StartAction {
return &NullableTunnelConfigurationPhase2StartAction{value: val, isSet: true}
}
func (v NullableTunnelConfigurationPhase2StartAction) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTunnelConfigurationPhase2StartAction) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type TunnelConfigurationPhase2GetStartActionAttributeType = *TunnelConfigurationPhase2StartAction
type TunnelConfigurationPhase2GetStartActionArgType = TunnelConfigurationPhase2StartAction
type TunnelConfigurationPhase2GetStartActionRetType = TunnelConfigurationPhase2StartAction
func getTunnelConfigurationPhase2GetStartActionAttributeTypeOk(arg TunnelConfigurationPhase2GetStartActionAttributeType) (ret TunnelConfigurationPhase2GetStartActionRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelConfigurationPhase2GetStartActionAttributeType(arg *TunnelConfigurationPhase2GetStartActionAttributeType, val TunnelConfigurationPhase2GetStartActionRetType) {
*arg = &val
}
// TunnelConfigurationPhase2 struct for TunnelConfigurationPhase2
type TunnelConfigurationPhase2 struct {
// The Diffie-Hellman Group. Required, except if AEAD algorithms are selected.
DhGroups TunnelConfigurationPhase2GetDhGroupsAttributeType `json:"dhGroups,omitempty"`
// REQUIRED
EncryptionAlgorithms TunnelConfigurationPhase2GetEncryptionAlgorithmsAttributeType `json:"encryptionAlgorithms" required:"true"`
// REQUIRED
IntegrityAlgorithms TunnelConfigurationPhase2GetIntegrityAlgorithmsAttributeType `json:"integrityAlgorithms" required:"true"`
// Action to perform for this CHILD_SA on DPD timeout. \"clear\": Closes the CHILD_SA and does not take further action. \"trap\": installs a trap policy which will catch matching traffic and tries to re-negotiate the tunnel on-demand). \"restart\": immediately tries to re-negotiate the CILD_SA under a fresh IKE_SA.
DpdAction TunnelConfigurationPhase2GetDpdActionAttributeType `json:"dpdAction,omitempty"`
// Time to schedule a Child SA re-keying (in seconds).
// Can be cast to int32 without loss of precision.
RekeyTime TunnelConfigurationPhase2GetRekeyTimeAttributeType `json:"rekeyTime,omitempty"`
// Action to perform after loading the connection configuration. \"none\": The connection will be loaded but needs to be manually initiated. \"trap\": installs a trap policy which triggers the tunnel as soon as matching traffic has been detected. \"start\": initiates the connection actively. \"start|stop\": Immediately initiate a connection for which trap policies have been installed.
StartAction TunnelConfigurationPhase2GetStartActionAttributeType `json:"startAction,omitempty"`
}
type _TunnelConfigurationPhase2 TunnelConfigurationPhase2
// NewTunnelConfigurationPhase2 instantiates a new TunnelConfigurationPhase2 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 NewTunnelConfigurationPhase2(encryptionAlgorithms TunnelConfigurationPhase2GetEncryptionAlgorithmsArgType, integrityAlgorithms TunnelConfigurationPhase2GetIntegrityAlgorithmsArgType) *TunnelConfigurationPhase2 {
this := TunnelConfigurationPhase2{}
setTunnelConfigurationPhase2GetEncryptionAlgorithmsAttributeType(&this.EncryptionAlgorithms, encryptionAlgorithms)
setTunnelConfigurationPhase2GetIntegrityAlgorithmsAttributeType(&this.IntegrityAlgorithms, integrityAlgorithms)
return &this
}
// NewTunnelConfigurationPhase2WithDefaults instantiates a new TunnelConfigurationPhase2 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 NewTunnelConfigurationPhase2WithDefaults() *TunnelConfigurationPhase2 {
this := TunnelConfigurationPhase2{}
var dpdAction TunnelConfigurationPhase2DpdAction = "restart"
this.DpdAction = &dpdAction
var rekeyTime int64 = 3600
this.RekeyTime = &rekeyTime
var startAction TunnelConfigurationPhase2StartAction = "start"
this.StartAction = &startAction
return &this
}
// GetDhGroups returns the DhGroups field value if set, zero value otherwise.
func (o *TunnelConfigurationPhase2) GetDhGroups() (res TunnelConfigurationPhase2GetDhGroupsRetType) {
res, _ = o.GetDhGroupsOk()
return
}
// GetDhGroupsOk returns a tuple with the DhGroups field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TunnelConfigurationPhase2) GetDhGroupsOk() (ret TunnelConfigurationPhase2GetDhGroupsRetType, ok bool) {
return getTunnelConfigurationPhase2GetDhGroupsAttributeTypeOk(o.DhGroups)
}
// HasDhGroups returns a boolean if a field has been set.
func (o *TunnelConfigurationPhase2) HasDhGroups() bool {
_, ok := o.GetDhGroupsOk()
return ok
}
// SetDhGroups gets a reference to the given []string and assigns it to the DhGroups field.
func (o *TunnelConfigurationPhase2) SetDhGroups(v TunnelConfigurationPhase2GetDhGroupsRetType) {
setTunnelConfigurationPhase2GetDhGroupsAttributeType(&o.DhGroups, v)
}
// GetEncryptionAlgorithms returns the EncryptionAlgorithms field value
func (o *TunnelConfigurationPhase2) GetEncryptionAlgorithms() (ret TunnelConfigurationPhase2GetEncryptionAlgorithmsRetType) {
ret, _ = o.GetEncryptionAlgorithmsOk()
return ret
}
// GetEncryptionAlgorithmsOk returns a tuple with the EncryptionAlgorithms field value
// and a boolean to check if the value has been set.
func (o *TunnelConfigurationPhase2) GetEncryptionAlgorithmsOk() (ret TunnelConfigurationPhase2GetEncryptionAlgorithmsRetType, ok bool) {
return getTunnelConfigurationPhase2GetEncryptionAlgorithmsAttributeTypeOk(o.EncryptionAlgorithms)
}
// SetEncryptionAlgorithms sets field value
func (o *TunnelConfigurationPhase2) SetEncryptionAlgorithms(v TunnelConfigurationPhase2GetEncryptionAlgorithmsRetType) {
setTunnelConfigurationPhase2GetEncryptionAlgorithmsAttributeType(&o.EncryptionAlgorithms, v)
}
// GetIntegrityAlgorithms returns the IntegrityAlgorithms field value
func (o *TunnelConfigurationPhase2) GetIntegrityAlgorithms() (ret TunnelConfigurationPhase2GetIntegrityAlgorithmsRetType) {
ret, _ = o.GetIntegrityAlgorithmsOk()
return ret
}
// GetIntegrityAlgorithmsOk returns a tuple with the IntegrityAlgorithms field value
// and a boolean to check if the value has been set.
func (o *TunnelConfigurationPhase2) GetIntegrityAlgorithmsOk() (ret TunnelConfigurationPhase2GetIntegrityAlgorithmsRetType, ok bool) {
return getTunnelConfigurationPhase2GetIntegrityAlgorithmsAttributeTypeOk(o.IntegrityAlgorithms)
}
// SetIntegrityAlgorithms sets field value
func (o *TunnelConfigurationPhase2) SetIntegrityAlgorithms(v TunnelConfigurationPhase2GetIntegrityAlgorithmsRetType) {
setTunnelConfigurationPhase2GetIntegrityAlgorithmsAttributeType(&o.IntegrityAlgorithms, v)
}
// GetDpdAction returns the DpdAction field value if set, zero value otherwise.
func (o *TunnelConfigurationPhase2) GetDpdAction() (res TunnelConfigurationPhase2GetDpdActionRetType) {
res, _ = o.GetDpdActionOk()
return
}
// GetDpdActionOk returns a tuple with the DpdAction field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TunnelConfigurationPhase2) GetDpdActionOk() (ret TunnelConfigurationPhase2GetDpdActionRetType, ok bool) {
return getTunnelConfigurationPhase2GetDpdActionAttributeTypeOk(o.DpdAction)
}
// HasDpdAction returns a boolean if a field has been set.
func (o *TunnelConfigurationPhase2) HasDpdAction() bool {
_, ok := o.GetDpdActionOk()
return ok
}
// SetDpdAction gets a reference to the given string and assigns it to the DpdAction field.
func (o *TunnelConfigurationPhase2) SetDpdAction(v TunnelConfigurationPhase2GetDpdActionRetType) {
setTunnelConfigurationPhase2GetDpdActionAttributeType(&o.DpdAction, v)
}
// GetRekeyTime returns the RekeyTime field value if set, zero value otherwise.
func (o *TunnelConfigurationPhase2) GetRekeyTime() (res TunnelConfigurationPhase2GetRekeyTimeRetType) {
res, _ = o.GetRekeyTimeOk()
return
}
// GetRekeyTimeOk returns a tuple with the RekeyTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TunnelConfigurationPhase2) GetRekeyTimeOk() (ret TunnelConfigurationPhase2GetRekeyTimeRetType, ok bool) {
return getTunnelConfigurationPhase2GetRekeyTimeAttributeTypeOk(o.RekeyTime)
}
// HasRekeyTime returns a boolean if a field has been set.
func (o *TunnelConfigurationPhase2) HasRekeyTime() bool {
_, ok := o.GetRekeyTimeOk()
return ok
}
// SetRekeyTime gets a reference to the given int64 and assigns it to the RekeyTime field.
func (o *TunnelConfigurationPhase2) SetRekeyTime(v TunnelConfigurationPhase2GetRekeyTimeRetType) {
setTunnelConfigurationPhase2GetRekeyTimeAttributeType(&o.RekeyTime, v)
}
// GetStartAction returns the StartAction field value if set, zero value otherwise.
func (o *TunnelConfigurationPhase2) GetStartAction() (res TunnelConfigurationPhase2GetStartActionRetType) {
res, _ = o.GetStartActionOk()
return
}
// GetStartActionOk returns a tuple with the StartAction field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TunnelConfigurationPhase2) GetStartActionOk() (ret TunnelConfigurationPhase2GetStartActionRetType, ok bool) {
return getTunnelConfigurationPhase2GetStartActionAttributeTypeOk(o.StartAction)
}
// HasStartAction returns a boolean if a field has been set.
func (o *TunnelConfigurationPhase2) HasStartAction() bool {
_, ok := o.GetStartActionOk()
return ok
}
// SetStartAction gets a reference to the given string and assigns it to the StartAction field.
func (o *TunnelConfigurationPhase2) SetStartAction(v TunnelConfigurationPhase2GetStartActionRetType) {
setTunnelConfigurationPhase2GetStartActionAttributeType(&o.StartAction, v)
}
func (o TunnelConfigurationPhase2) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getTunnelConfigurationPhase2GetDhGroupsAttributeTypeOk(o.DhGroups); ok {
toSerialize["DhGroups"] = val
}
if val, ok := getTunnelConfigurationPhase2GetEncryptionAlgorithmsAttributeTypeOk(o.EncryptionAlgorithms); ok {
toSerialize["EncryptionAlgorithms"] = val
}
if val, ok := getTunnelConfigurationPhase2GetIntegrityAlgorithmsAttributeTypeOk(o.IntegrityAlgorithms); ok {
toSerialize["IntegrityAlgorithms"] = val
}
if val, ok := getTunnelConfigurationPhase2GetDpdActionAttributeTypeOk(o.DpdAction); ok {
toSerialize["DpdAction"] = val
}
if val, ok := getTunnelConfigurationPhase2GetRekeyTimeAttributeTypeOk(o.RekeyTime); ok {
toSerialize["RekeyTime"] = val
}
if val, ok := getTunnelConfigurationPhase2GetStartActionAttributeTypeOk(o.StartAction); ok {
toSerialize["StartAction"] = val
}
return toSerialize, nil
}
type NullableTunnelConfigurationPhase2 struct {
value *TunnelConfigurationPhase2
isSet bool
}
func (v NullableTunnelConfigurationPhase2) Get() *TunnelConfigurationPhase2 {
return v.value
}
func (v *NullableTunnelConfigurationPhase2) Set(val *TunnelConfigurationPhase2) {
v.value = val
v.isSet = true
}
func (v NullableTunnelConfigurationPhase2) IsSet() bool {
return v.isSet
}
func (v *NullableTunnelConfigurationPhase2) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTunnelConfigurationPhase2(val *TunnelConfigurationPhase2) *NullableTunnelConfigurationPhase2 {
return &NullableTunnelConfigurationPhase2{value: val, isSet: true}
}
func (v NullableTunnelConfigurationPhase2) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTunnelConfigurationPhase2) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,446 @@
/*
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"
"fmt"
)
// checks if the TunnelConfigurationPhase2AllOf type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TunnelConfigurationPhase2AllOf{}
/*
types and functions for dpdAction
*/
// isEnum
// TunnelConfigurationPhase2AllOfDpdAction Action to perform for this CHILD_SA on DPD timeout. \"clear\": Closes the CHILD_SA and does not take further action. \"trap\": installs a trap policy which will catch matching traffic and tries to re-negotiate the tunnel on-demand). \"restart\": immediately tries to re-negotiate the CILD_SA under a fresh IKE_SA.
// value type for enums
type TunnelConfigurationPhase2AllOfDpdAction string
// List of DpdAction
const (
TUNNELCONFIGURATIONPHASE2ALLOFDPD_ACTION_CLEAR TunnelConfigurationPhase2AllOfDpdAction = "clear"
TUNNELCONFIGURATIONPHASE2ALLOFDPD_ACTION_TRAP TunnelConfigurationPhase2AllOfDpdAction = "trap"
TUNNELCONFIGURATIONPHASE2ALLOFDPD_ACTION_RESTART TunnelConfigurationPhase2AllOfDpdAction = "restart"
)
// All allowed values of TunnelConfigurationPhase2AllOf enum
var AllowedTunnelConfigurationPhase2AllOfDpdActionEnumValues = []TunnelConfigurationPhase2AllOfDpdAction{
"clear",
"trap",
"restart",
}
func (v *TunnelConfigurationPhase2AllOfDpdAction) UnmarshalJSON(src []byte) error {
// use a type alias to prevent infinite recursion during unmarshal,
// see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers
type TmpJson TunnelConfigurationPhase2AllOfDpdAction
var value TmpJson
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
// Allow unmarshalling zero value for testing purposes
var zeroValue TmpJson
if value == zeroValue {
return nil
}
enumTypeValue := TunnelConfigurationPhase2AllOfDpdAction(value)
for _, existing := range AllowedTunnelConfigurationPhase2AllOfDpdActionEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid TunnelConfigurationPhase2AllOf", value)
}
// NewTunnelConfigurationPhase2AllOfDpdActionFromValue returns a pointer to a valid TunnelConfigurationPhase2AllOfDpdAction
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewTunnelConfigurationPhase2AllOfDpdActionFromValue(v TunnelConfigurationPhase2AllOfDpdAction) (*TunnelConfigurationPhase2AllOfDpdAction, error) {
ev := TunnelConfigurationPhase2AllOfDpdAction(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for TunnelConfigurationPhase2AllOfDpdAction: valid values are %v", v, AllowedTunnelConfigurationPhase2AllOfDpdActionEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v TunnelConfigurationPhase2AllOfDpdAction) IsValid() bool {
for _, existing := range AllowedTunnelConfigurationPhase2AllOfDpdActionEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to DpdActionDpdAction value
func (v TunnelConfigurationPhase2AllOfDpdAction) Ptr() *TunnelConfigurationPhase2AllOfDpdAction {
return &v
}
type NullableTunnelConfigurationPhase2AllOfDpdAction struct {
value *TunnelConfigurationPhase2AllOfDpdAction
isSet bool
}
func (v NullableTunnelConfigurationPhase2AllOfDpdAction) Get() *TunnelConfigurationPhase2AllOfDpdAction {
return v.value
}
func (v *NullableTunnelConfigurationPhase2AllOfDpdAction) Set(val *TunnelConfigurationPhase2AllOfDpdAction) {
v.value = val
v.isSet = true
}
func (v NullableTunnelConfigurationPhase2AllOfDpdAction) IsSet() bool {
return v.isSet
}
func (v *NullableTunnelConfigurationPhase2AllOfDpdAction) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTunnelConfigurationPhase2AllOfDpdAction(val *TunnelConfigurationPhase2AllOfDpdAction) *NullableTunnelConfigurationPhase2AllOfDpdAction {
return &NullableTunnelConfigurationPhase2AllOfDpdAction{value: val, isSet: true}
}
func (v NullableTunnelConfigurationPhase2AllOfDpdAction) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTunnelConfigurationPhase2AllOfDpdAction) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type TunnelConfigurationPhase2AllOfGetDpdActionAttributeType = *TunnelConfigurationPhase2AllOfDpdAction
type TunnelConfigurationPhase2AllOfGetDpdActionArgType = TunnelConfigurationPhase2AllOfDpdAction
type TunnelConfigurationPhase2AllOfGetDpdActionRetType = TunnelConfigurationPhase2AllOfDpdAction
func getTunnelConfigurationPhase2AllOfGetDpdActionAttributeTypeOk(arg TunnelConfigurationPhase2AllOfGetDpdActionAttributeType) (ret TunnelConfigurationPhase2AllOfGetDpdActionRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelConfigurationPhase2AllOfGetDpdActionAttributeType(arg *TunnelConfigurationPhase2AllOfGetDpdActionAttributeType, val TunnelConfigurationPhase2AllOfGetDpdActionRetType) {
*arg = &val
}
/*
types and functions for rekeyTime
*/
// isInteger
type TunnelConfigurationPhase2AllOfGetRekeyTimeAttributeType = *int64
type TunnelConfigurationPhase2AllOfGetRekeyTimeArgType = int64
type TunnelConfigurationPhase2AllOfGetRekeyTimeRetType = int64
func getTunnelConfigurationPhase2AllOfGetRekeyTimeAttributeTypeOk(arg TunnelConfigurationPhase2AllOfGetRekeyTimeAttributeType) (ret TunnelConfigurationPhase2AllOfGetRekeyTimeRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelConfigurationPhase2AllOfGetRekeyTimeAttributeType(arg *TunnelConfigurationPhase2AllOfGetRekeyTimeAttributeType, val TunnelConfigurationPhase2AllOfGetRekeyTimeRetType) {
*arg = &val
}
/*
types and functions for startAction
*/
// isEnum
// TunnelConfigurationPhase2AllOfStartAction Action to perform after loading the connection configuration. \"none\": The connection will be loaded but needs to be manually initiated. \"trap\": installs a trap policy which triggers the tunnel as soon as matching traffic has been detected. \"start\": initiates the connection actively. \"start|stop\": Immediately initiate a connection for which trap policies have been installed.
// value type for enums
type TunnelConfigurationPhase2AllOfStartAction string
// List of StartAction
const (
TUNNELCONFIGURATIONPHASE2ALLOFSTART_ACTION_NONE TunnelConfigurationPhase2AllOfStartAction = "none"
TUNNELCONFIGURATIONPHASE2ALLOFSTART_ACTION_TRAP TunnelConfigurationPhase2AllOfStartAction = "trap"
TUNNELCONFIGURATIONPHASE2ALLOFSTART_ACTION_START TunnelConfigurationPhase2AllOfStartAction = "start"
TUNNELCONFIGURATIONPHASE2ALLOFSTART_ACTION_TRAP_START TunnelConfigurationPhase2AllOfStartAction = "trap|start"
)
// All allowed values of TunnelConfigurationPhase2AllOf enum
var AllowedTunnelConfigurationPhase2AllOfStartActionEnumValues = []TunnelConfigurationPhase2AllOfStartAction{
"none",
"trap",
"start",
"trap|start",
}
func (v *TunnelConfigurationPhase2AllOfStartAction) UnmarshalJSON(src []byte) error {
// use a type alias to prevent infinite recursion during unmarshal,
// see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers
type TmpJson TunnelConfigurationPhase2AllOfStartAction
var value TmpJson
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
// Allow unmarshalling zero value for testing purposes
var zeroValue TmpJson
if value == zeroValue {
return nil
}
enumTypeValue := TunnelConfigurationPhase2AllOfStartAction(value)
for _, existing := range AllowedTunnelConfigurationPhase2AllOfStartActionEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid TunnelConfigurationPhase2AllOf", value)
}
// NewTunnelConfigurationPhase2AllOfStartActionFromValue returns a pointer to a valid TunnelConfigurationPhase2AllOfStartAction
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewTunnelConfigurationPhase2AllOfStartActionFromValue(v TunnelConfigurationPhase2AllOfStartAction) (*TunnelConfigurationPhase2AllOfStartAction, error) {
ev := TunnelConfigurationPhase2AllOfStartAction(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for TunnelConfigurationPhase2AllOfStartAction: valid values are %v", v, AllowedTunnelConfigurationPhase2AllOfStartActionEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v TunnelConfigurationPhase2AllOfStartAction) IsValid() bool {
for _, existing := range AllowedTunnelConfigurationPhase2AllOfStartActionEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to StartActionStartAction value
func (v TunnelConfigurationPhase2AllOfStartAction) Ptr() *TunnelConfigurationPhase2AllOfStartAction {
return &v
}
type NullableTunnelConfigurationPhase2AllOfStartAction struct {
value *TunnelConfigurationPhase2AllOfStartAction
isSet bool
}
func (v NullableTunnelConfigurationPhase2AllOfStartAction) Get() *TunnelConfigurationPhase2AllOfStartAction {
return v.value
}
func (v *NullableTunnelConfigurationPhase2AllOfStartAction) Set(val *TunnelConfigurationPhase2AllOfStartAction) {
v.value = val
v.isSet = true
}
func (v NullableTunnelConfigurationPhase2AllOfStartAction) IsSet() bool {
return v.isSet
}
func (v *NullableTunnelConfigurationPhase2AllOfStartAction) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTunnelConfigurationPhase2AllOfStartAction(val *TunnelConfigurationPhase2AllOfStartAction) *NullableTunnelConfigurationPhase2AllOfStartAction {
return &NullableTunnelConfigurationPhase2AllOfStartAction{value: val, isSet: true}
}
func (v NullableTunnelConfigurationPhase2AllOfStartAction) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTunnelConfigurationPhase2AllOfStartAction) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type TunnelConfigurationPhase2AllOfGetStartActionAttributeType = *TunnelConfigurationPhase2AllOfStartAction
type TunnelConfigurationPhase2AllOfGetStartActionArgType = TunnelConfigurationPhase2AllOfStartAction
type TunnelConfigurationPhase2AllOfGetStartActionRetType = TunnelConfigurationPhase2AllOfStartAction
func getTunnelConfigurationPhase2AllOfGetStartActionAttributeTypeOk(arg TunnelConfigurationPhase2AllOfGetStartActionAttributeType) (ret TunnelConfigurationPhase2AllOfGetStartActionRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelConfigurationPhase2AllOfGetStartActionAttributeType(arg *TunnelConfigurationPhase2AllOfGetStartActionAttributeType, val TunnelConfigurationPhase2AllOfGetStartActionRetType) {
*arg = &val
}
// TunnelConfigurationPhase2AllOf struct for TunnelConfigurationPhase2AllOf
type TunnelConfigurationPhase2AllOf struct {
// Action to perform for this CHILD_SA on DPD timeout. \"clear\": Closes the CHILD_SA and does not take further action. \"trap\": installs a trap policy which will catch matching traffic and tries to re-negotiate the tunnel on-demand). \"restart\": immediately tries to re-negotiate the CILD_SA under a fresh IKE_SA.
DpdAction TunnelConfigurationPhase2AllOfGetDpdActionAttributeType `json:"dpdAction,omitempty"`
// Time to schedule a Child SA re-keying (in seconds).
// Can be cast to int32 without loss of precision.
RekeyTime TunnelConfigurationPhase2AllOfGetRekeyTimeAttributeType `json:"rekeyTime,omitempty"`
// Action to perform after loading the connection configuration. \"none\": The connection will be loaded but needs to be manually initiated. \"trap\": installs a trap policy which triggers the tunnel as soon as matching traffic has been detected. \"start\": initiates the connection actively. \"start|stop\": Immediately initiate a connection for which trap policies have been installed.
StartAction TunnelConfigurationPhase2AllOfGetStartActionAttributeType `json:"startAction,omitempty"`
}
// NewTunnelConfigurationPhase2AllOf instantiates a new TunnelConfigurationPhase2AllOf 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 NewTunnelConfigurationPhase2AllOf() *TunnelConfigurationPhase2AllOf {
this := TunnelConfigurationPhase2AllOf{}
return &this
}
// NewTunnelConfigurationPhase2AllOfWithDefaults instantiates a new TunnelConfigurationPhase2AllOf 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 NewTunnelConfigurationPhase2AllOfWithDefaults() *TunnelConfigurationPhase2AllOf {
this := TunnelConfigurationPhase2AllOf{}
var dpdAction TunnelConfigurationPhase2AllOfDpdAction = "restart"
this.DpdAction = &dpdAction
var rekeyTime int64 = 3600
this.RekeyTime = &rekeyTime
var startAction TunnelConfigurationPhase2AllOfStartAction = "start"
this.StartAction = &startAction
return &this
}
// GetDpdAction returns the DpdAction field value if set, zero value otherwise.
func (o *TunnelConfigurationPhase2AllOf) GetDpdAction() (res TunnelConfigurationPhase2AllOfGetDpdActionRetType) {
res, _ = o.GetDpdActionOk()
return
}
// GetDpdActionOk returns a tuple with the DpdAction field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TunnelConfigurationPhase2AllOf) GetDpdActionOk() (ret TunnelConfigurationPhase2AllOfGetDpdActionRetType, ok bool) {
return getTunnelConfigurationPhase2AllOfGetDpdActionAttributeTypeOk(o.DpdAction)
}
// HasDpdAction returns a boolean if a field has been set.
func (o *TunnelConfigurationPhase2AllOf) HasDpdAction() bool {
_, ok := o.GetDpdActionOk()
return ok
}
// SetDpdAction gets a reference to the given string and assigns it to the DpdAction field.
func (o *TunnelConfigurationPhase2AllOf) SetDpdAction(v TunnelConfigurationPhase2AllOfGetDpdActionRetType) {
setTunnelConfigurationPhase2AllOfGetDpdActionAttributeType(&o.DpdAction, v)
}
// GetRekeyTime returns the RekeyTime field value if set, zero value otherwise.
func (o *TunnelConfigurationPhase2AllOf) GetRekeyTime() (res TunnelConfigurationPhase2AllOfGetRekeyTimeRetType) {
res, _ = o.GetRekeyTimeOk()
return
}
// GetRekeyTimeOk returns a tuple with the RekeyTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TunnelConfigurationPhase2AllOf) GetRekeyTimeOk() (ret TunnelConfigurationPhase2AllOfGetRekeyTimeRetType, ok bool) {
return getTunnelConfigurationPhase2AllOfGetRekeyTimeAttributeTypeOk(o.RekeyTime)
}
// HasRekeyTime returns a boolean if a field has been set.
func (o *TunnelConfigurationPhase2AllOf) HasRekeyTime() bool {
_, ok := o.GetRekeyTimeOk()
return ok
}
// SetRekeyTime gets a reference to the given int64 and assigns it to the RekeyTime field.
func (o *TunnelConfigurationPhase2AllOf) SetRekeyTime(v TunnelConfigurationPhase2AllOfGetRekeyTimeRetType) {
setTunnelConfigurationPhase2AllOfGetRekeyTimeAttributeType(&o.RekeyTime, v)
}
// GetStartAction returns the StartAction field value if set, zero value otherwise.
func (o *TunnelConfigurationPhase2AllOf) GetStartAction() (res TunnelConfigurationPhase2AllOfGetStartActionRetType) {
res, _ = o.GetStartActionOk()
return
}
// GetStartActionOk returns a tuple with the StartAction field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TunnelConfigurationPhase2AllOf) GetStartActionOk() (ret TunnelConfigurationPhase2AllOfGetStartActionRetType, ok bool) {
return getTunnelConfigurationPhase2AllOfGetStartActionAttributeTypeOk(o.StartAction)
}
// HasStartAction returns a boolean if a field has been set.
func (o *TunnelConfigurationPhase2AllOf) HasStartAction() bool {
_, ok := o.GetStartActionOk()
return ok
}
// SetStartAction gets a reference to the given string and assigns it to the StartAction field.
func (o *TunnelConfigurationPhase2AllOf) SetStartAction(v TunnelConfigurationPhase2AllOfGetStartActionRetType) {
setTunnelConfigurationPhase2AllOfGetStartActionAttributeType(&o.StartAction, v)
}
func (o TunnelConfigurationPhase2AllOf) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getTunnelConfigurationPhase2AllOfGetDpdActionAttributeTypeOk(o.DpdAction); ok {
toSerialize["DpdAction"] = val
}
if val, ok := getTunnelConfigurationPhase2AllOfGetRekeyTimeAttributeTypeOk(o.RekeyTime); ok {
toSerialize["RekeyTime"] = val
}
if val, ok := getTunnelConfigurationPhase2AllOfGetStartActionAttributeTypeOk(o.StartAction); ok {
toSerialize["StartAction"] = val
}
return toSerialize, nil
}
type NullableTunnelConfigurationPhase2AllOf struct {
value *TunnelConfigurationPhase2AllOf
isSet bool
}
func (v NullableTunnelConfigurationPhase2AllOf) Get() *TunnelConfigurationPhase2AllOf {
return v.value
}
func (v *NullableTunnelConfigurationPhase2AllOf) Set(val *TunnelConfigurationPhase2AllOf) {
v.value = val
v.isSet = true
}
func (v NullableTunnelConfigurationPhase2AllOf) IsSet() bool {
return v.isSet
}
func (v *NullableTunnelConfigurationPhase2AllOf) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTunnelConfigurationPhase2AllOf(val *TunnelConfigurationPhase2AllOf) *NullableTunnelConfigurationPhase2AllOf {
return &NullableTunnelConfigurationPhase2AllOf{value: val, isSet: true}
}
func (v NullableTunnelConfigurationPhase2AllOf) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTunnelConfigurationPhase2AllOf) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,122 @@
/*
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 (
"testing"
)
// isEnum
func TestTunnelConfigurationPhase2AllOfDpdAction_UnmarshalJSON(t *testing.T) {
type args struct {
src []byte
}
tests := []struct {
name string
args args
wantErr bool
}{
{
name: `success - possible enum value no. 1`,
args: args{
src: []byte(`"clear"`),
},
wantErr: false,
},
{
name: `success - possible enum value no. 2`,
args: args{
src: []byte(`"trap"`),
},
wantErr: false,
},
{
name: `success - possible enum value no. 3`,
args: args{
src: []byte(`"restart"`),
},
wantErr: false,
},
{
name: "fail",
args: args{
src: []byte("\"FOOBAR\""),
},
wantErr: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
v := TunnelConfigurationPhase2AllOfDpdAction("")
if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr {
t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}
// isEnum
func TestTunnelConfigurationPhase2AllOfStartAction_UnmarshalJSON(t *testing.T) {
type args struct {
src []byte
}
tests := []struct {
name string
args args
wantErr bool
}{
{
name: `success - possible enum value no. 1`,
args: args{
src: []byte(`"none"`),
},
wantErr: false,
},
{
name: `success - possible enum value no. 2`,
args: args{
src: []byte(`"trap"`),
},
wantErr: false,
},
{
name: `success - possible enum value no. 3`,
args: args{
src: []byte(`"start"`),
},
wantErr: false,
},
{
name: `success - possible enum value no. 4`,
args: args{
src: []byte(`"trap|start"`),
},
wantErr: false,
},
{
name: "fail",
args: args{
src: []byte("\"FOOBAR\""),
},
wantErr: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
v := TunnelConfigurationPhase2AllOfStartAction("")
if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr {
t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}

View file

@ -0,0 +1,122 @@
/*
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 (
"testing"
)
// isEnum
func TestTunnelConfigurationPhase2DpdAction_UnmarshalJSON(t *testing.T) {
type args struct {
src []byte
}
tests := []struct {
name string
args args
wantErr bool
}{
{
name: `success - possible enum value no. 1`,
args: args{
src: []byte(`"clear"`),
},
wantErr: false,
},
{
name: `success - possible enum value no. 2`,
args: args{
src: []byte(`"trap"`),
},
wantErr: false,
},
{
name: `success - possible enum value no. 3`,
args: args{
src: []byte(`"restart"`),
},
wantErr: false,
},
{
name: "fail",
args: args{
src: []byte("\"FOOBAR\""),
},
wantErr: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
v := TunnelConfigurationPhase2DpdAction("")
if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr {
t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}
// isEnum
func TestTunnelConfigurationPhase2StartAction_UnmarshalJSON(t *testing.T) {
type args struct {
src []byte
}
tests := []struct {
name string
args args
wantErr bool
}{
{
name: `success - possible enum value no. 1`,
args: args{
src: []byte(`"none"`),
},
wantErr: false,
},
{
name: `success - possible enum value no. 2`,
args: args{
src: []byte(`"trap"`),
},
wantErr: false,
},
{
name: `success - possible enum value no. 3`,
args: args{
src: []byte(`"start"`),
},
wantErr: false,
},
{
name: `success - possible enum value no. 4`,
args: args{
src: []byte(`"trap|start"`),
},
wantErr: false,
},
{
name: "fail",
args: args{
src: []byte("\"FOOBAR\""),
},
wantErr: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
v := TunnelConfigurationPhase2StartAction("")
if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr {
t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,373 @@
/*
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"
"fmt"
)
// checks if the TunnelStatus type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TunnelStatus{}
/*
types and functions for established
*/
// isBoolean
type TunnelStatusgetEstablishedAttributeType = *bool
type TunnelStatusgetEstablishedArgType = bool
type TunnelStatusgetEstablishedRetType = bool
func getTunnelStatusgetEstablishedAttributeTypeOk(arg TunnelStatusgetEstablishedAttributeType) (ret TunnelStatusgetEstablishedRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelStatusgetEstablishedAttributeType(arg *TunnelStatusgetEstablishedAttributeType, val TunnelStatusgetEstablishedRetType) {
*arg = &val
}
/*
types and functions for name
*/
// isEnum
// TunnelStatusName the model 'TunnelStatus'
// value type for enums
type TunnelStatusName string
// List of Name
const (
TUNNELSTATUSNAME_TUNNEL1 TunnelStatusName = "tunnel1"
TUNNELSTATUSNAME_TUNNEL2 TunnelStatusName = "tunnel2"
)
// All allowed values of TunnelStatus enum
var AllowedTunnelStatusNameEnumValues = []TunnelStatusName{
"tunnel1",
"tunnel2",
}
func (v *TunnelStatusName) UnmarshalJSON(src []byte) error {
// use a type alias to prevent infinite recursion during unmarshal,
// see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers
type TmpJson TunnelStatusName
var value TmpJson
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
// Allow unmarshalling zero value for testing purposes
var zeroValue TmpJson
if value == zeroValue {
return nil
}
enumTypeValue := TunnelStatusName(value)
for _, existing := range AllowedTunnelStatusNameEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid TunnelStatus", value)
}
// NewTunnelStatusNameFromValue returns a pointer to a valid TunnelStatusName
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewTunnelStatusNameFromValue(v TunnelStatusName) (*TunnelStatusName, error) {
ev := TunnelStatusName(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for TunnelStatusName: valid values are %v", v, AllowedTunnelStatusNameEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v TunnelStatusName) IsValid() bool {
for _, existing := range AllowedTunnelStatusNameEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to NameName value
func (v TunnelStatusName) Ptr() *TunnelStatusName {
return &v
}
type NullableTunnelStatusName struct {
value *TunnelStatusName
isSet bool
}
func (v NullableTunnelStatusName) Get() *TunnelStatusName {
return v.value
}
func (v *NullableTunnelStatusName) Set(val *TunnelStatusName) {
v.value = val
v.isSet = true
}
func (v NullableTunnelStatusName) IsSet() bool {
return v.isSet
}
func (v *NullableTunnelStatusName) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTunnelStatusName(val *TunnelStatusName) *NullableTunnelStatusName {
return &NullableTunnelStatusName{value: val, isSet: true}
}
func (v NullableTunnelStatusName) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTunnelStatusName) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type TunnelStatusGetNameAttributeType = *TunnelStatusName
type TunnelStatusGetNameArgType = TunnelStatusName
type TunnelStatusGetNameRetType = TunnelStatusName
func getTunnelStatusGetNameAttributeTypeOk(arg TunnelStatusGetNameAttributeType) (ret TunnelStatusGetNameRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelStatusGetNameAttributeType(arg *TunnelStatusGetNameAttributeType, val TunnelStatusGetNameRetType) {
*arg = &val
}
/*
types and functions for phase1
*/
// isModel
type TunnelStatusGetPhase1AttributeType = *Phase1Status
type TunnelStatusGetPhase1ArgType = Phase1Status
type TunnelStatusGetPhase1RetType = Phase1Status
func getTunnelStatusGetPhase1AttributeTypeOk(arg TunnelStatusGetPhase1AttributeType) (ret TunnelStatusGetPhase1RetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelStatusGetPhase1AttributeType(arg *TunnelStatusGetPhase1AttributeType, val TunnelStatusGetPhase1RetType) {
*arg = &val
}
/*
types and functions for phase2
*/
// isModel
type TunnelStatusGetPhase2AttributeType = *Phase2Status
type TunnelStatusGetPhase2ArgType = Phase2Status
type TunnelStatusGetPhase2RetType = Phase2Status
func getTunnelStatusGetPhase2AttributeTypeOk(arg TunnelStatusGetPhase2AttributeType) (ret TunnelStatusGetPhase2RetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setTunnelStatusGetPhase2AttributeType(arg *TunnelStatusGetPhase2AttributeType, val TunnelStatusGetPhase2RetType) {
*arg = &val
}
// TunnelStatus Describes the status of the VPN itself.
type TunnelStatus struct {
Established TunnelStatusgetEstablishedAttributeType `json:"established,omitempty"`
Name TunnelStatusGetNameAttributeType `json:"name,omitempty"`
Phase1 TunnelStatusGetPhase1AttributeType `json:"phase1,omitempty"`
Phase2 TunnelStatusGetPhase2AttributeType `json:"phase2,omitempty"`
}
// NewTunnelStatus instantiates a new TunnelStatus 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 NewTunnelStatus() *TunnelStatus {
this := TunnelStatus{}
return &this
}
// NewTunnelStatusWithDefaults instantiates a new TunnelStatus 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 NewTunnelStatusWithDefaults() *TunnelStatus {
this := TunnelStatus{}
return &this
}
// GetEstablished returns the Established field value if set, zero value otherwise.
func (o *TunnelStatus) GetEstablished() (res TunnelStatusgetEstablishedRetType) {
res, _ = o.GetEstablishedOk()
return
}
// GetEstablishedOk returns a tuple with the Established field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TunnelStatus) GetEstablishedOk() (ret TunnelStatusgetEstablishedRetType, ok bool) {
return getTunnelStatusgetEstablishedAttributeTypeOk(o.Established)
}
// HasEstablished returns a boolean if a field has been set.
func (o *TunnelStatus) HasEstablished() bool {
_, ok := o.GetEstablishedOk()
return ok
}
// SetEstablished gets a reference to the given bool and assigns it to the Established field.
func (o *TunnelStatus) SetEstablished(v TunnelStatusgetEstablishedRetType) {
setTunnelStatusgetEstablishedAttributeType(&o.Established, v)
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *TunnelStatus) GetName() (res TunnelStatusGetNameRetType) {
res, _ = o.GetNameOk()
return
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TunnelStatus) GetNameOk() (ret TunnelStatusGetNameRetType, ok bool) {
return getTunnelStatusGetNameAttributeTypeOk(o.Name)
}
// HasName returns a boolean if a field has been set.
func (o *TunnelStatus) HasName() bool {
_, ok := o.GetNameOk()
return ok
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *TunnelStatus) SetName(v TunnelStatusGetNameRetType) {
setTunnelStatusGetNameAttributeType(&o.Name, v)
}
// GetPhase1 returns the Phase1 field value if set, zero value otherwise.
func (o *TunnelStatus) GetPhase1() (res TunnelStatusGetPhase1RetType) {
res, _ = o.GetPhase1Ok()
return
}
// GetPhase1Ok returns a tuple with the Phase1 field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TunnelStatus) GetPhase1Ok() (ret TunnelStatusGetPhase1RetType, ok bool) {
return getTunnelStatusGetPhase1AttributeTypeOk(o.Phase1)
}
// HasPhase1 returns a boolean if a field has been set.
func (o *TunnelStatus) HasPhase1() bool {
_, ok := o.GetPhase1Ok()
return ok
}
// SetPhase1 gets a reference to the given Phase1Status and assigns it to the Phase1 field.
func (o *TunnelStatus) SetPhase1(v TunnelStatusGetPhase1RetType) {
setTunnelStatusGetPhase1AttributeType(&o.Phase1, v)
}
// GetPhase2 returns the Phase2 field value if set, zero value otherwise.
func (o *TunnelStatus) GetPhase2() (res TunnelStatusGetPhase2RetType) {
res, _ = o.GetPhase2Ok()
return
}
// GetPhase2Ok returns a tuple with the Phase2 field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TunnelStatus) GetPhase2Ok() (ret TunnelStatusGetPhase2RetType, ok bool) {
return getTunnelStatusGetPhase2AttributeTypeOk(o.Phase2)
}
// HasPhase2 returns a boolean if a field has been set.
func (o *TunnelStatus) HasPhase2() bool {
_, ok := o.GetPhase2Ok()
return ok
}
// SetPhase2 gets a reference to the given Phase2Status and assigns it to the Phase2 field.
func (o *TunnelStatus) SetPhase2(v TunnelStatusGetPhase2RetType) {
setTunnelStatusGetPhase2AttributeType(&o.Phase2, v)
}
func (o TunnelStatus) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getTunnelStatusgetEstablishedAttributeTypeOk(o.Established); ok {
toSerialize["Established"] = val
}
if val, ok := getTunnelStatusGetNameAttributeTypeOk(o.Name); ok {
toSerialize["Name"] = val
}
if val, ok := getTunnelStatusGetPhase1AttributeTypeOk(o.Phase1); ok {
toSerialize["Phase1"] = val
}
if val, ok := getTunnelStatusGetPhase2AttributeTypeOk(o.Phase2); ok {
toSerialize["Phase2"] = val
}
return toSerialize, nil
}
type NullableTunnelStatus struct {
value *TunnelStatus
isSet bool
}
func (v NullableTunnelStatus) Get() *TunnelStatus {
return v.value
}
func (v *NullableTunnelStatus) Set(val *TunnelStatus) {
v.value = val
v.isSet = true
}
func (v NullableTunnelStatus) IsSet() bool {
return v.isSet
}
func (v *NullableTunnelStatus) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTunnelStatus(val *TunnelStatus) *NullableTunnelStatus {
return &NullableTunnelStatus{value: val, isSet: true}
}
func (v NullableTunnelStatus) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTunnelStatus) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,58 @@
/*
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 (
"testing"
)
// isEnum
func TestTunnelStatusName_UnmarshalJSON(t *testing.T) {
type args struct {
src []byte
}
tests := []struct {
name string
args args
wantErr bool
}{
{
name: `success - possible enum value no. 1`,
args: args{
src: []byte(`"tunnel1"`),
},
wantErr: false,
},
{
name: `success - possible enum value no. 2`,
args: args{
src: []byte(`"tunnel2"`),
},
wantErr: false,
},
{
name: "fail",
args: args{
src: []byte("\"FOOBAR\""),
},
wantErr: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
v := TunnelStatusName("")
if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr {
t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}

View file

@ -0,0 +1,397 @@
/*
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 labels
*/
// isContainer
type UpdateGatewayConnectionPayloadGetLabelsAttributeType = *map[string]string
type UpdateGatewayConnectionPayloadGetLabelsArgType = map[string]string
type UpdateGatewayConnectionPayloadGetLabelsRetType = map[string]string
func getUpdateGatewayConnectionPayloadGetLabelsAttributeTypeOk(arg UpdateGatewayConnectionPayloadGetLabelsAttributeType) (ret UpdateGatewayConnectionPayloadGetLabelsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setUpdateGatewayConnectionPayloadGetLabelsAttributeType(arg *UpdateGatewayConnectionPayloadGetLabelsAttributeType, val UpdateGatewayConnectionPayloadGetLabelsRetType) {
*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"`
// Map of custom labels. Key and values must be max 63 chars, start/end with alphanumeric.
Labels UpdateGatewayConnectionPayloadGetLabelsAttributeType `json:"labels,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)
}
// GetLabels returns the Labels field value if set, zero value otherwise.
func (o *UpdateGatewayConnectionPayload) GetLabels() (res UpdateGatewayConnectionPayloadGetLabelsRetType) {
res, _ = o.GetLabelsOk()
return
}
// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateGatewayConnectionPayload) GetLabelsOk() (ret UpdateGatewayConnectionPayloadGetLabelsRetType, ok bool) {
return getUpdateGatewayConnectionPayloadGetLabelsAttributeTypeOk(o.Labels)
}
// HasLabels returns a boolean if a field has been set.
func (o *UpdateGatewayConnectionPayload) HasLabels() bool {
_, ok := o.GetLabelsOk()
return ok
}
// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field.
func (o *UpdateGatewayConnectionPayload) SetLabels(v UpdateGatewayConnectionPayloadGetLabelsRetType) {
setUpdateGatewayConnectionPayloadGetLabelsAttributeType(&o.Labels, 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 := getUpdateGatewayConnectionPayloadGetLabelsAttributeTypeOk(o.Labels); ok {
toSerialize["Labels"] = 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)
}

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,358 @@
/*
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 UpdateVPNGatewayPayload type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &UpdateVPNGatewayPayload{}
/*
types and functions for availabilityZones
*/
// isModel
type UpdateVPNGatewayPayloadGetAvailabilityZonesAttributeType = *CreateVPNGatewayPayloadAvailabilityZones
type UpdateVPNGatewayPayloadGetAvailabilityZonesArgType = CreateVPNGatewayPayloadAvailabilityZones
type UpdateVPNGatewayPayloadGetAvailabilityZonesRetType = CreateVPNGatewayPayloadAvailabilityZones
func getUpdateVPNGatewayPayloadGetAvailabilityZonesAttributeTypeOk(arg UpdateVPNGatewayPayloadGetAvailabilityZonesAttributeType) (ret UpdateVPNGatewayPayloadGetAvailabilityZonesRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setUpdateVPNGatewayPayloadGetAvailabilityZonesAttributeType(arg *UpdateVPNGatewayPayloadGetAvailabilityZonesAttributeType, val UpdateVPNGatewayPayloadGetAvailabilityZonesRetType) {
*arg = &val
}
/*
types and functions for bgpEnabled
*/
// isBoolean
type UpdateVPNGatewayPayloadgetBgpEnabledAttributeType = *bool
type UpdateVPNGatewayPayloadgetBgpEnabledArgType = bool
type UpdateVPNGatewayPayloadgetBgpEnabledRetType = bool
func getUpdateVPNGatewayPayloadgetBgpEnabledAttributeTypeOk(arg UpdateVPNGatewayPayloadgetBgpEnabledAttributeType) (ret UpdateVPNGatewayPayloadgetBgpEnabledRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setUpdateVPNGatewayPayloadgetBgpEnabledAttributeType(arg *UpdateVPNGatewayPayloadgetBgpEnabledAttributeType, val UpdateVPNGatewayPayloadgetBgpEnabledRetType) {
*arg = &val
}
/*
types and functions for bgpGatewayConfig
*/
// isModel
type UpdateVPNGatewayPayloadGetBgpGatewayConfigAttributeType = *BGPGatewayConfig
type UpdateVPNGatewayPayloadGetBgpGatewayConfigArgType = BGPGatewayConfig
type UpdateVPNGatewayPayloadGetBgpGatewayConfigRetType = BGPGatewayConfig
func getUpdateVPNGatewayPayloadGetBgpGatewayConfigAttributeTypeOk(arg UpdateVPNGatewayPayloadGetBgpGatewayConfigAttributeType) (ret UpdateVPNGatewayPayloadGetBgpGatewayConfigRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setUpdateVPNGatewayPayloadGetBgpGatewayConfigAttributeType(arg *UpdateVPNGatewayPayloadGetBgpGatewayConfigAttributeType, val UpdateVPNGatewayPayloadGetBgpGatewayConfigRetType) {
*arg = &val
}
/*
types and functions for labels
*/
// isContainer
type UpdateVPNGatewayPayloadGetLabelsAttributeType = *map[string]string
type UpdateVPNGatewayPayloadGetLabelsArgType = map[string]string
type UpdateVPNGatewayPayloadGetLabelsRetType = map[string]string
func getUpdateVPNGatewayPayloadGetLabelsAttributeTypeOk(arg UpdateVPNGatewayPayloadGetLabelsAttributeType) (ret UpdateVPNGatewayPayloadGetLabelsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setUpdateVPNGatewayPayloadGetLabelsAttributeType(arg *UpdateVPNGatewayPayloadGetLabelsAttributeType, val UpdateVPNGatewayPayloadGetLabelsRetType) {
*arg = &val
}
/*
types and functions for name
*/
// isNotNullableString
type UpdateVPNGatewayPayloadGetNameAttributeType = *string
func getUpdateVPNGatewayPayloadGetNameAttributeTypeOk(arg UpdateVPNGatewayPayloadGetNameAttributeType) (ret UpdateVPNGatewayPayloadGetNameRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setUpdateVPNGatewayPayloadGetNameAttributeType(arg *UpdateVPNGatewayPayloadGetNameAttributeType, val UpdateVPNGatewayPayloadGetNameRetType) {
*arg = &val
}
type UpdateVPNGatewayPayloadGetNameArgType = string
type UpdateVPNGatewayPayloadGetNameRetType = string
/*
types and functions for planId
*/
// isNotNullableString
type UpdateVPNGatewayPayloadGetPlanIdAttributeType = *string
func getUpdateVPNGatewayPayloadGetPlanIdAttributeTypeOk(arg UpdateVPNGatewayPayloadGetPlanIdAttributeType) (ret UpdateVPNGatewayPayloadGetPlanIdRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setUpdateVPNGatewayPayloadGetPlanIdAttributeType(arg *UpdateVPNGatewayPayloadGetPlanIdAttributeType, val UpdateVPNGatewayPayloadGetPlanIdRetType) {
*arg = &val
}
type UpdateVPNGatewayPayloadGetPlanIdArgType = string
type UpdateVPNGatewayPayloadGetPlanIdRetType = string
// UpdateVPNGatewayPayload struct for UpdateVPNGatewayPayload
type UpdateVPNGatewayPayload struct {
// REQUIRED
AvailabilityZones UpdateVPNGatewayPayloadGetAvailabilityZonesAttributeType `json:"availabilityZones" required:"true"`
// Enable BGP routing. (This will require a BGPGatewayConfig and also a BGPTunnelConfig for each Tunnel in each Connection)
BgpEnabled UpdateVPNGatewayPayloadgetBgpEnabledAttributeType `json:"bgpEnabled,omitempty"`
BgpGatewayConfig UpdateVPNGatewayPayloadGetBgpGatewayConfigAttributeType `json:"bgpGatewayConfig,omitempty"`
// Map of custom labels. Key and values must be max 63 chars, start/end with alphanumeric.
Labels UpdateVPNGatewayPayloadGetLabelsAttributeType `json:"labels,omitempty"`
// The name of the VPN gateway. Maximum 20 characters (only alphanumeric and hyphens allowed). Not changeable after creation.
// REQUIRED
Name UpdateVPNGatewayPayloadGetNameAttributeType `json:"name" required:"true"`
// Service Plan to configure the limits of the VPN. Currently supported plans are p50, p100, p200. This list can change in the future where plan ids will be removed and new plans by added. That is the reason this is not an enum.
// REQUIRED
PlanId UpdateVPNGatewayPayloadGetPlanIdAttributeType `json:"planId" required:"true"`
}
type _UpdateVPNGatewayPayload UpdateVPNGatewayPayload
// NewUpdateVPNGatewayPayload instantiates a new UpdateVPNGatewayPayload 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 NewUpdateVPNGatewayPayload(availabilityZones UpdateVPNGatewayPayloadGetAvailabilityZonesArgType, name UpdateVPNGatewayPayloadGetNameArgType, planId UpdateVPNGatewayPayloadGetPlanIdArgType) *UpdateVPNGatewayPayload {
this := UpdateVPNGatewayPayload{}
setUpdateVPNGatewayPayloadGetAvailabilityZonesAttributeType(&this.AvailabilityZones, availabilityZones)
setUpdateVPNGatewayPayloadGetNameAttributeType(&this.Name, name)
setUpdateVPNGatewayPayloadGetPlanIdAttributeType(&this.PlanId, planId)
return &this
}
// NewUpdateVPNGatewayPayloadWithDefaults instantiates a new UpdateVPNGatewayPayload 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 NewUpdateVPNGatewayPayloadWithDefaults() *UpdateVPNGatewayPayload {
this := UpdateVPNGatewayPayload{}
return &this
}
// GetAvailabilityZones returns the AvailabilityZones field value
func (o *UpdateVPNGatewayPayload) GetAvailabilityZones() (ret UpdateVPNGatewayPayloadGetAvailabilityZonesRetType) {
ret, _ = o.GetAvailabilityZonesOk()
return ret
}
// GetAvailabilityZonesOk returns a tuple with the AvailabilityZones field value
// and a boolean to check if the value has been set.
func (o *UpdateVPNGatewayPayload) GetAvailabilityZonesOk() (ret UpdateVPNGatewayPayloadGetAvailabilityZonesRetType, ok bool) {
return getUpdateVPNGatewayPayloadGetAvailabilityZonesAttributeTypeOk(o.AvailabilityZones)
}
// SetAvailabilityZones sets field value
func (o *UpdateVPNGatewayPayload) SetAvailabilityZones(v UpdateVPNGatewayPayloadGetAvailabilityZonesRetType) {
setUpdateVPNGatewayPayloadGetAvailabilityZonesAttributeType(&o.AvailabilityZones, v)
}
// GetBgpEnabled returns the BgpEnabled field value if set, zero value otherwise.
func (o *UpdateVPNGatewayPayload) GetBgpEnabled() (res UpdateVPNGatewayPayloadgetBgpEnabledRetType) {
res, _ = o.GetBgpEnabledOk()
return
}
// GetBgpEnabledOk returns a tuple with the BgpEnabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateVPNGatewayPayload) GetBgpEnabledOk() (ret UpdateVPNGatewayPayloadgetBgpEnabledRetType, ok bool) {
return getUpdateVPNGatewayPayloadgetBgpEnabledAttributeTypeOk(o.BgpEnabled)
}
// HasBgpEnabled returns a boolean if a field has been set.
func (o *UpdateVPNGatewayPayload) HasBgpEnabled() bool {
_, ok := o.GetBgpEnabledOk()
return ok
}
// SetBgpEnabled gets a reference to the given bool and assigns it to the BgpEnabled field.
func (o *UpdateVPNGatewayPayload) SetBgpEnabled(v UpdateVPNGatewayPayloadgetBgpEnabledRetType) {
setUpdateVPNGatewayPayloadgetBgpEnabledAttributeType(&o.BgpEnabled, v)
}
// GetBgpGatewayConfig returns the BgpGatewayConfig field value if set, zero value otherwise.
func (o *UpdateVPNGatewayPayload) GetBgpGatewayConfig() (res UpdateVPNGatewayPayloadGetBgpGatewayConfigRetType) {
res, _ = o.GetBgpGatewayConfigOk()
return
}
// GetBgpGatewayConfigOk returns a tuple with the BgpGatewayConfig field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateVPNGatewayPayload) GetBgpGatewayConfigOk() (ret UpdateVPNGatewayPayloadGetBgpGatewayConfigRetType, ok bool) {
return getUpdateVPNGatewayPayloadGetBgpGatewayConfigAttributeTypeOk(o.BgpGatewayConfig)
}
// HasBgpGatewayConfig returns a boolean if a field has been set.
func (o *UpdateVPNGatewayPayload) HasBgpGatewayConfig() bool {
_, ok := o.GetBgpGatewayConfigOk()
return ok
}
// SetBgpGatewayConfig gets a reference to the given BGPGatewayConfig and assigns it to the BgpGatewayConfig field.
func (o *UpdateVPNGatewayPayload) SetBgpGatewayConfig(v UpdateVPNGatewayPayloadGetBgpGatewayConfigRetType) {
setUpdateVPNGatewayPayloadGetBgpGatewayConfigAttributeType(&o.BgpGatewayConfig, v)
}
// GetLabels returns the Labels field value if set, zero value otherwise.
func (o *UpdateVPNGatewayPayload) GetLabels() (res UpdateVPNGatewayPayloadGetLabelsRetType) {
res, _ = o.GetLabelsOk()
return
}
// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateVPNGatewayPayload) GetLabelsOk() (ret UpdateVPNGatewayPayloadGetLabelsRetType, ok bool) {
return getUpdateVPNGatewayPayloadGetLabelsAttributeTypeOk(o.Labels)
}
// HasLabels returns a boolean if a field has been set.
func (o *UpdateVPNGatewayPayload) HasLabels() bool {
_, ok := o.GetLabelsOk()
return ok
}
// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field.
func (o *UpdateVPNGatewayPayload) SetLabels(v UpdateVPNGatewayPayloadGetLabelsRetType) {
setUpdateVPNGatewayPayloadGetLabelsAttributeType(&o.Labels, v)
}
// GetName returns the Name field value
func (o *UpdateVPNGatewayPayload) GetName() (ret UpdateVPNGatewayPayloadGetNameRetType) {
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 *UpdateVPNGatewayPayload) GetNameOk() (ret UpdateVPNGatewayPayloadGetNameRetType, ok bool) {
return getUpdateVPNGatewayPayloadGetNameAttributeTypeOk(o.Name)
}
// SetName sets field value
func (o *UpdateVPNGatewayPayload) SetName(v UpdateVPNGatewayPayloadGetNameRetType) {
setUpdateVPNGatewayPayloadGetNameAttributeType(&o.Name, v)
}
// GetPlanId returns the PlanId field value
func (o *UpdateVPNGatewayPayload) GetPlanId() (ret UpdateVPNGatewayPayloadGetPlanIdRetType) {
ret, _ = o.GetPlanIdOk()
return ret
}
// GetPlanIdOk returns a tuple with the PlanId field value
// and a boolean to check if the value has been set.
func (o *UpdateVPNGatewayPayload) GetPlanIdOk() (ret UpdateVPNGatewayPayloadGetPlanIdRetType, ok bool) {
return getUpdateVPNGatewayPayloadGetPlanIdAttributeTypeOk(o.PlanId)
}
// SetPlanId sets field value
func (o *UpdateVPNGatewayPayload) SetPlanId(v UpdateVPNGatewayPayloadGetPlanIdRetType) {
setUpdateVPNGatewayPayloadGetPlanIdAttributeType(&o.PlanId, v)
}
func (o UpdateVPNGatewayPayload) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getUpdateVPNGatewayPayloadGetAvailabilityZonesAttributeTypeOk(o.AvailabilityZones); ok {
toSerialize["AvailabilityZones"] = val
}
if val, ok := getUpdateVPNGatewayPayloadgetBgpEnabledAttributeTypeOk(o.BgpEnabled); ok {
toSerialize["BgpEnabled"] = val
}
if val, ok := getUpdateVPNGatewayPayloadGetBgpGatewayConfigAttributeTypeOk(o.BgpGatewayConfig); ok {
toSerialize["BgpGatewayConfig"] = val
}
if val, ok := getUpdateVPNGatewayPayloadGetLabelsAttributeTypeOk(o.Labels); ok {
toSerialize["Labels"] = val
}
if val, ok := getUpdateVPNGatewayPayloadGetNameAttributeTypeOk(o.Name); ok {
toSerialize["Name"] = val
}
if val, ok := getUpdateVPNGatewayPayloadGetPlanIdAttributeTypeOk(o.PlanId); ok {
toSerialize["PlanId"] = val
}
return toSerialize, nil
}
type NullableUpdateVPNGatewayPayload struct {
value *UpdateVPNGatewayPayload
isSet bool
}
func (v NullableUpdateVPNGatewayPayload) Get() *UpdateVPNGatewayPayload {
return v.value
}
func (v *NullableUpdateVPNGatewayPayload) Set(val *UpdateVPNGatewayPayload) {
v.value = val
v.isSet = true
}
func (v NullableUpdateVPNGatewayPayload) IsSet() bool {
return v.isSet
}
func (v *NullableUpdateVPNGatewayPayload) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableUpdateVPNGatewayPayload(val *UpdateVPNGatewayPayload) *NullableUpdateVPNGatewayPayload {
return &NullableUpdateVPNGatewayPayload{value: val, isSet: true}
}
func (v NullableUpdateVPNGatewayPayload) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableUpdateVPNGatewayPayload) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,227 @@
/*
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 VPNTunnelPlan type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &VPNTunnelPlan{}
/*
types and functions for name
*/
// isNotNullableString
type VPNTunnelPlanGetNameAttributeType = *string
func getVPNTunnelPlanGetNameAttributeTypeOk(arg VPNTunnelPlanGetNameAttributeType) (ret VPNTunnelPlanGetNameRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setVPNTunnelPlanGetNameAttributeType(arg *VPNTunnelPlanGetNameAttributeType, val VPNTunnelPlanGetNameRetType) {
*arg = &val
}
type VPNTunnelPlanGetNameArgType = string
type VPNTunnelPlanGetNameRetType = string
/*
types and functions for region
*/
// isNotNullableString
type VPNTunnelPlanGetRegionAttributeType = *string
func getVPNTunnelPlanGetRegionAttributeTypeOk(arg VPNTunnelPlanGetRegionAttributeType) (ret VPNTunnelPlanGetRegionRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setVPNTunnelPlanGetRegionAttributeType(arg *VPNTunnelPlanGetRegionAttributeType, val VPNTunnelPlanGetRegionRetType) {
*arg = &val
}
type VPNTunnelPlanGetRegionArgType = string
type VPNTunnelPlanGetRegionRetType = string
/*
types and functions for sku
*/
// isNotNullableString
type VPNTunnelPlanGetSkuAttributeType = *string
func getVPNTunnelPlanGetSkuAttributeTypeOk(arg VPNTunnelPlanGetSkuAttributeType) (ret VPNTunnelPlanGetSkuRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setVPNTunnelPlanGetSkuAttributeType(arg *VPNTunnelPlanGetSkuAttributeType, val VPNTunnelPlanGetSkuRetType) {
*arg = &val
}
type VPNTunnelPlanGetSkuArgType = string
type VPNTunnelPlanGetSkuRetType = string
// VPNTunnelPlan struct for VPNTunnelPlan
type VPNTunnelPlan struct {
// Tunnel model name
Name VPNTunnelPlanGetNameAttributeType `json:"name,omitempty"`
// Tunnel model region
Region VPNTunnelPlanGetRegionAttributeType `json:"region,omitempty"`
// Tunnel model SKU
Sku VPNTunnelPlanGetSkuAttributeType `json:"sku,omitempty"`
}
// NewVPNTunnelPlan instantiates a new VPNTunnelPlan 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 NewVPNTunnelPlan() *VPNTunnelPlan {
this := VPNTunnelPlan{}
return &this
}
// NewVPNTunnelPlanWithDefaults instantiates a new VPNTunnelPlan 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 NewVPNTunnelPlanWithDefaults() *VPNTunnelPlan {
this := VPNTunnelPlan{}
return &this
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *VPNTunnelPlan) GetName() (res VPNTunnelPlanGetNameRetType) {
res, _ = o.GetNameOk()
return
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VPNTunnelPlan) GetNameOk() (ret VPNTunnelPlanGetNameRetType, ok bool) {
return getVPNTunnelPlanGetNameAttributeTypeOk(o.Name)
}
// HasName returns a boolean if a field has been set.
func (o *VPNTunnelPlan) HasName() bool {
_, ok := o.GetNameOk()
return ok
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *VPNTunnelPlan) SetName(v VPNTunnelPlanGetNameRetType) {
setVPNTunnelPlanGetNameAttributeType(&o.Name, v)
}
// GetRegion returns the Region field value if set, zero value otherwise.
func (o *VPNTunnelPlan) GetRegion() (res VPNTunnelPlanGetRegionRetType) {
res, _ = o.GetRegionOk()
return
}
// GetRegionOk returns a tuple with the Region field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VPNTunnelPlan) GetRegionOk() (ret VPNTunnelPlanGetRegionRetType, ok bool) {
return getVPNTunnelPlanGetRegionAttributeTypeOk(o.Region)
}
// HasRegion returns a boolean if a field has been set.
func (o *VPNTunnelPlan) HasRegion() bool {
_, ok := o.GetRegionOk()
return ok
}
// SetRegion gets a reference to the given string and assigns it to the Region field.
func (o *VPNTunnelPlan) SetRegion(v VPNTunnelPlanGetRegionRetType) {
setVPNTunnelPlanGetRegionAttributeType(&o.Region, v)
}
// GetSku returns the Sku field value if set, zero value otherwise.
func (o *VPNTunnelPlan) GetSku() (res VPNTunnelPlanGetSkuRetType) {
res, _ = o.GetSkuOk()
return
}
// GetSkuOk returns a tuple with the Sku field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VPNTunnelPlan) GetSkuOk() (ret VPNTunnelPlanGetSkuRetType, ok bool) {
return getVPNTunnelPlanGetSkuAttributeTypeOk(o.Sku)
}
// HasSku returns a boolean if a field has been set.
func (o *VPNTunnelPlan) HasSku() bool {
_, ok := o.GetSkuOk()
return ok
}
// SetSku gets a reference to the given string and assigns it to the Sku field.
func (o *VPNTunnelPlan) SetSku(v VPNTunnelPlanGetSkuRetType) {
setVPNTunnelPlanGetSkuAttributeType(&o.Sku, v)
}
func (o VPNTunnelPlan) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getVPNTunnelPlanGetNameAttributeTypeOk(o.Name); ok {
toSerialize["Name"] = val
}
if val, ok := getVPNTunnelPlanGetRegionAttributeTypeOk(o.Region); ok {
toSerialize["Region"] = val
}
if val, ok := getVPNTunnelPlanGetSkuAttributeTypeOk(o.Sku); ok {
toSerialize["Sku"] = val
}
return toSerialize, nil
}
type NullableVPNTunnelPlan struct {
value *VPNTunnelPlan
isSet bool
}
func (v NullableVPNTunnelPlan) Get() *VPNTunnelPlan {
return v.value
}
func (v *NullableVPNTunnelPlan) Set(val *VPNTunnelPlan) {
v.value = val
v.isSet = true
}
func (v NullableVPNTunnelPlan) IsSet() bool {
return v.isSet
}
func (v *NullableVPNTunnelPlan) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableVPNTunnelPlan(val *VPNTunnelPlan) *NullableVPNTunnelPlan {
return &NullableVPNTunnelPlan{value: val, isSet: true}
}
func (v NullableVPNTunnelPlan) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableVPNTunnelPlan) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,11 @@
/*
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

View file

@ -0,0 +1,385 @@
/*
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"
"fmt"
)
// checks if the VPNTunnels type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &VPNTunnels{}
/*
types and functions for bgpStatus
*/
// isModel
type VPNTunnelsGetBgpStatusAttributeType = *NullableBGPStatus
type VPNTunnelsGetBgpStatusArgType = *NullableBGPStatus
type VPNTunnelsGetBgpStatusRetType = *NullableBGPStatus
func getVPNTunnelsGetBgpStatusAttributeTypeOk(arg VPNTunnelsGetBgpStatusAttributeType) (ret VPNTunnelsGetBgpStatusRetType, ok bool) {
if arg == nil {
return nil, false
}
return arg, true
}
func setVPNTunnelsGetBgpStatusAttributeType(arg *VPNTunnelsGetBgpStatusAttributeType, val VPNTunnelsGetBgpStatusRetType) {
*arg = val
}
/*
types and functions for instanceState
*/
// isEnumRef
type VPNTunnelsGetInstanceStateAttributeType = *GatewayStatus
type VPNTunnelsGetInstanceStateArgType = GatewayStatus
type VPNTunnelsGetInstanceStateRetType = GatewayStatus
func getVPNTunnelsGetInstanceStateAttributeTypeOk(arg VPNTunnelsGetInstanceStateAttributeType) (ret VPNTunnelsGetInstanceStateRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setVPNTunnelsGetInstanceStateAttributeType(arg *VPNTunnelsGetInstanceStateAttributeType, val VPNTunnelsGetInstanceStateRetType) {
*arg = &val
}
/*
types and functions for name
*/
// isEnum
// VPNTunnelsName the model 'VPNTunnels'
// value type for enums
type VPNTunnelsName string
// List of Name
const (
VPNTUNNELSNAME_TUNNEL1 VPNTunnelsName = "tunnel1"
VPNTUNNELSNAME_TUNNEL2 VPNTunnelsName = "tunnel2"
)
// All allowed values of VPNTunnels enum
var AllowedVPNTunnelsNameEnumValues = []VPNTunnelsName{
"tunnel1",
"tunnel2",
}
func (v *VPNTunnelsName) UnmarshalJSON(src []byte) error {
// use a type alias to prevent infinite recursion during unmarshal,
// see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers
type TmpJson VPNTunnelsName
var value TmpJson
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
// Allow unmarshalling zero value for testing purposes
var zeroValue TmpJson
if value == zeroValue {
return nil
}
enumTypeValue := VPNTunnelsName(value)
for _, existing := range AllowedVPNTunnelsNameEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid VPNTunnels", value)
}
// NewVPNTunnelsNameFromValue returns a pointer to a valid VPNTunnelsName
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewVPNTunnelsNameFromValue(v VPNTunnelsName) (*VPNTunnelsName, error) {
ev := VPNTunnelsName(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for VPNTunnelsName: valid values are %v", v, AllowedVPNTunnelsNameEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v VPNTunnelsName) IsValid() bool {
for _, existing := range AllowedVPNTunnelsNameEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to NameName value
func (v VPNTunnelsName) Ptr() *VPNTunnelsName {
return &v
}
type NullableVPNTunnelsName struct {
value *VPNTunnelsName
isSet bool
}
func (v NullableVPNTunnelsName) Get() *VPNTunnelsName {
return v.value
}
func (v *NullableVPNTunnelsName) Set(val *VPNTunnelsName) {
v.value = val
v.isSet = true
}
func (v NullableVPNTunnelsName) IsSet() bool {
return v.isSet
}
func (v *NullableVPNTunnelsName) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableVPNTunnelsName(val *VPNTunnelsName) *NullableVPNTunnelsName {
return &NullableVPNTunnelsName{value: val, isSet: true}
}
func (v NullableVPNTunnelsName) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableVPNTunnelsName) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type VPNTunnelsGetNameAttributeType = *VPNTunnelsName
type VPNTunnelsGetNameArgType = VPNTunnelsName
type VPNTunnelsGetNameRetType = VPNTunnelsName
func getVPNTunnelsGetNameAttributeTypeOk(arg VPNTunnelsGetNameAttributeType) (ret VPNTunnelsGetNameRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setVPNTunnelsGetNameAttributeType(arg *VPNTunnelsGetNameAttributeType, val VPNTunnelsGetNameRetType) {
*arg = &val
}
/*
types and functions for publicIP
*/
// isNotNullableString
type VPNTunnelsGetPublicIPAttributeType = *string
func getVPNTunnelsGetPublicIPAttributeTypeOk(arg VPNTunnelsGetPublicIPAttributeType) (ret VPNTunnelsGetPublicIPRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setVPNTunnelsGetPublicIPAttributeType(arg *VPNTunnelsGetPublicIPAttributeType, val VPNTunnelsGetPublicIPRetType) {
*arg = &val
}
type VPNTunnelsGetPublicIPArgType = string
type VPNTunnelsGetPublicIPRetType = string
// VPNTunnels List all available tunnels with public IP and status
type VPNTunnels struct {
BgpStatus VPNTunnelsGetBgpStatusAttributeType `json:"bgpStatus,omitempty"`
InstanceState VPNTunnelsGetInstanceStateAttributeType `json:"instanceState,omitempty"`
Name VPNTunnelsGetNameAttributeType `json:"name,omitempty"`
PublicIP VPNTunnelsGetPublicIPAttributeType `json:"publicIP,omitempty"`
}
// NewVPNTunnels instantiates a new VPNTunnels 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 NewVPNTunnels() *VPNTunnels {
this := VPNTunnels{}
return &this
}
// NewVPNTunnelsWithDefaults instantiates a new VPNTunnels 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 NewVPNTunnelsWithDefaults() *VPNTunnels {
this := VPNTunnels{}
return &this
}
// GetBgpStatus returns the BgpStatus field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *VPNTunnels) GetBgpStatus() (res VPNTunnelsGetBgpStatusRetType) {
res, _ = o.GetBgpStatusOk()
return
}
// GetBgpStatusOk returns a tuple with the BgpStatus field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *VPNTunnels) GetBgpStatusOk() (ret VPNTunnelsGetBgpStatusRetType, ok bool) {
return getVPNTunnelsGetBgpStatusAttributeTypeOk(o.BgpStatus)
}
// HasBgpStatus returns a boolean if a field has been set.
func (o *VPNTunnels) HasBgpStatus() bool {
_, ok := o.GetBgpStatusOk()
return ok
}
// SetBgpStatus gets a reference to the given BGPStatus and assigns it to the BgpStatus field.
func (o *VPNTunnels) SetBgpStatus(v VPNTunnelsGetBgpStatusRetType) {
setVPNTunnelsGetBgpStatusAttributeType(&o.BgpStatus, v)
}
// SetBgpStatusNil sets the value for BgpStatus to be an explicit nil
func (o *VPNTunnels) SetBgpStatusNil() {
o.BgpStatus = nil
}
// UnsetBgpStatus ensures that no value is present for BgpStatus, not even an explicit nil
func (o *VPNTunnels) UnsetBgpStatus() {
o.BgpStatus = nil
}
// GetInstanceState returns the InstanceState field value if set, zero value otherwise.
func (o *VPNTunnels) GetInstanceState() (res VPNTunnelsGetInstanceStateRetType) {
res, _ = o.GetInstanceStateOk()
return
}
// GetInstanceStateOk returns a tuple with the InstanceState field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VPNTunnels) GetInstanceStateOk() (ret VPNTunnelsGetInstanceStateRetType, ok bool) {
return getVPNTunnelsGetInstanceStateAttributeTypeOk(o.InstanceState)
}
// HasInstanceState returns a boolean if a field has been set.
func (o *VPNTunnels) HasInstanceState() bool {
_, ok := o.GetInstanceStateOk()
return ok
}
// SetInstanceState gets a reference to the given GatewayStatus and assigns it to the InstanceState field.
func (o *VPNTunnels) SetInstanceState(v VPNTunnelsGetInstanceStateRetType) {
setVPNTunnelsGetInstanceStateAttributeType(&o.InstanceState, v)
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *VPNTunnels) GetName() (res VPNTunnelsGetNameRetType) {
res, _ = o.GetNameOk()
return
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VPNTunnels) GetNameOk() (ret VPNTunnelsGetNameRetType, ok bool) {
return getVPNTunnelsGetNameAttributeTypeOk(o.Name)
}
// HasName returns a boolean if a field has been set.
func (o *VPNTunnels) HasName() bool {
_, ok := o.GetNameOk()
return ok
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *VPNTunnels) SetName(v VPNTunnelsGetNameRetType) {
setVPNTunnelsGetNameAttributeType(&o.Name, v)
}
// GetPublicIP returns the PublicIP field value if set, zero value otherwise.
func (o *VPNTunnels) GetPublicIP() (res VPNTunnelsGetPublicIPRetType) {
res, _ = o.GetPublicIPOk()
return
}
// GetPublicIPOk returns a tuple with the PublicIP field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VPNTunnels) GetPublicIPOk() (ret VPNTunnelsGetPublicIPRetType, ok bool) {
return getVPNTunnelsGetPublicIPAttributeTypeOk(o.PublicIP)
}
// HasPublicIP returns a boolean if a field has been set.
func (o *VPNTunnels) HasPublicIP() bool {
_, ok := o.GetPublicIPOk()
return ok
}
// SetPublicIP gets a reference to the given string and assigns it to the PublicIP field.
func (o *VPNTunnels) SetPublicIP(v VPNTunnelsGetPublicIPRetType) {
setVPNTunnelsGetPublicIPAttributeType(&o.PublicIP, v)
}
func (o VPNTunnels) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getVPNTunnelsGetBgpStatusAttributeTypeOk(o.BgpStatus); ok {
toSerialize["BgpStatus"] = val
}
if val, ok := getVPNTunnelsGetInstanceStateAttributeTypeOk(o.InstanceState); ok {
toSerialize["InstanceState"] = val
}
if val, ok := getVPNTunnelsGetNameAttributeTypeOk(o.Name); ok {
toSerialize["Name"] = val
}
if val, ok := getVPNTunnelsGetPublicIPAttributeTypeOk(o.PublicIP); ok {
toSerialize["PublicIP"] = val
}
return toSerialize, nil
}
type NullableVPNTunnels struct {
value *VPNTunnels
isSet bool
}
func (v NullableVPNTunnels) Get() *VPNTunnels {
return v.value
}
func (v *NullableVPNTunnels) Set(val *VPNTunnels) {
v.value = val
v.isSet = true
}
func (v NullableVPNTunnels) IsSet() bool {
return v.isSet
}
func (v *NullableVPNTunnels) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableVPNTunnels(val *VPNTunnels) *NullableVPNTunnels {
return &NullableVPNTunnels{value: val, isSet: true}
}
func (v NullableVPNTunnels) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableVPNTunnels) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,58 @@
/*
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 (
"testing"
)
// isEnum
func TestVPNTunnelsName_UnmarshalJSON(t *testing.T) {
type args struct {
src []byte
}
tests := []struct {
name string
args args
wantErr bool
}{
{
name: `success - possible enum value no. 1`,
args: args{
src: []byte(`"tunnel1"`),
},
wantErr: false,
},
{
name: `success - possible enum value no. 2`,
args: args{
src: []byte(`"tunnel2"`),
},
wantErr: false,
},
{
name: "fail",
args: args{
src: []byte("\"FOOBAR\""),
},
wantErr: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
v := VPNTunnelsName("")
if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr {
t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}

385
pkg/vpnalpha/utils.go Normal file
View file

@ -0,0 +1,385 @@
/*
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"
"math/rand"
"reflect"
"time"
)
// PtrBool is a helper routine that returns a pointer to given boolean value.
func PtrBool(v bool) *bool { return &v }
// PtrInt is a helper routine that returns a pointer to given integer value.
func PtrInt(v int) *int { return &v }
// PtrInt32 is a helper routine that returns a pointer to given integer value.
func PtrInt32(v int32) *int32 { return &v }
// PtrInt64 is a helper routine that returns a pointer to given integer value.
func PtrInt64(v int64) *int64 { return &v }
// PtrFloat32 is a helper routine that returns a pointer to given float value.
func PtrFloat32(v float32) *float32 { return &v }
// PtrFloat64 is a helper routine that returns a pointer to given float value.
func PtrFloat64(v float64) *float64 { return &v }
// PtrString is a helper routine that returns a pointer to given string value.
func PtrString(v string) *string { return &v }
// PtrTime is helper routine that returns a pointer to given Time value.
func PtrTime(v time.Time) *time.Time { return &v }
type NullableValue[T any] struct {
value *T
isSet bool
}
func (v NullableValue[T]) Get() *T {
return v.value
}
func (v *NullableValue[T]) Set(val *T) {
v.value = val
v.isSet = true
}
func (v NullableValue[T]) IsSet() bool {
return v.isSet
}
func (v *NullableValue[T]) Unset() {
v.value = nil
v.isSet = false
}
type NullableBool struct {
value *bool
isSet bool
}
func (v NullableBool) Get() *bool {
return v.value
}
func (v *NullableBool) Set(val *bool) {
v.value = val
v.isSet = true
}
func (v NullableBool) IsSet() bool {
return v.isSet
}
func (v *NullableBool) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBool(val *bool) *NullableBool {
return &NullableBool{value: val, isSet: true}
}
func (v NullableBool) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBool) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableInt struct {
value *int
isSet bool
}
func (v NullableInt) Get() *int {
return v.value
}
func (v *NullableInt) Set(val *int) {
v.value = val
v.isSet = true
}
func (v NullableInt) IsSet() bool {
return v.isSet
}
func (v *NullableInt) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableInt(val *int) *NullableInt {
return &NullableInt{value: val, isSet: true}
}
func (v NullableInt) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableInt) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableInt32 struct {
value *int32
isSet bool
}
func (v NullableInt32) Get() *int32 {
return v.value
}
func (v *NullableInt32) Set(val *int32) {
v.value = val
v.isSet = true
}
func (v NullableInt32) IsSet() bool {
return v.isSet
}
func (v *NullableInt32) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableInt32(val *int32) *NullableInt32 {
return &NullableInt32{value: val, isSet: true}
}
func (v NullableInt32) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableInt32) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableInt64 struct {
value *int64
isSet bool
}
func (v NullableInt64) Get() *int64 {
return v.value
}
func (v *NullableInt64) Set(val *int64) {
v.value = val
v.isSet = true
}
func (v NullableInt64) IsSet() bool {
return v.isSet
}
func (v *NullableInt64) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableInt64(val *int64) *NullableInt64 {
return &NullableInt64{value: val, isSet: true}
}
func (v NullableInt64) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableInt64) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableFloat32 struct {
value *float32
isSet bool
}
func (v NullableFloat32) Get() *float32 {
return v.value
}
func (v *NullableFloat32) Set(val *float32) {
v.value = val
v.isSet = true
}
func (v NullableFloat32) IsSet() bool {
return v.isSet
}
func (v *NullableFloat32) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableFloat32(val *float32) *NullableFloat32 {
return &NullableFloat32{value: val, isSet: true}
}
func (v NullableFloat32) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableFloat32) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableFloat64 struct {
value *float64
isSet bool
}
func (v NullableFloat64) Get() *float64 {
return v.value
}
func (v *NullableFloat64) Set(val *float64) {
v.value = val
v.isSet = true
}
func (v NullableFloat64) IsSet() bool {
return v.isSet
}
func (v *NullableFloat64) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableFloat64(val *float64) *NullableFloat64 {
return &NullableFloat64{value: val, isSet: true}
}
func (v NullableFloat64) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableFloat64) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableString struct {
value *string
isSet bool
}
func (v NullableString) Get() *string {
return v.value
}
func (v *NullableString) Set(val *string) {
v.value = val
v.isSet = true
}
func (v NullableString) IsSet() bool {
return v.isSet
}
func (v *NullableString) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableString(val *string) *NullableString {
return &NullableString{value: val, isSet: true}
}
func (v NullableString) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableString) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableTime struct {
value *time.Time
isSet bool
}
func (v NullableTime) Get() *time.Time {
return v.value
}
func (v *NullableTime) Set(val *time.Time) {
v.value = val
v.isSet = true
}
func (v NullableTime) IsSet() bool {
return v.isSet
}
func (v *NullableTime) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTime(val *time.Time) *NullableTime {
return &NullableTime{value: val, isSet: true}
}
func (v NullableTime) MarshalJSON() ([]byte, error) {
return v.value.MarshalJSON()
}
func (v *NullableTime) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
// IsNil checks if an input is nil
func IsNil(i interface{}) bool {
if i == nil {
return true
}
if t, ok := i.(interface{ IsSet() bool }); ok {
return !t.IsSet()
}
switch reflect.TypeOf(i).Kind() {
case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice:
return reflect.ValueOf(i).IsNil()
case reflect.Array:
return reflect.ValueOf(i).IsZero()
}
return false
}
type MappedNullable interface {
ToMap() (map[string]interface{}, error)
}
const letterRunes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
// randString returns a random string with a specified length. It panics if n <= 0.
func randString(n int) string {
b := make([]byte, n)
for i := range b {
b[i] = letterRunes[rand.Intn(len(letterRunes))]
}
return string(b)
}