## 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>
211 lines
7.4 KiB
Go
211 lines
7.4 KiB
Go
/*
|
|
CDN API
|
|
|
|
API used to create and manage your CDN distributions.
|
|
|
|
API version: 1beta2.0.0
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package cdnbeta
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
// checks if the DistributionWaf type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &DistributionWaf{}
|
|
|
|
/*
|
|
types and functions for disabledRules
|
|
*/
|
|
|
|
// isArray
|
|
type DistributionWafGetDisabledRulesAttributeType = *[]WafStatusRuleBlock
|
|
type DistributionWafGetDisabledRulesArgType = []WafStatusRuleBlock
|
|
type DistributionWafGetDisabledRulesRetType = []WafStatusRuleBlock
|
|
|
|
func getDistributionWafGetDisabledRulesAttributeTypeOk(arg DistributionWafGetDisabledRulesAttributeType) (ret DistributionWafGetDisabledRulesRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setDistributionWafGetDisabledRulesAttributeType(arg *DistributionWafGetDisabledRulesAttributeType, val DistributionWafGetDisabledRulesRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for enabledRules
|
|
*/
|
|
|
|
// isArray
|
|
type DistributionWafGetEnabledRulesAttributeType = *[]WafStatusRuleBlock
|
|
type DistributionWafGetEnabledRulesArgType = []WafStatusRuleBlock
|
|
type DistributionWafGetEnabledRulesRetType = []WafStatusRuleBlock
|
|
|
|
func getDistributionWafGetEnabledRulesAttributeTypeOk(arg DistributionWafGetEnabledRulesAttributeType) (ret DistributionWafGetEnabledRulesRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setDistributionWafGetEnabledRulesAttributeType(arg *DistributionWafGetEnabledRulesAttributeType, val DistributionWafGetEnabledRulesRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for logOnlyRules
|
|
*/
|
|
|
|
// isArray
|
|
type DistributionWafGetLogOnlyRulesAttributeType = *[]WafStatusRuleBlock
|
|
type DistributionWafGetLogOnlyRulesArgType = []WafStatusRuleBlock
|
|
type DistributionWafGetLogOnlyRulesRetType = []WafStatusRuleBlock
|
|
|
|
func getDistributionWafGetLogOnlyRulesAttributeTypeOk(arg DistributionWafGetLogOnlyRulesAttributeType) (ret DistributionWafGetLogOnlyRulesRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setDistributionWafGetLogOnlyRulesAttributeType(arg *DistributionWafGetLogOnlyRulesAttributeType, val DistributionWafGetLogOnlyRulesRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
// DistributionWaf For this property to be present two pre-conditions must be met: - the WAF was enabled at least once - the query parameter ?withWafStatus is truthy This property contains the waf Status. At this point in time, this contains all resolved rules. Rules are split into 3 groups: - enabledRules - logOnlyRules - disabledRules **Do note that the global waf mode (Disabled, LogOnly, Enabled) is *NOT* reflected in this list!**
|
|
type DistributionWaf struct {
|
|
// REQUIRED
|
|
DisabledRules DistributionWafGetDisabledRulesAttributeType `json:"disabledRules" required:"true"`
|
|
// REQUIRED
|
|
EnabledRules DistributionWafGetEnabledRulesAttributeType `json:"enabledRules" required:"true"`
|
|
// REQUIRED
|
|
LogOnlyRules DistributionWafGetLogOnlyRulesAttributeType `json:"logOnlyRules" required:"true"`
|
|
}
|
|
|
|
type _DistributionWaf DistributionWaf
|
|
|
|
// NewDistributionWaf instantiates a new DistributionWaf 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 NewDistributionWaf(disabledRules DistributionWafGetDisabledRulesArgType, enabledRules DistributionWafGetEnabledRulesArgType, logOnlyRules DistributionWafGetLogOnlyRulesArgType) *DistributionWaf {
|
|
this := DistributionWaf{}
|
|
setDistributionWafGetDisabledRulesAttributeType(&this.DisabledRules, disabledRules)
|
|
setDistributionWafGetEnabledRulesAttributeType(&this.EnabledRules, enabledRules)
|
|
setDistributionWafGetLogOnlyRulesAttributeType(&this.LogOnlyRules, logOnlyRules)
|
|
return &this
|
|
}
|
|
|
|
// NewDistributionWafWithDefaults instantiates a new DistributionWaf 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 NewDistributionWafWithDefaults() *DistributionWaf {
|
|
this := DistributionWaf{}
|
|
return &this
|
|
}
|
|
|
|
// GetDisabledRules returns the DisabledRules field value
|
|
func (o *DistributionWaf) GetDisabledRules() (ret DistributionWafGetDisabledRulesRetType) {
|
|
ret, _ = o.GetDisabledRulesOk()
|
|
return ret
|
|
}
|
|
|
|
// GetDisabledRulesOk returns a tuple with the DisabledRules field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *DistributionWaf) GetDisabledRulesOk() (ret DistributionWafGetDisabledRulesRetType, ok bool) {
|
|
return getDistributionWafGetDisabledRulesAttributeTypeOk(o.DisabledRules)
|
|
}
|
|
|
|
// SetDisabledRules sets field value
|
|
func (o *DistributionWaf) SetDisabledRules(v DistributionWafGetDisabledRulesRetType) {
|
|
setDistributionWafGetDisabledRulesAttributeType(&o.DisabledRules, v)
|
|
}
|
|
|
|
// GetEnabledRules returns the EnabledRules field value
|
|
func (o *DistributionWaf) GetEnabledRules() (ret DistributionWafGetEnabledRulesRetType) {
|
|
ret, _ = o.GetEnabledRulesOk()
|
|
return ret
|
|
}
|
|
|
|
// GetEnabledRulesOk returns a tuple with the EnabledRules field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *DistributionWaf) GetEnabledRulesOk() (ret DistributionWafGetEnabledRulesRetType, ok bool) {
|
|
return getDistributionWafGetEnabledRulesAttributeTypeOk(o.EnabledRules)
|
|
}
|
|
|
|
// SetEnabledRules sets field value
|
|
func (o *DistributionWaf) SetEnabledRules(v DistributionWafGetEnabledRulesRetType) {
|
|
setDistributionWafGetEnabledRulesAttributeType(&o.EnabledRules, v)
|
|
}
|
|
|
|
// GetLogOnlyRules returns the LogOnlyRules field value
|
|
func (o *DistributionWaf) GetLogOnlyRules() (ret DistributionWafGetLogOnlyRulesRetType) {
|
|
ret, _ = o.GetLogOnlyRulesOk()
|
|
return ret
|
|
}
|
|
|
|
// GetLogOnlyRulesOk returns a tuple with the LogOnlyRules field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *DistributionWaf) GetLogOnlyRulesOk() (ret DistributionWafGetLogOnlyRulesRetType, ok bool) {
|
|
return getDistributionWafGetLogOnlyRulesAttributeTypeOk(o.LogOnlyRules)
|
|
}
|
|
|
|
// SetLogOnlyRules sets field value
|
|
func (o *DistributionWaf) SetLogOnlyRules(v DistributionWafGetLogOnlyRulesRetType) {
|
|
setDistributionWafGetLogOnlyRulesAttributeType(&o.LogOnlyRules, v)
|
|
}
|
|
|
|
func (o DistributionWaf) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if val, ok := getDistributionWafGetDisabledRulesAttributeTypeOk(o.DisabledRules); ok {
|
|
toSerialize["DisabledRules"] = val
|
|
}
|
|
if val, ok := getDistributionWafGetEnabledRulesAttributeTypeOk(o.EnabledRules); ok {
|
|
toSerialize["EnabledRules"] = val
|
|
}
|
|
if val, ok := getDistributionWafGetLogOnlyRulesAttributeTypeOk(o.LogOnlyRules); ok {
|
|
toSerialize["LogOnlyRules"] = val
|
|
}
|
|
return toSerialize, nil
|
|
}
|
|
|
|
type NullableDistributionWaf struct {
|
|
value *DistributionWaf
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableDistributionWaf) Get() *DistributionWaf {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableDistributionWaf) Set(val *DistributionWaf) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableDistributionWaf) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableDistributionWaf) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableDistributionWaf(val *DistributionWaf) *NullableDistributionWaf {
|
|
return &NullableDistributionWaf{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableDistributionWaf) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableDistributionWaf) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|