mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
421 lines
12 KiB
Go
421 lines
12 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 AgentPatchTargetIn type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &AgentPatchTargetIn{}
|
|
|
|
// AgentPatchTargetIn struct for AgentPatchTargetIn
|
|
type AgentPatchTargetIn struct {
|
|
// Capacity rewrites the human summary, up to 256 characters. \"\" clears it.
|
|
Capacity *string `json:"capacity,omitempty"`
|
|
// Host re-points the hostname sessions are matched by. Moving it moves the load: the session counts follow the new name from the next read.
|
|
Host *string `json:"host,omitempty"`
|
|
// ID is the target to update, from the path.
|
|
Id *string `json:"id,omitempty"`
|
|
// Kind re-files it under laptop | cloud | gpu | cluster | machine.
|
|
Kind *string `json:"kind,omitempty"`
|
|
// Label renames the machine, up to 128 characters. Empty STRING is refused — a target with no name is a row nobody can pick out of a fleet.
|
|
Label *string `json:"label,omitempty"`
|
|
// Metrics replaces the live sample, and sending one IS A HEARTBEAT: the server stamps the time and appends the point to the fleet series. Sending an all-zero sample CLEARS the heartbeat — the machine goes back to having no liveness fact at all, and its stored status is taken at face value again.
|
|
Metrics *AgentMetrics `json:"metrics,omitempty"`
|
|
// Spec replaces the static capability whole, sanitized and clamped the same way a register's is.
|
|
Spec *AgentSpec `json:"spec,omitempty"`
|
|
// Status sets operator INTENT: online | offline | draining. Draining is how a machine is taken out of dispatch without ending what is already on it. What comes back may still read offline, because the heartbeat outranks the intent.
|
|
Status *string `json:"status,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _AgentPatchTargetIn AgentPatchTargetIn
|
|
|
|
// NewAgentPatchTargetIn instantiates a new AgentPatchTargetIn 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 NewAgentPatchTargetIn() *AgentPatchTargetIn {
|
|
this := AgentPatchTargetIn{}
|
|
return &this
|
|
}
|
|
|
|
// NewAgentPatchTargetInWithDefaults instantiates a new AgentPatchTargetIn 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 NewAgentPatchTargetInWithDefaults() *AgentPatchTargetIn {
|
|
this := AgentPatchTargetIn{}
|
|
return &this
|
|
}
|
|
|
|
// GetCapacity returns the Capacity field value if set, zero value otherwise.
|
|
func (o *AgentPatchTargetIn) GetCapacity() string {
|
|
if o == nil || IsNil(o.Capacity) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Capacity
|
|
}
|
|
|
|
// GetCapacityOk returns a tuple with the Capacity field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentPatchTargetIn) GetCapacityOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Capacity) {
|
|
return nil, false
|
|
}
|
|
return o.Capacity, true
|
|
}
|
|
|
|
// HasCapacity returns a boolean if a field has been set.
|
|
func (o *AgentPatchTargetIn) HasCapacity() bool {
|
|
if o != nil && !IsNil(o.Capacity) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCapacity gets a reference to the given string and assigns it to the Capacity field.
|
|
func (o *AgentPatchTargetIn) SetCapacity(v string) {
|
|
o.Capacity = &v
|
|
}
|
|
|
|
// GetHost returns the Host field value if set, zero value otherwise.
|
|
func (o *AgentPatchTargetIn) GetHost() string {
|
|
if o == nil || IsNil(o.Host) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Host
|
|
}
|
|
|
|
// GetHostOk returns a tuple with the Host field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentPatchTargetIn) GetHostOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Host) {
|
|
return nil, false
|
|
}
|
|
return o.Host, true
|
|
}
|
|
|
|
// HasHost returns a boolean if a field has been set.
|
|
func (o *AgentPatchTargetIn) HasHost() bool {
|
|
if o != nil && !IsNil(o.Host) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetHost gets a reference to the given string and assigns it to the Host field.
|
|
func (o *AgentPatchTargetIn) SetHost(v string) {
|
|
o.Host = &v
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *AgentPatchTargetIn) 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 *AgentPatchTargetIn) 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 *AgentPatchTargetIn) 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 *AgentPatchTargetIn) SetId(v string) {
|
|
o.Id = &v
|
|
}
|
|
|
|
// GetKind returns the Kind field value if set, zero value otherwise.
|
|
func (o *AgentPatchTargetIn) GetKind() string {
|
|
if o == nil || IsNil(o.Kind) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Kind
|
|
}
|
|
|
|
// GetKindOk returns a tuple with the Kind field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentPatchTargetIn) GetKindOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Kind) {
|
|
return nil, false
|
|
}
|
|
return o.Kind, true
|
|
}
|
|
|
|
// HasKind returns a boolean if a field has been set.
|
|
func (o *AgentPatchTargetIn) HasKind() bool {
|
|
if o != nil && !IsNil(o.Kind) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetKind gets a reference to the given string and assigns it to the Kind field.
|
|
func (o *AgentPatchTargetIn) SetKind(v string) {
|
|
o.Kind = &v
|
|
}
|
|
|
|
// GetLabel returns the Label field value if set, zero value otherwise.
|
|
func (o *AgentPatchTargetIn) GetLabel() string {
|
|
if o == nil || IsNil(o.Label) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Label
|
|
}
|
|
|
|
// GetLabelOk returns a tuple with the Label field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentPatchTargetIn) GetLabelOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Label) {
|
|
return nil, false
|
|
}
|
|
return o.Label, true
|
|
}
|
|
|
|
// HasLabel returns a boolean if a field has been set.
|
|
func (o *AgentPatchTargetIn) HasLabel() bool {
|
|
if o != nil && !IsNil(o.Label) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLabel gets a reference to the given string and assigns it to the Label field.
|
|
func (o *AgentPatchTargetIn) SetLabel(v string) {
|
|
o.Label = &v
|
|
}
|
|
|
|
// GetMetrics returns the Metrics field value if set, zero value otherwise.
|
|
func (o *AgentPatchTargetIn) GetMetrics() AgentMetrics {
|
|
if o == nil || IsNil(o.Metrics) {
|
|
var ret AgentMetrics
|
|
return ret
|
|
}
|
|
return *o.Metrics
|
|
}
|
|
|
|
// GetMetricsOk returns a tuple with the Metrics field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentPatchTargetIn) GetMetricsOk() (*AgentMetrics, bool) {
|
|
if o == nil || IsNil(o.Metrics) {
|
|
return nil, false
|
|
}
|
|
return o.Metrics, true
|
|
}
|
|
|
|
// HasMetrics returns a boolean if a field has been set.
|
|
func (o *AgentPatchTargetIn) HasMetrics() bool {
|
|
if o != nil && !IsNil(o.Metrics) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMetrics gets a reference to the given AgentMetrics and assigns it to the Metrics field.
|
|
func (o *AgentPatchTargetIn) SetMetrics(v AgentMetrics) {
|
|
o.Metrics = &v
|
|
}
|
|
|
|
// GetSpec returns the Spec field value if set, zero value otherwise.
|
|
func (o *AgentPatchTargetIn) GetSpec() AgentSpec {
|
|
if o == nil || IsNil(o.Spec) {
|
|
var ret AgentSpec
|
|
return ret
|
|
}
|
|
return *o.Spec
|
|
}
|
|
|
|
// GetSpecOk returns a tuple with the Spec field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentPatchTargetIn) GetSpecOk() (*AgentSpec, bool) {
|
|
if o == nil || IsNil(o.Spec) {
|
|
return nil, false
|
|
}
|
|
return o.Spec, true
|
|
}
|
|
|
|
// HasSpec returns a boolean if a field has been set.
|
|
func (o *AgentPatchTargetIn) HasSpec() bool {
|
|
if o != nil && !IsNil(o.Spec) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSpec gets a reference to the given AgentSpec and assigns it to the Spec field.
|
|
func (o *AgentPatchTargetIn) SetSpec(v AgentSpec) {
|
|
o.Spec = &v
|
|
}
|
|
|
|
// GetStatus returns the Status field value if set, zero value otherwise.
|
|
func (o *AgentPatchTargetIn) 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 *AgentPatchTargetIn) 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 *AgentPatchTargetIn) 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 *AgentPatchTargetIn) SetStatus(v string) {
|
|
o.Status = &v
|
|
}
|
|
|
|
func (o AgentPatchTargetIn) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o AgentPatchTargetIn) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Capacity) {
|
|
toSerialize["capacity"] = o.Capacity
|
|
}
|
|
if !IsNil(o.Host) {
|
|
toSerialize["host"] = o.Host
|
|
}
|
|
if !IsNil(o.Id) {
|
|
toSerialize["id"] = o.Id
|
|
}
|
|
if !IsNil(o.Kind) {
|
|
toSerialize["kind"] = o.Kind
|
|
}
|
|
if !IsNil(o.Label) {
|
|
toSerialize["label"] = o.Label
|
|
}
|
|
if !IsNil(o.Metrics) {
|
|
toSerialize["metrics"] = o.Metrics
|
|
}
|
|
if !IsNil(o.Spec) {
|
|
toSerialize["spec"] = o.Spec
|
|
}
|
|
if !IsNil(o.Status) {
|
|
toSerialize["status"] = o.Status
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *AgentPatchTargetIn) UnmarshalJSON(data []byte) (err error) {
|
|
varAgentPatchTargetIn := _AgentPatchTargetIn{}
|
|
|
|
err = json.Unmarshal(data, &varAgentPatchTargetIn)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = AgentPatchTargetIn(varAgentPatchTargetIn)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "capacity")
|
|
delete(additionalProperties, "host")
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "kind")
|
|
delete(additionalProperties, "label")
|
|
delete(additionalProperties, "metrics")
|
|
delete(additionalProperties, "spec")
|
|
delete(additionalProperties, "status")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableAgentPatchTargetIn struct {
|
|
value *AgentPatchTargetIn
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableAgentPatchTargetIn) Get() *AgentPatchTargetIn {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableAgentPatchTargetIn) Set(val *AgentPatchTargetIn) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableAgentPatchTargetIn) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableAgentPatchTargetIn) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableAgentPatchTargetIn(val *AgentPatchTargetIn) *NullableAgentPatchTargetIn {
|
|
return &NullableAgentPatchTargetIn{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableAgentPatchTargetIn) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableAgentPatchTargetIn) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|