Files
sdk/model_tally.go

302 lines
7.2 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 Tally type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Tally{}
// Tally struct for Tally
type Tally struct {
Cached *int32 `json:"cached,omitempty"`
Characters *int32 `json:"characters,omitempty"`
Failed *int32 `json:"failed,omitempty"`
Strings *int32 `json:"strings,omitempty"`
Translated *int32 `json:"translated,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Tally Tally
// NewTally instantiates a new Tally 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 NewTally() *Tally {
this := Tally{}
return &this
}
// NewTallyWithDefaults instantiates a new Tally 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 NewTallyWithDefaults() *Tally {
this := Tally{}
return &this
}
// GetCached returns the Cached field value if set, zero value otherwise.
func (o *Tally) GetCached() int32 {
if o == nil || IsNil(o.Cached) {
var ret int32
return ret
}
return *o.Cached
}
// GetCachedOk returns a tuple with the Cached field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Tally) GetCachedOk() (*int32, bool) {
if o == nil || IsNil(o.Cached) {
return nil, false
}
return o.Cached, true
}
// HasCached returns a boolean if a field has been set.
func (o *Tally) HasCached() bool {
if o != nil && !IsNil(o.Cached) {
return true
}
return false
}
// SetCached gets a reference to the given int32 and assigns it to the Cached field.
func (o *Tally) SetCached(v int32) {
o.Cached = &v
}
// GetCharacters returns the Characters field value if set, zero value otherwise.
func (o *Tally) GetCharacters() int32 {
if o == nil || IsNil(o.Characters) {
var ret int32
return ret
}
return *o.Characters
}
// GetCharactersOk returns a tuple with the Characters field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Tally) GetCharactersOk() (*int32, bool) {
if o == nil || IsNil(o.Characters) {
return nil, false
}
return o.Characters, true
}
// HasCharacters returns a boolean if a field has been set.
func (o *Tally) HasCharacters() bool {
if o != nil && !IsNil(o.Characters) {
return true
}
return false
}
// SetCharacters gets a reference to the given int32 and assigns it to the Characters field.
func (o *Tally) SetCharacters(v int32) {
o.Characters = &v
}
// GetFailed returns the Failed field value if set, zero value otherwise.
func (o *Tally) GetFailed() int32 {
if o == nil || IsNil(o.Failed) {
var ret int32
return ret
}
return *o.Failed
}
// GetFailedOk returns a tuple with the Failed field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Tally) GetFailedOk() (*int32, bool) {
if o == nil || IsNil(o.Failed) {
return nil, false
}
return o.Failed, true
}
// HasFailed returns a boolean if a field has been set.
func (o *Tally) HasFailed() bool {
if o != nil && !IsNil(o.Failed) {
return true
}
return false
}
// SetFailed gets a reference to the given int32 and assigns it to the Failed field.
func (o *Tally) SetFailed(v int32) {
o.Failed = &v
}
// GetStrings returns the Strings field value if set, zero value otherwise.
func (o *Tally) GetStrings() int32 {
if o == nil || IsNil(o.Strings) {
var ret int32
return ret
}
return *o.Strings
}
// GetStringsOk returns a tuple with the Strings field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Tally) GetStringsOk() (*int32, bool) {
if o == nil || IsNil(o.Strings) {
return nil, false
}
return o.Strings, true
}
// HasStrings returns a boolean if a field has been set.
func (o *Tally) HasStrings() bool {
if o != nil && !IsNil(o.Strings) {
return true
}
return false
}
// SetStrings gets a reference to the given int32 and assigns it to the Strings field.
func (o *Tally) SetStrings(v int32) {
o.Strings = &v
}
// GetTranslated returns the Translated field value if set, zero value otherwise.
func (o *Tally) GetTranslated() int32 {
if o == nil || IsNil(o.Translated) {
var ret int32
return ret
}
return *o.Translated
}
// GetTranslatedOk returns a tuple with the Translated field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Tally) GetTranslatedOk() (*int32, bool) {
if o == nil || IsNil(o.Translated) {
return nil, false
}
return o.Translated, true
}
// HasTranslated returns a boolean if a field has been set.
func (o *Tally) HasTranslated() bool {
if o != nil && !IsNil(o.Translated) {
return true
}
return false
}
// SetTranslated gets a reference to the given int32 and assigns it to the Translated field.
func (o *Tally) SetTranslated(v int32) {
o.Translated = &v
}
func (o Tally) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Tally) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Cached) {
toSerialize["cached"] = o.Cached
}
if !IsNil(o.Characters) {
toSerialize["characters"] = o.Characters
}
if !IsNil(o.Failed) {
toSerialize["failed"] = o.Failed
}
if !IsNil(o.Strings) {
toSerialize["strings"] = o.Strings
}
if !IsNil(o.Translated) {
toSerialize["translated"] = o.Translated
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Tally) UnmarshalJSON(data []byte) (err error) {
varTally := _Tally{}
err = json.Unmarshal(data, &varTally)
if err != nil {
return err
}
*o = Tally(varTally)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "cached")
delete(additionalProperties, "characters")
delete(additionalProperties, "failed")
delete(additionalProperties, "strings")
delete(additionalProperties, "translated")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTally struct {
value *Tally
isSet bool
}
func (v NullableTally) Get() *Tally {
return v.value
}
func (v *NullableTally) Set(val *Tally) {
v.value = val
v.isSet = true
}
func (v NullableTally) IsSet() bool {
return v.isSet
}
func (v *NullableTally) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTally(val *Tally) *NullableTally {
return &NullableTally{value: val, isSet: true}
}
func (v NullableTally) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTally) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}