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