mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
307 lines
8.2 KiB
Go
307 lines
8.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 AgentLastEventView type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &AgentLastEventView{}
|
|
|
|
// AgentLastEventView struct for AgentLastEventView
|
|
type AgentLastEventView struct {
|
|
// Actor is who produced the turn, defaulted to the calling principal when the writer named nobody.
|
|
Actor *string `json:"actor,omitempty"`
|
|
// At is when the turn was recorded, RFC 3339 in UTC to the second.
|
|
At *string `json:"at,omitempty"`
|
|
// Kind is what the turn was, from the log's closed six: message, tool-call, spawn, log, status, control.
|
|
Kind *string `json:"kind,omitempty"`
|
|
// Preview is the first 240 bytes of the event's payload, cut without regard for the JSON inside it — it is a string to SHOW, never a value to parse. Read the detail or the stream for the whole payload.
|
|
Preview *string `json:"preview,omitempty"`
|
|
// Seq is that event's position in the session's log — monotonic from 1, per session. A reader holding it can ask the detail or stream reads for everything after it, so this doubles as the list's resume cursor.
|
|
Seq *int64 `json:"seq,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _AgentLastEventView AgentLastEventView
|
|
|
|
// NewAgentLastEventView instantiates a new AgentLastEventView 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 NewAgentLastEventView() *AgentLastEventView {
|
|
this := AgentLastEventView{}
|
|
return &this
|
|
}
|
|
|
|
// NewAgentLastEventViewWithDefaults instantiates a new AgentLastEventView 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 NewAgentLastEventViewWithDefaults() *AgentLastEventView {
|
|
this := AgentLastEventView{}
|
|
return &this
|
|
}
|
|
|
|
// GetActor returns the Actor field value if set, zero value otherwise.
|
|
func (o *AgentLastEventView) GetActor() string {
|
|
if o == nil || IsNil(o.Actor) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Actor
|
|
}
|
|
|
|
// GetActorOk returns a tuple with the Actor field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentLastEventView) GetActorOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Actor) {
|
|
return nil, false
|
|
}
|
|
return o.Actor, true
|
|
}
|
|
|
|
// HasActor returns a boolean if a field has been set.
|
|
func (o *AgentLastEventView) HasActor() bool {
|
|
if o != nil && !IsNil(o.Actor) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetActor gets a reference to the given string and assigns it to the Actor field.
|
|
func (o *AgentLastEventView) SetActor(v string) {
|
|
o.Actor = &v
|
|
}
|
|
|
|
// GetAt returns the At field value if set, zero value otherwise.
|
|
func (o *AgentLastEventView) GetAt() string {
|
|
if o == nil || IsNil(o.At) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.At
|
|
}
|
|
|
|
// GetAtOk returns a tuple with the At field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentLastEventView) GetAtOk() (*string, bool) {
|
|
if o == nil || IsNil(o.At) {
|
|
return nil, false
|
|
}
|
|
return o.At, true
|
|
}
|
|
|
|
// HasAt returns a boolean if a field has been set.
|
|
func (o *AgentLastEventView) HasAt() bool {
|
|
if o != nil && !IsNil(o.At) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAt gets a reference to the given string and assigns it to the At field.
|
|
func (o *AgentLastEventView) SetAt(v string) {
|
|
o.At = &v
|
|
}
|
|
|
|
// GetKind returns the Kind field value if set, zero value otherwise.
|
|
func (o *AgentLastEventView) 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 *AgentLastEventView) 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 *AgentLastEventView) 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 *AgentLastEventView) SetKind(v string) {
|
|
o.Kind = &v
|
|
}
|
|
|
|
// GetPreview returns the Preview field value if set, zero value otherwise.
|
|
func (o *AgentLastEventView) GetPreview() string {
|
|
if o == nil || IsNil(o.Preview) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Preview
|
|
}
|
|
|
|
// GetPreviewOk returns a tuple with the Preview field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentLastEventView) GetPreviewOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Preview) {
|
|
return nil, false
|
|
}
|
|
return o.Preview, true
|
|
}
|
|
|
|
// HasPreview returns a boolean if a field has been set.
|
|
func (o *AgentLastEventView) HasPreview() bool {
|
|
if o != nil && !IsNil(o.Preview) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPreview gets a reference to the given string and assigns it to the Preview field.
|
|
func (o *AgentLastEventView) SetPreview(v string) {
|
|
o.Preview = &v
|
|
}
|
|
|
|
// GetSeq returns the Seq field value if set, zero value otherwise.
|
|
func (o *AgentLastEventView) 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 *AgentLastEventView) 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 *AgentLastEventView) 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 *AgentLastEventView) SetSeq(v int64) {
|
|
o.Seq = &v
|
|
}
|
|
|
|
func (o AgentLastEventView) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o AgentLastEventView) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Actor) {
|
|
toSerialize["actor"] = o.Actor
|
|
}
|
|
if !IsNil(o.At) {
|
|
toSerialize["at"] = o.At
|
|
}
|
|
if !IsNil(o.Kind) {
|
|
toSerialize["kind"] = o.Kind
|
|
}
|
|
if !IsNil(o.Preview) {
|
|
toSerialize["preview"] = o.Preview
|
|
}
|
|
if !IsNil(o.Seq) {
|
|
toSerialize["seq"] = o.Seq
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *AgentLastEventView) UnmarshalJSON(data []byte) (err error) {
|
|
varAgentLastEventView := _AgentLastEventView{}
|
|
|
|
err = json.Unmarshal(data, &varAgentLastEventView)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = AgentLastEventView(varAgentLastEventView)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "actor")
|
|
delete(additionalProperties, "at")
|
|
delete(additionalProperties, "kind")
|
|
delete(additionalProperties, "preview")
|
|
delete(additionalProperties, "seq")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableAgentLastEventView struct {
|
|
value *AgentLastEventView
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableAgentLastEventView) Get() *AgentLastEventView {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableAgentLastEventView) Set(val *AgentLastEventView) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableAgentLastEventView) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableAgentLastEventView) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableAgentLastEventView(val *AgentLastEventView) *NullableAgentLastEventView {
|
|
return &NullableAgentLastEventView{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableAgentLastEventView) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableAgentLastEventView) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|