/* authentik Making authentication simple. API version: 2026.5.0-rc1 Contact: hello@goauthentik.io */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package api import ( "encoding/json" "fmt" ) // checks if the Cache type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Cache{} // Cache Generic cache stats for an object type Cache struct { Count int32 `json:"count"` AdditionalProperties map[string]interface{} } type _Cache Cache // NewCache instantiates a new Cache 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 NewCache(count int32) *Cache { this := Cache{} this.Count = count return &this } // NewCacheWithDefaults instantiates a new Cache 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 NewCacheWithDefaults() *Cache { this := Cache{} return &this } // GetCount returns the Count field value func (o *Cache) GetCount() int32 { if o == nil { var ret int32 return ret } return o.Count } // GetCountOk returns a tuple with the Count field value // and a boolean to check if the value has been set. func (o *Cache) GetCountOk() (*int32, bool) { if o == nil { return nil, false } return &o.Count, true } // SetCount sets field value func (o *Cache) SetCount(v int32) { o.Count = v } func (o Cache) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o Cache) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["count"] = o.Count for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *Cache) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ "count", } allProperties := make(map[string]interface{}) err = json.Unmarshal(data, &allProperties) if err != nil { return err } for _, requiredProperty := range requiredProperties { if _, exists := allProperties[requiredProperty]; !exists { return fmt.Errorf("no value given for required property %v", requiredProperty) } } varCache := _Cache{} err = json.Unmarshal(data, &varCache) if err != nil { return err } *o = Cache(varCache) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "count") o.AdditionalProperties = additionalProperties } return err } type NullableCache struct { value *Cache isSet bool } func (v NullableCache) Get() *Cache { return v.value } func (v *NullableCache) Set(val *Cache) { v.value = val v.isSet = true } func (v NullableCache) IsSet() bool { return v.isSet } func (v *NullableCache) Unset() { v.value = nil v.isSet = false } func NewNullableCache(val *Cache) *NullableCache { return &NullableCache{value: val, isSet: true} } func (v NullableCache) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableCache) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }