## Description
<!-- **Please link some issue here describing what you are trying to achieve.**
In case there is no issue present for your PR, please consider creating one.
At least please give us some description what you are trying to achieve and why your change is needed. -->
relates to #1234
## Checklist
- [ ] Issue was linked above
- [ ] Code format was applied: `make fmt`
- [ ] Examples were added / adjusted (see `examples/` directory)
- [x] Docs are up-to-date: `make generate-docs` (will be checked by CI)
- [ ] Unit tests got implemented or updated
- [ ] Acceptance tests got implemented or updated (see e.g. [here](f5f99d1709/stackit/internal/services/dns/dns_acc_test.go))
- [x] Unit tests are passing: `make test` (will be checked by CI)
- [x] No linter issues: `make lint` (will be checked by CI)
Reviewed-on: #4
Reviewed-by: Andre_Harms <andre.harms@stackit.cloud>
Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
Co-committed-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
325 lines
11 KiB
Go
325 lines
11 KiB
Go
/*
|
|
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)
|
|
}
|