Files
sdk/model_agent_control_drain.go

193 lines
5.2 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 AgentControlDrain type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AgentControlDrain{}
// AgentControlDrain struct for AgentControlDrain
type AgentControlDrain struct {
// Commands is the session's control commands newer than the cursor, oldest first.
Commands []AgentControlCommandView `json:"commands,omitempty"`
// Cursor is the seq to send as `after` on the next poll — the highest seq in this page, or the cursor sent in when the page is empty.
Cursor *int64 `json:"cursor,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AgentControlDrain AgentControlDrain
// NewAgentControlDrain instantiates a new AgentControlDrain 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 NewAgentControlDrain() *AgentControlDrain {
this := AgentControlDrain{}
return &this
}
// NewAgentControlDrainWithDefaults instantiates a new AgentControlDrain 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 NewAgentControlDrainWithDefaults() *AgentControlDrain {
this := AgentControlDrain{}
return &this
}
// GetCommands returns the Commands field value if set, zero value otherwise.
func (o *AgentControlDrain) GetCommands() []AgentControlCommandView {
if o == nil || IsNil(o.Commands) {
var ret []AgentControlCommandView
return ret
}
return o.Commands
}
// GetCommandsOk returns a tuple with the Commands field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentControlDrain) GetCommandsOk() ([]AgentControlCommandView, bool) {
if o == nil || IsNil(o.Commands) {
return nil, false
}
return o.Commands, true
}
// HasCommands returns a boolean if a field has been set.
func (o *AgentControlDrain) HasCommands() bool {
if o != nil && !IsNil(o.Commands) {
return true
}
return false
}
// SetCommands gets a reference to the given []AgentControlCommandView and assigns it to the Commands field.
func (o *AgentControlDrain) SetCommands(v []AgentControlCommandView) {
o.Commands = v
}
// GetCursor returns the Cursor field value if set, zero value otherwise.
func (o *AgentControlDrain) GetCursor() int64 {
if o == nil || IsNil(o.Cursor) {
var ret int64
return ret
}
return *o.Cursor
}
// GetCursorOk returns a tuple with the Cursor field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentControlDrain) GetCursorOk() (*int64, bool) {
if o == nil || IsNil(o.Cursor) {
return nil, false
}
return o.Cursor, true
}
// HasCursor returns a boolean if a field has been set.
func (o *AgentControlDrain) HasCursor() bool {
if o != nil && !IsNil(o.Cursor) {
return true
}
return false
}
// SetCursor gets a reference to the given int64 and assigns it to the Cursor field.
func (o *AgentControlDrain) SetCursor(v int64) {
o.Cursor = &v
}
func (o AgentControlDrain) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AgentControlDrain) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Commands) {
toSerialize["commands"] = o.Commands
}
if !IsNil(o.Cursor) {
toSerialize["cursor"] = o.Cursor
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AgentControlDrain) UnmarshalJSON(data []byte) (err error) {
varAgentControlDrain := _AgentControlDrain{}
err = json.Unmarshal(data, &varAgentControlDrain)
if err != nil {
return err
}
*o = AgentControlDrain(varAgentControlDrain)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "commands")
delete(additionalProperties, "cursor")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAgentControlDrain struct {
value *AgentControlDrain
isSet bool
}
func (v NullableAgentControlDrain) Get() *AgentControlDrain {
return v.value
}
func (v *NullableAgentControlDrain) Set(val *AgentControlDrain) {
v.value = val
v.isSet = true
}
func (v NullableAgentControlDrain) IsSet() bool {
return v.isSet
}
func (v *NullableAgentControlDrain) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAgentControlDrain(val *AgentControlDrain) *NullableAgentControlDrain {
return &NullableAgentControlDrain{value: val, isSet: true}
}
func (v NullableAgentControlDrain) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAgentControlDrain) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}