Files
sdk/model_platform_drift_tally.go

231 lines
5.8 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 PlatformDriftTally type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PlatformDriftTally{}
// PlatformDriftTally struct for PlatformDriftTally
type PlatformDriftTally struct {
// OK is how many rows run what they declare.
Ok *int64 `json:"ok,omitempty"`
// Red is how many have drifted badly.
Red *int64 `json:"red,omitempty"`
// Yellow is how many have drifted within tolerance.
Yellow *int64 `json:"yellow,omitempty"`
AdditionalProperties map[string]interface{}
}
type _PlatformDriftTally PlatformDriftTally
// NewPlatformDriftTally instantiates a new PlatformDriftTally 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 NewPlatformDriftTally() *PlatformDriftTally {
this := PlatformDriftTally{}
return &this
}
// NewPlatformDriftTallyWithDefaults instantiates a new PlatformDriftTally 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 NewPlatformDriftTallyWithDefaults() *PlatformDriftTally {
this := PlatformDriftTally{}
return &this
}
// GetOk returns the Ok field value if set, zero value otherwise.
func (o *PlatformDriftTally) GetOk() int64 {
if o == nil || IsNil(o.Ok) {
var ret int64
return ret
}
return *o.Ok
}
// GetOkOk returns a tuple with the Ok field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformDriftTally) GetOkOk() (*int64, bool) {
if o == nil || IsNil(o.Ok) {
return nil, false
}
return o.Ok, true
}
// HasOk returns a boolean if a field has been set.
func (o *PlatformDriftTally) HasOk() bool {
if o != nil && !IsNil(o.Ok) {
return true
}
return false
}
// SetOk gets a reference to the given int64 and assigns it to the Ok field.
func (o *PlatformDriftTally) SetOk(v int64) {
o.Ok = &v
}
// GetRed returns the Red field value if set, zero value otherwise.
func (o *PlatformDriftTally) GetRed() int64 {
if o == nil || IsNil(o.Red) {
var ret int64
return ret
}
return *o.Red
}
// GetRedOk returns a tuple with the Red field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformDriftTally) GetRedOk() (*int64, bool) {
if o == nil || IsNil(o.Red) {
return nil, false
}
return o.Red, true
}
// HasRed returns a boolean if a field has been set.
func (o *PlatformDriftTally) HasRed() bool {
if o != nil && !IsNil(o.Red) {
return true
}
return false
}
// SetRed gets a reference to the given int64 and assigns it to the Red field.
func (o *PlatformDriftTally) SetRed(v int64) {
o.Red = &v
}
// GetYellow returns the Yellow field value if set, zero value otherwise.
func (o *PlatformDriftTally) GetYellow() int64 {
if o == nil || IsNil(o.Yellow) {
var ret int64
return ret
}
return *o.Yellow
}
// GetYellowOk returns a tuple with the Yellow field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformDriftTally) GetYellowOk() (*int64, bool) {
if o == nil || IsNil(o.Yellow) {
return nil, false
}
return o.Yellow, true
}
// HasYellow returns a boolean if a field has been set.
func (o *PlatformDriftTally) HasYellow() bool {
if o != nil && !IsNil(o.Yellow) {
return true
}
return false
}
// SetYellow gets a reference to the given int64 and assigns it to the Yellow field.
func (o *PlatformDriftTally) SetYellow(v int64) {
o.Yellow = &v
}
func (o PlatformDriftTally) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PlatformDriftTally) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Ok) {
toSerialize["ok"] = o.Ok
}
if !IsNil(o.Red) {
toSerialize["red"] = o.Red
}
if !IsNil(o.Yellow) {
toSerialize["yellow"] = o.Yellow
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *PlatformDriftTally) UnmarshalJSON(data []byte) (err error) {
varPlatformDriftTally := _PlatformDriftTally{}
err = json.Unmarshal(data, &varPlatformDriftTally)
if err != nil {
return err
}
*o = PlatformDriftTally(varPlatformDriftTally)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "ok")
delete(additionalProperties, "red")
delete(additionalProperties, "yellow")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullablePlatformDriftTally struct {
value *PlatformDriftTally
isSet bool
}
func (v NullablePlatformDriftTally) Get() *PlatformDriftTally {
return v.value
}
func (v *NullablePlatformDriftTally) Set(val *PlatformDriftTally) {
v.value = val
v.isSet = true
}
func (v NullablePlatformDriftTally) IsSet() bool {
return v.isSet
}
func (v *NullablePlatformDriftTally) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePlatformDriftTally(val *PlatformDriftTally) *NullablePlatformDriftTally {
return &NullablePlatformDriftTally{value: val, isSet: true}
}
func (v NullablePlatformDriftTally) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePlatformDriftTally) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}