feat: generating code
This commit is contained in:
parent
c329d58970
commit
51663cd8d0
1221 changed files with 271709 additions and 2444 deletions
1
pkg/albwafalpha/.openapi-generator/VERSION
Normal file
1
pkg/albwafalpha/.openapi-generator/VERSION
Normal file
|
|
@ -0,0 +1 @@
|
|||
6.6.0
|
||||
2778
pkg/albwafalpha/api_default.go
Normal file
2778
pkg/albwafalpha/api_default.go
Normal file
File diff suppressed because it is too large
Load diff
884
pkg/albwafalpha/api_default_test.go
Normal file
884
pkg/albwafalpha/api_default_test.go
Normal file
|
|
@ -0,0 +1,884 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Testing DefaultApiService
|
||||
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech);
|
||||
|
||||
package albwafalpha
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"net/url"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/stackitcloud/stackit-sdk-go/core/config"
|
||||
)
|
||||
|
||||
func Test_albwafalpha_DefaultApiService(t *testing.T) {
|
||||
|
||||
t.Run("Test DefaultApiService CreateCoreRuleSet", func(t *testing.T) {
|
||||
_apiUrlPath := "/v1alpha/projects/{projectId}/regions/{region}/core-rule-sets"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
regionValue := "region-value"
|
||||
_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 := CreateCoreRuleSetResponse{}
|
||||
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 albwafalpha_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
|
||||
createCoreRuleSetPayload := CreateCoreRuleSetPayload{}
|
||||
|
||||
resp, reqErr := apiClient.CreateCoreRuleSet(context.Background(), projectId, region).CreateCoreRuleSetPayload(createCoreRuleSetPayload).Execute()
|
||||
|
||||
if reqErr != nil {
|
||||
t.Fatalf("error in call: %v", reqErr)
|
||||
}
|
||||
if IsNil(resp) {
|
||||
t.Fatalf("response not present")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("Test DefaultApiService CreateRules", func(t *testing.T) {
|
||||
_apiUrlPath := "/v1alpha/projects/{projectId}/regions/{region}/rules"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
regionValue := "region-value"
|
||||
_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 := CreateRulesResponse{}
|
||||
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 albwafalpha_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
|
||||
createRulesPayload := CreateRulesPayload{}
|
||||
|
||||
resp, reqErr := apiClient.CreateRules(context.Background(), projectId, region).CreateRulesPayload(createRulesPayload).Execute()
|
||||
|
||||
if reqErr != nil {
|
||||
t.Fatalf("error in call: %v", reqErr)
|
||||
}
|
||||
if IsNil(resp) {
|
||||
t.Fatalf("response not present")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("Test DefaultApiService CreateWAF", func(t *testing.T) {
|
||||
_apiUrlPath := "/v1alpha/projects/{projectId}/regions/{region}/wafs"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
regionValue := "region-value"
|
||||
_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 := CreateWAFResponse{}
|
||||
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 albwafalpha_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
|
||||
createWAFPayload := CreateWAFPayload{}
|
||||
|
||||
resp, reqErr := apiClient.CreateWAF(context.Background(), projectId, region).CreateWAFPayload(createWAFPayload).Execute()
|
||||
|
||||
if reqErr != nil {
|
||||
t.Fatalf("error in call: %v", reqErr)
|
||||
}
|
||||
if IsNil(resp) {
|
||||
t.Fatalf("response not present")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("Test DefaultApiService DeleteCoreRuleSet", func(t *testing.T) {
|
||||
_apiUrlPath := "/v1alpha/projects/{projectId}/regions/{region}/core-rule-sets/{name}"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
nameValue := "name-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"name"+"}", url.PathEscape(ParameterValueToString(nameValue, "name")), -1)
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
data := map[string]interface{}{}
|
||||
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 albwafalpha_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
|
||||
name := nameValue
|
||||
|
||||
resp, reqErr := apiClient.DeleteCoreRuleSet(context.Background(), projectId, region, name).Execute()
|
||||
|
||||
if reqErr != nil {
|
||||
t.Fatalf("error in call: %v", reqErr)
|
||||
}
|
||||
if IsNil(resp) {
|
||||
t.Fatalf("response not present")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("Test DefaultApiService DeleteRules", func(t *testing.T) {
|
||||
_apiUrlPath := "/v1alpha/projects/{projectId}/regions/{region}/rules/{name}"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
nameValue := "name-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"name"+"}", url.PathEscape(ParameterValueToString(nameValue, "name")), -1)
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
data := map[string]interface{}{}
|
||||
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 albwafalpha_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
|
||||
name := nameValue
|
||||
|
||||
resp, reqErr := apiClient.DeleteRules(context.Background(), projectId, region, name).Execute()
|
||||
|
||||
if reqErr != nil {
|
||||
t.Fatalf("error in call: %v", reqErr)
|
||||
}
|
||||
if IsNil(resp) {
|
||||
t.Fatalf("response not present")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("Test DefaultApiService DeleteWAF", func(t *testing.T) {
|
||||
_apiUrlPath := "/v1alpha/projects/{projectId}/regions/{region}/wafs/{name}"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
nameValue := "name-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"name"+"}", url.PathEscape(ParameterValueToString(nameValue, "name")), -1)
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
data := map[string]interface{}{}
|
||||
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 albwafalpha_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
|
||||
name := nameValue
|
||||
|
||||
resp, reqErr := apiClient.DeleteWAF(context.Background(), projectId, region, name).Execute()
|
||||
|
||||
if reqErr != nil {
|
||||
t.Fatalf("error in call: %v", reqErr)
|
||||
}
|
||||
if IsNil(resp) {
|
||||
t.Fatalf("response not present")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("Test DefaultApiService GetCoreRuleSet", func(t *testing.T) {
|
||||
_apiUrlPath := "/v1alpha/projects/{projectId}/regions/{region}/core-rule-sets/{name}"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
nameValue := "name-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"name"+"}", url.PathEscape(ParameterValueToString(nameValue, "name")), -1)
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
data := GetCoreRuleSetResponse{}
|
||||
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 albwafalpha_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
|
||||
name := nameValue
|
||||
|
||||
resp, reqErr := apiClient.GetCoreRuleSet(context.Background(), projectId, region, name).Execute()
|
||||
|
||||
if reqErr != nil {
|
||||
t.Fatalf("error in call: %v", reqErr)
|
||||
}
|
||||
if IsNil(resp) {
|
||||
t.Fatalf("response not present")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("Test DefaultApiService GetRules", func(t *testing.T) {
|
||||
_apiUrlPath := "/v1alpha/projects/{projectId}/regions/{region}/rules/{name}"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
nameValue := "name-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"name"+"}", url.PathEscape(ParameterValueToString(nameValue, "name")), -1)
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
data := GetRulesResponse{}
|
||||
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 albwafalpha_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
|
||||
name := nameValue
|
||||
|
||||
resp, reqErr := apiClient.GetRules(context.Background(), projectId, region, name).Execute()
|
||||
|
||||
if reqErr != nil {
|
||||
t.Fatalf("error in call: %v", reqErr)
|
||||
}
|
||||
if IsNil(resp) {
|
||||
t.Fatalf("response not present")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("Test DefaultApiService GetWAF", func(t *testing.T) {
|
||||
_apiUrlPath := "/v1alpha/projects/{projectId}/regions/{region}/wafs/{name}"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
nameValue := "name-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"name"+"}", url.PathEscape(ParameterValueToString(nameValue, "name")), -1)
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
data := GetWAFResponse{}
|
||||
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 albwafalpha_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
|
||||
name := nameValue
|
||||
|
||||
resp, reqErr := apiClient.GetWAF(context.Background(), projectId, region, name).Execute()
|
||||
|
||||
if reqErr != nil {
|
||||
t.Fatalf("error in call: %v", reqErr)
|
||||
}
|
||||
if IsNil(resp) {
|
||||
t.Fatalf("response not present")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("Test DefaultApiService ListCoreRuleSets", func(t *testing.T) {
|
||||
_apiUrlPath := "/v1alpha/projects/{projectId}/regions/{region}/core-rule-sets"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
regionValue := "region-value"
|
||||
_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 := ListCoreRuleSetResponse{}
|
||||
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 albwafalpha_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.ListCoreRuleSets(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 ListRules", func(t *testing.T) {
|
||||
_apiUrlPath := "/v1alpha/projects/{projectId}/regions/{region}/rules"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
regionValue := "region-value"
|
||||
_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 := ListRulesResponse{}
|
||||
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 albwafalpha_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.ListRules(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 ListWAF", func(t *testing.T) {
|
||||
_apiUrlPath := "/v1alpha/projects/{projectId}/regions/{region}/wafs"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
regionValue := "region-value"
|
||||
_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 := ListWAFResponse{}
|
||||
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 albwafalpha_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.ListWAF(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 UpdateCoreRuleSet", func(t *testing.T) {
|
||||
_apiUrlPath := "/v1alpha/projects/{projectId}/regions/{region}/core-rule-sets/{name}"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
nameValue := "name-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"name"+"}", url.PathEscape(ParameterValueToString(nameValue, "name")), -1)
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
data := UpdateCoreRuleSetResponse{}
|
||||
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 albwafalpha_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
|
||||
name := nameValue
|
||||
updateCoreRuleSetPayload := UpdateCoreRuleSetPayload{}
|
||||
|
||||
resp, reqErr := apiClient.UpdateCoreRuleSet(context.Background(), projectId, region, name).UpdateCoreRuleSetPayload(updateCoreRuleSetPayload).Execute()
|
||||
|
||||
if reqErr != nil {
|
||||
t.Fatalf("error in call: %v", reqErr)
|
||||
}
|
||||
if IsNil(resp) {
|
||||
t.Fatalf("response not present")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("Test DefaultApiService UpdateRules", func(t *testing.T) {
|
||||
_apiUrlPath := "/v1alpha/projects/{projectId}/regions/{region}/rules/{name}"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
nameValue := "name-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"name"+"}", url.PathEscape(ParameterValueToString(nameValue, "name")), -1)
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
data := UpdateRulesResponse{}
|
||||
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 albwafalpha_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
|
||||
name := nameValue
|
||||
updateRulesPayload := UpdateRulesPayload{}
|
||||
|
||||
resp, reqErr := apiClient.UpdateRules(context.Background(), projectId, region, name).UpdateRulesPayload(updateRulesPayload).Execute()
|
||||
|
||||
if reqErr != nil {
|
||||
t.Fatalf("error in call: %v", reqErr)
|
||||
}
|
||||
if IsNil(resp) {
|
||||
t.Fatalf("response not present")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("Test DefaultApiService UpdateWAF", func(t *testing.T) {
|
||||
_apiUrlPath := "/v1alpha/projects/{projectId}/regions/{region}/wafs/{name}"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
regionValue := "region-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1)
|
||||
nameValue := "name-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"name"+"}", url.PathEscape(ParameterValueToString(nameValue, "name")), -1)
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
data := UpdateWAFResponse{}
|
||||
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 albwafalpha_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
|
||||
name := nameValue
|
||||
updateWAFPayload := UpdateWAFPayload{}
|
||||
|
||||
resp, reqErr := apiClient.UpdateWAF(context.Background(), projectId, region, name).UpdateWAFPayload(updateWAFPayload).Execute()
|
||||
|
||||
if reqErr != nil {
|
||||
t.Fatalf("error in call: %v", reqErr)
|
||||
}
|
||||
if IsNil(resp) {
|
||||
t.Fatalf("response not present")
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
631
pkg/albwafalpha/client.go
Normal file
631
pkg/albwafalpha/client.go
Normal file
|
|
@ -0,0 +1,631 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
|
||||
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 Application Load Balancer Web Application Firewall API API v1alpha.0.0
|
||||
// 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
|
||||
}
|
||||
err = file.Close()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
38
pkg/albwafalpha/configuration.go
Normal file
38
pkg/albwafalpha/configuration.go
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
|
||||
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/albwafalpha",
|
||||
Debug: false,
|
||||
Servers: config.ServerConfigurations{
|
||||
{
|
||||
URL: "https://alb-waf.api.stackit.cloud",
|
||||
Description: "No description provided",
|
||||
Variables: map[string]config.ServerVariable{
|
||||
"region": {
|
||||
Description: "No description provided",
|
||||
DefaultValue: "global",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
OperationServers: map[string]config.ServerConfigurations{},
|
||||
}
|
||||
return cfg
|
||||
}
|
||||
275
pkg/albwafalpha/model_create_core_rule_set_payload.go
Normal file
275
pkg/albwafalpha/model_create_core_rule_set_payload.go
Normal file
|
|
@ -0,0 +1,275 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the CreateCoreRuleSetPayload type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CreateCoreRuleSetPayload{}
|
||||
|
||||
/*
|
||||
types and functions for active
|
||||
*/
|
||||
|
||||
// isBoolean
|
||||
type CreateCoreRuleSetPayloadgetActiveAttributeType = *bool
|
||||
type CreateCoreRuleSetPayloadgetActiveArgType = bool
|
||||
type CreateCoreRuleSetPayloadgetActiveRetType = bool
|
||||
|
||||
func getCreateCoreRuleSetPayloadgetActiveAttributeTypeOk(arg CreateCoreRuleSetPayloadgetActiveAttributeType) (ret CreateCoreRuleSetPayloadgetActiveRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateCoreRuleSetPayloadgetActiveAttributeType(arg *CreateCoreRuleSetPayloadgetActiveAttributeType, val CreateCoreRuleSetPayloadgetActiveRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for name
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateCoreRuleSetPayloadGetNameAttributeType = *string
|
||||
|
||||
func getCreateCoreRuleSetPayloadGetNameAttributeTypeOk(arg CreateCoreRuleSetPayloadGetNameAttributeType) (ret CreateCoreRuleSetPayloadGetNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateCoreRuleSetPayloadGetNameAttributeType(arg *CreateCoreRuleSetPayloadGetNameAttributeType, val CreateCoreRuleSetPayloadGetNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateCoreRuleSetPayloadGetNameArgType = string
|
||||
type CreateCoreRuleSetPayloadGetNameRetType = string
|
||||
|
||||
/*
|
||||
types and functions for projectId
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateCoreRuleSetPayloadGetProjectIdAttributeType = *string
|
||||
|
||||
func getCreateCoreRuleSetPayloadGetProjectIdAttributeTypeOk(arg CreateCoreRuleSetPayloadGetProjectIdAttributeType) (ret CreateCoreRuleSetPayloadGetProjectIdRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateCoreRuleSetPayloadGetProjectIdAttributeType(arg *CreateCoreRuleSetPayloadGetProjectIdAttributeType, val CreateCoreRuleSetPayloadGetProjectIdRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateCoreRuleSetPayloadGetProjectIdArgType = string
|
||||
type CreateCoreRuleSetPayloadGetProjectIdRetType = string
|
||||
|
||||
/*
|
||||
types and functions for region
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateCoreRuleSetPayloadGetRegionAttributeType = *string
|
||||
|
||||
func getCreateCoreRuleSetPayloadGetRegionAttributeTypeOk(arg CreateCoreRuleSetPayloadGetRegionAttributeType) (ret CreateCoreRuleSetPayloadGetRegionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateCoreRuleSetPayloadGetRegionAttributeType(arg *CreateCoreRuleSetPayloadGetRegionAttributeType, val CreateCoreRuleSetPayloadGetRegionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateCoreRuleSetPayloadGetRegionArgType = string
|
||||
type CreateCoreRuleSetPayloadGetRegionRetType = string
|
||||
|
||||
// CreateCoreRuleSetPayload CreateCoreRuleSetRequest creates a rule configuration.
|
||||
type CreateCoreRuleSetPayload struct {
|
||||
// To activate the OWASP core rule set, set this boolean to true.
|
||||
Active CreateCoreRuleSetPayloadgetActiveAttributeType `json:"active,omitempty"`
|
||||
// Core rule set configuration name.
|
||||
Name CreateCoreRuleSetPayloadGetNameAttributeType `json:"name,omitempty"`
|
||||
// Project identifier
|
||||
ProjectId CreateCoreRuleSetPayloadGetProjectIdAttributeType `json:"projectId,omitempty"`
|
||||
// Region
|
||||
Region CreateCoreRuleSetPayloadGetRegionAttributeType `json:"region,omitempty"`
|
||||
}
|
||||
|
||||
// NewCreateCoreRuleSetPayload instantiates a new CreateCoreRuleSetPayload 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 NewCreateCoreRuleSetPayload() *CreateCoreRuleSetPayload {
|
||||
this := CreateCoreRuleSetPayload{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewCreateCoreRuleSetPayloadWithDefaults instantiates a new CreateCoreRuleSetPayload 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 NewCreateCoreRuleSetPayloadWithDefaults() *CreateCoreRuleSetPayload {
|
||||
this := CreateCoreRuleSetPayload{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetActive returns the Active field value if set, zero value otherwise.
|
||||
func (o *CreateCoreRuleSetPayload) GetActive() (res CreateCoreRuleSetPayloadgetActiveRetType) {
|
||||
res, _ = o.GetActiveOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetActiveOk returns a tuple with the Active field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CreateCoreRuleSetPayload) GetActiveOk() (ret CreateCoreRuleSetPayloadgetActiveRetType, ok bool) {
|
||||
return getCreateCoreRuleSetPayloadgetActiveAttributeTypeOk(o.Active)
|
||||
}
|
||||
|
||||
// HasActive returns a boolean if a field has been set.
|
||||
func (o *CreateCoreRuleSetPayload) HasActive() bool {
|
||||
_, ok := o.GetActiveOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetActive gets a reference to the given bool and assigns it to the Active field.
|
||||
func (o *CreateCoreRuleSetPayload) SetActive(v CreateCoreRuleSetPayloadgetActiveRetType) {
|
||||
setCreateCoreRuleSetPayloadgetActiveAttributeType(&o.Active, v)
|
||||
}
|
||||
|
||||
// GetName returns the Name field value if set, zero value otherwise.
|
||||
func (o *CreateCoreRuleSetPayload) GetName() (res CreateCoreRuleSetPayloadGetNameRetType) {
|
||||
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 *CreateCoreRuleSetPayload) GetNameOk() (ret CreateCoreRuleSetPayloadGetNameRetType, ok bool) {
|
||||
return getCreateCoreRuleSetPayloadGetNameAttributeTypeOk(o.Name)
|
||||
}
|
||||
|
||||
// HasName returns a boolean if a field has been set.
|
||||
func (o *CreateCoreRuleSetPayload) HasName() bool {
|
||||
_, ok := o.GetNameOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetName gets a reference to the given string and assigns it to the Name field.
|
||||
func (o *CreateCoreRuleSetPayload) SetName(v CreateCoreRuleSetPayloadGetNameRetType) {
|
||||
setCreateCoreRuleSetPayloadGetNameAttributeType(&o.Name, v)
|
||||
}
|
||||
|
||||
// GetProjectId returns the ProjectId field value if set, zero value otherwise.
|
||||
func (o *CreateCoreRuleSetPayload) GetProjectId() (res CreateCoreRuleSetPayloadGetProjectIdRetType) {
|
||||
res, _ = o.GetProjectIdOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetProjectIdOk returns a tuple with the ProjectId field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CreateCoreRuleSetPayload) GetProjectIdOk() (ret CreateCoreRuleSetPayloadGetProjectIdRetType, ok bool) {
|
||||
return getCreateCoreRuleSetPayloadGetProjectIdAttributeTypeOk(o.ProjectId)
|
||||
}
|
||||
|
||||
// HasProjectId returns a boolean if a field has been set.
|
||||
func (o *CreateCoreRuleSetPayload) HasProjectId() bool {
|
||||
_, ok := o.GetProjectIdOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetProjectId gets a reference to the given string and assigns it to the ProjectId field.
|
||||
func (o *CreateCoreRuleSetPayload) SetProjectId(v CreateCoreRuleSetPayloadGetProjectIdRetType) {
|
||||
setCreateCoreRuleSetPayloadGetProjectIdAttributeType(&o.ProjectId, v)
|
||||
}
|
||||
|
||||
// GetRegion returns the Region field value if set, zero value otherwise.
|
||||
func (o *CreateCoreRuleSetPayload) GetRegion() (res CreateCoreRuleSetPayloadGetRegionRetType) {
|
||||
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 *CreateCoreRuleSetPayload) GetRegionOk() (ret CreateCoreRuleSetPayloadGetRegionRetType, ok bool) {
|
||||
return getCreateCoreRuleSetPayloadGetRegionAttributeTypeOk(o.Region)
|
||||
}
|
||||
|
||||
// HasRegion returns a boolean if a field has been set.
|
||||
func (o *CreateCoreRuleSetPayload) HasRegion() bool {
|
||||
_, ok := o.GetRegionOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetRegion gets a reference to the given string and assigns it to the Region field.
|
||||
func (o *CreateCoreRuleSetPayload) SetRegion(v CreateCoreRuleSetPayloadGetRegionRetType) {
|
||||
setCreateCoreRuleSetPayloadGetRegionAttributeType(&o.Region, v)
|
||||
}
|
||||
|
||||
func (o CreateCoreRuleSetPayload) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getCreateCoreRuleSetPayloadgetActiveAttributeTypeOk(o.Active); ok {
|
||||
toSerialize["Active"] = val
|
||||
}
|
||||
if val, ok := getCreateCoreRuleSetPayloadGetNameAttributeTypeOk(o.Name); ok {
|
||||
toSerialize["Name"] = val
|
||||
}
|
||||
if val, ok := getCreateCoreRuleSetPayloadGetProjectIdAttributeTypeOk(o.ProjectId); ok {
|
||||
toSerialize["ProjectId"] = val
|
||||
}
|
||||
if val, ok := getCreateCoreRuleSetPayloadGetRegionAttributeTypeOk(o.Region); ok {
|
||||
toSerialize["Region"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableCreateCoreRuleSetPayload struct {
|
||||
value *CreateCoreRuleSetPayload
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableCreateCoreRuleSetPayload) Get() *CreateCoreRuleSetPayload {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableCreateCoreRuleSetPayload) Set(val *CreateCoreRuleSetPayload) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableCreateCoreRuleSetPayload) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableCreateCoreRuleSetPayload) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableCreateCoreRuleSetPayload(val *CreateCoreRuleSetPayload) *NullableCreateCoreRuleSetPayload {
|
||||
return &NullableCreateCoreRuleSetPayload{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableCreateCoreRuleSetPayload) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableCreateCoreRuleSetPayload) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/albwafalpha/model_create_core_rule_set_payload_test.go
Normal file
11
pkg/albwafalpha/model_create_core_rule_set_payload_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
226
pkg/albwafalpha/model_create_core_rule_set_response.go
Normal file
226
pkg/albwafalpha/model_create_core_rule_set_response.go
Normal file
|
|
@ -0,0 +1,226 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the CreateCoreRuleSetResponse type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CreateCoreRuleSetResponse{}
|
||||
|
||||
/*
|
||||
types and functions for active
|
||||
*/
|
||||
|
||||
// isBoolean
|
||||
type CreateCoreRuleSetResponsegetActiveAttributeType = *bool
|
||||
type CreateCoreRuleSetResponsegetActiveArgType = bool
|
||||
type CreateCoreRuleSetResponsegetActiveRetType = bool
|
||||
|
||||
func getCreateCoreRuleSetResponsegetActiveAttributeTypeOk(arg CreateCoreRuleSetResponsegetActiveAttributeType) (ret CreateCoreRuleSetResponsegetActiveRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateCoreRuleSetResponsegetActiveAttributeType(arg *CreateCoreRuleSetResponsegetActiveAttributeType, val CreateCoreRuleSetResponsegetActiveRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for name
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateCoreRuleSetResponseGetNameAttributeType = *string
|
||||
|
||||
func getCreateCoreRuleSetResponseGetNameAttributeTypeOk(arg CreateCoreRuleSetResponseGetNameAttributeType) (ret CreateCoreRuleSetResponseGetNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateCoreRuleSetResponseGetNameAttributeType(arg *CreateCoreRuleSetResponseGetNameAttributeType, val CreateCoreRuleSetResponseGetNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateCoreRuleSetResponseGetNameArgType = string
|
||||
type CreateCoreRuleSetResponseGetNameRetType = string
|
||||
|
||||
/*
|
||||
types and functions for region
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateCoreRuleSetResponseGetRegionAttributeType = *string
|
||||
|
||||
func getCreateCoreRuleSetResponseGetRegionAttributeTypeOk(arg CreateCoreRuleSetResponseGetRegionAttributeType) (ret CreateCoreRuleSetResponseGetRegionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateCoreRuleSetResponseGetRegionAttributeType(arg *CreateCoreRuleSetResponseGetRegionAttributeType, val CreateCoreRuleSetResponseGetRegionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateCoreRuleSetResponseGetRegionArgType = string
|
||||
type CreateCoreRuleSetResponseGetRegionRetType = string
|
||||
|
||||
// CreateCoreRuleSetResponse CreateCoreRuleSetResponse returns rule configuration name and it's rules.
|
||||
type CreateCoreRuleSetResponse struct {
|
||||
// Indicates if the OWASP core rule set is active.
|
||||
Active CreateCoreRuleSetResponsegetActiveAttributeType `json:"active,omitempty"`
|
||||
// Core rule set configuration name.
|
||||
Name CreateCoreRuleSetResponseGetNameAttributeType `json:"name,omitempty"`
|
||||
// Region
|
||||
Region CreateCoreRuleSetResponseGetRegionAttributeType `json:"region,omitempty"`
|
||||
}
|
||||
|
||||
// NewCreateCoreRuleSetResponse instantiates a new CreateCoreRuleSetResponse 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 NewCreateCoreRuleSetResponse() *CreateCoreRuleSetResponse {
|
||||
this := CreateCoreRuleSetResponse{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewCreateCoreRuleSetResponseWithDefaults instantiates a new CreateCoreRuleSetResponse 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 NewCreateCoreRuleSetResponseWithDefaults() *CreateCoreRuleSetResponse {
|
||||
this := CreateCoreRuleSetResponse{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetActive returns the Active field value if set, zero value otherwise.
|
||||
func (o *CreateCoreRuleSetResponse) GetActive() (res CreateCoreRuleSetResponsegetActiveRetType) {
|
||||
res, _ = o.GetActiveOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetActiveOk returns a tuple with the Active field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CreateCoreRuleSetResponse) GetActiveOk() (ret CreateCoreRuleSetResponsegetActiveRetType, ok bool) {
|
||||
return getCreateCoreRuleSetResponsegetActiveAttributeTypeOk(o.Active)
|
||||
}
|
||||
|
||||
// HasActive returns a boolean if a field has been set.
|
||||
func (o *CreateCoreRuleSetResponse) HasActive() bool {
|
||||
_, ok := o.GetActiveOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetActive gets a reference to the given bool and assigns it to the Active field.
|
||||
func (o *CreateCoreRuleSetResponse) SetActive(v CreateCoreRuleSetResponsegetActiveRetType) {
|
||||
setCreateCoreRuleSetResponsegetActiveAttributeType(&o.Active, v)
|
||||
}
|
||||
|
||||
// GetName returns the Name field value if set, zero value otherwise.
|
||||
func (o *CreateCoreRuleSetResponse) GetName() (res CreateCoreRuleSetResponseGetNameRetType) {
|
||||
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 *CreateCoreRuleSetResponse) GetNameOk() (ret CreateCoreRuleSetResponseGetNameRetType, ok bool) {
|
||||
return getCreateCoreRuleSetResponseGetNameAttributeTypeOk(o.Name)
|
||||
}
|
||||
|
||||
// HasName returns a boolean if a field has been set.
|
||||
func (o *CreateCoreRuleSetResponse) HasName() bool {
|
||||
_, ok := o.GetNameOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetName gets a reference to the given string and assigns it to the Name field.
|
||||
func (o *CreateCoreRuleSetResponse) SetName(v CreateCoreRuleSetResponseGetNameRetType) {
|
||||
setCreateCoreRuleSetResponseGetNameAttributeType(&o.Name, v)
|
||||
}
|
||||
|
||||
// GetRegion returns the Region field value if set, zero value otherwise.
|
||||
func (o *CreateCoreRuleSetResponse) GetRegion() (res CreateCoreRuleSetResponseGetRegionRetType) {
|
||||
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 *CreateCoreRuleSetResponse) GetRegionOk() (ret CreateCoreRuleSetResponseGetRegionRetType, ok bool) {
|
||||
return getCreateCoreRuleSetResponseGetRegionAttributeTypeOk(o.Region)
|
||||
}
|
||||
|
||||
// HasRegion returns a boolean if a field has been set.
|
||||
func (o *CreateCoreRuleSetResponse) HasRegion() bool {
|
||||
_, ok := o.GetRegionOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetRegion gets a reference to the given string and assigns it to the Region field.
|
||||
func (o *CreateCoreRuleSetResponse) SetRegion(v CreateCoreRuleSetResponseGetRegionRetType) {
|
||||
setCreateCoreRuleSetResponseGetRegionAttributeType(&o.Region, v)
|
||||
}
|
||||
|
||||
func (o CreateCoreRuleSetResponse) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getCreateCoreRuleSetResponsegetActiveAttributeTypeOk(o.Active); ok {
|
||||
toSerialize["Active"] = val
|
||||
}
|
||||
if val, ok := getCreateCoreRuleSetResponseGetNameAttributeTypeOk(o.Name); ok {
|
||||
toSerialize["Name"] = val
|
||||
}
|
||||
if val, ok := getCreateCoreRuleSetResponseGetRegionAttributeTypeOk(o.Region); ok {
|
||||
toSerialize["Region"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableCreateCoreRuleSetResponse struct {
|
||||
value *CreateCoreRuleSetResponse
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableCreateCoreRuleSetResponse) Get() *CreateCoreRuleSetResponse {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableCreateCoreRuleSetResponse) Set(val *CreateCoreRuleSetResponse) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableCreateCoreRuleSetResponse) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableCreateCoreRuleSetResponse) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableCreateCoreRuleSetResponse(val *CreateCoreRuleSetResponse) *NullableCreateCoreRuleSetResponse {
|
||||
return &NullableCreateCoreRuleSetResponse{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableCreateCoreRuleSetResponse) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableCreateCoreRuleSetResponse) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/albwafalpha/model_create_core_rule_set_response_test.go
Normal file
11
pkg/albwafalpha/model_create_core_rule_set_response_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
276
pkg/albwafalpha/model_create_rules_payload.go
Normal file
276
pkg/albwafalpha/model_create_rules_payload.go
Normal file
|
|
@ -0,0 +1,276 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the CreateRulesPayload type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CreateRulesPayload{}
|
||||
|
||||
/*
|
||||
types and functions for name
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateRulesPayloadGetNameAttributeType = *string
|
||||
|
||||
func getCreateRulesPayloadGetNameAttributeTypeOk(arg CreateRulesPayloadGetNameAttributeType) (ret CreateRulesPayloadGetNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateRulesPayloadGetNameAttributeType(arg *CreateRulesPayloadGetNameAttributeType, val CreateRulesPayloadGetNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateRulesPayloadGetNameArgType = string
|
||||
type CreateRulesPayloadGetNameRetType = string
|
||||
|
||||
/*
|
||||
types and functions for projectId
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateRulesPayloadGetProjectIdAttributeType = *string
|
||||
|
||||
func getCreateRulesPayloadGetProjectIdAttributeTypeOk(arg CreateRulesPayloadGetProjectIdAttributeType) (ret CreateRulesPayloadGetProjectIdRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateRulesPayloadGetProjectIdAttributeType(arg *CreateRulesPayloadGetProjectIdAttributeType, val CreateRulesPayloadGetProjectIdRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateRulesPayloadGetProjectIdArgType = string
|
||||
type CreateRulesPayloadGetProjectIdRetType = string
|
||||
|
||||
/*
|
||||
types and functions for region
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateRulesPayloadGetRegionAttributeType = *string
|
||||
|
||||
func getCreateRulesPayloadGetRegionAttributeTypeOk(arg CreateRulesPayloadGetRegionAttributeType) (ret CreateRulesPayloadGetRegionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateRulesPayloadGetRegionAttributeType(arg *CreateRulesPayloadGetRegionAttributeType, val CreateRulesPayloadGetRegionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateRulesPayloadGetRegionArgType = string
|
||||
type CreateRulesPayloadGetRegionRetType = string
|
||||
|
||||
/*
|
||||
types and functions for rules
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateRulesPayloadGetRulesAttributeType = *string
|
||||
|
||||
func getCreateRulesPayloadGetRulesAttributeTypeOk(arg CreateRulesPayloadGetRulesAttributeType) (ret CreateRulesPayloadGetRulesRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateRulesPayloadGetRulesAttributeType(arg *CreateRulesPayloadGetRulesAttributeType, val CreateRulesPayloadGetRulesRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateRulesPayloadGetRulesArgType = string
|
||||
type CreateRulesPayloadGetRulesRetType = string
|
||||
|
||||
// CreateRulesPayload CreateRulesRequest creates a rule configuration.
|
||||
type CreateRulesPayload struct {
|
||||
// Rule configuration name.
|
||||
Name CreateRulesPayloadGetNameAttributeType `json:"name,omitempty"`
|
||||
// Project identifier
|
||||
ProjectId CreateRulesPayloadGetProjectIdAttributeType `json:"projectId,omitempty"`
|
||||
// Region
|
||||
Region CreateRulesPayloadGetRegionAttributeType `json:"region,omitempty"`
|
||||
// Custom rules for WAF written in Seclang syntax.
|
||||
Rules CreateRulesPayloadGetRulesAttributeType `json:"rules,omitempty"`
|
||||
}
|
||||
|
||||
// NewCreateRulesPayload instantiates a new CreateRulesPayload 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 NewCreateRulesPayload() *CreateRulesPayload {
|
||||
this := CreateRulesPayload{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewCreateRulesPayloadWithDefaults instantiates a new CreateRulesPayload 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 NewCreateRulesPayloadWithDefaults() *CreateRulesPayload {
|
||||
this := CreateRulesPayload{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetName returns the Name field value if set, zero value otherwise.
|
||||
func (o *CreateRulesPayload) GetName() (res CreateRulesPayloadGetNameRetType) {
|
||||
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 *CreateRulesPayload) GetNameOk() (ret CreateRulesPayloadGetNameRetType, ok bool) {
|
||||
return getCreateRulesPayloadGetNameAttributeTypeOk(o.Name)
|
||||
}
|
||||
|
||||
// HasName returns a boolean if a field has been set.
|
||||
func (o *CreateRulesPayload) HasName() bool {
|
||||
_, ok := o.GetNameOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetName gets a reference to the given string and assigns it to the Name field.
|
||||
func (o *CreateRulesPayload) SetName(v CreateRulesPayloadGetNameRetType) {
|
||||
setCreateRulesPayloadGetNameAttributeType(&o.Name, v)
|
||||
}
|
||||
|
||||
// GetProjectId returns the ProjectId field value if set, zero value otherwise.
|
||||
func (o *CreateRulesPayload) GetProjectId() (res CreateRulesPayloadGetProjectIdRetType) {
|
||||
res, _ = o.GetProjectIdOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetProjectIdOk returns a tuple with the ProjectId field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CreateRulesPayload) GetProjectIdOk() (ret CreateRulesPayloadGetProjectIdRetType, ok bool) {
|
||||
return getCreateRulesPayloadGetProjectIdAttributeTypeOk(o.ProjectId)
|
||||
}
|
||||
|
||||
// HasProjectId returns a boolean if a field has been set.
|
||||
func (o *CreateRulesPayload) HasProjectId() bool {
|
||||
_, ok := o.GetProjectIdOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetProjectId gets a reference to the given string and assigns it to the ProjectId field.
|
||||
func (o *CreateRulesPayload) SetProjectId(v CreateRulesPayloadGetProjectIdRetType) {
|
||||
setCreateRulesPayloadGetProjectIdAttributeType(&o.ProjectId, v)
|
||||
}
|
||||
|
||||
// GetRegion returns the Region field value if set, zero value otherwise.
|
||||
func (o *CreateRulesPayload) GetRegion() (res CreateRulesPayloadGetRegionRetType) {
|
||||
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 *CreateRulesPayload) GetRegionOk() (ret CreateRulesPayloadGetRegionRetType, ok bool) {
|
||||
return getCreateRulesPayloadGetRegionAttributeTypeOk(o.Region)
|
||||
}
|
||||
|
||||
// HasRegion returns a boolean if a field has been set.
|
||||
func (o *CreateRulesPayload) HasRegion() bool {
|
||||
_, ok := o.GetRegionOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetRegion gets a reference to the given string and assigns it to the Region field.
|
||||
func (o *CreateRulesPayload) SetRegion(v CreateRulesPayloadGetRegionRetType) {
|
||||
setCreateRulesPayloadGetRegionAttributeType(&o.Region, v)
|
||||
}
|
||||
|
||||
// GetRules returns the Rules field value if set, zero value otherwise.
|
||||
func (o *CreateRulesPayload) GetRules() (res CreateRulesPayloadGetRulesRetType) {
|
||||
res, _ = o.GetRulesOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetRulesOk returns a tuple with the Rules field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CreateRulesPayload) GetRulesOk() (ret CreateRulesPayloadGetRulesRetType, ok bool) {
|
||||
return getCreateRulesPayloadGetRulesAttributeTypeOk(o.Rules)
|
||||
}
|
||||
|
||||
// HasRules returns a boolean if a field has been set.
|
||||
func (o *CreateRulesPayload) HasRules() bool {
|
||||
_, ok := o.GetRulesOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetRules gets a reference to the given string and assigns it to the Rules field.
|
||||
func (o *CreateRulesPayload) SetRules(v CreateRulesPayloadGetRulesRetType) {
|
||||
setCreateRulesPayloadGetRulesAttributeType(&o.Rules, v)
|
||||
}
|
||||
|
||||
func (o CreateRulesPayload) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getCreateRulesPayloadGetNameAttributeTypeOk(o.Name); ok {
|
||||
toSerialize["Name"] = val
|
||||
}
|
||||
if val, ok := getCreateRulesPayloadGetProjectIdAttributeTypeOk(o.ProjectId); ok {
|
||||
toSerialize["ProjectId"] = val
|
||||
}
|
||||
if val, ok := getCreateRulesPayloadGetRegionAttributeTypeOk(o.Region); ok {
|
||||
toSerialize["Region"] = val
|
||||
}
|
||||
if val, ok := getCreateRulesPayloadGetRulesAttributeTypeOk(o.Rules); ok {
|
||||
toSerialize["Rules"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableCreateRulesPayload struct {
|
||||
value *CreateRulesPayload
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableCreateRulesPayload) Get() *CreateRulesPayload {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableCreateRulesPayload) Set(val *CreateRulesPayload) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableCreateRulesPayload) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableCreateRulesPayload) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableCreateRulesPayload(val *CreateRulesPayload) *NullableCreateRulesPayload {
|
||||
return &NullableCreateRulesPayload{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableCreateRulesPayload) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableCreateRulesPayload) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/albwafalpha/model_create_rules_payload_test.go
Normal file
11
pkg/albwafalpha/model_create_rules_payload_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
227
pkg/albwafalpha/model_create_rules_response.go
Normal file
227
pkg/albwafalpha/model_create_rules_response.go
Normal file
|
|
@ -0,0 +1,227 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the CreateRulesResponse type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CreateRulesResponse{}
|
||||
|
||||
/*
|
||||
types and functions for name
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateRulesResponseGetNameAttributeType = *string
|
||||
|
||||
func getCreateRulesResponseGetNameAttributeTypeOk(arg CreateRulesResponseGetNameAttributeType) (ret CreateRulesResponseGetNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateRulesResponseGetNameAttributeType(arg *CreateRulesResponseGetNameAttributeType, val CreateRulesResponseGetNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateRulesResponseGetNameArgType = string
|
||||
type CreateRulesResponseGetNameRetType = string
|
||||
|
||||
/*
|
||||
types and functions for region
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateRulesResponseGetRegionAttributeType = *string
|
||||
|
||||
func getCreateRulesResponseGetRegionAttributeTypeOk(arg CreateRulesResponseGetRegionAttributeType) (ret CreateRulesResponseGetRegionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateRulesResponseGetRegionAttributeType(arg *CreateRulesResponseGetRegionAttributeType, val CreateRulesResponseGetRegionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateRulesResponseGetRegionArgType = string
|
||||
type CreateRulesResponseGetRegionRetType = string
|
||||
|
||||
/*
|
||||
types and functions for rules
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateRulesResponseGetRulesAttributeType = *string
|
||||
|
||||
func getCreateRulesResponseGetRulesAttributeTypeOk(arg CreateRulesResponseGetRulesAttributeType) (ret CreateRulesResponseGetRulesRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateRulesResponseGetRulesAttributeType(arg *CreateRulesResponseGetRulesAttributeType, val CreateRulesResponseGetRulesRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateRulesResponseGetRulesArgType = string
|
||||
type CreateRulesResponseGetRulesRetType = string
|
||||
|
||||
// CreateRulesResponse CreateRulesResponse returns rule configuration name and it's rules.
|
||||
type CreateRulesResponse struct {
|
||||
// Rule configuration name.
|
||||
Name CreateRulesResponseGetNameAttributeType `json:"name,omitempty"`
|
||||
// Region
|
||||
Region CreateRulesResponseGetRegionAttributeType `json:"region,omitempty"`
|
||||
// Custom rules written in Seclang syntax.
|
||||
Rules CreateRulesResponseGetRulesAttributeType `json:"rules,omitempty"`
|
||||
}
|
||||
|
||||
// NewCreateRulesResponse instantiates a new CreateRulesResponse 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 NewCreateRulesResponse() *CreateRulesResponse {
|
||||
this := CreateRulesResponse{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewCreateRulesResponseWithDefaults instantiates a new CreateRulesResponse 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 NewCreateRulesResponseWithDefaults() *CreateRulesResponse {
|
||||
this := CreateRulesResponse{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetName returns the Name field value if set, zero value otherwise.
|
||||
func (o *CreateRulesResponse) GetName() (res CreateRulesResponseGetNameRetType) {
|
||||
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 *CreateRulesResponse) GetNameOk() (ret CreateRulesResponseGetNameRetType, ok bool) {
|
||||
return getCreateRulesResponseGetNameAttributeTypeOk(o.Name)
|
||||
}
|
||||
|
||||
// HasName returns a boolean if a field has been set.
|
||||
func (o *CreateRulesResponse) HasName() bool {
|
||||
_, ok := o.GetNameOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetName gets a reference to the given string and assigns it to the Name field.
|
||||
func (o *CreateRulesResponse) SetName(v CreateRulesResponseGetNameRetType) {
|
||||
setCreateRulesResponseGetNameAttributeType(&o.Name, v)
|
||||
}
|
||||
|
||||
// GetRegion returns the Region field value if set, zero value otherwise.
|
||||
func (o *CreateRulesResponse) GetRegion() (res CreateRulesResponseGetRegionRetType) {
|
||||
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 *CreateRulesResponse) GetRegionOk() (ret CreateRulesResponseGetRegionRetType, ok bool) {
|
||||
return getCreateRulesResponseGetRegionAttributeTypeOk(o.Region)
|
||||
}
|
||||
|
||||
// HasRegion returns a boolean if a field has been set.
|
||||
func (o *CreateRulesResponse) HasRegion() bool {
|
||||
_, ok := o.GetRegionOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetRegion gets a reference to the given string and assigns it to the Region field.
|
||||
func (o *CreateRulesResponse) SetRegion(v CreateRulesResponseGetRegionRetType) {
|
||||
setCreateRulesResponseGetRegionAttributeType(&o.Region, v)
|
||||
}
|
||||
|
||||
// GetRules returns the Rules field value if set, zero value otherwise.
|
||||
func (o *CreateRulesResponse) GetRules() (res CreateRulesResponseGetRulesRetType) {
|
||||
res, _ = o.GetRulesOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetRulesOk returns a tuple with the Rules field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CreateRulesResponse) GetRulesOk() (ret CreateRulesResponseGetRulesRetType, ok bool) {
|
||||
return getCreateRulesResponseGetRulesAttributeTypeOk(o.Rules)
|
||||
}
|
||||
|
||||
// HasRules returns a boolean if a field has been set.
|
||||
func (o *CreateRulesResponse) HasRules() bool {
|
||||
_, ok := o.GetRulesOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetRules gets a reference to the given string and assigns it to the Rules field.
|
||||
func (o *CreateRulesResponse) SetRules(v CreateRulesResponseGetRulesRetType) {
|
||||
setCreateRulesResponseGetRulesAttributeType(&o.Rules, v)
|
||||
}
|
||||
|
||||
func (o CreateRulesResponse) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getCreateRulesResponseGetNameAttributeTypeOk(o.Name); ok {
|
||||
toSerialize["Name"] = val
|
||||
}
|
||||
if val, ok := getCreateRulesResponseGetRegionAttributeTypeOk(o.Region); ok {
|
||||
toSerialize["Region"] = val
|
||||
}
|
||||
if val, ok := getCreateRulesResponseGetRulesAttributeTypeOk(o.Rules); ok {
|
||||
toSerialize["Rules"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableCreateRulesResponse struct {
|
||||
value *CreateRulesResponse
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableCreateRulesResponse) Get() *CreateRulesResponse {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableCreateRulesResponse) Set(val *CreateRulesResponse) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableCreateRulesResponse) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableCreateRulesResponse) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableCreateRulesResponse(val *CreateRulesResponse) *NullableCreateRulesResponse {
|
||||
return &NullableCreateRulesResponse{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableCreateRulesResponse) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableCreateRulesResponse) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/albwafalpha/model_create_rules_response_test.go
Normal file
11
pkg/albwafalpha/model_create_rules_response_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
325
pkg/albwafalpha/model_create_waf_payload.go
Normal file
325
pkg/albwafalpha/model_create_waf_payload.go
Normal file
|
|
@ -0,0 +1,325 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the CreateWAFPayload type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CreateWAFPayload{}
|
||||
|
||||
/*
|
||||
types and functions for coreRuleSetName
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateWAFPayloadGetCoreRuleSetNameAttributeType = *string
|
||||
|
||||
func getCreateWAFPayloadGetCoreRuleSetNameAttributeTypeOk(arg CreateWAFPayloadGetCoreRuleSetNameAttributeType) (ret CreateWAFPayloadGetCoreRuleSetNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateWAFPayloadGetCoreRuleSetNameAttributeType(arg *CreateWAFPayloadGetCoreRuleSetNameAttributeType, val CreateWAFPayloadGetCoreRuleSetNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateWAFPayloadGetCoreRuleSetNameArgType = string
|
||||
type CreateWAFPayloadGetCoreRuleSetNameRetType = string
|
||||
|
||||
/*
|
||||
types and functions for name
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateWAFPayloadGetNameAttributeType = *string
|
||||
|
||||
func getCreateWAFPayloadGetNameAttributeTypeOk(arg CreateWAFPayloadGetNameAttributeType) (ret CreateWAFPayloadGetNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateWAFPayloadGetNameAttributeType(arg *CreateWAFPayloadGetNameAttributeType, val CreateWAFPayloadGetNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateWAFPayloadGetNameArgType = string
|
||||
type CreateWAFPayloadGetNameRetType = string
|
||||
|
||||
/*
|
||||
types and functions for projectId
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateWAFPayloadGetProjectIdAttributeType = *string
|
||||
|
||||
func getCreateWAFPayloadGetProjectIdAttributeTypeOk(arg CreateWAFPayloadGetProjectIdAttributeType) (ret CreateWAFPayloadGetProjectIdRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateWAFPayloadGetProjectIdAttributeType(arg *CreateWAFPayloadGetProjectIdAttributeType, val CreateWAFPayloadGetProjectIdRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateWAFPayloadGetProjectIdArgType = string
|
||||
type CreateWAFPayloadGetProjectIdRetType = string
|
||||
|
||||
/*
|
||||
types and functions for region
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateWAFPayloadGetRegionAttributeType = *string
|
||||
|
||||
func getCreateWAFPayloadGetRegionAttributeTypeOk(arg CreateWAFPayloadGetRegionAttributeType) (ret CreateWAFPayloadGetRegionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateWAFPayloadGetRegionAttributeType(arg *CreateWAFPayloadGetRegionAttributeType, val CreateWAFPayloadGetRegionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateWAFPayloadGetRegionArgType = string
|
||||
type CreateWAFPayloadGetRegionRetType = string
|
||||
|
||||
/*
|
||||
types and functions for rulesConfigName
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateWAFPayloadGetRulesConfigNameAttributeType = *string
|
||||
|
||||
func getCreateWAFPayloadGetRulesConfigNameAttributeTypeOk(arg CreateWAFPayloadGetRulesConfigNameAttributeType) (ret CreateWAFPayloadGetRulesConfigNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateWAFPayloadGetRulesConfigNameAttributeType(arg *CreateWAFPayloadGetRulesConfigNameAttributeType, val CreateWAFPayloadGetRulesConfigNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateWAFPayloadGetRulesConfigNameArgType = string
|
||||
type CreateWAFPayloadGetRulesConfigNameRetType = string
|
||||
|
||||
// CreateWAFPayload CreateWAFRequest creates a WAF with rules.
|
||||
type CreateWAFPayload struct {
|
||||
// Name of the core rule set configuration for that WAF.
|
||||
CoreRuleSetName CreateWAFPayloadGetCoreRuleSetNameAttributeType `json:"coreRuleSetName,omitempty"`
|
||||
// WAF name
|
||||
Name CreateWAFPayloadGetNameAttributeType `json:"name,omitempty"`
|
||||
// Project identifier
|
||||
ProjectId CreateWAFPayloadGetProjectIdAttributeType `json:"projectId,omitempty"`
|
||||
// Region
|
||||
Region CreateWAFPayloadGetRegionAttributeType `json:"region,omitempty"`
|
||||
// Name of the rule configuration for that WAF.
|
||||
RulesConfigName CreateWAFPayloadGetRulesConfigNameAttributeType `json:"rulesConfigName,omitempty"`
|
||||
}
|
||||
|
||||
// NewCreateWAFPayload instantiates a new CreateWAFPayload 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 NewCreateWAFPayload() *CreateWAFPayload {
|
||||
this := CreateWAFPayload{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewCreateWAFPayloadWithDefaults instantiates a new CreateWAFPayload 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 NewCreateWAFPayloadWithDefaults() *CreateWAFPayload {
|
||||
this := CreateWAFPayload{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetCoreRuleSetName returns the CoreRuleSetName field value if set, zero value otherwise.
|
||||
func (o *CreateWAFPayload) GetCoreRuleSetName() (res CreateWAFPayloadGetCoreRuleSetNameRetType) {
|
||||
res, _ = o.GetCoreRuleSetNameOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetCoreRuleSetNameOk returns a tuple with the CoreRuleSetName field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CreateWAFPayload) GetCoreRuleSetNameOk() (ret CreateWAFPayloadGetCoreRuleSetNameRetType, ok bool) {
|
||||
return getCreateWAFPayloadGetCoreRuleSetNameAttributeTypeOk(o.CoreRuleSetName)
|
||||
}
|
||||
|
||||
// HasCoreRuleSetName returns a boolean if a field has been set.
|
||||
func (o *CreateWAFPayload) HasCoreRuleSetName() bool {
|
||||
_, ok := o.GetCoreRuleSetNameOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetCoreRuleSetName gets a reference to the given string and assigns it to the CoreRuleSetName field.
|
||||
func (o *CreateWAFPayload) SetCoreRuleSetName(v CreateWAFPayloadGetCoreRuleSetNameRetType) {
|
||||
setCreateWAFPayloadGetCoreRuleSetNameAttributeType(&o.CoreRuleSetName, v)
|
||||
}
|
||||
|
||||
// GetName returns the Name field value if set, zero value otherwise.
|
||||
func (o *CreateWAFPayload) GetName() (res CreateWAFPayloadGetNameRetType) {
|
||||
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 *CreateWAFPayload) GetNameOk() (ret CreateWAFPayloadGetNameRetType, ok bool) {
|
||||
return getCreateWAFPayloadGetNameAttributeTypeOk(o.Name)
|
||||
}
|
||||
|
||||
// HasName returns a boolean if a field has been set.
|
||||
func (o *CreateWAFPayload) HasName() bool {
|
||||
_, ok := o.GetNameOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetName gets a reference to the given string and assigns it to the Name field.
|
||||
func (o *CreateWAFPayload) SetName(v CreateWAFPayloadGetNameRetType) {
|
||||
setCreateWAFPayloadGetNameAttributeType(&o.Name, v)
|
||||
}
|
||||
|
||||
// GetProjectId returns the ProjectId field value if set, zero value otherwise.
|
||||
func (o *CreateWAFPayload) GetProjectId() (res CreateWAFPayloadGetProjectIdRetType) {
|
||||
res, _ = o.GetProjectIdOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetProjectIdOk returns a tuple with the ProjectId field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CreateWAFPayload) GetProjectIdOk() (ret CreateWAFPayloadGetProjectIdRetType, ok bool) {
|
||||
return getCreateWAFPayloadGetProjectIdAttributeTypeOk(o.ProjectId)
|
||||
}
|
||||
|
||||
// HasProjectId returns a boolean if a field has been set.
|
||||
func (o *CreateWAFPayload) HasProjectId() bool {
|
||||
_, ok := o.GetProjectIdOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetProjectId gets a reference to the given string and assigns it to the ProjectId field.
|
||||
func (o *CreateWAFPayload) SetProjectId(v CreateWAFPayloadGetProjectIdRetType) {
|
||||
setCreateWAFPayloadGetProjectIdAttributeType(&o.ProjectId, v)
|
||||
}
|
||||
|
||||
// GetRegion returns the Region field value if set, zero value otherwise.
|
||||
func (o *CreateWAFPayload) GetRegion() (res CreateWAFPayloadGetRegionRetType) {
|
||||
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 *CreateWAFPayload) GetRegionOk() (ret CreateWAFPayloadGetRegionRetType, ok bool) {
|
||||
return getCreateWAFPayloadGetRegionAttributeTypeOk(o.Region)
|
||||
}
|
||||
|
||||
// HasRegion returns a boolean if a field has been set.
|
||||
func (o *CreateWAFPayload) HasRegion() bool {
|
||||
_, ok := o.GetRegionOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetRegion gets a reference to the given string and assigns it to the Region field.
|
||||
func (o *CreateWAFPayload) SetRegion(v CreateWAFPayloadGetRegionRetType) {
|
||||
setCreateWAFPayloadGetRegionAttributeType(&o.Region, v)
|
||||
}
|
||||
|
||||
// GetRulesConfigName returns the RulesConfigName field value if set, zero value otherwise.
|
||||
func (o *CreateWAFPayload) GetRulesConfigName() (res CreateWAFPayloadGetRulesConfigNameRetType) {
|
||||
res, _ = o.GetRulesConfigNameOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetRulesConfigNameOk returns a tuple with the RulesConfigName field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CreateWAFPayload) GetRulesConfigNameOk() (ret CreateWAFPayloadGetRulesConfigNameRetType, ok bool) {
|
||||
return getCreateWAFPayloadGetRulesConfigNameAttributeTypeOk(o.RulesConfigName)
|
||||
}
|
||||
|
||||
// HasRulesConfigName returns a boolean if a field has been set.
|
||||
func (o *CreateWAFPayload) HasRulesConfigName() bool {
|
||||
_, ok := o.GetRulesConfigNameOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetRulesConfigName gets a reference to the given string and assigns it to the RulesConfigName field.
|
||||
func (o *CreateWAFPayload) SetRulesConfigName(v CreateWAFPayloadGetRulesConfigNameRetType) {
|
||||
setCreateWAFPayloadGetRulesConfigNameAttributeType(&o.RulesConfigName, v)
|
||||
}
|
||||
|
||||
func (o CreateWAFPayload) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getCreateWAFPayloadGetCoreRuleSetNameAttributeTypeOk(o.CoreRuleSetName); ok {
|
||||
toSerialize["CoreRuleSetName"] = val
|
||||
}
|
||||
if val, ok := getCreateWAFPayloadGetNameAttributeTypeOk(o.Name); ok {
|
||||
toSerialize["Name"] = val
|
||||
}
|
||||
if val, ok := getCreateWAFPayloadGetProjectIdAttributeTypeOk(o.ProjectId); ok {
|
||||
toSerialize["ProjectId"] = val
|
||||
}
|
||||
if val, ok := getCreateWAFPayloadGetRegionAttributeTypeOk(o.Region); ok {
|
||||
toSerialize["Region"] = val
|
||||
}
|
||||
if val, ok := getCreateWAFPayloadGetRulesConfigNameAttributeTypeOk(o.RulesConfigName); ok {
|
||||
toSerialize["RulesConfigName"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableCreateWAFPayload struct {
|
||||
value *CreateWAFPayload
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableCreateWAFPayload) Get() *CreateWAFPayload {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableCreateWAFPayload) Set(val *CreateWAFPayload) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableCreateWAFPayload) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableCreateWAFPayload) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableCreateWAFPayload(val *CreateWAFPayload) *NullableCreateWAFPayload {
|
||||
return &NullableCreateWAFPayload{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableCreateWAFPayload) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableCreateWAFPayload) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/albwafalpha/model_create_waf_payload_test.go
Normal file
11
pkg/albwafalpha/model_create_waf_payload_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
276
pkg/albwafalpha/model_create_waf_response.go
Normal file
276
pkg/albwafalpha/model_create_waf_response.go
Normal file
|
|
@ -0,0 +1,276 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the CreateWAFResponse type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CreateWAFResponse{}
|
||||
|
||||
/*
|
||||
types and functions for coreRuleSetName
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateWAFResponseGetCoreRuleSetNameAttributeType = *string
|
||||
|
||||
func getCreateWAFResponseGetCoreRuleSetNameAttributeTypeOk(arg CreateWAFResponseGetCoreRuleSetNameAttributeType) (ret CreateWAFResponseGetCoreRuleSetNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateWAFResponseGetCoreRuleSetNameAttributeType(arg *CreateWAFResponseGetCoreRuleSetNameAttributeType, val CreateWAFResponseGetCoreRuleSetNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateWAFResponseGetCoreRuleSetNameArgType = string
|
||||
type CreateWAFResponseGetCoreRuleSetNameRetType = string
|
||||
|
||||
/*
|
||||
types and functions for name
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateWAFResponseGetNameAttributeType = *string
|
||||
|
||||
func getCreateWAFResponseGetNameAttributeTypeOk(arg CreateWAFResponseGetNameAttributeType) (ret CreateWAFResponseGetNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateWAFResponseGetNameAttributeType(arg *CreateWAFResponseGetNameAttributeType, val CreateWAFResponseGetNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateWAFResponseGetNameArgType = string
|
||||
type CreateWAFResponseGetNameRetType = string
|
||||
|
||||
/*
|
||||
types and functions for region
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateWAFResponseGetRegionAttributeType = *string
|
||||
|
||||
func getCreateWAFResponseGetRegionAttributeTypeOk(arg CreateWAFResponseGetRegionAttributeType) (ret CreateWAFResponseGetRegionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateWAFResponseGetRegionAttributeType(arg *CreateWAFResponseGetRegionAttributeType, val CreateWAFResponseGetRegionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateWAFResponseGetRegionArgType = string
|
||||
type CreateWAFResponseGetRegionRetType = string
|
||||
|
||||
/*
|
||||
types and functions for rulesConfigName
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateWAFResponseGetRulesConfigNameAttributeType = *string
|
||||
|
||||
func getCreateWAFResponseGetRulesConfigNameAttributeTypeOk(arg CreateWAFResponseGetRulesConfigNameAttributeType) (ret CreateWAFResponseGetRulesConfigNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateWAFResponseGetRulesConfigNameAttributeType(arg *CreateWAFResponseGetRulesConfigNameAttributeType, val CreateWAFResponseGetRulesConfigNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateWAFResponseGetRulesConfigNameArgType = string
|
||||
type CreateWAFResponseGetRulesConfigNameRetType = string
|
||||
|
||||
// CreateWAFResponse CreateWAFResponse returns name and custom rules.
|
||||
type CreateWAFResponse struct {
|
||||
// Name of the core rule set configuration for that WAF.
|
||||
CoreRuleSetName CreateWAFResponseGetCoreRuleSetNameAttributeType `json:"coreRuleSetName,omitempty"`
|
||||
// WAF name
|
||||
Name CreateWAFResponseGetNameAttributeType `json:"name,omitempty"`
|
||||
// Region
|
||||
Region CreateWAFResponseGetRegionAttributeType `json:"region,omitempty"`
|
||||
// Name of the rule configuration for that WAF.
|
||||
RulesConfigName CreateWAFResponseGetRulesConfigNameAttributeType `json:"rulesConfigName,omitempty"`
|
||||
}
|
||||
|
||||
// NewCreateWAFResponse instantiates a new CreateWAFResponse 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 NewCreateWAFResponse() *CreateWAFResponse {
|
||||
this := CreateWAFResponse{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewCreateWAFResponseWithDefaults instantiates a new CreateWAFResponse 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 NewCreateWAFResponseWithDefaults() *CreateWAFResponse {
|
||||
this := CreateWAFResponse{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetCoreRuleSetName returns the CoreRuleSetName field value if set, zero value otherwise.
|
||||
func (o *CreateWAFResponse) GetCoreRuleSetName() (res CreateWAFResponseGetCoreRuleSetNameRetType) {
|
||||
res, _ = o.GetCoreRuleSetNameOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetCoreRuleSetNameOk returns a tuple with the CoreRuleSetName field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CreateWAFResponse) GetCoreRuleSetNameOk() (ret CreateWAFResponseGetCoreRuleSetNameRetType, ok bool) {
|
||||
return getCreateWAFResponseGetCoreRuleSetNameAttributeTypeOk(o.CoreRuleSetName)
|
||||
}
|
||||
|
||||
// HasCoreRuleSetName returns a boolean if a field has been set.
|
||||
func (o *CreateWAFResponse) HasCoreRuleSetName() bool {
|
||||
_, ok := o.GetCoreRuleSetNameOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetCoreRuleSetName gets a reference to the given string and assigns it to the CoreRuleSetName field.
|
||||
func (o *CreateWAFResponse) SetCoreRuleSetName(v CreateWAFResponseGetCoreRuleSetNameRetType) {
|
||||
setCreateWAFResponseGetCoreRuleSetNameAttributeType(&o.CoreRuleSetName, v)
|
||||
}
|
||||
|
||||
// GetName returns the Name field value if set, zero value otherwise.
|
||||
func (o *CreateWAFResponse) GetName() (res CreateWAFResponseGetNameRetType) {
|
||||
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 *CreateWAFResponse) GetNameOk() (ret CreateWAFResponseGetNameRetType, ok bool) {
|
||||
return getCreateWAFResponseGetNameAttributeTypeOk(o.Name)
|
||||
}
|
||||
|
||||
// HasName returns a boolean if a field has been set.
|
||||
func (o *CreateWAFResponse) HasName() bool {
|
||||
_, ok := o.GetNameOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetName gets a reference to the given string and assigns it to the Name field.
|
||||
func (o *CreateWAFResponse) SetName(v CreateWAFResponseGetNameRetType) {
|
||||
setCreateWAFResponseGetNameAttributeType(&o.Name, v)
|
||||
}
|
||||
|
||||
// GetRegion returns the Region field value if set, zero value otherwise.
|
||||
func (o *CreateWAFResponse) GetRegion() (res CreateWAFResponseGetRegionRetType) {
|
||||
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 *CreateWAFResponse) GetRegionOk() (ret CreateWAFResponseGetRegionRetType, ok bool) {
|
||||
return getCreateWAFResponseGetRegionAttributeTypeOk(o.Region)
|
||||
}
|
||||
|
||||
// HasRegion returns a boolean if a field has been set.
|
||||
func (o *CreateWAFResponse) HasRegion() bool {
|
||||
_, ok := o.GetRegionOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetRegion gets a reference to the given string and assigns it to the Region field.
|
||||
func (o *CreateWAFResponse) SetRegion(v CreateWAFResponseGetRegionRetType) {
|
||||
setCreateWAFResponseGetRegionAttributeType(&o.Region, v)
|
||||
}
|
||||
|
||||
// GetRulesConfigName returns the RulesConfigName field value if set, zero value otherwise.
|
||||
func (o *CreateWAFResponse) GetRulesConfigName() (res CreateWAFResponseGetRulesConfigNameRetType) {
|
||||
res, _ = o.GetRulesConfigNameOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetRulesConfigNameOk returns a tuple with the RulesConfigName field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CreateWAFResponse) GetRulesConfigNameOk() (ret CreateWAFResponseGetRulesConfigNameRetType, ok bool) {
|
||||
return getCreateWAFResponseGetRulesConfigNameAttributeTypeOk(o.RulesConfigName)
|
||||
}
|
||||
|
||||
// HasRulesConfigName returns a boolean if a field has been set.
|
||||
func (o *CreateWAFResponse) HasRulesConfigName() bool {
|
||||
_, ok := o.GetRulesConfigNameOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetRulesConfigName gets a reference to the given string and assigns it to the RulesConfigName field.
|
||||
func (o *CreateWAFResponse) SetRulesConfigName(v CreateWAFResponseGetRulesConfigNameRetType) {
|
||||
setCreateWAFResponseGetRulesConfigNameAttributeType(&o.RulesConfigName, v)
|
||||
}
|
||||
|
||||
func (o CreateWAFResponse) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getCreateWAFResponseGetCoreRuleSetNameAttributeTypeOk(o.CoreRuleSetName); ok {
|
||||
toSerialize["CoreRuleSetName"] = val
|
||||
}
|
||||
if val, ok := getCreateWAFResponseGetNameAttributeTypeOk(o.Name); ok {
|
||||
toSerialize["Name"] = val
|
||||
}
|
||||
if val, ok := getCreateWAFResponseGetRegionAttributeTypeOk(o.Region); ok {
|
||||
toSerialize["Region"] = val
|
||||
}
|
||||
if val, ok := getCreateWAFResponseGetRulesConfigNameAttributeTypeOk(o.RulesConfigName); ok {
|
||||
toSerialize["RulesConfigName"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableCreateWAFResponse struct {
|
||||
value *CreateWAFResponse
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableCreateWAFResponse) Get() *CreateWAFResponse {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableCreateWAFResponse) Set(val *CreateWAFResponse) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableCreateWAFResponse) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableCreateWAFResponse) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableCreateWAFResponse(val *CreateWAFResponse) *NullableCreateWAFResponse {
|
||||
return &NullableCreateWAFResponse{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableCreateWAFResponse) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableCreateWAFResponse) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/albwafalpha/model_create_waf_response_test.go
Normal file
11
pkg/albwafalpha/model_create_waf_response_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
226
pkg/albwafalpha/model_get_core_rule_set_response.go
Normal file
226
pkg/albwafalpha/model_get_core_rule_set_response.go
Normal file
|
|
@ -0,0 +1,226 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the GetCoreRuleSetResponse type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &GetCoreRuleSetResponse{}
|
||||
|
||||
/*
|
||||
types and functions for active
|
||||
*/
|
||||
|
||||
// isBoolean
|
||||
type GetCoreRuleSetResponsegetActiveAttributeType = *bool
|
||||
type GetCoreRuleSetResponsegetActiveArgType = bool
|
||||
type GetCoreRuleSetResponsegetActiveRetType = bool
|
||||
|
||||
func getGetCoreRuleSetResponsegetActiveAttributeTypeOk(arg GetCoreRuleSetResponsegetActiveAttributeType) (ret GetCoreRuleSetResponsegetActiveRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setGetCoreRuleSetResponsegetActiveAttributeType(arg *GetCoreRuleSetResponsegetActiveAttributeType, val GetCoreRuleSetResponsegetActiveRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for name
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type GetCoreRuleSetResponseGetNameAttributeType = *string
|
||||
|
||||
func getGetCoreRuleSetResponseGetNameAttributeTypeOk(arg GetCoreRuleSetResponseGetNameAttributeType) (ret GetCoreRuleSetResponseGetNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setGetCoreRuleSetResponseGetNameAttributeType(arg *GetCoreRuleSetResponseGetNameAttributeType, val GetCoreRuleSetResponseGetNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type GetCoreRuleSetResponseGetNameArgType = string
|
||||
type GetCoreRuleSetResponseGetNameRetType = string
|
||||
|
||||
/*
|
||||
types and functions for region
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type GetCoreRuleSetResponseGetRegionAttributeType = *string
|
||||
|
||||
func getGetCoreRuleSetResponseGetRegionAttributeTypeOk(arg GetCoreRuleSetResponseGetRegionAttributeType) (ret GetCoreRuleSetResponseGetRegionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setGetCoreRuleSetResponseGetRegionAttributeType(arg *GetCoreRuleSetResponseGetRegionAttributeType, val GetCoreRuleSetResponseGetRegionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type GetCoreRuleSetResponseGetRegionArgType = string
|
||||
type GetCoreRuleSetResponseGetRegionRetType = string
|
||||
|
||||
// GetCoreRuleSetResponse GetCoreRuleSetResponse returns rule configuration name and it's rules.
|
||||
type GetCoreRuleSetResponse struct {
|
||||
// Indicates if the OWASP core rule set is active.
|
||||
Active GetCoreRuleSetResponsegetActiveAttributeType `json:"active,omitempty"`
|
||||
// Core rule set configuration name.
|
||||
Name GetCoreRuleSetResponseGetNameAttributeType `json:"name,omitempty"`
|
||||
// Region
|
||||
Region GetCoreRuleSetResponseGetRegionAttributeType `json:"region,omitempty"`
|
||||
}
|
||||
|
||||
// NewGetCoreRuleSetResponse instantiates a new GetCoreRuleSetResponse 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 NewGetCoreRuleSetResponse() *GetCoreRuleSetResponse {
|
||||
this := GetCoreRuleSetResponse{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewGetCoreRuleSetResponseWithDefaults instantiates a new GetCoreRuleSetResponse 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 NewGetCoreRuleSetResponseWithDefaults() *GetCoreRuleSetResponse {
|
||||
this := GetCoreRuleSetResponse{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetActive returns the Active field value if set, zero value otherwise.
|
||||
func (o *GetCoreRuleSetResponse) GetActive() (res GetCoreRuleSetResponsegetActiveRetType) {
|
||||
res, _ = o.GetActiveOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetActiveOk returns a tuple with the Active field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *GetCoreRuleSetResponse) GetActiveOk() (ret GetCoreRuleSetResponsegetActiveRetType, ok bool) {
|
||||
return getGetCoreRuleSetResponsegetActiveAttributeTypeOk(o.Active)
|
||||
}
|
||||
|
||||
// HasActive returns a boolean if a field has been set.
|
||||
func (o *GetCoreRuleSetResponse) HasActive() bool {
|
||||
_, ok := o.GetActiveOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetActive gets a reference to the given bool and assigns it to the Active field.
|
||||
func (o *GetCoreRuleSetResponse) SetActive(v GetCoreRuleSetResponsegetActiveRetType) {
|
||||
setGetCoreRuleSetResponsegetActiveAttributeType(&o.Active, v)
|
||||
}
|
||||
|
||||
// GetName returns the Name field value if set, zero value otherwise.
|
||||
func (o *GetCoreRuleSetResponse) GetName() (res GetCoreRuleSetResponseGetNameRetType) {
|
||||
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 *GetCoreRuleSetResponse) GetNameOk() (ret GetCoreRuleSetResponseGetNameRetType, ok bool) {
|
||||
return getGetCoreRuleSetResponseGetNameAttributeTypeOk(o.Name)
|
||||
}
|
||||
|
||||
// HasName returns a boolean if a field has been set.
|
||||
func (o *GetCoreRuleSetResponse) HasName() bool {
|
||||
_, ok := o.GetNameOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetName gets a reference to the given string and assigns it to the Name field.
|
||||
func (o *GetCoreRuleSetResponse) SetName(v GetCoreRuleSetResponseGetNameRetType) {
|
||||
setGetCoreRuleSetResponseGetNameAttributeType(&o.Name, v)
|
||||
}
|
||||
|
||||
// GetRegion returns the Region field value if set, zero value otherwise.
|
||||
func (o *GetCoreRuleSetResponse) GetRegion() (res GetCoreRuleSetResponseGetRegionRetType) {
|
||||
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 *GetCoreRuleSetResponse) GetRegionOk() (ret GetCoreRuleSetResponseGetRegionRetType, ok bool) {
|
||||
return getGetCoreRuleSetResponseGetRegionAttributeTypeOk(o.Region)
|
||||
}
|
||||
|
||||
// HasRegion returns a boolean if a field has been set.
|
||||
func (o *GetCoreRuleSetResponse) HasRegion() bool {
|
||||
_, ok := o.GetRegionOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetRegion gets a reference to the given string and assigns it to the Region field.
|
||||
func (o *GetCoreRuleSetResponse) SetRegion(v GetCoreRuleSetResponseGetRegionRetType) {
|
||||
setGetCoreRuleSetResponseGetRegionAttributeType(&o.Region, v)
|
||||
}
|
||||
|
||||
func (o GetCoreRuleSetResponse) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getGetCoreRuleSetResponsegetActiveAttributeTypeOk(o.Active); ok {
|
||||
toSerialize["Active"] = val
|
||||
}
|
||||
if val, ok := getGetCoreRuleSetResponseGetNameAttributeTypeOk(o.Name); ok {
|
||||
toSerialize["Name"] = val
|
||||
}
|
||||
if val, ok := getGetCoreRuleSetResponseGetRegionAttributeTypeOk(o.Region); ok {
|
||||
toSerialize["Region"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableGetCoreRuleSetResponse struct {
|
||||
value *GetCoreRuleSetResponse
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableGetCoreRuleSetResponse) Get() *GetCoreRuleSetResponse {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableGetCoreRuleSetResponse) Set(val *GetCoreRuleSetResponse) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableGetCoreRuleSetResponse) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableGetCoreRuleSetResponse) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableGetCoreRuleSetResponse(val *GetCoreRuleSetResponse) *NullableGetCoreRuleSetResponse {
|
||||
return &NullableGetCoreRuleSetResponse{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableGetCoreRuleSetResponse) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableGetCoreRuleSetResponse) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/albwafalpha/model_get_core_rule_set_response_test.go
Normal file
11
pkg/albwafalpha/model_get_core_rule_set_response_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
227
pkg/albwafalpha/model_get_rules_response.go
Normal file
227
pkg/albwafalpha/model_get_rules_response.go
Normal file
|
|
@ -0,0 +1,227 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the GetRulesResponse type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &GetRulesResponse{}
|
||||
|
||||
/*
|
||||
types and functions for name
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type GetRulesResponseGetNameAttributeType = *string
|
||||
|
||||
func getGetRulesResponseGetNameAttributeTypeOk(arg GetRulesResponseGetNameAttributeType) (ret GetRulesResponseGetNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setGetRulesResponseGetNameAttributeType(arg *GetRulesResponseGetNameAttributeType, val GetRulesResponseGetNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type GetRulesResponseGetNameArgType = string
|
||||
type GetRulesResponseGetNameRetType = string
|
||||
|
||||
/*
|
||||
types and functions for region
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type GetRulesResponseGetRegionAttributeType = *string
|
||||
|
||||
func getGetRulesResponseGetRegionAttributeTypeOk(arg GetRulesResponseGetRegionAttributeType) (ret GetRulesResponseGetRegionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setGetRulesResponseGetRegionAttributeType(arg *GetRulesResponseGetRegionAttributeType, val GetRulesResponseGetRegionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type GetRulesResponseGetRegionArgType = string
|
||||
type GetRulesResponseGetRegionRetType = string
|
||||
|
||||
/*
|
||||
types and functions for rules
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type GetRulesResponseGetRulesAttributeType = *string
|
||||
|
||||
func getGetRulesResponseGetRulesAttributeTypeOk(arg GetRulesResponseGetRulesAttributeType) (ret GetRulesResponseGetRulesRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setGetRulesResponseGetRulesAttributeType(arg *GetRulesResponseGetRulesAttributeType, val GetRulesResponseGetRulesRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type GetRulesResponseGetRulesArgType = string
|
||||
type GetRulesResponseGetRulesRetType = string
|
||||
|
||||
// GetRulesResponse GetRulesResponse returns rule configuration name and it's rules.
|
||||
type GetRulesResponse struct {
|
||||
// Rule configuration name.
|
||||
Name GetRulesResponseGetNameAttributeType `json:"name,omitempty"`
|
||||
// Region
|
||||
Region GetRulesResponseGetRegionAttributeType `json:"region,omitempty"`
|
||||
// Custom rules written in Seclang syntax.
|
||||
Rules GetRulesResponseGetRulesAttributeType `json:"rules,omitempty"`
|
||||
}
|
||||
|
||||
// NewGetRulesResponse instantiates a new GetRulesResponse 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 NewGetRulesResponse() *GetRulesResponse {
|
||||
this := GetRulesResponse{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewGetRulesResponseWithDefaults instantiates a new GetRulesResponse 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 NewGetRulesResponseWithDefaults() *GetRulesResponse {
|
||||
this := GetRulesResponse{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetName returns the Name field value if set, zero value otherwise.
|
||||
func (o *GetRulesResponse) GetName() (res GetRulesResponseGetNameRetType) {
|
||||
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 *GetRulesResponse) GetNameOk() (ret GetRulesResponseGetNameRetType, ok bool) {
|
||||
return getGetRulesResponseGetNameAttributeTypeOk(o.Name)
|
||||
}
|
||||
|
||||
// HasName returns a boolean if a field has been set.
|
||||
func (o *GetRulesResponse) HasName() bool {
|
||||
_, ok := o.GetNameOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetName gets a reference to the given string and assigns it to the Name field.
|
||||
func (o *GetRulesResponse) SetName(v GetRulesResponseGetNameRetType) {
|
||||
setGetRulesResponseGetNameAttributeType(&o.Name, v)
|
||||
}
|
||||
|
||||
// GetRegion returns the Region field value if set, zero value otherwise.
|
||||
func (o *GetRulesResponse) GetRegion() (res GetRulesResponseGetRegionRetType) {
|
||||
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 *GetRulesResponse) GetRegionOk() (ret GetRulesResponseGetRegionRetType, ok bool) {
|
||||
return getGetRulesResponseGetRegionAttributeTypeOk(o.Region)
|
||||
}
|
||||
|
||||
// HasRegion returns a boolean if a field has been set.
|
||||
func (o *GetRulesResponse) HasRegion() bool {
|
||||
_, ok := o.GetRegionOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetRegion gets a reference to the given string and assigns it to the Region field.
|
||||
func (o *GetRulesResponse) SetRegion(v GetRulesResponseGetRegionRetType) {
|
||||
setGetRulesResponseGetRegionAttributeType(&o.Region, v)
|
||||
}
|
||||
|
||||
// GetRules returns the Rules field value if set, zero value otherwise.
|
||||
func (o *GetRulesResponse) GetRules() (res GetRulesResponseGetRulesRetType) {
|
||||
res, _ = o.GetRulesOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetRulesOk returns a tuple with the Rules field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *GetRulesResponse) GetRulesOk() (ret GetRulesResponseGetRulesRetType, ok bool) {
|
||||
return getGetRulesResponseGetRulesAttributeTypeOk(o.Rules)
|
||||
}
|
||||
|
||||
// HasRules returns a boolean if a field has been set.
|
||||
func (o *GetRulesResponse) HasRules() bool {
|
||||
_, ok := o.GetRulesOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetRules gets a reference to the given string and assigns it to the Rules field.
|
||||
func (o *GetRulesResponse) SetRules(v GetRulesResponseGetRulesRetType) {
|
||||
setGetRulesResponseGetRulesAttributeType(&o.Rules, v)
|
||||
}
|
||||
|
||||
func (o GetRulesResponse) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getGetRulesResponseGetNameAttributeTypeOk(o.Name); ok {
|
||||
toSerialize["Name"] = val
|
||||
}
|
||||
if val, ok := getGetRulesResponseGetRegionAttributeTypeOk(o.Region); ok {
|
||||
toSerialize["Region"] = val
|
||||
}
|
||||
if val, ok := getGetRulesResponseGetRulesAttributeTypeOk(o.Rules); ok {
|
||||
toSerialize["Rules"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableGetRulesResponse struct {
|
||||
value *GetRulesResponse
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableGetRulesResponse) Get() *GetRulesResponse {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableGetRulesResponse) Set(val *GetRulesResponse) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableGetRulesResponse) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableGetRulesResponse) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableGetRulesResponse(val *GetRulesResponse) *NullableGetRulesResponse {
|
||||
return &NullableGetRulesResponse{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableGetRulesResponse) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableGetRulesResponse) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/albwafalpha/model_get_rules_response_test.go
Normal file
11
pkg/albwafalpha/model_get_rules_response_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
276
pkg/albwafalpha/model_get_waf_response.go
Normal file
276
pkg/albwafalpha/model_get_waf_response.go
Normal file
|
|
@ -0,0 +1,276 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the GetWAFResponse type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &GetWAFResponse{}
|
||||
|
||||
/*
|
||||
types and functions for coreRuleSetName
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type GetWAFResponseGetCoreRuleSetNameAttributeType = *string
|
||||
|
||||
func getGetWAFResponseGetCoreRuleSetNameAttributeTypeOk(arg GetWAFResponseGetCoreRuleSetNameAttributeType) (ret GetWAFResponseGetCoreRuleSetNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setGetWAFResponseGetCoreRuleSetNameAttributeType(arg *GetWAFResponseGetCoreRuleSetNameAttributeType, val GetWAFResponseGetCoreRuleSetNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type GetWAFResponseGetCoreRuleSetNameArgType = string
|
||||
type GetWAFResponseGetCoreRuleSetNameRetType = string
|
||||
|
||||
/*
|
||||
types and functions for name
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type GetWAFResponseGetNameAttributeType = *string
|
||||
|
||||
func getGetWAFResponseGetNameAttributeTypeOk(arg GetWAFResponseGetNameAttributeType) (ret GetWAFResponseGetNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setGetWAFResponseGetNameAttributeType(arg *GetWAFResponseGetNameAttributeType, val GetWAFResponseGetNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type GetWAFResponseGetNameArgType = string
|
||||
type GetWAFResponseGetNameRetType = string
|
||||
|
||||
/*
|
||||
types and functions for region
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type GetWAFResponseGetRegionAttributeType = *string
|
||||
|
||||
func getGetWAFResponseGetRegionAttributeTypeOk(arg GetWAFResponseGetRegionAttributeType) (ret GetWAFResponseGetRegionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setGetWAFResponseGetRegionAttributeType(arg *GetWAFResponseGetRegionAttributeType, val GetWAFResponseGetRegionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type GetWAFResponseGetRegionArgType = string
|
||||
type GetWAFResponseGetRegionRetType = string
|
||||
|
||||
/*
|
||||
types and functions for rulesConfigName
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type GetWAFResponseGetRulesConfigNameAttributeType = *string
|
||||
|
||||
func getGetWAFResponseGetRulesConfigNameAttributeTypeOk(arg GetWAFResponseGetRulesConfigNameAttributeType) (ret GetWAFResponseGetRulesConfigNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setGetWAFResponseGetRulesConfigNameAttributeType(arg *GetWAFResponseGetRulesConfigNameAttributeType, val GetWAFResponseGetRulesConfigNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type GetWAFResponseGetRulesConfigNameArgType = string
|
||||
type GetWAFResponseGetRulesConfigNameRetType = string
|
||||
|
||||
// GetWAFResponse GetWAFResponse returns id, name and custom rules.
|
||||
type GetWAFResponse struct {
|
||||
// Name of the core rule set configuration for that WAF.
|
||||
CoreRuleSetName GetWAFResponseGetCoreRuleSetNameAttributeType `json:"coreRuleSetName,omitempty"`
|
||||
// WAF name
|
||||
Name GetWAFResponseGetNameAttributeType `json:"name,omitempty"`
|
||||
// Region
|
||||
Region GetWAFResponseGetRegionAttributeType `json:"region,omitempty"`
|
||||
// Name of the rule configuration for that WAF.
|
||||
RulesConfigName GetWAFResponseGetRulesConfigNameAttributeType `json:"rulesConfigName,omitempty"`
|
||||
}
|
||||
|
||||
// NewGetWAFResponse instantiates a new GetWAFResponse 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 NewGetWAFResponse() *GetWAFResponse {
|
||||
this := GetWAFResponse{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewGetWAFResponseWithDefaults instantiates a new GetWAFResponse 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 NewGetWAFResponseWithDefaults() *GetWAFResponse {
|
||||
this := GetWAFResponse{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetCoreRuleSetName returns the CoreRuleSetName field value if set, zero value otherwise.
|
||||
func (o *GetWAFResponse) GetCoreRuleSetName() (res GetWAFResponseGetCoreRuleSetNameRetType) {
|
||||
res, _ = o.GetCoreRuleSetNameOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetCoreRuleSetNameOk returns a tuple with the CoreRuleSetName field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *GetWAFResponse) GetCoreRuleSetNameOk() (ret GetWAFResponseGetCoreRuleSetNameRetType, ok bool) {
|
||||
return getGetWAFResponseGetCoreRuleSetNameAttributeTypeOk(o.CoreRuleSetName)
|
||||
}
|
||||
|
||||
// HasCoreRuleSetName returns a boolean if a field has been set.
|
||||
func (o *GetWAFResponse) HasCoreRuleSetName() bool {
|
||||
_, ok := o.GetCoreRuleSetNameOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetCoreRuleSetName gets a reference to the given string and assigns it to the CoreRuleSetName field.
|
||||
func (o *GetWAFResponse) SetCoreRuleSetName(v GetWAFResponseGetCoreRuleSetNameRetType) {
|
||||
setGetWAFResponseGetCoreRuleSetNameAttributeType(&o.CoreRuleSetName, v)
|
||||
}
|
||||
|
||||
// GetName returns the Name field value if set, zero value otherwise.
|
||||
func (o *GetWAFResponse) GetName() (res GetWAFResponseGetNameRetType) {
|
||||
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 *GetWAFResponse) GetNameOk() (ret GetWAFResponseGetNameRetType, ok bool) {
|
||||
return getGetWAFResponseGetNameAttributeTypeOk(o.Name)
|
||||
}
|
||||
|
||||
// HasName returns a boolean if a field has been set.
|
||||
func (o *GetWAFResponse) HasName() bool {
|
||||
_, ok := o.GetNameOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetName gets a reference to the given string and assigns it to the Name field.
|
||||
func (o *GetWAFResponse) SetName(v GetWAFResponseGetNameRetType) {
|
||||
setGetWAFResponseGetNameAttributeType(&o.Name, v)
|
||||
}
|
||||
|
||||
// GetRegion returns the Region field value if set, zero value otherwise.
|
||||
func (o *GetWAFResponse) GetRegion() (res GetWAFResponseGetRegionRetType) {
|
||||
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 *GetWAFResponse) GetRegionOk() (ret GetWAFResponseGetRegionRetType, ok bool) {
|
||||
return getGetWAFResponseGetRegionAttributeTypeOk(o.Region)
|
||||
}
|
||||
|
||||
// HasRegion returns a boolean if a field has been set.
|
||||
func (o *GetWAFResponse) HasRegion() bool {
|
||||
_, ok := o.GetRegionOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetRegion gets a reference to the given string and assigns it to the Region field.
|
||||
func (o *GetWAFResponse) SetRegion(v GetWAFResponseGetRegionRetType) {
|
||||
setGetWAFResponseGetRegionAttributeType(&o.Region, v)
|
||||
}
|
||||
|
||||
// GetRulesConfigName returns the RulesConfigName field value if set, zero value otherwise.
|
||||
func (o *GetWAFResponse) GetRulesConfigName() (res GetWAFResponseGetRulesConfigNameRetType) {
|
||||
res, _ = o.GetRulesConfigNameOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetRulesConfigNameOk returns a tuple with the RulesConfigName field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *GetWAFResponse) GetRulesConfigNameOk() (ret GetWAFResponseGetRulesConfigNameRetType, ok bool) {
|
||||
return getGetWAFResponseGetRulesConfigNameAttributeTypeOk(o.RulesConfigName)
|
||||
}
|
||||
|
||||
// HasRulesConfigName returns a boolean if a field has been set.
|
||||
func (o *GetWAFResponse) HasRulesConfigName() bool {
|
||||
_, ok := o.GetRulesConfigNameOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetRulesConfigName gets a reference to the given string and assigns it to the RulesConfigName field.
|
||||
func (o *GetWAFResponse) SetRulesConfigName(v GetWAFResponseGetRulesConfigNameRetType) {
|
||||
setGetWAFResponseGetRulesConfigNameAttributeType(&o.RulesConfigName, v)
|
||||
}
|
||||
|
||||
func (o GetWAFResponse) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getGetWAFResponseGetCoreRuleSetNameAttributeTypeOk(o.CoreRuleSetName); ok {
|
||||
toSerialize["CoreRuleSetName"] = val
|
||||
}
|
||||
if val, ok := getGetWAFResponseGetNameAttributeTypeOk(o.Name); ok {
|
||||
toSerialize["Name"] = val
|
||||
}
|
||||
if val, ok := getGetWAFResponseGetRegionAttributeTypeOk(o.Region); ok {
|
||||
toSerialize["Region"] = val
|
||||
}
|
||||
if val, ok := getGetWAFResponseGetRulesConfigNameAttributeTypeOk(o.RulesConfigName); ok {
|
||||
toSerialize["RulesConfigName"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableGetWAFResponse struct {
|
||||
value *GetWAFResponse
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableGetWAFResponse) Get() *GetWAFResponse {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableGetWAFResponse) Set(val *GetWAFResponse) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableGetWAFResponse) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableGetWAFResponse) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableGetWAFResponse(val *GetWAFResponse) *NullableGetWAFResponse {
|
||||
return &NullableGetWAFResponse{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableGetWAFResponse) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableGetWAFResponse) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/albwafalpha/model_get_waf_response_test.go
Normal file
11
pkg/albwafalpha/model_get_waf_response_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
137
pkg/albwafalpha/model_google_protobuf_any.go
Normal file
137
pkg/albwafalpha/model_google_protobuf_any.go
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the GoogleProtobufAny type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &GoogleProtobufAny{}
|
||||
|
||||
/*
|
||||
types and functions for @type
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type GoogleProtobufAnyGetTypeAttributeType = *string
|
||||
|
||||
func getGoogleProtobufAnyGetTypeAttributeTypeOk(arg GoogleProtobufAnyGetTypeAttributeType) (ret GoogleProtobufAnyGetTypeRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setGoogleProtobufAnyGetTypeAttributeType(arg *GoogleProtobufAnyGetTypeAttributeType, val GoogleProtobufAnyGetTypeRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type GoogleProtobufAnyGetTypeArgType = string
|
||||
type GoogleProtobufAnyGetTypeRetType = string
|
||||
|
||||
// GoogleProtobufAny Contains an arbitrary serialized message along with a @type that describes the type of the serialized message.
|
||||
type GoogleProtobufAny struct {
|
||||
// The type of the serialized message.
|
||||
Type GoogleProtobufAnyGetTypeAttributeType `json:"@type,omitempty"`
|
||||
AdditionalProperties map[string]interface{}
|
||||
}
|
||||
|
||||
type _GoogleProtobufAny GoogleProtobufAny
|
||||
|
||||
// NewGoogleProtobufAny instantiates a new GoogleProtobufAny 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 NewGoogleProtobufAny() *GoogleProtobufAny {
|
||||
this := GoogleProtobufAny{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewGoogleProtobufAnyWithDefaults instantiates a new GoogleProtobufAny 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 NewGoogleProtobufAnyWithDefaults() *GoogleProtobufAny {
|
||||
this := GoogleProtobufAny{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetType returns the Type field value if set, zero value otherwise.
|
||||
func (o *GoogleProtobufAny) GetType() (res GoogleProtobufAnyGetTypeRetType) {
|
||||
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 *GoogleProtobufAny) GetTypeOk() (ret GoogleProtobufAnyGetTypeRetType, ok bool) {
|
||||
return getGoogleProtobufAnyGetTypeAttributeTypeOk(o.Type)
|
||||
}
|
||||
|
||||
// HasType returns a boolean if a field has been set.
|
||||
func (o *GoogleProtobufAny) HasType() bool {
|
||||
_, ok := o.GetTypeOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetType gets a reference to the given string and assigns it to the Type field.
|
||||
func (o *GoogleProtobufAny) SetType(v GoogleProtobufAnyGetTypeRetType) {
|
||||
setGoogleProtobufAnyGetTypeAttributeType(&o.Type, v)
|
||||
}
|
||||
|
||||
func (o GoogleProtobufAny) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getGoogleProtobufAnyGetTypeAttributeTypeOk(o.Type); ok {
|
||||
toSerialize["Type"] = val
|
||||
}
|
||||
|
||||
for key, value := range o.AdditionalProperties {
|
||||
toSerialize[key] = value
|
||||
}
|
||||
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableGoogleProtobufAny struct {
|
||||
value *GoogleProtobufAny
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableGoogleProtobufAny) Get() *GoogleProtobufAny {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableGoogleProtobufAny) Set(val *GoogleProtobufAny) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableGoogleProtobufAny) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableGoogleProtobufAny) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableGoogleProtobufAny(val *GoogleProtobufAny) *NullableGoogleProtobufAny {
|
||||
return &NullableGoogleProtobufAny{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableGoogleProtobufAny) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableGoogleProtobufAny) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/albwafalpha/model_google_protobuf_any_test.go
Normal file
11
pkg/albwafalpha/model_google_protobuf_any_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
176
pkg/albwafalpha/model_list_core_rule_set_response.go
Normal file
176
pkg/albwafalpha/model_list_core_rule_set_response.go
Normal file
|
|
@ -0,0 +1,176 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the ListCoreRuleSetResponse type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &ListCoreRuleSetResponse{}
|
||||
|
||||
/*
|
||||
types and functions for items
|
||||
*/
|
||||
|
||||
// isArray
|
||||
type ListCoreRuleSetResponseGetItemsAttributeType = *[]GetCoreRuleSetResponse
|
||||
type ListCoreRuleSetResponseGetItemsArgType = []GetCoreRuleSetResponse
|
||||
type ListCoreRuleSetResponseGetItemsRetType = []GetCoreRuleSetResponse
|
||||
|
||||
func getListCoreRuleSetResponseGetItemsAttributeTypeOk(arg ListCoreRuleSetResponseGetItemsAttributeType) (ret ListCoreRuleSetResponseGetItemsRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setListCoreRuleSetResponseGetItemsAttributeType(arg *ListCoreRuleSetResponseGetItemsAttributeType, val ListCoreRuleSetResponseGetItemsRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for nextPageId
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type ListCoreRuleSetResponseGetNextPageIdAttributeType = *string
|
||||
|
||||
func getListCoreRuleSetResponseGetNextPageIdAttributeTypeOk(arg ListCoreRuleSetResponseGetNextPageIdAttributeType) (ret ListCoreRuleSetResponseGetNextPageIdRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setListCoreRuleSetResponseGetNextPageIdAttributeType(arg *ListCoreRuleSetResponseGetNextPageIdAttributeType, val ListCoreRuleSetResponseGetNextPageIdRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type ListCoreRuleSetResponseGetNextPageIdArgType = string
|
||||
type ListCoreRuleSetResponseGetNextPageIdRetType = string
|
||||
|
||||
// ListCoreRuleSetResponse ListCoreRuleSetResponse returns a list of rule configuration responses.
|
||||
type ListCoreRuleSetResponse struct {
|
||||
Items ListCoreRuleSetResponseGetItemsAttributeType `json:"items,omitempty"`
|
||||
// Continue token from the ListCoreRuleSetResponse with Limit option
|
||||
NextPageId ListCoreRuleSetResponseGetNextPageIdAttributeType `json:"nextPageId,omitempty"`
|
||||
}
|
||||
|
||||
// NewListCoreRuleSetResponse instantiates a new ListCoreRuleSetResponse 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 NewListCoreRuleSetResponse() *ListCoreRuleSetResponse {
|
||||
this := ListCoreRuleSetResponse{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewListCoreRuleSetResponseWithDefaults instantiates a new ListCoreRuleSetResponse 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 NewListCoreRuleSetResponseWithDefaults() *ListCoreRuleSetResponse {
|
||||
this := ListCoreRuleSetResponse{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetItems returns the Items field value if set, zero value otherwise.
|
||||
func (o *ListCoreRuleSetResponse) GetItems() (res ListCoreRuleSetResponseGetItemsRetType) {
|
||||
res, _ = o.GetItemsOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetItemsOk returns a tuple with the Items field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *ListCoreRuleSetResponse) GetItemsOk() (ret ListCoreRuleSetResponseGetItemsRetType, ok bool) {
|
||||
return getListCoreRuleSetResponseGetItemsAttributeTypeOk(o.Items)
|
||||
}
|
||||
|
||||
// HasItems returns a boolean if a field has been set.
|
||||
func (o *ListCoreRuleSetResponse) HasItems() bool {
|
||||
_, ok := o.GetItemsOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetItems gets a reference to the given []GetCoreRuleSetResponse and assigns it to the Items field.
|
||||
func (o *ListCoreRuleSetResponse) SetItems(v ListCoreRuleSetResponseGetItemsRetType) {
|
||||
setListCoreRuleSetResponseGetItemsAttributeType(&o.Items, v)
|
||||
}
|
||||
|
||||
// GetNextPageId returns the NextPageId field value if set, zero value otherwise.
|
||||
func (o *ListCoreRuleSetResponse) GetNextPageId() (res ListCoreRuleSetResponseGetNextPageIdRetType) {
|
||||
res, _ = o.GetNextPageIdOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetNextPageIdOk returns a tuple with the NextPageId field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *ListCoreRuleSetResponse) GetNextPageIdOk() (ret ListCoreRuleSetResponseGetNextPageIdRetType, ok bool) {
|
||||
return getListCoreRuleSetResponseGetNextPageIdAttributeTypeOk(o.NextPageId)
|
||||
}
|
||||
|
||||
// HasNextPageId returns a boolean if a field has been set.
|
||||
func (o *ListCoreRuleSetResponse) HasNextPageId() bool {
|
||||
_, ok := o.GetNextPageIdOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetNextPageId gets a reference to the given string and assigns it to the NextPageId field.
|
||||
func (o *ListCoreRuleSetResponse) SetNextPageId(v ListCoreRuleSetResponseGetNextPageIdRetType) {
|
||||
setListCoreRuleSetResponseGetNextPageIdAttributeType(&o.NextPageId, v)
|
||||
}
|
||||
|
||||
func (o ListCoreRuleSetResponse) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getListCoreRuleSetResponseGetItemsAttributeTypeOk(o.Items); ok {
|
||||
toSerialize["Items"] = val
|
||||
}
|
||||
if val, ok := getListCoreRuleSetResponseGetNextPageIdAttributeTypeOk(o.NextPageId); ok {
|
||||
toSerialize["NextPageId"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableListCoreRuleSetResponse struct {
|
||||
value *ListCoreRuleSetResponse
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableListCoreRuleSetResponse) Get() *ListCoreRuleSetResponse {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableListCoreRuleSetResponse) Set(val *ListCoreRuleSetResponse) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableListCoreRuleSetResponse) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableListCoreRuleSetResponse) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableListCoreRuleSetResponse(val *ListCoreRuleSetResponse) *NullableListCoreRuleSetResponse {
|
||||
return &NullableListCoreRuleSetResponse{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableListCoreRuleSetResponse) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableListCoreRuleSetResponse) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/albwafalpha/model_list_core_rule_set_response_test.go
Normal file
11
pkg/albwafalpha/model_list_core_rule_set_response_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
176
pkg/albwafalpha/model_list_rules_response.go
Normal file
176
pkg/albwafalpha/model_list_rules_response.go
Normal file
|
|
@ -0,0 +1,176 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the ListRulesResponse type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &ListRulesResponse{}
|
||||
|
||||
/*
|
||||
types and functions for items
|
||||
*/
|
||||
|
||||
// isArray
|
||||
type ListRulesResponseGetItemsAttributeType = *[]GetRulesResponse
|
||||
type ListRulesResponseGetItemsArgType = []GetRulesResponse
|
||||
type ListRulesResponseGetItemsRetType = []GetRulesResponse
|
||||
|
||||
func getListRulesResponseGetItemsAttributeTypeOk(arg ListRulesResponseGetItemsAttributeType) (ret ListRulesResponseGetItemsRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setListRulesResponseGetItemsAttributeType(arg *ListRulesResponseGetItemsAttributeType, val ListRulesResponseGetItemsRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for nextPageId
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type ListRulesResponseGetNextPageIdAttributeType = *string
|
||||
|
||||
func getListRulesResponseGetNextPageIdAttributeTypeOk(arg ListRulesResponseGetNextPageIdAttributeType) (ret ListRulesResponseGetNextPageIdRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setListRulesResponseGetNextPageIdAttributeType(arg *ListRulesResponseGetNextPageIdAttributeType, val ListRulesResponseGetNextPageIdRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type ListRulesResponseGetNextPageIdArgType = string
|
||||
type ListRulesResponseGetNextPageIdRetType = string
|
||||
|
||||
// ListRulesResponse ListRulesResponse returns a list of rule configuration responses.
|
||||
type ListRulesResponse struct {
|
||||
Items ListRulesResponseGetItemsAttributeType `json:"items,omitempty"`
|
||||
// Continue token from the ListRulesResponse with Limit option
|
||||
NextPageId ListRulesResponseGetNextPageIdAttributeType `json:"nextPageId,omitempty"`
|
||||
}
|
||||
|
||||
// NewListRulesResponse instantiates a new ListRulesResponse 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 NewListRulesResponse() *ListRulesResponse {
|
||||
this := ListRulesResponse{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewListRulesResponseWithDefaults instantiates a new ListRulesResponse 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 NewListRulesResponseWithDefaults() *ListRulesResponse {
|
||||
this := ListRulesResponse{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetItems returns the Items field value if set, zero value otherwise.
|
||||
func (o *ListRulesResponse) GetItems() (res ListRulesResponseGetItemsRetType) {
|
||||
res, _ = o.GetItemsOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetItemsOk returns a tuple with the Items field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *ListRulesResponse) GetItemsOk() (ret ListRulesResponseGetItemsRetType, ok bool) {
|
||||
return getListRulesResponseGetItemsAttributeTypeOk(o.Items)
|
||||
}
|
||||
|
||||
// HasItems returns a boolean if a field has been set.
|
||||
func (o *ListRulesResponse) HasItems() bool {
|
||||
_, ok := o.GetItemsOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetItems gets a reference to the given []GetRulesResponse and assigns it to the Items field.
|
||||
func (o *ListRulesResponse) SetItems(v ListRulesResponseGetItemsRetType) {
|
||||
setListRulesResponseGetItemsAttributeType(&o.Items, v)
|
||||
}
|
||||
|
||||
// GetNextPageId returns the NextPageId field value if set, zero value otherwise.
|
||||
func (o *ListRulesResponse) GetNextPageId() (res ListRulesResponseGetNextPageIdRetType) {
|
||||
res, _ = o.GetNextPageIdOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetNextPageIdOk returns a tuple with the NextPageId field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *ListRulesResponse) GetNextPageIdOk() (ret ListRulesResponseGetNextPageIdRetType, ok bool) {
|
||||
return getListRulesResponseGetNextPageIdAttributeTypeOk(o.NextPageId)
|
||||
}
|
||||
|
||||
// HasNextPageId returns a boolean if a field has been set.
|
||||
func (o *ListRulesResponse) HasNextPageId() bool {
|
||||
_, ok := o.GetNextPageIdOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetNextPageId gets a reference to the given string and assigns it to the NextPageId field.
|
||||
func (o *ListRulesResponse) SetNextPageId(v ListRulesResponseGetNextPageIdRetType) {
|
||||
setListRulesResponseGetNextPageIdAttributeType(&o.NextPageId, v)
|
||||
}
|
||||
|
||||
func (o ListRulesResponse) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getListRulesResponseGetItemsAttributeTypeOk(o.Items); ok {
|
||||
toSerialize["Items"] = val
|
||||
}
|
||||
if val, ok := getListRulesResponseGetNextPageIdAttributeTypeOk(o.NextPageId); ok {
|
||||
toSerialize["NextPageId"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableListRulesResponse struct {
|
||||
value *ListRulesResponse
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableListRulesResponse) Get() *ListRulesResponse {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableListRulesResponse) Set(val *ListRulesResponse) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableListRulesResponse) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableListRulesResponse) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableListRulesResponse(val *ListRulesResponse) *NullableListRulesResponse {
|
||||
return &NullableListRulesResponse{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableListRulesResponse) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableListRulesResponse) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/albwafalpha/model_list_rules_response_test.go
Normal file
11
pkg/albwafalpha/model_list_rules_response_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
176
pkg/albwafalpha/model_list_waf_response.go
Normal file
176
pkg/albwafalpha/model_list_waf_response.go
Normal file
|
|
@ -0,0 +1,176 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the ListWAFResponse type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &ListWAFResponse{}
|
||||
|
||||
/*
|
||||
types and functions for items
|
||||
*/
|
||||
|
||||
// isArray
|
||||
type ListWAFResponseGetItemsAttributeType = *[]GetWAFResponse
|
||||
type ListWAFResponseGetItemsArgType = []GetWAFResponse
|
||||
type ListWAFResponseGetItemsRetType = []GetWAFResponse
|
||||
|
||||
func getListWAFResponseGetItemsAttributeTypeOk(arg ListWAFResponseGetItemsAttributeType) (ret ListWAFResponseGetItemsRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setListWAFResponseGetItemsAttributeType(arg *ListWAFResponseGetItemsAttributeType, val ListWAFResponseGetItemsRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for nextPageId
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type ListWAFResponseGetNextPageIdAttributeType = *string
|
||||
|
||||
func getListWAFResponseGetNextPageIdAttributeTypeOk(arg ListWAFResponseGetNextPageIdAttributeType) (ret ListWAFResponseGetNextPageIdRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setListWAFResponseGetNextPageIdAttributeType(arg *ListWAFResponseGetNextPageIdAttributeType, val ListWAFResponseGetNextPageIdRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type ListWAFResponseGetNextPageIdArgType = string
|
||||
type ListWAFResponseGetNextPageIdRetType = string
|
||||
|
||||
// ListWAFResponse ListWAFResponse returns a list of WAF responses.
|
||||
type ListWAFResponse struct {
|
||||
Items ListWAFResponseGetItemsAttributeType `json:"items,omitempty"`
|
||||
// Continue token from the ListWAFResponse with Limit option
|
||||
NextPageId ListWAFResponseGetNextPageIdAttributeType `json:"nextPageId,omitempty"`
|
||||
}
|
||||
|
||||
// NewListWAFResponse instantiates a new ListWAFResponse 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 NewListWAFResponse() *ListWAFResponse {
|
||||
this := ListWAFResponse{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewListWAFResponseWithDefaults instantiates a new ListWAFResponse 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 NewListWAFResponseWithDefaults() *ListWAFResponse {
|
||||
this := ListWAFResponse{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetItems returns the Items field value if set, zero value otherwise.
|
||||
func (o *ListWAFResponse) GetItems() (res ListWAFResponseGetItemsRetType) {
|
||||
res, _ = o.GetItemsOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetItemsOk returns a tuple with the Items field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *ListWAFResponse) GetItemsOk() (ret ListWAFResponseGetItemsRetType, ok bool) {
|
||||
return getListWAFResponseGetItemsAttributeTypeOk(o.Items)
|
||||
}
|
||||
|
||||
// HasItems returns a boolean if a field has been set.
|
||||
func (o *ListWAFResponse) HasItems() bool {
|
||||
_, ok := o.GetItemsOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetItems gets a reference to the given []GetWAFResponse and assigns it to the Items field.
|
||||
func (o *ListWAFResponse) SetItems(v ListWAFResponseGetItemsRetType) {
|
||||
setListWAFResponseGetItemsAttributeType(&o.Items, v)
|
||||
}
|
||||
|
||||
// GetNextPageId returns the NextPageId field value if set, zero value otherwise.
|
||||
func (o *ListWAFResponse) GetNextPageId() (res ListWAFResponseGetNextPageIdRetType) {
|
||||
res, _ = o.GetNextPageIdOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetNextPageIdOk returns a tuple with the NextPageId field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *ListWAFResponse) GetNextPageIdOk() (ret ListWAFResponseGetNextPageIdRetType, ok bool) {
|
||||
return getListWAFResponseGetNextPageIdAttributeTypeOk(o.NextPageId)
|
||||
}
|
||||
|
||||
// HasNextPageId returns a boolean if a field has been set.
|
||||
func (o *ListWAFResponse) HasNextPageId() bool {
|
||||
_, ok := o.GetNextPageIdOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetNextPageId gets a reference to the given string and assigns it to the NextPageId field.
|
||||
func (o *ListWAFResponse) SetNextPageId(v ListWAFResponseGetNextPageIdRetType) {
|
||||
setListWAFResponseGetNextPageIdAttributeType(&o.NextPageId, v)
|
||||
}
|
||||
|
||||
func (o ListWAFResponse) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getListWAFResponseGetItemsAttributeTypeOk(o.Items); ok {
|
||||
toSerialize["Items"] = val
|
||||
}
|
||||
if val, ok := getListWAFResponseGetNextPageIdAttributeTypeOk(o.NextPageId); ok {
|
||||
toSerialize["NextPageId"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableListWAFResponse struct {
|
||||
value *ListWAFResponse
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableListWAFResponse) Get() *ListWAFResponse {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableListWAFResponse) Set(val *ListWAFResponse) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableListWAFResponse) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableListWAFResponse) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableListWAFResponse(val *ListWAFResponse) *NullableListWAFResponse {
|
||||
return &NullableListWAFResponse{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableListWAFResponse) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableListWAFResponse) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/albwafalpha/model_list_waf_response_test.go
Normal file
11
pkg/albwafalpha/model_list_waf_response_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
226
pkg/albwafalpha/model_status.go
Normal file
226
pkg/albwafalpha/model_status.go
Normal file
|
|
@ -0,0 +1,226 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the Status type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &Status{}
|
||||
|
||||
/*
|
||||
types and functions for code
|
||||
*/
|
||||
|
||||
// isInteger
|
||||
type StatusGetCodeAttributeType = *int64
|
||||
type StatusGetCodeArgType = int64
|
||||
type StatusGetCodeRetType = int64
|
||||
|
||||
func getStatusGetCodeAttributeTypeOk(arg StatusGetCodeAttributeType) (ret StatusGetCodeRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setStatusGetCodeAttributeType(arg *StatusGetCodeAttributeType, val StatusGetCodeRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for details
|
||||
*/
|
||||
|
||||
// isArray
|
||||
type StatusGetDetailsAttributeType = *[]GoogleProtobufAny
|
||||
type StatusGetDetailsArgType = []GoogleProtobufAny
|
||||
type StatusGetDetailsRetType = []GoogleProtobufAny
|
||||
|
||||
func getStatusGetDetailsAttributeTypeOk(arg StatusGetDetailsAttributeType) (ret StatusGetDetailsRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setStatusGetDetailsAttributeType(arg *StatusGetDetailsAttributeType, val StatusGetDetailsRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for message
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type StatusGetMessageAttributeType = *string
|
||||
|
||||
func getStatusGetMessageAttributeTypeOk(arg StatusGetMessageAttributeType) (ret StatusGetMessageRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setStatusGetMessageAttributeType(arg *StatusGetMessageAttributeType, val StatusGetMessageRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type StatusGetMessageArgType = string
|
||||
type StatusGetMessageRetType = string
|
||||
|
||||
// Status The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
|
||||
type Status struct {
|
||||
// The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
|
||||
// Can be cast to int32 without loss of precision.
|
||||
Code StatusGetCodeAttributeType `json:"code,omitempty"`
|
||||
// A list of messages that carry the error details. There is a common set of message types for APIs to use.
|
||||
Details StatusGetDetailsAttributeType `json:"details,omitempty"`
|
||||
// A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
|
||||
Message StatusGetMessageAttributeType `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// NewStatus instantiates a new Status 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 NewStatus() *Status {
|
||||
this := Status{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewStatusWithDefaults instantiates a new Status 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 NewStatusWithDefaults() *Status {
|
||||
this := Status{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetCode returns the Code field value if set, zero value otherwise.
|
||||
func (o *Status) GetCode() (res StatusGetCodeRetType) {
|
||||
res, _ = o.GetCodeOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetCodeOk returns a tuple with the Code field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Status) GetCodeOk() (ret StatusGetCodeRetType, ok bool) {
|
||||
return getStatusGetCodeAttributeTypeOk(o.Code)
|
||||
}
|
||||
|
||||
// HasCode returns a boolean if a field has been set.
|
||||
func (o *Status) HasCode() bool {
|
||||
_, ok := o.GetCodeOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetCode gets a reference to the given int64 and assigns it to the Code field.
|
||||
func (o *Status) SetCode(v StatusGetCodeRetType) {
|
||||
setStatusGetCodeAttributeType(&o.Code, v)
|
||||
}
|
||||
|
||||
// GetDetails returns the Details field value if set, zero value otherwise.
|
||||
func (o *Status) GetDetails() (res StatusGetDetailsRetType) {
|
||||
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 *Status) GetDetailsOk() (ret StatusGetDetailsRetType, ok bool) {
|
||||
return getStatusGetDetailsAttributeTypeOk(o.Details)
|
||||
}
|
||||
|
||||
// HasDetails returns a boolean if a field has been set.
|
||||
func (o *Status) HasDetails() bool {
|
||||
_, ok := o.GetDetailsOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetDetails gets a reference to the given []GoogleProtobufAny and assigns it to the Details field.
|
||||
func (o *Status) SetDetails(v StatusGetDetailsRetType) {
|
||||
setStatusGetDetailsAttributeType(&o.Details, v)
|
||||
}
|
||||
|
||||
// GetMessage returns the Message field value if set, zero value otherwise.
|
||||
func (o *Status) GetMessage() (res StatusGetMessageRetType) {
|
||||
res, _ = o.GetMessageOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetMessageOk returns a tuple with the Message field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Status) GetMessageOk() (ret StatusGetMessageRetType, ok bool) {
|
||||
return getStatusGetMessageAttributeTypeOk(o.Message)
|
||||
}
|
||||
|
||||
// HasMessage returns a boolean if a field has been set.
|
||||
func (o *Status) HasMessage() bool {
|
||||
_, ok := o.GetMessageOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetMessage gets a reference to the given string and assigns it to the Message field.
|
||||
func (o *Status) SetMessage(v StatusGetMessageRetType) {
|
||||
setStatusGetMessageAttributeType(&o.Message, v)
|
||||
}
|
||||
|
||||
func (o Status) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getStatusGetCodeAttributeTypeOk(o.Code); ok {
|
||||
toSerialize["Code"] = val
|
||||
}
|
||||
if val, ok := getStatusGetDetailsAttributeTypeOk(o.Details); ok {
|
||||
toSerialize["Details"] = val
|
||||
}
|
||||
if val, ok := getStatusGetMessageAttributeTypeOk(o.Message); ok {
|
||||
toSerialize["Message"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableStatus struct {
|
||||
value *Status
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableStatus) Get() *Status {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableStatus) Set(val *Status) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableStatus) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableStatus) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableStatus(val *Status) *NullableStatus {
|
||||
return &NullableStatus{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableStatus) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableStatus) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/albwafalpha/model_status_test.go
Normal file
11
pkg/albwafalpha/model_status_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
275
pkg/albwafalpha/model_update_core_rule_set_payload.go
Normal file
275
pkg/albwafalpha/model_update_core_rule_set_payload.go
Normal file
|
|
@ -0,0 +1,275 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the UpdateCoreRuleSetPayload type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &UpdateCoreRuleSetPayload{}
|
||||
|
||||
/*
|
||||
types and functions for active
|
||||
*/
|
||||
|
||||
// isBoolean
|
||||
type UpdateCoreRuleSetPayloadgetActiveAttributeType = *bool
|
||||
type UpdateCoreRuleSetPayloadgetActiveArgType = bool
|
||||
type UpdateCoreRuleSetPayloadgetActiveRetType = bool
|
||||
|
||||
func getUpdateCoreRuleSetPayloadgetActiveAttributeTypeOk(arg UpdateCoreRuleSetPayloadgetActiveAttributeType) (ret UpdateCoreRuleSetPayloadgetActiveRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setUpdateCoreRuleSetPayloadgetActiveAttributeType(arg *UpdateCoreRuleSetPayloadgetActiveAttributeType, val UpdateCoreRuleSetPayloadgetActiveRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for name
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type UpdateCoreRuleSetPayloadGetNameAttributeType = *string
|
||||
|
||||
func getUpdateCoreRuleSetPayloadGetNameAttributeTypeOk(arg UpdateCoreRuleSetPayloadGetNameAttributeType) (ret UpdateCoreRuleSetPayloadGetNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setUpdateCoreRuleSetPayloadGetNameAttributeType(arg *UpdateCoreRuleSetPayloadGetNameAttributeType, val UpdateCoreRuleSetPayloadGetNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type UpdateCoreRuleSetPayloadGetNameArgType = string
|
||||
type UpdateCoreRuleSetPayloadGetNameRetType = string
|
||||
|
||||
/*
|
||||
types and functions for projectId
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type UpdateCoreRuleSetPayloadGetProjectIdAttributeType = *string
|
||||
|
||||
func getUpdateCoreRuleSetPayloadGetProjectIdAttributeTypeOk(arg UpdateCoreRuleSetPayloadGetProjectIdAttributeType) (ret UpdateCoreRuleSetPayloadGetProjectIdRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setUpdateCoreRuleSetPayloadGetProjectIdAttributeType(arg *UpdateCoreRuleSetPayloadGetProjectIdAttributeType, val UpdateCoreRuleSetPayloadGetProjectIdRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type UpdateCoreRuleSetPayloadGetProjectIdArgType = string
|
||||
type UpdateCoreRuleSetPayloadGetProjectIdRetType = string
|
||||
|
||||
/*
|
||||
types and functions for region
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type UpdateCoreRuleSetPayloadGetRegionAttributeType = *string
|
||||
|
||||
func getUpdateCoreRuleSetPayloadGetRegionAttributeTypeOk(arg UpdateCoreRuleSetPayloadGetRegionAttributeType) (ret UpdateCoreRuleSetPayloadGetRegionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setUpdateCoreRuleSetPayloadGetRegionAttributeType(arg *UpdateCoreRuleSetPayloadGetRegionAttributeType, val UpdateCoreRuleSetPayloadGetRegionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type UpdateCoreRuleSetPayloadGetRegionArgType = string
|
||||
type UpdateCoreRuleSetPayloadGetRegionRetType = string
|
||||
|
||||
// UpdateCoreRuleSetPayload UpdateCoreRuleSetRequest updates a rules configuration, but only if it changed.
|
||||
type UpdateCoreRuleSetPayload struct {
|
||||
// To activate the OWASP core rule set, set this boolean to true.
|
||||
Active UpdateCoreRuleSetPayloadgetActiveAttributeType `json:"active,omitempty"`
|
||||
// Core rule set configuration name.
|
||||
Name UpdateCoreRuleSetPayloadGetNameAttributeType `json:"name,omitempty"`
|
||||
// Project identifier
|
||||
ProjectId UpdateCoreRuleSetPayloadGetProjectIdAttributeType `json:"projectId,omitempty"`
|
||||
// Region
|
||||
Region UpdateCoreRuleSetPayloadGetRegionAttributeType `json:"region,omitempty"`
|
||||
}
|
||||
|
||||
// NewUpdateCoreRuleSetPayload instantiates a new UpdateCoreRuleSetPayload 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 NewUpdateCoreRuleSetPayload() *UpdateCoreRuleSetPayload {
|
||||
this := UpdateCoreRuleSetPayload{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewUpdateCoreRuleSetPayloadWithDefaults instantiates a new UpdateCoreRuleSetPayload 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 NewUpdateCoreRuleSetPayloadWithDefaults() *UpdateCoreRuleSetPayload {
|
||||
this := UpdateCoreRuleSetPayload{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetActive returns the Active field value if set, zero value otherwise.
|
||||
func (o *UpdateCoreRuleSetPayload) GetActive() (res UpdateCoreRuleSetPayloadgetActiveRetType) {
|
||||
res, _ = o.GetActiveOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetActiveOk returns a tuple with the Active field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *UpdateCoreRuleSetPayload) GetActiveOk() (ret UpdateCoreRuleSetPayloadgetActiveRetType, ok bool) {
|
||||
return getUpdateCoreRuleSetPayloadgetActiveAttributeTypeOk(o.Active)
|
||||
}
|
||||
|
||||
// HasActive returns a boolean if a field has been set.
|
||||
func (o *UpdateCoreRuleSetPayload) HasActive() bool {
|
||||
_, ok := o.GetActiveOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetActive gets a reference to the given bool and assigns it to the Active field.
|
||||
func (o *UpdateCoreRuleSetPayload) SetActive(v UpdateCoreRuleSetPayloadgetActiveRetType) {
|
||||
setUpdateCoreRuleSetPayloadgetActiveAttributeType(&o.Active, v)
|
||||
}
|
||||
|
||||
// GetName returns the Name field value if set, zero value otherwise.
|
||||
func (o *UpdateCoreRuleSetPayload) GetName() (res UpdateCoreRuleSetPayloadGetNameRetType) {
|
||||
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 *UpdateCoreRuleSetPayload) GetNameOk() (ret UpdateCoreRuleSetPayloadGetNameRetType, ok bool) {
|
||||
return getUpdateCoreRuleSetPayloadGetNameAttributeTypeOk(o.Name)
|
||||
}
|
||||
|
||||
// HasName returns a boolean if a field has been set.
|
||||
func (o *UpdateCoreRuleSetPayload) HasName() bool {
|
||||
_, ok := o.GetNameOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetName gets a reference to the given string and assigns it to the Name field.
|
||||
func (o *UpdateCoreRuleSetPayload) SetName(v UpdateCoreRuleSetPayloadGetNameRetType) {
|
||||
setUpdateCoreRuleSetPayloadGetNameAttributeType(&o.Name, v)
|
||||
}
|
||||
|
||||
// GetProjectId returns the ProjectId field value if set, zero value otherwise.
|
||||
func (o *UpdateCoreRuleSetPayload) GetProjectId() (res UpdateCoreRuleSetPayloadGetProjectIdRetType) {
|
||||
res, _ = o.GetProjectIdOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetProjectIdOk returns a tuple with the ProjectId field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *UpdateCoreRuleSetPayload) GetProjectIdOk() (ret UpdateCoreRuleSetPayloadGetProjectIdRetType, ok bool) {
|
||||
return getUpdateCoreRuleSetPayloadGetProjectIdAttributeTypeOk(o.ProjectId)
|
||||
}
|
||||
|
||||
// HasProjectId returns a boolean if a field has been set.
|
||||
func (o *UpdateCoreRuleSetPayload) HasProjectId() bool {
|
||||
_, ok := o.GetProjectIdOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetProjectId gets a reference to the given string and assigns it to the ProjectId field.
|
||||
func (o *UpdateCoreRuleSetPayload) SetProjectId(v UpdateCoreRuleSetPayloadGetProjectIdRetType) {
|
||||
setUpdateCoreRuleSetPayloadGetProjectIdAttributeType(&o.ProjectId, v)
|
||||
}
|
||||
|
||||
// GetRegion returns the Region field value if set, zero value otherwise.
|
||||
func (o *UpdateCoreRuleSetPayload) GetRegion() (res UpdateCoreRuleSetPayloadGetRegionRetType) {
|
||||
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 *UpdateCoreRuleSetPayload) GetRegionOk() (ret UpdateCoreRuleSetPayloadGetRegionRetType, ok bool) {
|
||||
return getUpdateCoreRuleSetPayloadGetRegionAttributeTypeOk(o.Region)
|
||||
}
|
||||
|
||||
// HasRegion returns a boolean if a field has been set.
|
||||
func (o *UpdateCoreRuleSetPayload) HasRegion() bool {
|
||||
_, ok := o.GetRegionOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetRegion gets a reference to the given string and assigns it to the Region field.
|
||||
func (o *UpdateCoreRuleSetPayload) SetRegion(v UpdateCoreRuleSetPayloadGetRegionRetType) {
|
||||
setUpdateCoreRuleSetPayloadGetRegionAttributeType(&o.Region, v)
|
||||
}
|
||||
|
||||
func (o UpdateCoreRuleSetPayload) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getUpdateCoreRuleSetPayloadgetActiveAttributeTypeOk(o.Active); ok {
|
||||
toSerialize["Active"] = val
|
||||
}
|
||||
if val, ok := getUpdateCoreRuleSetPayloadGetNameAttributeTypeOk(o.Name); ok {
|
||||
toSerialize["Name"] = val
|
||||
}
|
||||
if val, ok := getUpdateCoreRuleSetPayloadGetProjectIdAttributeTypeOk(o.ProjectId); ok {
|
||||
toSerialize["ProjectId"] = val
|
||||
}
|
||||
if val, ok := getUpdateCoreRuleSetPayloadGetRegionAttributeTypeOk(o.Region); ok {
|
||||
toSerialize["Region"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableUpdateCoreRuleSetPayload struct {
|
||||
value *UpdateCoreRuleSetPayload
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableUpdateCoreRuleSetPayload) Get() *UpdateCoreRuleSetPayload {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableUpdateCoreRuleSetPayload) Set(val *UpdateCoreRuleSetPayload) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableUpdateCoreRuleSetPayload) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableUpdateCoreRuleSetPayload) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableUpdateCoreRuleSetPayload(val *UpdateCoreRuleSetPayload) *NullableUpdateCoreRuleSetPayload {
|
||||
return &NullableUpdateCoreRuleSetPayload{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableUpdateCoreRuleSetPayload) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableUpdateCoreRuleSetPayload) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/albwafalpha/model_update_core_rule_set_payload_test.go
Normal file
11
pkg/albwafalpha/model_update_core_rule_set_payload_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
226
pkg/albwafalpha/model_update_core_rule_set_response.go
Normal file
226
pkg/albwafalpha/model_update_core_rule_set_response.go
Normal file
|
|
@ -0,0 +1,226 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the UpdateCoreRuleSetResponse type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &UpdateCoreRuleSetResponse{}
|
||||
|
||||
/*
|
||||
types and functions for active
|
||||
*/
|
||||
|
||||
// isBoolean
|
||||
type UpdateCoreRuleSetResponsegetActiveAttributeType = *bool
|
||||
type UpdateCoreRuleSetResponsegetActiveArgType = bool
|
||||
type UpdateCoreRuleSetResponsegetActiveRetType = bool
|
||||
|
||||
func getUpdateCoreRuleSetResponsegetActiveAttributeTypeOk(arg UpdateCoreRuleSetResponsegetActiveAttributeType) (ret UpdateCoreRuleSetResponsegetActiveRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setUpdateCoreRuleSetResponsegetActiveAttributeType(arg *UpdateCoreRuleSetResponsegetActiveAttributeType, val UpdateCoreRuleSetResponsegetActiveRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for name
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type UpdateCoreRuleSetResponseGetNameAttributeType = *string
|
||||
|
||||
func getUpdateCoreRuleSetResponseGetNameAttributeTypeOk(arg UpdateCoreRuleSetResponseGetNameAttributeType) (ret UpdateCoreRuleSetResponseGetNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setUpdateCoreRuleSetResponseGetNameAttributeType(arg *UpdateCoreRuleSetResponseGetNameAttributeType, val UpdateCoreRuleSetResponseGetNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type UpdateCoreRuleSetResponseGetNameArgType = string
|
||||
type UpdateCoreRuleSetResponseGetNameRetType = string
|
||||
|
||||
/*
|
||||
types and functions for region
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type UpdateCoreRuleSetResponseGetRegionAttributeType = *string
|
||||
|
||||
func getUpdateCoreRuleSetResponseGetRegionAttributeTypeOk(arg UpdateCoreRuleSetResponseGetRegionAttributeType) (ret UpdateCoreRuleSetResponseGetRegionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setUpdateCoreRuleSetResponseGetRegionAttributeType(arg *UpdateCoreRuleSetResponseGetRegionAttributeType, val UpdateCoreRuleSetResponseGetRegionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type UpdateCoreRuleSetResponseGetRegionArgType = string
|
||||
type UpdateCoreRuleSetResponseGetRegionRetType = string
|
||||
|
||||
// UpdateCoreRuleSetResponse UpdateCoreRuleSetResponse returns rule configuration name and it's rules.
|
||||
type UpdateCoreRuleSetResponse struct {
|
||||
// Indicates if the OWASP core rule set is active.
|
||||
Active UpdateCoreRuleSetResponsegetActiveAttributeType `json:"active,omitempty"`
|
||||
// Core rule set configuration name.
|
||||
Name UpdateCoreRuleSetResponseGetNameAttributeType `json:"name,omitempty"`
|
||||
// Region
|
||||
Region UpdateCoreRuleSetResponseGetRegionAttributeType `json:"region,omitempty"`
|
||||
}
|
||||
|
||||
// NewUpdateCoreRuleSetResponse instantiates a new UpdateCoreRuleSetResponse 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 NewUpdateCoreRuleSetResponse() *UpdateCoreRuleSetResponse {
|
||||
this := UpdateCoreRuleSetResponse{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewUpdateCoreRuleSetResponseWithDefaults instantiates a new UpdateCoreRuleSetResponse 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 NewUpdateCoreRuleSetResponseWithDefaults() *UpdateCoreRuleSetResponse {
|
||||
this := UpdateCoreRuleSetResponse{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetActive returns the Active field value if set, zero value otherwise.
|
||||
func (o *UpdateCoreRuleSetResponse) GetActive() (res UpdateCoreRuleSetResponsegetActiveRetType) {
|
||||
res, _ = o.GetActiveOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetActiveOk returns a tuple with the Active field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *UpdateCoreRuleSetResponse) GetActiveOk() (ret UpdateCoreRuleSetResponsegetActiveRetType, ok bool) {
|
||||
return getUpdateCoreRuleSetResponsegetActiveAttributeTypeOk(o.Active)
|
||||
}
|
||||
|
||||
// HasActive returns a boolean if a field has been set.
|
||||
func (o *UpdateCoreRuleSetResponse) HasActive() bool {
|
||||
_, ok := o.GetActiveOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetActive gets a reference to the given bool and assigns it to the Active field.
|
||||
func (o *UpdateCoreRuleSetResponse) SetActive(v UpdateCoreRuleSetResponsegetActiveRetType) {
|
||||
setUpdateCoreRuleSetResponsegetActiveAttributeType(&o.Active, v)
|
||||
}
|
||||
|
||||
// GetName returns the Name field value if set, zero value otherwise.
|
||||
func (o *UpdateCoreRuleSetResponse) GetName() (res UpdateCoreRuleSetResponseGetNameRetType) {
|
||||
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 *UpdateCoreRuleSetResponse) GetNameOk() (ret UpdateCoreRuleSetResponseGetNameRetType, ok bool) {
|
||||
return getUpdateCoreRuleSetResponseGetNameAttributeTypeOk(o.Name)
|
||||
}
|
||||
|
||||
// HasName returns a boolean if a field has been set.
|
||||
func (o *UpdateCoreRuleSetResponse) HasName() bool {
|
||||
_, ok := o.GetNameOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetName gets a reference to the given string and assigns it to the Name field.
|
||||
func (o *UpdateCoreRuleSetResponse) SetName(v UpdateCoreRuleSetResponseGetNameRetType) {
|
||||
setUpdateCoreRuleSetResponseGetNameAttributeType(&o.Name, v)
|
||||
}
|
||||
|
||||
// GetRegion returns the Region field value if set, zero value otherwise.
|
||||
func (o *UpdateCoreRuleSetResponse) GetRegion() (res UpdateCoreRuleSetResponseGetRegionRetType) {
|
||||
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 *UpdateCoreRuleSetResponse) GetRegionOk() (ret UpdateCoreRuleSetResponseGetRegionRetType, ok bool) {
|
||||
return getUpdateCoreRuleSetResponseGetRegionAttributeTypeOk(o.Region)
|
||||
}
|
||||
|
||||
// HasRegion returns a boolean if a field has been set.
|
||||
func (o *UpdateCoreRuleSetResponse) HasRegion() bool {
|
||||
_, ok := o.GetRegionOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetRegion gets a reference to the given string and assigns it to the Region field.
|
||||
func (o *UpdateCoreRuleSetResponse) SetRegion(v UpdateCoreRuleSetResponseGetRegionRetType) {
|
||||
setUpdateCoreRuleSetResponseGetRegionAttributeType(&o.Region, v)
|
||||
}
|
||||
|
||||
func (o UpdateCoreRuleSetResponse) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getUpdateCoreRuleSetResponsegetActiveAttributeTypeOk(o.Active); ok {
|
||||
toSerialize["Active"] = val
|
||||
}
|
||||
if val, ok := getUpdateCoreRuleSetResponseGetNameAttributeTypeOk(o.Name); ok {
|
||||
toSerialize["Name"] = val
|
||||
}
|
||||
if val, ok := getUpdateCoreRuleSetResponseGetRegionAttributeTypeOk(o.Region); ok {
|
||||
toSerialize["Region"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableUpdateCoreRuleSetResponse struct {
|
||||
value *UpdateCoreRuleSetResponse
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableUpdateCoreRuleSetResponse) Get() *UpdateCoreRuleSetResponse {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableUpdateCoreRuleSetResponse) Set(val *UpdateCoreRuleSetResponse) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableUpdateCoreRuleSetResponse) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableUpdateCoreRuleSetResponse) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableUpdateCoreRuleSetResponse(val *UpdateCoreRuleSetResponse) *NullableUpdateCoreRuleSetResponse {
|
||||
return &NullableUpdateCoreRuleSetResponse{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableUpdateCoreRuleSetResponse) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableUpdateCoreRuleSetResponse) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/albwafalpha/model_update_core_rule_set_response_test.go
Normal file
11
pkg/albwafalpha/model_update_core_rule_set_response_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
276
pkg/albwafalpha/model_update_rules_payload.go
Normal file
276
pkg/albwafalpha/model_update_rules_payload.go
Normal file
|
|
@ -0,0 +1,276 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the UpdateRulesPayload type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &UpdateRulesPayload{}
|
||||
|
||||
/*
|
||||
types and functions for name
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type UpdateRulesPayloadGetNameAttributeType = *string
|
||||
|
||||
func getUpdateRulesPayloadGetNameAttributeTypeOk(arg UpdateRulesPayloadGetNameAttributeType) (ret UpdateRulesPayloadGetNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setUpdateRulesPayloadGetNameAttributeType(arg *UpdateRulesPayloadGetNameAttributeType, val UpdateRulesPayloadGetNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type UpdateRulesPayloadGetNameArgType = string
|
||||
type UpdateRulesPayloadGetNameRetType = string
|
||||
|
||||
/*
|
||||
types and functions for projectId
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type UpdateRulesPayloadGetProjectIdAttributeType = *string
|
||||
|
||||
func getUpdateRulesPayloadGetProjectIdAttributeTypeOk(arg UpdateRulesPayloadGetProjectIdAttributeType) (ret UpdateRulesPayloadGetProjectIdRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setUpdateRulesPayloadGetProjectIdAttributeType(arg *UpdateRulesPayloadGetProjectIdAttributeType, val UpdateRulesPayloadGetProjectIdRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type UpdateRulesPayloadGetProjectIdArgType = string
|
||||
type UpdateRulesPayloadGetProjectIdRetType = string
|
||||
|
||||
/*
|
||||
types and functions for region
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type UpdateRulesPayloadGetRegionAttributeType = *string
|
||||
|
||||
func getUpdateRulesPayloadGetRegionAttributeTypeOk(arg UpdateRulesPayloadGetRegionAttributeType) (ret UpdateRulesPayloadGetRegionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setUpdateRulesPayloadGetRegionAttributeType(arg *UpdateRulesPayloadGetRegionAttributeType, val UpdateRulesPayloadGetRegionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type UpdateRulesPayloadGetRegionArgType = string
|
||||
type UpdateRulesPayloadGetRegionRetType = string
|
||||
|
||||
/*
|
||||
types and functions for rules
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type UpdateRulesPayloadGetRulesAttributeType = *string
|
||||
|
||||
func getUpdateRulesPayloadGetRulesAttributeTypeOk(arg UpdateRulesPayloadGetRulesAttributeType) (ret UpdateRulesPayloadGetRulesRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setUpdateRulesPayloadGetRulesAttributeType(arg *UpdateRulesPayloadGetRulesAttributeType, val UpdateRulesPayloadGetRulesRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type UpdateRulesPayloadGetRulesArgType = string
|
||||
type UpdateRulesPayloadGetRulesRetType = string
|
||||
|
||||
// UpdateRulesPayload UpdateRulesRequest updates a rules configuration, but only if it changed.
|
||||
type UpdateRulesPayload struct {
|
||||
// Rule configuration name.
|
||||
Name UpdateRulesPayloadGetNameAttributeType `json:"name,omitempty"`
|
||||
// Project identifier
|
||||
ProjectId UpdateRulesPayloadGetProjectIdAttributeType `json:"projectId,omitempty"`
|
||||
// Region
|
||||
Region UpdateRulesPayloadGetRegionAttributeType `json:"region,omitempty"`
|
||||
// Custom rules for WAF written in Seclang syntax.
|
||||
Rules UpdateRulesPayloadGetRulesAttributeType `json:"rules,omitempty"`
|
||||
}
|
||||
|
||||
// NewUpdateRulesPayload instantiates a new UpdateRulesPayload 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 NewUpdateRulesPayload() *UpdateRulesPayload {
|
||||
this := UpdateRulesPayload{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewUpdateRulesPayloadWithDefaults instantiates a new UpdateRulesPayload 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 NewUpdateRulesPayloadWithDefaults() *UpdateRulesPayload {
|
||||
this := UpdateRulesPayload{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetName returns the Name field value if set, zero value otherwise.
|
||||
func (o *UpdateRulesPayload) GetName() (res UpdateRulesPayloadGetNameRetType) {
|
||||
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 *UpdateRulesPayload) GetNameOk() (ret UpdateRulesPayloadGetNameRetType, ok bool) {
|
||||
return getUpdateRulesPayloadGetNameAttributeTypeOk(o.Name)
|
||||
}
|
||||
|
||||
// HasName returns a boolean if a field has been set.
|
||||
func (o *UpdateRulesPayload) HasName() bool {
|
||||
_, ok := o.GetNameOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetName gets a reference to the given string and assigns it to the Name field.
|
||||
func (o *UpdateRulesPayload) SetName(v UpdateRulesPayloadGetNameRetType) {
|
||||
setUpdateRulesPayloadGetNameAttributeType(&o.Name, v)
|
||||
}
|
||||
|
||||
// GetProjectId returns the ProjectId field value if set, zero value otherwise.
|
||||
func (o *UpdateRulesPayload) GetProjectId() (res UpdateRulesPayloadGetProjectIdRetType) {
|
||||
res, _ = o.GetProjectIdOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetProjectIdOk returns a tuple with the ProjectId field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *UpdateRulesPayload) GetProjectIdOk() (ret UpdateRulesPayloadGetProjectIdRetType, ok bool) {
|
||||
return getUpdateRulesPayloadGetProjectIdAttributeTypeOk(o.ProjectId)
|
||||
}
|
||||
|
||||
// HasProjectId returns a boolean if a field has been set.
|
||||
func (o *UpdateRulesPayload) HasProjectId() bool {
|
||||
_, ok := o.GetProjectIdOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetProjectId gets a reference to the given string and assigns it to the ProjectId field.
|
||||
func (o *UpdateRulesPayload) SetProjectId(v UpdateRulesPayloadGetProjectIdRetType) {
|
||||
setUpdateRulesPayloadGetProjectIdAttributeType(&o.ProjectId, v)
|
||||
}
|
||||
|
||||
// GetRegion returns the Region field value if set, zero value otherwise.
|
||||
func (o *UpdateRulesPayload) GetRegion() (res UpdateRulesPayloadGetRegionRetType) {
|
||||
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 *UpdateRulesPayload) GetRegionOk() (ret UpdateRulesPayloadGetRegionRetType, ok bool) {
|
||||
return getUpdateRulesPayloadGetRegionAttributeTypeOk(o.Region)
|
||||
}
|
||||
|
||||
// HasRegion returns a boolean if a field has been set.
|
||||
func (o *UpdateRulesPayload) HasRegion() bool {
|
||||
_, ok := o.GetRegionOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetRegion gets a reference to the given string and assigns it to the Region field.
|
||||
func (o *UpdateRulesPayload) SetRegion(v UpdateRulesPayloadGetRegionRetType) {
|
||||
setUpdateRulesPayloadGetRegionAttributeType(&o.Region, v)
|
||||
}
|
||||
|
||||
// GetRules returns the Rules field value if set, zero value otherwise.
|
||||
func (o *UpdateRulesPayload) GetRules() (res UpdateRulesPayloadGetRulesRetType) {
|
||||
res, _ = o.GetRulesOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetRulesOk returns a tuple with the Rules field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *UpdateRulesPayload) GetRulesOk() (ret UpdateRulesPayloadGetRulesRetType, ok bool) {
|
||||
return getUpdateRulesPayloadGetRulesAttributeTypeOk(o.Rules)
|
||||
}
|
||||
|
||||
// HasRules returns a boolean if a field has been set.
|
||||
func (o *UpdateRulesPayload) HasRules() bool {
|
||||
_, ok := o.GetRulesOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetRules gets a reference to the given string and assigns it to the Rules field.
|
||||
func (o *UpdateRulesPayload) SetRules(v UpdateRulesPayloadGetRulesRetType) {
|
||||
setUpdateRulesPayloadGetRulesAttributeType(&o.Rules, v)
|
||||
}
|
||||
|
||||
func (o UpdateRulesPayload) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getUpdateRulesPayloadGetNameAttributeTypeOk(o.Name); ok {
|
||||
toSerialize["Name"] = val
|
||||
}
|
||||
if val, ok := getUpdateRulesPayloadGetProjectIdAttributeTypeOk(o.ProjectId); ok {
|
||||
toSerialize["ProjectId"] = val
|
||||
}
|
||||
if val, ok := getUpdateRulesPayloadGetRegionAttributeTypeOk(o.Region); ok {
|
||||
toSerialize["Region"] = val
|
||||
}
|
||||
if val, ok := getUpdateRulesPayloadGetRulesAttributeTypeOk(o.Rules); ok {
|
||||
toSerialize["Rules"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableUpdateRulesPayload struct {
|
||||
value *UpdateRulesPayload
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableUpdateRulesPayload) Get() *UpdateRulesPayload {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableUpdateRulesPayload) Set(val *UpdateRulesPayload) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableUpdateRulesPayload) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableUpdateRulesPayload) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableUpdateRulesPayload(val *UpdateRulesPayload) *NullableUpdateRulesPayload {
|
||||
return &NullableUpdateRulesPayload{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableUpdateRulesPayload) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableUpdateRulesPayload) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/albwafalpha/model_update_rules_payload_test.go
Normal file
11
pkg/albwafalpha/model_update_rules_payload_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
227
pkg/albwafalpha/model_update_rules_response.go
Normal file
227
pkg/albwafalpha/model_update_rules_response.go
Normal file
|
|
@ -0,0 +1,227 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the UpdateRulesResponse type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &UpdateRulesResponse{}
|
||||
|
||||
/*
|
||||
types and functions for name
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type UpdateRulesResponseGetNameAttributeType = *string
|
||||
|
||||
func getUpdateRulesResponseGetNameAttributeTypeOk(arg UpdateRulesResponseGetNameAttributeType) (ret UpdateRulesResponseGetNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setUpdateRulesResponseGetNameAttributeType(arg *UpdateRulesResponseGetNameAttributeType, val UpdateRulesResponseGetNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type UpdateRulesResponseGetNameArgType = string
|
||||
type UpdateRulesResponseGetNameRetType = string
|
||||
|
||||
/*
|
||||
types and functions for region
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type UpdateRulesResponseGetRegionAttributeType = *string
|
||||
|
||||
func getUpdateRulesResponseGetRegionAttributeTypeOk(arg UpdateRulesResponseGetRegionAttributeType) (ret UpdateRulesResponseGetRegionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setUpdateRulesResponseGetRegionAttributeType(arg *UpdateRulesResponseGetRegionAttributeType, val UpdateRulesResponseGetRegionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type UpdateRulesResponseGetRegionArgType = string
|
||||
type UpdateRulesResponseGetRegionRetType = string
|
||||
|
||||
/*
|
||||
types and functions for rules
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type UpdateRulesResponseGetRulesAttributeType = *string
|
||||
|
||||
func getUpdateRulesResponseGetRulesAttributeTypeOk(arg UpdateRulesResponseGetRulesAttributeType) (ret UpdateRulesResponseGetRulesRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setUpdateRulesResponseGetRulesAttributeType(arg *UpdateRulesResponseGetRulesAttributeType, val UpdateRulesResponseGetRulesRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type UpdateRulesResponseGetRulesArgType = string
|
||||
type UpdateRulesResponseGetRulesRetType = string
|
||||
|
||||
// UpdateRulesResponse UpdateRulesResponse returns rule configuration name and it's rules.
|
||||
type UpdateRulesResponse struct {
|
||||
// Rule configuration name.
|
||||
Name UpdateRulesResponseGetNameAttributeType `json:"name,omitempty"`
|
||||
// Region
|
||||
Region UpdateRulesResponseGetRegionAttributeType `json:"region,omitempty"`
|
||||
// Custom rules written in Seclang syntax.
|
||||
Rules UpdateRulesResponseGetRulesAttributeType `json:"rules,omitempty"`
|
||||
}
|
||||
|
||||
// NewUpdateRulesResponse instantiates a new UpdateRulesResponse 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 NewUpdateRulesResponse() *UpdateRulesResponse {
|
||||
this := UpdateRulesResponse{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewUpdateRulesResponseWithDefaults instantiates a new UpdateRulesResponse 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 NewUpdateRulesResponseWithDefaults() *UpdateRulesResponse {
|
||||
this := UpdateRulesResponse{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetName returns the Name field value if set, zero value otherwise.
|
||||
func (o *UpdateRulesResponse) GetName() (res UpdateRulesResponseGetNameRetType) {
|
||||
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 *UpdateRulesResponse) GetNameOk() (ret UpdateRulesResponseGetNameRetType, ok bool) {
|
||||
return getUpdateRulesResponseGetNameAttributeTypeOk(o.Name)
|
||||
}
|
||||
|
||||
// HasName returns a boolean if a field has been set.
|
||||
func (o *UpdateRulesResponse) HasName() bool {
|
||||
_, ok := o.GetNameOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetName gets a reference to the given string and assigns it to the Name field.
|
||||
func (o *UpdateRulesResponse) SetName(v UpdateRulesResponseGetNameRetType) {
|
||||
setUpdateRulesResponseGetNameAttributeType(&o.Name, v)
|
||||
}
|
||||
|
||||
// GetRegion returns the Region field value if set, zero value otherwise.
|
||||
func (o *UpdateRulesResponse) GetRegion() (res UpdateRulesResponseGetRegionRetType) {
|
||||
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 *UpdateRulesResponse) GetRegionOk() (ret UpdateRulesResponseGetRegionRetType, ok bool) {
|
||||
return getUpdateRulesResponseGetRegionAttributeTypeOk(o.Region)
|
||||
}
|
||||
|
||||
// HasRegion returns a boolean if a field has been set.
|
||||
func (o *UpdateRulesResponse) HasRegion() bool {
|
||||
_, ok := o.GetRegionOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetRegion gets a reference to the given string and assigns it to the Region field.
|
||||
func (o *UpdateRulesResponse) SetRegion(v UpdateRulesResponseGetRegionRetType) {
|
||||
setUpdateRulesResponseGetRegionAttributeType(&o.Region, v)
|
||||
}
|
||||
|
||||
// GetRules returns the Rules field value if set, zero value otherwise.
|
||||
func (o *UpdateRulesResponse) GetRules() (res UpdateRulesResponseGetRulesRetType) {
|
||||
res, _ = o.GetRulesOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetRulesOk returns a tuple with the Rules field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *UpdateRulesResponse) GetRulesOk() (ret UpdateRulesResponseGetRulesRetType, ok bool) {
|
||||
return getUpdateRulesResponseGetRulesAttributeTypeOk(o.Rules)
|
||||
}
|
||||
|
||||
// HasRules returns a boolean if a field has been set.
|
||||
func (o *UpdateRulesResponse) HasRules() bool {
|
||||
_, ok := o.GetRulesOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetRules gets a reference to the given string and assigns it to the Rules field.
|
||||
func (o *UpdateRulesResponse) SetRules(v UpdateRulesResponseGetRulesRetType) {
|
||||
setUpdateRulesResponseGetRulesAttributeType(&o.Rules, v)
|
||||
}
|
||||
|
||||
func (o UpdateRulesResponse) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getUpdateRulesResponseGetNameAttributeTypeOk(o.Name); ok {
|
||||
toSerialize["Name"] = val
|
||||
}
|
||||
if val, ok := getUpdateRulesResponseGetRegionAttributeTypeOk(o.Region); ok {
|
||||
toSerialize["Region"] = val
|
||||
}
|
||||
if val, ok := getUpdateRulesResponseGetRulesAttributeTypeOk(o.Rules); ok {
|
||||
toSerialize["Rules"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableUpdateRulesResponse struct {
|
||||
value *UpdateRulesResponse
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableUpdateRulesResponse) Get() *UpdateRulesResponse {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableUpdateRulesResponse) Set(val *UpdateRulesResponse) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableUpdateRulesResponse) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableUpdateRulesResponse) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableUpdateRulesResponse(val *UpdateRulesResponse) *NullableUpdateRulesResponse {
|
||||
return &NullableUpdateRulesResponse{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableUpdateRulesResponse) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableUpdateRulesResponse) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/albwafalpha/model_update_rules_response_test.go
Normal file
11
pkg/albwafalpha/model_update_rules_response_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
325
pkg/albwafalpha/model_update_waf_payload.go
Normal file
325
pkg/albwafalpha/model_update_waf_payload.go
Normal file
|
|
@ -0,0 +1,325 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the UpdateWAFPayload type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &UpdateWAFPayload{}
|
||||
|
||||
/*
|
||||
types and functions for coreRuleSetName
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type UpdateWAFPayloadGetCoreRuleSetNameAttributeType = *string
|
||||
|
||||
func getUpdateWAFPayloadGetCoreRuleSetNameAttributeTypeOk(arg UpdateWAFPayloadGetCoreRuleSetNameAttributeType) (ret UpdateWAFPayloadGetCoreRuleSetNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setUpdateWAFPayloadGetCoreRuleSetNameAttributeType(arg *UpdateWAFPayloadGetCoreRuleSetNameAttributeType, val UpdateWAFPayloadGetCoreRuleSetNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type UpdateWAFPayloadGetCoreRuleSetNameArgType = string
|
||||
type UpdateWAFPayloadGetCoreRuleSetNameRetType = string
|
||||
|
||||
/*
|
||||
types and functions for name
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type UpdateWAFPayloadGetNameAttributeType = *string
|
||||
|
||||
func getUpdateWAFPayloadGetNameAttributeTypeOk(arg UpdateWAFPayloadGetNameAttributeType) (ret UpdateWAFPayloadGetNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setUpdateWAFPayloadGetNameAttributeType(arg *UpdateWAFPayloadGetNameAttributeType, val UpdateWAFPayloadGetNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type UpdateWAFPayloadGetNameArgType = string
|
||||
type UpdateWAFPayloadGetNameRetType = string
|
||||
|
||||
/*
|
||||
types and functions for projectId
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type UpdateWAFPayloadGetProjectIdAttributeType = *string
|
||||
|
||||
func getUpdateWAFPayloadGetProjectIdAttributeTypeOk(arg UpdateWAFPayloadGetProjectIdAttributeType) (ret UpdateWAFPayloadGetProjectIdRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setUpdateWAFPayloadGetProjectIdAttributeType(arg *UpdateWAFPayloadGetProjectIdAttributeType, val UpdateWAFPayloadGetProjectIdRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type UpdateWAFPayloadGetProjectIdArgType = string
|
||||
type UpdateWAFPayloadGetProjectIdRetType = string
|
||||
|
||||
/*
|
||||
types and functions for region
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type UpdateWAFPayloadGetRegionAttributeType = *string
|
||||
|
||||
func getUpdateWAFPayloadGetRegionAttributeTypeOk(arg UpdateWAFPayloadGetRegionAttributeType) (ret UpdateWAFPayloadGetRegionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setUpdateWAFPayloadGetRegionAttributeType(arg *UpdateWAFPayloadGetRegionAttributeType, val UpdateWAFPayloadGetRegionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type UpdateWAFPayloadGetRegionArgType = string
|
||||
type UpdateWAFPayloadGetRegionRetType = string
|
||||
|
||||
/*
|
||||
types and functions for rulesConfigName
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type UpdateWAFPayloadGetRulesConfigNameAttributeType = *string
|
||||
|
||||
func getUpdateWAFPayloadGetRulesConfigNameAttributeTypeOk(arg UpdateWAFPayloadGetRulesConfigNameAttributeType) (ret UpdateWAFPayloadGetRulesConfigNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setUpdateWAFPayloadGetRulesConfigNameAttributeType(arg *UpdateWAFPayloadGetRulesConfigNameAttributeType, val UpdateWAFPayloadGetRulesConfigNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type UpdateWAFPayloadGetRulesConfigNameArgType = string
|
||||
type UpdateWAFPayloadGetRulesConfigNameRetType = string
|
||||
|
||||
// UpdateWAFPayload UpdateWAFRequest updates a WAF if rules changed.
|
||||
type UpdateWAFPayload struct {
|
||||
// Name of the core rule set configuration for that WAF.
|
||||
CoreRuleSetName UpdateWAFPayloadGetCoreRuleSetNameAttributeType `json:"coreRuleSetName,omitempty"`
|
||||
// WAF name
|
||||
Name UpdateWAFPayloadGetNameAttributeType `json:"name,omitempty"`
|
||||
// Project identifier
|
||||
ProjectId UpdateWAFPayloadGetProjectIdAttributeType `json:"projectId,omitempty"`
|
||||
// Region
|
||||
Region UpdateWAFPayloadGetRegionAttributeType `json:"region,omitempty"`
|
||||
// Name of the rule configuration for that WAF.
|
||||
RulesConfigName UpdateWAFPayloadGetRulesConfigNameAttributeType `json:"rulesConfigName,omitempty"`
|
||||
}
|
||||
|
||||
// NewUpdateWAFPayload instantiates a new UpdateWAFPayload 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 NewUpdateWAFPayload() *UpdateWAFPayload {
|
||||
this := UpdateWAFPayload{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewUpdateWAFPayloadWithDefaults instantiates a new UpdateWAFPayload 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 NewUpdateWAFPayloadWithDefaults() *UpdateWAFPayload {
|
||||
this := UpdateWAFPayload{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetCoreRuleSetName returns the CoreRuleSetName field value if set, zero value otherwise.
|
||||
func (o *UpdateWAFPayload) GetCoreRuleSetName() (res UpdateWAFPayloadGetCoreRuleSetNameRetType) {
|
||||
res, _ = o.GetCoreRuleSetNameOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetCoreRuleSetNameOk returns a tuple with the CoreRuleSetName field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *UpdateWAFPayload) GetCoreRuleSetNameOk() (ret UpdateWAFPayloadGetCoreRuleSetNameRetType, ok bool) {
|
||||
return getUpdateWAFPayloadGetCoreRuleSetNameAttributeTypeOk(o.CoreRuleSetName)
|
||||
}
|
||||
|
||||
// HasCoreRuleSetName returns a boolean if a field has been set.
|
||||
func (o *UpdateWAFPayload) HasCoreRuleSetName() bool {
|
||||
_, ok := o.GetCoreRuleSetNameOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetCoreRuleSetName gets a reference to the given string and assigns it to the CoreRuleSetName field.
|
||||
func (o *UpdateWAFPayload) SetCoreRuleSetName(v UpdateWAFPayloadGetCoreRuleSetNameRetType) {
|
||||
setUpdateWAFPayloadGetCoreRuleSetNameAttributeType(&o.CoreRuleSetName, v)
|
||||
}
|
||||
|
||||
// GetName returns the Name field value if set, zero value otherwise.
|
||||
func (o *UpdateWAFPayload) GetName() (res UpdateWAFPayloadGetNameRetType) {
|
||||
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 *UpdateWAFPayload) GetNameOk() (ret UpdateWAFPayloadGetNameRetType, ok bool) {
|
||||
return getUpdateWAFPayloadGetNameAttributeTypeOk(o.Name)
|
||||
}
|
||||
|
||||
// HasName returns a boolean if a field has been set.
|
||||
func (o *UpdateWAFPayload) HasName() bool {
|
||||
_, ok := o.GetNameOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetName gets a reference to the given string and assigns it to the Name field.
|
||||
func (o *UpdateWAFPayload) SetName(v UpdateWAFPayloadGetNameRetType) {
|
||||
setUpdateWAFPayloadGetNameAttributeType(&o.Name, v)
|
||||
}
|
||||
|
||||
// GetProjectId returns the ProjectId field value if set, zero value otherwise.
|
||||
func (o *UpdateWAFPayload) GetProjectId() (res UpdateWAFPayloadGetProjectIdRetType) {
|
||||
res, _ = o.GetProjectIdOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetProjectIdOk returns a tuple with the ProjectId field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *UpdateWAFPayload) GetProjectIdOk() (ret UpdateWAFPayloadGetProjectIdRetType, ok bool) {
|
||||
return getUpdateWAFPayloadGetProjectIdAttributeTypeOk(o.ProjectId)
|
||||
}
|
||||
|
||||
// HasProjectId returns a boolean if a field has been set.
|
||||
func (o *UpdateWAFPayload) HasProjectId() bool {
|
||||
_, ok := o.GetProjectIdOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetProjectId gets a reference to the given string and assigns it to the ProjectId field.
|
||||
func (o *UpdateWAFPayload) SetProjectId(v UpdateWAFPayloadGetProjectIdRetType) {
|
||||
setUpdateWAFPayloadGetProjectIdAttributeType(&o.ProjectId, v)
|
||||
}
|
||||
|
||||
// GetRegion returns the Region field value if set, zero value otherwise.
|
||||
func (o *UpdateWAFPayload) GetRegion() (res UpdateWAFPayloadGetRegionRetType) {
|
||||
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 *UpdateWAFPayload) GetRegionOk() (ret UpdateWAFPayloadGetRegionRetType, ok bool) {
|
||||
return getUpdateWAFPayloadGetRegionAttributeTypeOk(o.Region)
|
||||
}
|
||||
|
||||
// HasRegion returns a boolean if a field has been set.
|
||||
func (o *UpdateWAFPayload) HasRegion() bool {
|
||||
_, ok := o.GetRegionOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetRegion gets a reference to the given string and assigns it to the Region field.
|
||||
func (o *UpdateWAFPayload) SetRegion(v UpdateWAFPayloadGetRegionRetType) {
|
||||
setUpdateWAFPayloadGetRegionAttributeType(&o.Region, v)
|
||||
}
|
||||
|
||||
// GetRulesConfigName returns the RulesConfigName field value if set, zero value otherwise.
|
||||
func (o *UpdateWAFPayload) GetRulesConfigName() (res UpdateWAFPayloadGetRulesConfigNameRetType) {
|
||||
res, _ = o.GetRulesConfigNameOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetRulesConfigNameOk returns a tuple with the RulesConfigName field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *UpdateWAFPayload) GetRulesConfigNameOk() (ret UpdateWAFPayloadGetRulesConfigNameRetType, ok bool) {
|
||||
return getUpdateWAFPayloadGetRulesConfigNameAttributeTypeOk(o.RulesConfigName)
|
||||
}
|
||||
|
||||
// HasRulesConfigName returns a boolean if a field has been set.
|
||||
func (o *UpdateWAFPayload) HasRulesConfigName() bool {
|
||||
_, ok := o.GetRulesConfigNameOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetRulesConfigName gets a reference to the given string and assigns it to the RulesConfigName field.
|
||||
func (o *UpdateWAFPayload) SetRulesConfigName(v UpdateWAFPayloadGetRulesConfigNameRetType) {
|
||||
setUpdateWAFPayloadGetRulesConfigNameAttributeType(&o.RulesConfigName, v)
|
||||
}
|
||||
|
||||
func (o UpdateWAFPayload) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getUpdateWAFPayloadGetCoreRuleSetNameAttributeTypeOk(o.CoreRuleSetName); ok {
|
||||
toSerialize["CoreRuleSetName"] = val
|
||||
}
|
||||
if val, ok := getUpdateWAFPayloadGetNameAttributeTypeOk(o.Name); ok {
|
||||
toSerialize["Name"] = val
|
||||
}
|
||||
if val, ok := getUpdateWAFPayloadGetProjectIdAttributeTypeOk(o.ProjectId); ok {
|
||||
toSerialize["ProjectId"] = val
|
||||
}
|
||||
if val, ok := getUpdateWAFPayloadGetRegionAttributeTypeOk(o.Region); ok {
|
||||
toSerialize["Region"] = val
|
||||
}
|
||||
if val, ok := getUpdateWAFPayloadGetRulesConfigNameAttributeTypeOk(o.RulesConfigName); ok {
|
||||
toSerialize["RulesConfigName"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableUpdateWAFPayload struct {
|
||||
value *UpdateWAFPayload
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableUpdateWAFPayload) Get() *UpdateWAFPayload {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableUpdateWAFPayload) Set(val *UpdateWAFPayload) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableUpdateWAFPayload) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableUpdateWAFPayload) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableUpdateWAFPayload(val *UpdateWAFPayload) *NullableUpdateWAFPayload {
|
||||
return &NullableUpdateWAFPayload{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableUpdateWAFPayload) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableUpdateWAFPayload) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/albwafalpha/model_update_waf_payload_test.go
Normal file
11
pkg/albwafalpha/model_update_waf_payload_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
276
pkg/albwafalpha/model_update_waf_response.go
Normal file
276
pkg/albwafalpha/model_update_waf_response.go
Normal file
|
|
@ -0,0 +1,276 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the UpdateWAFResponse type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &UpdateWAFResponse{}
|
||||
|
||||
/*
|
||||
types and functions for coreRuleSetName
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type UpdateWAFResponseGetCoreRuleSetNameAttributeType = *string
|
||||
|
||||
func getUpdateWAFResponseGetCoreRuleSetNameAttributeTypeOk(arg UpdateWAFResponseGetCoreRuleSetNameAttributeType) (ret UpdateWAFResponseGetCoreRuleSetNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setUpdateWAFResponseGetCoreRuleSetNameAttributeType(arg *UpdateWAFResponseGetCoreRuleSetNameAttributeType, val UpdateWAFResponseGetCoreRuleSetNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type UpdateWAFResponseGetCoreRuleSetNameArgType = string
|
||||
type UpdateWAFResponseGetCoreRuleSetNameRetType = string
|
||||
|
||||
/*
|
||||
types and functions for name
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type UpdateWAFResponseGetNameAttributeType = *string
|
||||
|
||||
func getUpdateWAFResponseGetNameAttributeTypeOk(arg UpdateWAFResponseGetNameAttributeType) (ret UpdateWAFResponseGetNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setUpdateWAFResponseGetNameAttributeType(arg *UpdateWAFResponseGetNameAttributeType, val UpdateWAFResponseGetNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type UpdateWAFResponseGetNameArgType = string
|
||||
type UpdateWAFResponseGetNameRetType = string
|
||||
|
||||
/*
|
||||
types and functions for region
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type UpdateWAFResponseGetRegionAttributeType = *string
|
||||
|
||||
func getUpdateWAFResponseGetRegionAttributeTypeOk(arg UpdateWAFResponseGetRegionAttributeType) (ret UpdateWAFResponseGetRegionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setUpdateWAFResponseGetRegionAttributeType(arg *UpdateWAFResponseGetRegionAttributeType, val UpdateWAFResponseGetRegionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type UpdateWAFResponseGetRegionArgType = string
|
||||
type UpdateWAFResponseGetRegionRetType = string
|
||||
|
||||
/*
|
||||
types and functions for rulesConfigName
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type UpdateWAFResponseGetRulesConfigNameAttributeType = *string
|
||||
|
||||
func getUpdateWAFResponseGetRulesConfigNameAttributeTypeOk(arg UpdateWAFResponseGetRulesConfigNameAttributeType) (ret UpdateWAFResponseGetRulesConfigNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setUpdateWAFResponseGetRulesConfigNameAttributeType(arg *UpdateWAFResponseGetRulesConfigNameAttributeType, val UpdateWAFResponseGetRulesConfigNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type UpdateWAFResponseGetRulesConfigNameArgType = string
|
||||
type UpdateWAFResponseGetRulesConfigNameRetType = string
|
||||
|
||||
// UpdateWAFResponse UpdateWAFResponse returns name and custom rules.
|
||||
type UpdateWAFResponse struct {
|
||||
// Name of the core rule set configuration for that WAF.
|
||||
CoreRuleSetName UpdateWAFResponseGetCoreRuleSetNameAttributeType `json:"coreRuleSetName,omitempty"`
|
||||
// WAF name
|
||||
Name UpdateWAFResponseGetNameAttributeType `json:"name,omitempty"`
|
||||
// Region
|
||||
Region UpdateWAFResponseGetRegionAttributeType `json:"region,omitempty"`
|
||||
// Name of the rule configuration for that WAF.
|
||||
RulesConfigName UpdateWAFResponseGetRulesConfigNameAttributeType `json:"rulesConfigName,omitempty"`
|
||||
}
|
||||
|
||||
// NewUpdateWAFResponse instantiates a new UpdateWAFResponse 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 NewUpdateWAFResponse() *UpdateWAFResponse {
|
||||
this := UpdateWAFResponse{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewUpdateWAFResponseWithDefaults instantiates a new UpdateWAFResponse 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 NewUpdateWAFResponseWithDefaults() *UpdateWAFResponse {
|
||||
this := UpdateWAFResponse{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetCoreRuleSetName returns the CoreRuleSetName field value if set, zero value otherwise.
|
||||
func (o *UpdateWAFResponse) GetCoreRuleSetName() (res UpdateWAFResponseGetCoreRuleSetNameRetType) {
|
||||
res, _ = o.GetCoreRuleSetNameOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetCoreRuleSetNameOk returns a tuple with the CoreRuleSetName field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *UpdateWAFResponse) GetCoreRuleSetNameOk() (ret UpdateWAFResponseGetCoreRuleSetNameRetType, ok bool) {
|
||||
return getUpdateWAFResponseGetCoreRuleSetNameAttributeTypeOk(o.CoreRuleSetName)
|
||||
}
|
||||
|
||||
// HasCoreRuleSetName returns a boolean if a field has been set.
|
||||
func (o *UpdateWAFResponse) HasCoreRuleSetName() bool {
|
||||
_, ok := o.GetCoreRuleSetNameOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetCoreRuleSetName gets a reference to the given string and assigns it to the CoreRuleSetName field.
|
||||
func (o *UpdateWAFResponse) SetCoreRuleSetName(v UpdateWAFResponseGetCoreRuleSetNameRetType) {
|
||||
setUpdateWAFResponseGetCoreRuleSetNameAttributeType(&o.CoreRuleSetName, v)
|
||||
}
|
||||
|
||||
// GetName returns the Name field value if set, zero value otherwise.
|
||||
func (o *UpdateWAFResponse) GetName() (res UpdateWAFResponseGetNameRetType) {
|
||||
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 *UpdateWAFResponse) GetNameOk() (ret UpdateWAFResponseGetNameRetType, ok bool) {
|
||||
return getUpdateWAFResponseGetNameAttributeTypeOk(o.Name)
|
||||
}
|
||||
|
||||
// HasName returns a boolean if a field has been set.
|
||||
func (o *UpdateWAFResponse) HasName() bool {
|
||||
_, ok := o.GetNameOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetName gets a reference to the given string and assigns it to the Name field.
|
||||
func (o *UpdateWAFResponse) SetName(v UpdateWAFResponseGetNameRetType) {
|
||||
setUpdateWAFResponseGetNameAttributeType(&o.Name, v)
|
||||
}
|
||||
|
||||
// GetRegion returns the Region field value if set, zero value otherwise.
|
||||
func (o *UpdateWAFResponse) GetRegion() (res UpdateWAFResponseGetRegionRetType) {
|
||||
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 *UpdateWAFResponse) GetRegionOk() (ret UpdateWAFResponseGetRegionRetType, ok bool) {
|
||||
return getUpdateWAFResponseGetRegionAttributeTypeOk(o.Region)
|
||||
}
|
||||
|
||||
// HasRegion returns a boolean if a field has been set.
|
||||
func (o *UpdateWAFResponse) HasRegion() bool {
|
||||
_, ok := o.GetRegionOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetRegion gets a reference to the given string and assigns it to the Region field.
|
||||
func (o *UpdateWAFResponse) SetRegion(v UpdateWAFResponseGetRegionRetType) {
|
||||
setUpdateWAFResponseGetRegionAttributeType(&o.Region, v)
|
||||
}
|
||||
|
||||
// GetRulesConfigName returns the RulesConfigName field value if set, zero value otherwise.
|
||||
func (o *UpdateWAFResponse) GetRulesConfigName() (res UpdateWAFResponseGetRulesConfigNameRetType) {
|
||||
res, _ = o.GetRulesConfigNameOk()
|
||||
return
|
||||
}
|
||||
|
||||
// GetRulesConfigNameOk returns a tuple with the RulesConfigName field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *UpdateWAFResponse) GetRulesConfigNameOk() (ret UpdateWAFResponseGetRulesConfigNameRetType, ok bool) {
|
||||
return getUpdateWAFResponseGetRulesConfigNameAttributeTypeOk(o.RulesConfigName)
|
||||
}
|
||||
|
||||
// HasRulesConfigName returns a boolean if a field has been set.
|
||||
func (o *UpdateWAFResponse) HasRulesConfigName() bool {
|
||||
_, ok := o.GetRulesConfigNameOk()
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetRulesConfigName gets a reference to the given string and assigns it to the RulesConfigName field.
|
||||
func (o *UpdateWAFResponse) SetRulesConfigName(v UpdateWAFResponseGetRulesConfigNameRetType) {
|
||||
setUpdateWAFResponseGetRulesConfigNameAttributeType(&o.RulesConfigName, v)
|
||||
}
|
||||
|
||||
func (o UpdateWAFResponse) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getUpdateWAFResponseGetCoreRuleSetNameAttributeTypeOk(o.CoreRuleSetName); ok {
|
||||
toSerialize["CoreRuleSetName"] = val
|
||||
}
|
||||
if val, ok := getUpdateWAFResponseGetNameAttributeTypeOk(o.Name); ok {
|
||||
toSerialize["Name"] = val
|
||||
}
|
||||
if val, ok := getUpdateWAFResponseGetRegionAttributeTypeOk(o.Region); ok {
|
||||
toSerialize["Region"] = val
|
||||
}
|
||||
if val, ok := getUpdateWAFResponseGetRulesConfigNameAttributeTypeOk(o.RulesConfigName); ok {
|
||||
toSerialize["RulesConfigName"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableUpdateWAFResponse struct {
|
||||
value *UpdateWAFResponse
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableUpdateWAFResponse) Get() *UpdateWAFResponse {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableUpdateWAFResponse) Set(val *UpdateWAFResponse) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableUpdateWAFResponse) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableUpdateWAFResponse) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableUpdateWAFResponse(val *UpdateWAFResponse) *NullableUpdateWAFResponse {
|
||||
return &NullableUpdateWAFResponse{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableUpdateWAFResponse) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableUpdateWAFResponse) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/albwafalpha/model_update_waf_response_test.go
Normal file
11
pkg/albwafalpha/model_update_waf_response_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
385
pkg/albwafalpha/utils.go
Normal file
385
pkg/albwafalpha/utils.go
Normal file
|
|
@ -0,0 +1,385 @@
|
|||
/*
|
||||
STACKIT Application Load Balancer Web Application Firewall API
|
||||
|
||||
Generate a Web Application Firewall (WAF) to use with Application Load Balancers (ALB). The name of the WAF configuration is used in the listener of the ALB. This will activate the WAF for that ALB. An ALB with a WAF can have OWASP core rule set enabled and in addition can have custom rule configurations. To create a WAF one first needs to create all the configurations that are referenced in the WAF configuration. Currently this only consists of a rule configuration, which is written in Seclang. Once all configurations are created and referenced in the WAF configuration it can be used with an ALB. Currently updating a WAF configuration will not update an existing ALB until the Load Balancer VMs are restarted.
|
||||
|
||||
API version: 1alpha.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package albwafalpha
|
||||
|
||||
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)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue