Files
sdk/model_platform_running.go

269 lines
6.9 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 PlatformRunning type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PlatformRunning{}
// PlatformRunning struct for PlatformRunning
type PlatformRunning struct {
// Digest is the digest the kubelet resolved that image to, \"\" when no pod has reported one yet.
Digest *string `json:"digest,omitempty"`
// Image is the image the app's container runs, as the pod spec names it. When pods disagree — a rollout in flight — it is the one most of them run.
Image *string `json:"image,omitempty"`
// Pods is how many pods carry the app's selector.
Pods *int64 `json:"pods,omitempty"`
// Ready is how many of them report every container ready.
Ready *int64 `json:"ready,omitempty"`
AdditionalProperties map[string]interface{}
}
type _PlatformRunning PlatformRunning
// NewPlatformRunning instantiates a new PlatformRunning 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 NewPlatformRunning() *PlatformRunning {
this := PlatformRunning{}
return &this
}
// NewPlatformRunningWithDefaults instantiates a new PlatformRunning 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 NewPlatformRunningWithDefaults() *PlatformRunning {
this := PlatformRunning{}
return &this
}
// GetDigest returns the Digest field value if set, zero value otherwise.
func (o *PlatformRunning) GetDigest() string {
if o == nil || IsNil(o.Digest) {
var ret string
return ret
}
return *o.Digest
}
// GetDigestOk returns a tuple with the Digest field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformRunning) GetDigestOk() (*string, bool) {
if o == nil || IsNil(o.Digest) {
return nil, false
}
return o.Digest, true
}
// HasDigest returns a boolean if a field has been set.
func (o *PlatformRunning) HasDigest() bool {
if o != nil && !IsNil(o.Digest) {
return true
}
return false
}
// SetDigest gets a reference to the given string and assigns it to the Digest field.
func (o *PlatformRunning) SetDigest(v string) {
o.Digest = &v
}
// GetImage returns the Image field value if set, zero value otherwise.
func (o *PlatformRunning) GetImage() string {
if o == nil || IsNil(o.Image) {
var ret string
return ret
}
return *o.Image
}
// GetImageOk returns a tuple with the Image field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformRunning) GetImageOk() (*string, bool) {
if o == nil || IsNil(o.Image) {
return nil, false
}
return o.Image, true
}
// HasImage returns a boolean if a field has been set.
func (o *PlatformRunning) HasImage() bool {
if o != nil && !IsNil(o.Image) {
return true
}
return false
}
// SetImage gets a reference to the given string and assigns it to the Image field.
func (o *PlatformRunning) SetImage(v string) {
o.Image = &v
}
// GetPods returns the Pods field value if set, zero value otherwise.
func (o *PlatformRunning) GetPods() int64 {
if o == nil || IsNil(o.Pods) {
var ret int64
return ret
}
return *o.Pods
}
// GetPodsOk returns a tuple with the Pods field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformRunning) GetPodsOk() (*int64, bool) {
if o == nil || IsNil(o.Pods) {
return nil, false
}
return o.Pods, true
}
// HasPods returns a boolean if a field has been set.
func (o *PlatformRunning) HasPods() bool {
if o != nil && !IsNil(o.Pods) {
return true
}
return false
}
// SetPods gets a reference to the given int64 and assigns it to the Pods field.
func (o *PlatformRunning) SetPods(v int64) {
o.Pods = &v
}
// GetReady returns the Ready field value if set, zero value otherwise.
func (o *PlatformRunning) GetReady() int64 {
if o == nil || IsNil(o.Ready) {
var ret int64
return ret
}
return *o.Ready
}
// GetReadyOk returns a tuple with the Ready field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformRunning) GetReadyOk() (*int64, bool) {
if o == nil || IsNil(o.Ready) {
return nil, false
}
return o.Ready, true
}
// HasReady returns a boolean if a field has been set.
func (o *PlatformRunning) HasReady() bool {
if o != nil && !IsNil(o.Ready) {
return true
}
return false
}
// SetReady gets a reference to the given int64 and assigns it to the Ready field.
func (o *PlatformRunning) SetReady(v int64) {
o.Ready = &v
}
func (o PlatformRunning) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PlatformRunning) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Digest) {
toSerialize["digest"] = o.Digest
}
if !IsNil(o.Image) {
toSerialize["image"] = o.Image
}
if !IsNil(o.Pods) {
toSerialize["pods"] = o.Pods
}
if !IsNil(o.Ready) {
toSerialize["ready"] = o.Ready
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *PlatformRunning) UnmarshalJSON(data []byte) (err error) {
varPlatformRunning := _PlatformRunning{}
err = json.Unmarshal(data, &varPlatformRunning)
if err != nil {
return err
}
*o = PlatformRunning(varPlatformRunning)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "digest")
delete(additionalProperties, "image")
delete(additionalProperties, "pods")
delete(additionalProperties, "ready")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullablePlatformRunning struct {
value *PlatformRunning
isSet bool
}
func (v NullablePlatformRunning) Get() *PlatformRunning {
return v.value
}
func (v *NullablePlatformRunning) Set(val *PlatformRunning) {
v.value = val
v.isSet = true
}
func (v NullablePlatformRunning) IsSet() bool {
return v.isSet
}
func (v *NullablePlatformRunning) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePlatformRunning(val *PlatformRunning) *NullablePlatformRunning {
return &NullablePlatformRunning{value: val, isSet: true}
}
func (v NullablePlatformRunning) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePlatformRunning) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}