Files
sdk/model_pref_prefs_view.go

193 lines
5.0 KiB
Go

/*
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
API version: v1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hanzoai
import (
"encoding/json"
)
// checks if the PrefPrefsView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PrefPrefsView{}
// PrefPrefsView struct for PrefPrefsView
type PrefPrefsView struct {
Prefs interface{} `json:"prefs,omitempty"`
// UpdatedAt is when the document was last written, unix seconds. Absent when nothing has been saved.
UpdatedAt *int64 `json:"updatedAt,omitempty"`
AdditionalProperties map[string]interface{}
}
type _PrefPrefsView PrefPrefsView
// NewPrefPrefsView instantiates a new PrefPrefsView 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 NewPrefPrefsView() *PrefPrefsView {
this := PrefPrefsView{}
return &this
}
// NewPrefPrefsViewWithDefaults instantiates a new PrefPrefsView 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 NewPrefPrefsViewWithDefaults() *PrefPrefsView {
this := PrefPrefsView{}
return &this
}
// GetPrefs returns the Prefs field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PrefPrefsView) GetPrefs() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Prefs
}
// GetPrefsOk returns a tuple with the Prefs field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *PrefPrefsView) GetPrefsOk() (*interface{}, bool) {
if o == nil || IsNil(o.Prefs) {
return nil, false
}
return &o.Prefs, true
}
// HasPrefs returns a boolean if a field has been set.
func (o *PrefPrefsView) HasPrefs() bool {
if o != nil && !IsNil(o.Prefs) {
return true
}
return false
}
// SetPrefs gets a reference to the given interface{} and assigns it to the Prefs field.
func (o *PrefPrefsView) SetPrefs(v interface{}) {
o.Prefs = v
}
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
func (o *PrefPrefsView) GetUpdatedAt() int64 {
if o == nil || IsNil(o.UpdatedAt) {
var ret int64
return ret
}
return *o.UpdatedAt
}
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PrefPrefsView) GetUpdatedAtOk() (*int64, bool) {
if o == nil || IsNil(o.UpdatedAt) {
return nil, false
}
return o.UpdatedAt, true
}
// HasUpdatedAt returns a boolean if a field has been set.
func (o *PrefPrefsView) HasUpdatedAt() bool {
if o != nil && !IsNil(o.UpdatedAt) {
return true
}
return false
}
// SetUpdatedAt gets a reference to the given int64 and assigns it to the UpdatedAt field.
func (o *PrefPrefsView) SetUpdatedAt(v int64) {
o.UpdatedAt = &v
}
func (o PrefPrefsView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PrefPrefsView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.Prefs != nil {
toSerialize["prefs"] = o.Prefs
}
if !IsNil(o.UpdatedAt) {
toSerialize["updatedAt"] = o.UpdatedAt
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *PrefPrefsView) UnmarshalJSON(data []byte) (err error) {
varPrefPrefsView := _PrefPrefsView{}
err = json.Unmarshal(data, &varPrefPrefsView)
if err != nil {
return err
}
*o = PrefPrefsView(varPrefPrefsView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "prefs")
delete(additionalProperties, "updatedAt")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullablePrefPrefsView struct {
value *PrefPrefsView
isSet bool
}
func (v NullablePrefPrefsView) Get() *PrefPrefsView {
return v.value
}
func (v *NullablePrefPrefsView) Set(val *PrefPrefsView) {
v.value = val
v.isSet = true
}
func (v NullablePrefPrefsView) IsSet() bool {
return v.isSet
}
func (v *NullablePrefPrefsView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePrefPrefsView(val *PrefPrefsView) *NullablePrefPrefsView {
return &NullablePrefPrefsView{value: val, isSet: true}
}
func (v NullablePrefPrefsView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePrefPrefsView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}