Files
sdk/model_o11y_deployment.go

193 lines
5.0 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 O11yDeployment type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &O11yDeployment{}
// O11yDeployment struct for O11yDeployment
type O11yDeployment struct {
// Instance is the replica as the telemetry store labels it — the address the series was recorded against, which is what distinguishes two replicas of one service.
Instance *string `json:"instance,omitempty"`
// Up is that replica's last reported state. Every target emits on every cycle, so a replica missing from the list is one the prober is not reporting at all, which is a different fact from down.
Up *bool `json:"up,omitempty"`
AdditionalProperties map[string]interface{}
}
type _O11yDeployment O11yDeployment
// NewO11yDeployment instantiates a new O11yDeployment 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 NewO11yDeployment() *O11yDeployment {
this := O11yDeployment{}
return &this
}
// NewO11yDeploymentWithDefaults instantiates a new O11yDeployment 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 NewO11yDeploymentWithDefaults() *O11yDeployment {
this := O11yDeployment{}
return &this
}
// GetInstance returns the Instance field value if set, zero value otherwise.
func (o *O11yDeployment) GetInstance() string {
if o == nil || IsNil(o.Instance) {
var ret string
return ret
}
return *o.Instance
}
// GetInstanceOk returns a tuple with the Instance field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yDeployment) GetInstanceOk() (*string, bool) {
if o == nil || IsNil(o.Instance) {
return nil, false
}
return o.Instance, true
}
// HasInstance returns a boolean if a field has been set.
func (o *O11yDeployment) HasInstance() bool {
if o != nil && !IsNil(o.Instance) {
return true
}
return false
}
// SetInstance gets a reference to the given string and assigns it to the Instance field.
func (o *O11yDeployment) SetInstance(v string) {
o.Instance = &v
}
// GetUp returns the Up field value if set, zero value otherwise.
func (o *O11yDeployment) GetUp() bool {
if o == nil || IsNil(o.Up) {
var ret bool
return ret
}
return *o.Up
}
// GetUpOk returns a tuple with the Up field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yDeployment) GetUpOk() (*bool, bool) {
if o == nil || IsNil(o.Up) {
return nil, false
}
return o.Up, true
}
// HasUp returns a boolean if a field has been set.
func (o *O11yDeployment) HasUp() bool {
if o != nil && !IsNil(o.Up) {
return true
}
return false
}
// SetUp gets a reference to the given bool and assigns it to the Up field.
func (o *O11yDeployment) SetUp(v bool) {
o.Up = &v
}
func (o O11yDeployment) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o O11yDeployment) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Instance) {
toSerialize["instance"] = o.Instance
}
if !IsNil(o.Up) {
toSerialize["up"] = o.Up
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *O11yDeployment) UnmarshalJSON(data []byte) (err error) {
varO11yDeployment := _O11yDeployment{}
err = json.Unmarshal(data, &varO11yDeployment)
if err != nil {
return err
}
*o = O11yDeployment(varO11yDeployment)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "instance")
delete(additionalProperties, "up")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableO11yDeployment struct {
value *O11yDeployment
isSet bool
}
func (v NullableO11yDeployment) Get() *O11yDeployment {
return v.value
}
func (v *NullableO11yDeployment) Set(val *O11yDeployment) {
v.value = val
v.isSet = true
}
func (v NullableO11yDeployment) IsSet() bool {
return v.isSet
}
func (v *NullableO11yDeployment) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableO11yDeployment(val *O11yDeployment) *NullableO11yDeployment {
return &NullableO11yDeployment{value: val, isSet: true}
}
func (v NullableO11yDeployment) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableO11yDeployment) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}