mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
231 lines
6.4 KiB
Go
231 lines
6.4 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 O11yStatusComponent type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &O11yStatusComponent{}
|
|
|
|
// O11yStatusComponent struct for O11yStatusComponent
|
|
type O11yStatusComponent struct {
|
|
// CurrentStatus is this component's own condition: \"full_outage\" for a service that did not answer its health probe at all.
|
|
CurrentStatus *string `json:"current_status,omitempty"`
|
|
// ID is the component's stable handle, which on this platform IS the service name — there is no separate component registry to allocate ids from.
|
|
Id *string `json:"id,omitempty"`
|
|
// Name is the service as the fleet prober knows it (the `service` label on hanzo_service_up), so a reader can match a component to what is being probed.
|
|
Name *string `json:"name,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _O11yStatusComponent O11yStatusComponent
|
|
|
|
// NewO11yStatusComponent instantiates a new O11yStatusComponent 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 NewO11yStatusComponent() *O11yStatusComponent {
|
|
this := O11yStatusComponent{}
|
|
return &this
|
|
}
|
|
|
|
// NewO11yStatusComponentWithDefaults instantiates a new O11yStatusComponent 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 NewO11yStatusComponentWithDefaults() *O11yStatusComponent {
|
|
this := O11yStatusComponent{}
|
|
return &this
|
|
}
|
|
|
|
// GetCurrentStatus returns the CurrentStatus field value if set, zero value otherwise.
|
|
func (o *O11yStatusComponent) GetCurrentStatus() string {
|
|
if o == nil || IsNil(o.CurrentStatus) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.CurrentStatus
|
|
}
|
|
|
|
// GetCurrentStatusOk returns a tuple with the CurrentStatus field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *O11yStatusComponent) GetCurrentStatusOk() (*string, bool) {
|
|
if o == nil || IsNil(o.CurrentStatus) {
|
|
return nil, false
|
|
}
|
|
return o.CurrentStatus, true
|
|
}
|
|
|
|
// HasCurrentStatus returns a boolean if a field has been set.
|
|
func (o *O11yStatusComponent) HasCurrentStatus() bool {
|
|
if o != nil && !IsNil(o.CurrentStatus) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCurrentStatus gets a reference to the given string and assigns it to the CurrentStatus field.
|
|
func (o *O11yStatusComponent) SetCurrentStatus(v string) {
|
|
o.CurrentStatus = &v
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *O11yStatusComponent) GetId() string {
|
|
if o == nil || IsNil(o.Id) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Id
|
|
}
|
|
|
|
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *O11yStatusComponent) GetIdOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Id) {
|
|
return nil, false
|
|
}
|
|
return o.Id, true
|
|
}
|
|
|
|
// HasId returns a boolean if a field has been set.
|
|
func (o *O11yStatusComponent) HasId() bool {
|
|
if o != nil && !IsNil(o.Id) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetId gets a reference to the given string and assigns it to the Id field.
|
|
func (o *O11yStatusComponent) SetId(v string) {
|
|
o.Id = &v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *O11yStatusComponent) GetName() string {
|
|
if o == nil || IsNil(o.Name) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Name
|
|
}
|
|
|
|
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *O11yStatusComponent) GetNameOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Name) {
|
|
return nil, false
|
|
}
|
|
return o.Name, true
|
|
}
|
|
|
|
// HasName returns a boolean if a field has been set.
|
|
func (o *O11yStatusComponent) HasName() bool {
|
|
if o != nil && !IsNil(o.Name) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetName gets a reference to the given string and assigns it to the Name field.
|
|
func (o *O11yStatusComponent) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
func (o O11yStatusComponent) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o O11yStatusComponent) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.CurrentStatus) {
|
|
toSerialize["current_status"] = o.CurrentStatus
|
|
}
|
|
if !IsNil(o.Id) {
|
|
toSerialize["id"] = o.Id
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *O11yStatusComponent) UnmarshalJSON(data []byte) (err error) {
|
|
varO11yStatusComponent := _O11yStatusComponent{}
|
|
|
|
err = json.Unmarshal(data, &varO11yStatusComponent)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = O11yStatusComponent(varO11yStatusComponent)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "current_status")
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "name")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableO11yStatusComponent struct {
|
|
value *O11yStatusComponent
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableO11yStatusComponent) Get() *O11yStatusComponent {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableO11yStatusComponent) Set(val *O11yStatusComponent) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableO11yStatusComponent) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableO11yStatusComponent) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableO11yStatusComponent(val *O11yStatusComponent) *NullableO11yStatusComponent {
|
|
return &NullableO11yStatusComponent{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableO11yStatusComponent) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableO11yStatusComponent) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|