terraform-provider-stackitp.../pkg/cdnbeta/model_waf_rule.go
2026-01-21 09:07:29 +01:00

219 lines
5.8 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 WafRule type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &WafRule{}
/*
types and functions for code
*/
// isNotNullableString
type WafRuleGetCodeAttributeType = *string
func getWafRuleGetCodeAttributeTypeOk(arg WafRuleGetCodeAttributeType) (ret WafRuleGetCodeRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setWafRuleGetCodeAttributeType(arg *WafRuleGetCodeAttributeType, val WafRuleGetCodeRetType) {
*arg = &val
}
type WafRuleGetCodeArgType = string
type WafRuleGetCodeRetType = string
/*
types and functions for description
*/
// isContainer
type WafRuleGetDescriptionAttributeType = *map[string]string
type WafRuleGetDescriptionArgType = map[string]string
type WafRuleGetDescriptionRetType = map[string]string
func getWafRuleGetDescriptionAttributeTypeOk(arg WafRuleGetDescriptionAttributeType) (ret WafRuleGetDescriptionRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setWafRuleGetDescriptionAttributeType(arg *WafRuleGetDescriptionAttributeType, val WafRuleGetDescriptionRetType) {
*arg = &val
}
/*
types and functions for id
*/
// isNotNullableString
type WafRuleGetIdAttributeType = *string
func getWafRuleGetIdAttributeTypeOk(arg WafRuleGetIdAttributeType) (ret WafRuleGetIdRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setWafRuleGetIdAttributeType(arg *WafRuleGetIdAttributeType, val WafRuleGetIdRetType) {
*arg = &val
}
type WafRuleGetIdArgType = string
type WafRuleGetIdRetType = string
// WafRule struct for WafRule
type WafRule struct {
// Optional CoreRuleSet rule Id in case this is a CRS rule
Code WafRuleGetCodeAttributeType `json:"code,omitempty"`
// LocalizedString is a map from language to string value
// REQUIRED
Description WafRuleGetDescriptionAttributeType `json:"description" required:"true"`
// REQUIRED
Id WafRuleGetIdAttributeType `json:"id" required:"true"`
}
type _WafRule WafRule
// NewWafRule instantiates a new WafRule 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 NewWafRule(description WafRuleGetDescriptionArgType, id WafRuleGetIdArgType) *WafRule {
this := WafRule{}
setWafRuleGetDescriptionAttributeType(&this.Description, description)
setWafRuleGetIdAttributeType(&this.Id, id)
return &this
}
// NewWafRuleWithDefaults instantiates a new WafRule 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 NewWafRuleWithDefaults() *WafRule {
this := WafRule{}
return &this
}
// GetCode returns the Code field value if set, zero value otherwise.
func (o *WafRule) GetCode() (res WafRuleGetCodeRetType) {
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 *WafRule) GetCodeOk() (ret WafRuleGetCodeRetType, ok bool) {
return getWafRuleGetCodeAttributeTypeOk(o.Code)
}
// HasCode returns a boolean if a field has been set.
func (o *WafRule) HasCode() bool {
_, ok := o.GetCodeOk()
return ok
}
// SetCode gets a reference to the given string and assigns it to the Code field.
func (o *WafRule) SetCode(v WafRuleGetCodeRetType) {
setWafRuleGetCodeAttributeType(&o.Code, v)
}
// GetDescription returns the Description field value
func (o *WafRule) GetDescription() (ret WafRuleGetDescriptionRetType) {
ret, _ = o.GetDescriptionOk()
return ret
}
// GetDescriptionOk returns a tuple with the Description field value
// and a boolean to check if the value has been set.
func (o *WafRule) GetDescriptionOk() (ret WafRuleGetDescriptionRetType, ok bool) {
return getWafRuleGetDescriptionAttributeTypeOk(o.Description)
}
// SetDescription sets field value
func (o *WafRule) SetDescription(v WafRuleGetDescriptionRetType) {
setWafRuleGetDescriptionAttributeType(&o.Description, v)
}
// GetId returns the Id field value
func (o *WafRule) GetId() (ret WafRuleGetIdRetType) {
ret, _ = o.GetIdOk()
return ret
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *WafRule) GetIdOk() (ret WafRuleGetIdRetType, ok bool) {
return getWafRuleGetIdAttributeTypeOk(o.Id)
}
// SetId sets field value
func (o *WafRule) SetId(v WafRuleGetIdRetType) {
setWafRuleGetIdAttributeType(&o.Id, v)
}
func (o WafRule) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getWafRuleGetCodeAttributeTypeOk(o.Code); ok {
toSerialize["Code"] = val
}
if val, ok := getWafRuleGetDescriptionAttributeTypeOk(o.Description); ok {
toSerialize["Description"] = val
}
if val, ok := getWafRuleGetIdAttributeTypeOk(o.Id); ok {
toSerialize["Id"] = val
}
return toSerialize, nil
}
type NullableWafRule struct {
value *WafRule
isSet bool
}
func (v NullableWafRule) Get() *WafRule {
return v.value
}
func (v *NullableWafRule) Set(val *WafRule) {
v.value = val
v.isSet = true
}
func (v NullableWafRule) IsSet() bool {
return v.isSet
}
func (v *NullableWafRule) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableWafRule(val *WafRule) *NullableWafRule {
return &NullableWafRule{value: val, isSet: true}
}
func (v NullableWafRule) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableWafRule) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}