## 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>
276 lines
9.8 KiB
Go
276 lines
9.8 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 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)
|
|
}
|