174 lines
4.8 KiB
Go
174 lines
4.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 WafConfigPatch type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &WafConfigPatch{}
|
|
|
|
/*
|
|
types and functions for mode
|
|
*/
|
|
|
|
// isEnumRef
|
|
type WafConfigPatchGetModeAttributeType = *WafMode
|
|
type WafConfigPatchGetModeArgType = WafMode
|
|
type WafConfigPatchGetModeRetType = WafMode
|
|
|
|
func getWafConfigPatchGetModeAttributeTypeOk(arg WafConfigPatchGetModeAttributeType) (ret WafConfigPatchGetModeRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setWafConfigPatchGetModeAttributeType(arg *WafConfigPatchGetModeAttributeType, val WafConfigPatchGetModeRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for type
|
|
*/
|
|
|
|
// isEnumRef
|
|
type WafConfigPatchGetTypeAttributeType = *WafType
|
|
type WafConfigPatchGetTypeArgType = WafType
|
|
type WafConfigPatchGetTypeRetType = WafType
|
|
|
|
func getWafConfigPatchGetTypeAttributeTypeOk(arg WafConfigPatchGetTypeAttributeType) (ret WafConfigPatchGetTypeRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setWafConfigPatchGetTypeAttributeType(arg *WafConfigPatchGetTypeAttributeType, val WafConfigPatchGetTypeRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
// WafConfigPatch struct for WafConfigPatch
|
|
type WafConfigPatch struct {
|
|
Mode WafConfigPatchGetModeAttributeType `json:"mode,omitempty"`
|
|
Type WafConfigPatchGetTypeAttributeType `json:"type,omitempty"`
|
|
}
|
|
|
|
// NewWafConfigPatch instantiates a new WafConfigPatch 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 NewWafConfigPatch() *WafConfigPatch {
|
|
this := WafConfigPatch{}
|
|
return &this
|
|
}
|
|
|
|
// NewWafConfigPatchWithDefaults instantiates a new WafConfigPatch 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 NewWafConfigPatchWithDefaults() *WafConfigPatch {
|
|
this := WafConfigPatch{}
|
|
return &this
|
|
}
|
|
|
|
// GetMode returns the Mode field value if set, zero value otherwise.
|
|
func (o *WafConfigPatch) GetMode() (res WafConfigPatchGetModeRetType) {
|
|
res, _ = o.GetModeOk()
|
|
return
|
|
}
|
|
|
|
// GetModeOk returns a tuple with the Mode field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WafConfigPatch) GetModeOk() (ret WafConfigPatchGetModeRetType, ok bool) {
|
|
return getWafConfigPatchGetModeAttributeTypeOk(o.Mode)
|
|
}
|
|
|
|
// HasMode returns a boolean if a field has been set.
|
|
func (o *WafConfigPatch) HasMode() bool {
|
|
_, ok := o.GetModeOk()
|
|
return ok
|
|
}
|
|
|
|
// SetMode gets a reference to the given WafMode and assigns it to the Mode field.
|
|
func (o *WafConfigPatch) SetMode(v WafConfigPatchGetModeRetType) {
|
|
setWafConfigPatchGetModeAttributeType(&o.Mode, v)
|
|
}
|
|
|
|
// GetType returns the Type field value if set, zero value otherwise.
|
|
func (o *WafConfigPatch) GetType() (res WafConfigPatchGetTypeRetType) {
|
|
res, _ = o.GetTypeOk()
|
|
return
|
|
}
|
|
|
|
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WafConfigPatch) GetTypeOk() (ret WafConfigPatchGetTypeRetType, ok bool) {
|
|
return getWafConfigPatchGetTypeAttributeTypeOk(o.Type)
|
|
}
|
|
|
|
// HasType returns a boolean if a field has been set.
|
|
func (o *WafConfigPatch) HasType() bool {
|
|
_, ok := o.GetTypeOk()
|
|
return ok
|
|
}
|
|
|
|
// SetType gets a reference to the given WafType and assigns it to the Type field.
|
|
func (o *WafConfigPatch) SetType(v WafConfigPatchGetTypeRetType) {
|
|
setWafConfigPatchGetTypeAttributeType(&o.Type, v)
|
|
}
|
|
|
|
func (o WafConfigPatch) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if val, ok := getWafConfigPatchGetModeAttributeTypeOk(o.Mode); ok {
|
|
toSerialize["Mode"] = val
|
|
}
|
|
if val, ok := getWafConfigPatchGetTypeAttributeTypeOk(o.Type); ok {
|
|
toSerialize["Type"] = val
|
|
}
|
|
return toSerialize, nil
|
|
}
|
|
|
|
type NullableWafConfigPatch struct {
|
|
value *WafConfigPatch
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableWafConfigPatch) Get() *WafConfigPatch {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableWafConfigPatch) Set(val *WafConfigPatch) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableWafConfigPatch) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableWafConfigPatch) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableWafConfigPatch(val *WafConfigPatch) *NullableWafConfigPatch {
|
|
return &NullableWafConfigPatch{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableWafConfigPatch) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableWafConfigPatch) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|