Files
sdk/model_liveness.go

193 lines
4.6 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 Liveness type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Liveness{}
// Liveness struct for Liveness
type Liveness struct {
// Service names the answering subsystem; it is always commerce.
Service *string `json:"service,omitempty"`
// Status is always ok: mounted is the only state that can answer.
Status *string `json:"status,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Liveness Liveness
// NewLiveness instantiates a new Liveness 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 NewLiveness() *Liveness {
this := Liveness{}
return &this
}
// NewLivenessWithDefaults instantiates a new Liveness 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 NewLivenessWithDefaults() *Liveness {
this := Liveness{}
return &this
}
// GetService returns the Service field value if set, zero value otherwise.
func (o *Liveness) GetService() string {
if o == nil || IsNil(o.Service) {
var ret string
return ret
}
return *o.Service
}
// GetServiceOk returns a tuple with the Service field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Liveness) GetServiceOk() (*string, bool) {
if o == nil || IsNil(o.Service) {
return nil, false
}
return o.Service, true
}
// HasService returns a boolean if a field has been set.
func (o *Liveness) HasService() bool {
if o != nil && !IsNil(o.Service) {
return true
}
return false
}
// SetService gets a reference to the given string and assigns it to the Service field.
func (o *Liveness) SetService(v string) {
o.Service = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *Liveness) GetStatus() string {
if o == nil || IsNil(o.Status) {
var ret string
return ret
}
return *o.Status
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Liveness) GetStatusOk() (*string, bool) {
if o == nil || IsNil(o.Status) {
return nil, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *Liveness) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *Liveness) SetStatus(v string) {
o.Status = &v
}
func (o Liveness) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Liveness) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Service) {
toSerialize["service"] = o.Service
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Liveness) UnmarshalJSON(data []byte) (err error) {
varLiveness := _Liveness{}
err = json.Unmarshal(data, &varLiveness)
if err != nil {
return err
}
*o = Liveness(varLiveness)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "service")
delete(additionalProperties, "status")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableLiveness struct {
value *Liveness
isSet bool
}
func (v NullableLiveness) Get() *Liveness {
return v.value
}
func (v *NullableLiveness) Set(val *Liveness) {
v.value = val
v.isSet = true
}
func (v NullableLiveness) IsSet() bool {
return v.isSet
}
func (v *NullableLiveness) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableLiveness(val *Liveness) *NullableLiveness {
return &NullableLiveness{value: val, isSet: true}
}
func (v NullableLiveness) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableLiveness) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}