mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
307 lines
8.0 KiB
Go
307 lines
8.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 PlatformReadiness type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &PlatformReadiness{}
|
|
|
|
// PlatformReadiness struct for PlatformReadiness
|
|
type PlatformReadiness struct {
|
|
// CRD is whether the operator App CRD was found, and is absent when no cluster client resolved and the question could not be asked.
|
|
Crd *bool `json:"crd,omitempty"`
|
|
// Error is the real reason the plane is degraded; absent when it is not.
|
|
Error *string `json:"error,omitempty"`
|
|
// K8s is whether a cluster client resolved at all. False means no kubeconfig.
|
|
K8s *bool `json:"k8s,omitempty"`
|
|
// Service is always \"platform\" — which control plane answered.
|
|
Service *string `json:"service,omitempty"`
|
|
// Status is \"ok\" when this plane can deploy, \"degraded\" when it cannot.
|
|
Status *string `json:"status,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _PlatformReadiness PlatformReadiness
|
|
|
|
// NewPlatformReadiness instantiates a new PlatformReadiness 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 NewPlatformReadiness() *PlatformReadiness {
|
|
this := PlatformReadiness{}
|
|
return &this
|
|
}
|
|
|
|
// NewPlatformReadinessWithDefaults instantiates a new PlatformReadiness 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 NewPlatformReadinessWithDefaults() *PlatformReadiness {
|
|
this := PlatformReadiness{}
|
|
return &this
|
|
}
|
|
|
|
// GetCrd returns the Crd field value if set, zero value otherwise.
|
|
func (o *PlatformReadiness) GetCrd() bool {
|
|
if o == nil || IsNil(o.Crd) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Crd
|
|
}
|
|
|
|
// GetCrdOk returns a tuple with the Crd field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformReadiness) GetCrdOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Crd) {
|
|
return nil, false
|
|
}
|
|
return o.Crd, true
|
|
}
|
|
|
|
// HasCrd returns a boolean if a field has been set.
|
|
func (o *PlatformReadiness) HasCrd() bool {
|
|
if o != nil && !IsNil(o.Crd) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCrd gets a reference to the given bool and assigns it to the Crd field.
|
|
func (o *PlatformReadiness) SetCrd(v bool) {
|
|
o.Crd = &v
|
|
}
|
|
|
|
// GetError returns the Error field value if set, zero value otherwise.
|
|
func (o *PlatformReadiness) GetError() string {
|
|
if o == nil || IsNil(o.Error) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Error
|
|
}
|
|
|
|
// GetErrorOk returns a tuple with the Error field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformReadiness) GetErrorOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Error) {
|
|
return nil, false
|
|
}
|
|
return o.Error, true
|
|
}
|
|
|
|
// HasError returns a boolean if a field has been set.
|
|
func (o *PlatformReadiness) HasError() bool {
|
|
if o != nil && !IsNil(o.Error) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetError gets a reference to the given string and assigns it to the Error field.
|
|
func (o *PlatformReadiness) SetError(v string) {
|
|
o.Error = &v
|
|
}
|
|
|
|
// GetK8s returns the K8s field value if set, zero value otherwise.
|
|
func (o *PlatformReadiness) GetK8s() bool {
|
|
if o == nil || IsNil(o.K8s) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.K8s
|
|
}
|
|
|
|
// GetK8sOk returns a tuple with the K8s field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformReadiness) GetK8sOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.K8s) {
|
|
return nil, false
|
|
}
|
|
return o.K8s, true
|
|
}
|
|
|
|
// HasK8s returns a boolean if a field has been set.
|
|
func (o *PlatformReadiness) HasK8s() bool {
|
|
if o != nil && !IsNil(o.K8s) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetK8s gets a reference to the given bool and assigns it to the K8s field.
|
|
func (o *PlatformReadiness) SetK8s(v bool) {
|
|
o.K8s = &v
|
|
}
|
|
|
|
// GetService returns the Service field value if set, zero value otherwise.
|
|
func (o *PlatformReadiness) 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 *PlatformReadiness) 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 *PlatformReadiness) 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 *PlatformReadiness) SetService(v string) {
|
|
o.Service = &v
|
|
}
|
|
|
|
// GetStatus returns the Status field value if set, zero value otherwise.
|
|
func (o *PlatformReadiness) 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 *PlatformReadiness) 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 *PlatformReadiness) 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 *PlatformReadiness) SetStatus(v string) {
|
|
o.Status = &v
|
|
}
|
|
|
|
func (o PlatformReadiness) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o PlatformReadiness) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Crd) {
|
|
toSerialize["crd"] = o.Crd
|
|
}
|
|
if !IsNil(o.Error) {
|
|
toSerialize["error"] = o.Error
|
|
}
|
|
if !IsNil(o.K8s) {
|
|
toSerialize["k8s"] = o.K8s
|
|
}
|
|
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 *PlatformReadiness) UnmarshalJSON(data []byte) (err error) {
|
|
varPlatformReadiness := _PlatformReadiness{}
|
|
|
|
err = json.Unmarshal(data, &varPlatformReadiness)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = PlatformReadiness(varPlatformReadiness)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "crd")
|
|
delete(additionalProperties, "error")
|
|
delete(additionalProperties, "k8s")
|
|
delete(additionalProperties, "service")
|
|
delete(additionalProperties, "status")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullablePlatformReadiness struct {
|
|
value *PlatformReadiness
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullablePlatformReadiness) Get() *PlatformReadiness {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullablePlatformReadiness) Set(val *PlatformReadiness) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullablePlatformReadiness) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullablePlatformReadiness) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullablePlatformReadiness(val *PlatformReadiness) *NullablePlatformReadiness {
|
|
return &NullablePlatformReadiness{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullablePlatformReadiness) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullablePlatformReadiness) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|