Files
sdk/model_account_appearance.go

231 lines
6.1 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 AccountAppearance type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AccountAppearance{}
// AccountAppearance struct for AccountAppearance
type AccountAppearance struct {
// Accent is the one hue — a CSS colour token (a hex, or a bounded functional colour like rgb()/oklch()). Anything else is dropped rather than stored.
Accent *string `json:"accent,omitempty"`
// Density is the spacing step: \"compact\", \"default\" or \"comfortable\".
Density *string `json:"density,omitempty"`
// Type is the text-size multiplier, clamped to the ramp window [0.85, 1.4]. Absent (0) leaves the published default.
Type *float64 `json:"type,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AccountAppearance AccountAppearance
// NewAccountAppearance instantiates a new AccountAppearance 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 NewAccountAppearance() *AccountAppearance {
this := AccountAppearance{}
return &this
}
// NewAccountAppearanceWithDefaults instantiates a new AccountAppearance 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 NewAccountAppearanceWithDefaults() *AccountAppearance {
this := AccountAppearance{}
return &this
}
// GetAccent returns the Accent field value if set, zero value otherwise.
func (o *AccountAppearance) GetAccent() string {
if o == nil || IsNil(o.Accent) {
var ret string
return ret
}
return *o.Accent
}
// GetAccentOk returns a tuple with the Accent field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AccountAppearance) GetAccentOk() (*string, bool) {
if o == nil || IsNil(o.Accent) {
return nil, false
}
return o.Accent, true
}
// HasAccent returns a boolean if a field has been set.
func (o *AccountAppearance) HasAccent() bool {
if o != nil && !IsNil(o.Accent) {
return true
}
return false
}
// SetAccent gets a reference to the given string and assigns it to the Accent field.
func (o *AccountAppearance) SetAccent(v string) {
o.Accent = &v
}
// GetDensity returns the Density field value if set, zero value otherwise.
func (o *AccountAppearance) GetDensity() string {
if o == nil || IsNil(o.Density) {
var ret string
return ret
}
return *o.Density
}
// GetDensityOk returns a tuple with the Density field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AccountAppearance) GetDensityOk() (*string, bool) {
if o == nil || IsNil(o.Density) {
return nil, false
}
return o.Density, true
}
// HasDensity returns a boolean if a field has been set.
func (o *AccountAppearance) HasDensity() bool {
if o != nil && !IsNil(o.Density) {
return true
}
return false
}
// SetDensity gets a reference to the given string and assigns it to the Density field.
func (o *AccountAppearance) SetDensity(v string) {
o.Density = &v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *AccountAppearance) GetType() float64 {
if o == nil || IsNil(o.Type) {
var ret float64
return ret
}
return *o.Type
}
// 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 *AccountAppearance) GetTypeOk() (*float64, bool) {
if o == nil || IsNil(o.Type) {
return nil, false
}
return o.Type, true
}
// HasType returns a boolean if a field has been set.
func (o *AccountAppearance) HasType() bool {
if o != nil && !IsNil(o.Type) {
return true
}
return false
}
// SetType gets a reference to the given float64 and assigns it to the Type field.
func (o *AccountAppearance) SetType(v float64) {
o.Type = &v
}
func (o AccountAppearance) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AccountAppearance) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Accent) {
toSerialize["accent"] = o.Accent
}
if !IsNil(o.Density) {
toSerialize["density"] = o.Density
}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AccountAppearance) UnmarshalJSON(data []byte) (err error) {
varAccountAppearance := _AccountAppearance{}
err = json.Unmarshal(data, &varAccountAppearance)
if err != nil {
return err
}
*o = AccountAppearance(varAccountAppearance)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "accent")
delete(additionalProperties, "density")
delete(additionalProperties, "type")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAccountAppearance struct {
value *AccountAppearance
isSet bool
}
func (v NullableAccountAppearance) Get() *AccountAppearance {
return v.value
}
func (v *NullableAccountAppearance) Set(val *AccountAppearance) {
v.value = val
v.isSet = true
}
func (v NullableAccountAppearance) IsSet() bool {
return v.isSet
}
func (v *NullableAccountAppearance) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAccountAppearance(val *AccountAppearance) *NullableAccountAppearance {
return &NullableAccountAppearance{value: val, isSet: true}
}
func (v NullableAccountAppearance) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAccountAppearance) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}