Files
sdk/model_agent_control_command_view.go

269 lines
7.8 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 AgentControlCommandView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AgentControlCommandView{}
// AgentControlCommandView struct for AgentControlCommandView
type AgentControlCommandView struct {
// Command is what was asked, from a closed four: pause, resume, stop, message. It is an INTENT — the poller decides what to do about it, and the session's status changes only when the poller reports back that it did.
Command *string `json:"command,omitempty"`
// Message is the text that came with the command: what to say into the run for `message`, and the cancellation reason for `stop`. Up to 16 KiB. Empty on a bare pause or resume.
Message *string `json:"message,omitempty"`
Payload interface{} `json:"payload,omitempty"`
// Seq is this command's position in the session's log — the same monotonic number every other turn is ordered by, so a command sits in the transcript where it was issued. Send the highest one you applied back as `after` and it is never redelivered.
Seq *int64 `json:"seq,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AgentControlCommandView AgentControlCommandView
// NewAgentControlCommandView instantiates a new AgentControlCommandView 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 NewAgentControlCommandView() *AgentControlCommandView {
this := AgentControlCommandView{}
return &this
}
// NewAgentControlCommandViewWithDefaults instantiates a new AgentControlCommandView 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 NewAgentControlCommandViewWithDefaults() *AgentControlCommandView {
this := AgentControlCommandView{}
return &this
}
// GetCommand returns the Command field value if set, zero value otherwise.
func (o *AgentControlCommandView) GetCommand() string {
if o == nil || IsNil(o.Command) {
var ret string
return ret
}
return *o.Command
}
// GetCommandOk returns a tuple with the Command field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentControlCommandView) GetCommandOk() (*string, bool) {
if o == nil || IsNil(o.Command) {
return nil, false
}
return o.Command, true
}
// HasCommand returns a boolean if a field has been set.
func (o *AgentControlCommandView) HasCommand() bool {
if o != nil && !IsNil(o.Command) {
return true
}
return false
}
// SetCommand gets a reference to the given string and assigns it to the Command field.
func (o *AgentControlCommandView) SetCommand(v string) {
o.Command = &v
}
// GetMessage returns the Message field value if set, zero value otherwise.
func (o *AgentControlCommandView) GetMessage() string {
if o == nil || IsNil(o.Message) {
var ret string
return ret
}
return *o.Message
}
// GetMessageOk returns a tuple with the Message field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentControlCommandView) GetMessageOk() (*string, bool) {
if o == nil || IsNil(o.Message) {
return nil, false
}
return o.Message, true
}
// HasMessage returns a boolean if a field has been set.
func (o *AgentControlCommandView) HasMessage() bool {
if o != nil && !IsNil(o.Message) {
return true
}
return false
}
// SetMessage gets a reference to the given string and assigns it to the Message field.
func (o *AgentControlCommandView) SetMessage(v string) {
o.Message = &v
}
// GetPayload returns the Payload field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AgentControlCommandView) GetPayload() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Payload
}
// GetPayloadOk returns a tuple with the Payload field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *AgentControlCommandView) GetPayloadOk() (*interface{}, bool) {
if o == nil || IsNil(o.Payload) {
return nil, false
}
return &o.Payload, true
}
// HasPayload returns a boolean if a field has been set.
func (o *AgentControlCommandView) HasPayload() bool {
if o != nil && !IsNil(o.Payload) {
return true
}
return false
}
// SetPayload gets a reference to the given interface{} and assigns it to the Payload field.
func (o *AgentControlCommandView) SetPayload(v interface{}) {
o.Payload = v
}
// GetSeq returns the Seq field value if set, zero value otherwise.
func (o *AgentControlCommandView) GetSeq() int64 {
if o == nil || IsNil(o.Seq) {
var ret int64
return ret
}
return *o.Seq
}
// GetSeqOk returns a tuple with the Seq field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentControlCommandView) GetSeqOk() (*int64, bool) {
if o == nil || IsNil(o.Seq) {
return nil, false
}
return o.Seq, true
}
// HasSeq returns a boolean if a field has been set.
func (o *AgentControlCommandView) HasSeq() bool {
if o != nil && !IsNil(o.Seq) {
return true
}
return false
}
// SetSeq gets a reference to the given int64 and assigns it to the Seq field.
func (o *AgentControlCommandView) SetSeq(v int64) {
o.Seq = &v
}
func (o AgentControlCommandView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AgentControlCommandView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Command) {
toSerialize["command"] = o.Command
}
if !IsNil(o.Message) {
toSerialize["message"] = o.Message
}
if o.Payload != nil {
toSerialize["payload"] = o.Payload
}
if !IsNil(o.Seq) {
toSerialize["seq"] = o.Seq
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AgentControlCommandView) UnmarshalJSON(data []byte) (err error) {
varAgentControlCommandView := _AgentControlCommandView{}
err = json.Unmarshal(data, &varAgentControlCommandView)
if err != nil {
return err
}
*o = AgentControlCommandView(varAgentControlCommandView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "command")
delete(additionalProperties, "message")
delete(additionalProperties, "payload")
delete(additionalProperties, "seq")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAgentControlCommandView struct {
value *AgentControlCommandView
isSet bool
}
func (v NullableAgentControlCommandView) Get() *AgentControlCommandView {
return v.value
}
func (v *NullableAgentControlCommandView) Set(val *AgentControlCommandView) {
v.value = val
v.isSet = true
}
func (v NullableAgentControlCommandView) IsSet() bool {
return v.isSet
}
func (v *NullableAgentControlCommandView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAgentControlCommandView(val *AgentControlCommandView) *NullableAgentControlCommandView {
return &NullableAgentControlCommandView{value: val, isSet: true}
}
func (v NullableAgentControlCommandView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAgentControlCommandView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}