Files
sdk/model_agent_control_result.go

269 lines
7.5 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 AgentControlResult type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AgentControlResult{}
// AgentControlResult struct for AgentControlResult
type AgentControlResult struct {
// Command is the verb that was recorded: pause, resume, stop or message.
Command *string `json:"command,omitempty"`
// Event is the durable control event the command became. The intent is recorded whether or not it reached an engine, which is what makes a stream-consuming surface able to act on it.
Event *AgentEventView `json:"event,omitempty"`
// Forwarded is whether the command also reached the durable-execution engine. FALSE IS NOT A FAILURE: a session with no workflow link, or a deployment with no tasks backend, is record-only by design. A forward that was attempted and failed is a 502, never a false here.
Forwarded *bool `json:"forwarded,omitempty"`
// Run is the run a resume started, under the same session. Empty for every other command.
Run *string `json:"run,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AgentControlResult AgentControlResult
// NewAgentControlResult instantiates a new AgentControlResult 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 NewAgentControlResult() *AgentControlResult {
this := AgentControlResult{}
return &this
}
// NewAgentControlResultWithDefaults instantiates a new AgentControlResult 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 NewAgentControlResultWithDefaults() *AgentControlResult {
this := AgentControlResult{}
return &this
}
// GetCommand returns the Command field value if set, zero value otherwise.
func (o *AgentControlResult) 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 *AgentControlResult) 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 *AgentControlResult) 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 *AgentControlResult) SetCommand(v string) {
o.Command = &v
}
// GetEvent returns the Event field value if set, zero value otherwise.
func (o *AgentControlResult) GetEvent() AgentEventView {
if o == nil || IsNil(o.Event) {
var ret AgentEventView
return ret
}
return *o.Event
}
// GetEventOk returns a tuple with the Event field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentControlResult) GetEventOk() (*AgentEventView, bool) {
if o == nil || IsNil(o.Event) {
return nil, false
}
return o.Event, true
}
// HasEvent returns a boolean if a field has been set.
func (o *AgentControlResult) HasEvent() bool {
if o != nil && !IsNil(o.Event) {
return true
}
return false
}
// SetEvent gets a reference to the given AgentEventView and assigns it to the Event field.
func (o *AgentControlResult) SetEvent(v AgentEventView) {
o.Event = &v
}
// GetForwarded returns the Forwarded field value if set, zero value otherwise.
func (o *AgentControlResult) GetForwarded() bool {
if o == nil || IsNil(o.Forwarded) {
var ret bool
return ret
}
return *o.Forwarded
}
// GetForwardedOk returns a tuple with the Forwarded field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentControlResult) GetForwardedOk() (*bool, bool) {
if o == nil || IsNil(o.Forwarded) {
return nil, false
}
return o.Forwarded, true
}
// HasForwarded returns a boolean if a field has been set.
func (o *AgentControlResult) HasForwarded() bool {
if o != nil && !IsNil(o.Forwarded) {
return true
}
return false
}
// SetForwarded gets a reference to the given bool and assigns it to the Forwarded field.
func (o *AgentControlResult) SetForwarded(v bool) {
o.Forwarded = &v
}
// GetRun returns the Run field value if set, zero value otherwise.
func (o *AgentControlResult) GetRun() string {
if o == nil || IsNil(o.Run) {
var ret string
return ret
}
return *o.Run
}
// GetRunOk returns a tuple with the Run field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentControlResult) GetRunOk() (*string, bool) {
if o == nil || IsNil(o.Run) {
return nil, false
}
return o.Run, true
}
// HasRun returns a boolean if a field has been set.
func (o *AgentControlResult) HasRun() bool {
if o != nil && !IsNil(o.Run) {
return true
}
return false
}
// SetRun gets a reference to the given string and assigns it to the Run field.
func (o *AgentControlResult) SetRun(v string) {
o.Run = &v
}
func (o AgentControlResult) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AgentControlResult) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Command) {
toSerialize["command"] = o.Command
}
if !IsNil(o.Event) {
toSerialize["event"] = o.Event
}
if !IsNil(o.Forwarded) {
toSerialize["forwarded"] = o.Forwarded
}
if !IsNil(o.Run) {
toSerialize["run"] = o.Run
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AgentControlResult) UnmarshalJSON(data []byte) (err error) {
varAgentControlResult := _AgentControlResult{}
err = json.Unmarshal(data, &varAgentControlResult)
if err != nil {
return err
}
*o = AgentControlResult(varAgentControlResult)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "command")
delete(additionalProperties, "event")
delete(additionalProperties, "forwarded")
delete(additionalProperties, "run")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAgentControlResult struct {
value *AgentControlResult
isSet bool
}
func (v NullableAgentControlResult) Get() *AgentControlResult {
return v.value
}
func (v *NullableAgentControlResult) Set(val *AgentControlResult) {
v.value = val
v.isSet = true
}
func (v NullableAgentControlResult) IsSet() bool {
return v.isSet
}
func (v *NullableAgentControlResult) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAgentControlResult(val *AgentControlResult) *NullableAgentControlResult {
return &NullableAgentControlResult{value: val, isSet: true}
}
func (v NullableAgentControlResult) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAgentControlResult) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}