mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
383 lines
10 KiB
Go
383 lines
10 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 AgentEventView type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &AgentEventView{}
|
|
|
|
// AgentEventView struct for AgentEventView
|
|
type AgentEventView struct {
|
|
// Actor is who produced the turn. A write that names nobody takes the calling principal, so this is rarely empty in practice.
|
|
Actor *string `json:"actor,omitempty"`
|
|
// CreatedAt is when the turn was recorded, RFC 3339 in UTC to the second. Seconds are coarse enough that two turns can share one, which is why Seq and not this is the order.
|
|
CreatedAt *string `json:"createdAt,omitempty"`
|
|
// ID is the event's own handle, minted as \"evt_\" + 32 hex characters. It identifies the turn; Seq is what ORDERS it.
|
|
Id *string `json:"id,omitempty"`
|
|
// Kind is what the turn IS, from a closed six: message (a model turn), tool-call, spawn (a subagent started), log, status, control (a steering command the running surface consumes). Anything else is refused at the write.
|
|
Kind *string `json:"kind,omitempty"`
|
|
Payload interface{} `json:"payload,omitempty"`
|
|
// Seq is the turn's position in this session's log: monotonic from 1, assigned by the store inside the insert, and unique PER SESSION rather than globally. It is the cursor a reader resumes from after a reconnect — ask for everything after your last-seen seq.
|
|
Seq *int64 `json:"seq,omitempty"`
|
|
// SessionID is the session this turn belongs to. Carried on every event so a stream frame stands alone — a subscriber watching a whole tree gets turns from several sessions down one connection.
|
|
SessionId *string `json:"sessionId,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _AgentEventView AgentEventView
|
|
|
|
// NewAgentEventView instantiates a new AgentEventView 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 NewAgentEventView() *AgentEventView {
|
|
this := AgentEventView{}
|
|
return &this
|
|
}
|
|
|
|
// NewAgentEventViewWithDefaults instantiates a new AgentEventView 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 NewAgentEventViewWithDefaults() *AgentEventView {
|
|
this := AgentEventView{}
|
|
return &this
|
|
}
|
|
|
|
// GetActor returns the Actor field value if set, zero value otherwise.
|
|
func (o *AgentEventView) 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 *AgentEventView) 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 *AgentEventView) 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 *AgentEventView) SetActor(v string) {
|
|
o.Actor = &v
|
|
}
|
|
|
|
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
|
|
func (o *AgentEventView) GetCreatedAt() string {
|
|
if o == nil || IsNil(o.CreatedAt) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.CreatedAt
|
|
}
|
|
|
|
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentEventView) GetCreatedAtOk() (*string, bool) {
|
|
if o == nil || IsNil(o.CreatedAt) {
|
|
return nil, false
|
|
}
|
|
return o.CreatedAt, true
|
|
}
|
|
|
|
// HasCreatedAt returns a boolean if a field has been set.
|
|
func (o *AgentEventView) HasCreatedAt() bool {
|
|
if o != nil && !IsNil(o.CreatedAt) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field.
|
|
func (o *AgentEventView) SetCreatedAt(v string) {
|
|
o.CreatedAt = &v
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *AgentEventView) 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 *AgentEventView) 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 *AgentEventView) 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 *AgentEventView) SetId(v string) {
|
|
o.Id = &v
|
|
}
|
|
|
|
// GetKind returns the Kind field value if set, zero value otherwise.
|
|
func (o *AgentEventView) 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 *AgentEventView) 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 *AgentEventView) 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 *AgentEventView) SetKind(v string) {
|
|
o.Kind = &v
|
|
}
|
|
|
|
// GetPayload returns the Payload field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *AgentEventView) 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 *AgentEventView) 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 *AgentEventView) 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 *AgentEventView) SetPayload(v interface{}) {
|
|
o.Payload = v
|
|
}
|
|
|
|
// GetSeq returns the Seq field value if set, zero value otherwise.
|
|
func (o *AgentEventView) 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 *AgentEventView) 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 *AgentEventView) 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 *AgentEventView) SetSeq(v int64) {
|
|
o.Seq = &v
|
|
}
|
|
|
|
// GetSessionId returns the SessionId field value if set, zero value otherwise.
|
|
func (o *AgentEventView) GetSessionId() string {
|
|
if o == nil || IsNil(o.SessionId) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.SessionId
|
|
}
|
|
|
|
// GetSessionIdOk returns a tuple with the SessionId field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentEventView) GetSessionIdOk() (*string, bool) {
|
|
if o == nil || IsNil(o.SessionId) {
|
|
return nil, false
|
|
}
|
|
return o.SessionId, true
|
|
}
|
|
|
|
// HasSessionId returns a boolean if a field has been set.
|
|
func (o *AgentEventView) HasSessionId() bool {
|
|
if o != nil && !IsNil(o.SessionId) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSessionId gets a reference to the given string and assigns it to the SessionId field.
|
|
func (o *AgentEventView) SetSessionId(v string) {
|
|
o.SessionId = &v
|
|
}
|
|
|
|
func (o AgentEventView) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o AgentEventView) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Actor) {
|
|
toSerialize["actor"] = o.Actor
|
|
}
|
|
if !IsNil(o.CreatedAt) {
|
|
toSerialize["createdAt"] = o.CreatedAt
|
|
}
|
|
if !IsNil(o.Id) {
|
|
toSerialize["id"] = o.Id
|
|
}
|
|
if !IsNil(o.Kind) {
|
|
toSerialize["kind"] = o.Kind
|
|
}
|
|
if o.Payload != nil {
|
|
toSerialize["payload"] = o.Payload
|
|
}
|
|
if !IsNil(o.Seq) {
|
|
toSerialize["seq"] = o.Seq
|
|
}
|
|
if !IsNil(o.SessionId) {
|
|
toSerialize["sessionId"] = o.SessionId
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *AgentEventView) UnmarshalJSON(data []byte) (err error) {
|
|
varAgentEventView := _AgentEventView{}
|
|
|
|
err = json.Unmarshal(data, &varAgentEventView)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = AgentEventView(varAgentEventView)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "actor")
|
|
delete(additionalProperties, "createdAt")
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "kind")
|
|
delete(additionalProperties, "payload")
|
|
delete(additionalProperties, "seq")
|
|
delete(additionalProperties, "sessionId")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableAgentEventView struct {
|
|
value *AgentEventView
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableAgentEventView) Get() *AgentEventView {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableAgentEventView) Set(val *AgentEventView) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableAgentEventView) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableAgentEventView) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableAgentEventView(val *AgentEventView) *NullableAgentEventView {
|
|
return &NullableAgentEventView{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableAgentEventView) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableAgentEventView) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|