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 AgentBuildTurn type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &AgentBuildTurn{}
|
|
|
|
// AgentBuildTurn struct for AgentBuildTurn
|
|
type AgentBuildTurn struct {
|
|
// Actor is who took the turn. A deploy turn's actor is the literal \"deploy\", because nobody took it.
|
|
Actor *string `json:"actor,omitempty"`
|
|
// At is when the turn was recorded, RFC 3339 in UTC to the second.
|
|
At *string `json:"at,omitempty"`
|
|
// Body is the readable text of the turn, taken from the stored event's `text`. Empty when the event carried a payload of some other shape — this route reads transcripts and does not invent prose for turns that are not one.
|
|
Body *string `json:"body,omitempty"`
|
|
// Commit is the full sha this turn produced, empty when the turn changed nothing. It is ECHOED from the transcript, and the authority is the commit itself: it carries the `Hanzo-Session:`/`Hanzo-Turn:` trailer, or a note under refs/notes/hanzo-provenance saying the same, so the claim is checkable at source with the command in `verify`.
|
|
Commit *string `json:"commit,omitempty"`
|
|
// Kind is what the turn was, from the log's closed six: message, tool-call, spawn, log, status, control. A deploy arrives as a `status` turn.
|
|
Kind *string `json:"kind,omitempty"`
|
|
// Subject is that commit's subject line, from the same transcript, so a reader sees what the commit says without fetching the repository.
|
|
Subject *string `json:"subject,omitempty"`
|
|
// Seq is this turn's POSITION in the session's log — monotonic from 1, per session — and it is what a commit's `Hanzo-Turn:` trailer names. It is not a count of anything: the count is `turns` on the summary beside it.
|
|
Turn *int64 `json:"turn,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _AgentBuildTurn AgentBuildTurn
|
|
|
|
// NewAgentBuildTurn instantiates a new AgentBuildTurn 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 NewAgentBuildTurn() *AgentBuildTurn {
|
|
this := AgentBuildTurn{}
|
|
return &this
|
|
}
|
|
|
|
// NewAgentBuildTurnWithDefaults instantiates a new AgentBuildTurn 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 NewAgentBuildTurnWithDefaults() *AgentBuildTurn {
|
|
this := AgentBuildTurn{}
|
|
return &this
|
|
}
|
|
|
|
// GetActor returns the Actor field value if set, zero value otherwise.
|
|
func (o *AgentBuildTurn) 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 *AgentBuildTurn) 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 *AgentBuildTurn) 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 *AgentBuildTurn) SetActor(v string) {
|
|
o.Actor = &v
|
|
}
|
|
|
|
// GetAt returns the At field value if set, zero value otherwise.
|
|
func (o *AgentBuildTurn) 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 *AgentBuildTurn) 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 *AgentBuildTurn) 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 *AgentBuildTurn) SetAt(v string) {
|
|
o.At = &v
|
|
}
|
|
|
|
// GetBody returns the Body field value if set, zero value otherwise.
|
|
func (o *AgentBuildTurn) GetBody() string {
|
|
if o == nil || IsNil(o.Body) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Body
|
|
}
|
|
|
|
// GetBodyOk returns a tuple with the Body field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentBuildTurn) GetBodyOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Body) {
|
|
return nil, false
|
|
}
|
|
return o.Body, true
|
|
}
|
|
|
|
// HasBody returns a boolean if a field has been set.
|
|
func (o *AgentBuildTurn) HasBody() bool {
|
|
if o != nil && !IsNil(o.Body) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetBody gets a reference to the given string and assigns it to the Body field.
|
|
func (o *AgentBuildTurn) SetBody(v string) {
|
|
o.Body = &v
|
|
}
|
|
|
|
// GetCommit returns the Commit field value if set, zero value otherwise.
|
|
func (o *AgentBuildTurn) GetCommit() string {
|
|
if o == nil || IsNil(o.Commit) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Commit
|
|
}
|
|
|
|
// GetCommitOk returns a tuple with the Commit field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentBuildTurn) GetCommitOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Commit) {
|
|
return nil, false
|
|
}
|
|
return o.Commit, true
|
|
}
|
|
|
|
// HasCommit returns a boolean if a field has been set.
|
|
func (o *AgentBuildTurn) HasCommit() bool {
|
|
if o != nil && !IsNil(o.Commit) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCommit gets a reference to the given string and assigns it to the Commit field.
|
|
func (o *AgentBuildTurn) SetCommit(v string) {
|
|
o.Commit = &v
|
|
}
|
|
|
|
// GetKind returns the Kind field value if set, zero value otherwise.
|
|
func (o *AgentBuildTurn) 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 *AgentBuildTurn) 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 *AgentBuildTurn) 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 *AgentBuildTurn) SetKind(v string) {
|
|
o.Kind = &v
|
|
}
|
|
|
|
// GetSubject returns the Subject field value if set, zero value otherwise.
|
|
func (o *AgentBuildTurn) GetSubject() string {
|
|
if o == nil || IsNil(o.Subject) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Subject
|
|
}
|
|
|
|
// GetSubjectOk returns a tuple with the Subject field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentBuildTurn) GetSubjectOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Subject) {
|
|
return nil, false
|
|
}
|
|
return o.Subject, true
|
|
}
|
|
|
|
// HasSubject returns a boolean if a field has been set.
|
|
func (o *AgentBuildTurn) HasSubject() bool {
|
|
if o != nil && !IsNil(o.Subject) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSubject gets a reference to the given string and assigns it to the Subject field.
|
|
func (o *AgentBuildTurn) SetSubject(v string) {
|
|
o.Subject = &v
|
|
}
|
|
|
|
// GetTurn returns the Turn field value if set, zero value otherwise.
|
|
func (o *AgentBuildTurn) GetTurn() int64 {
|
|
if o == nil || IsNil(o.Turn) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Turn
|
|
}
|
|
|
|
// GetTurnOk returns a tuple with the Turn field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentBuildTurn) GetTurnOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Turn) {
|
|
return nil, false
|
|
}
|
|
return o.Turn, true
|
|
}
|
|
|
|
// HasTurn returns a boolean if a field has been set.
|
|
func (o *AgentBuildTurn) HasTurn() bool {
|
|
if o != nil && !IsNil(o.Turn) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTurn gets a reference to the given int64 and assigns it to the Turn field.
|
|
func (o *AgentBuildTurn) SetTurn(v int64) {
|
|
o.Turn = &v
|
|
}
|
|
|
|
func (o AgentBuildTurn) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o AgentBuildTurn) 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.Body) {
|
|
toSerialize["body"] = o.Body
|
|
}
|
|
if !IsNil(o.Commit) {
|
|
toSerialize["commit"] = o.Commit
|
|
}
|
|
if !IsNil(o.Kind) {
|
|
toSerialize["kind"] = o.Kind
|
|
}
|
|
if !IsNil(o.Subject) {
|
|
toSerialize["subject"] = o.Subject
|
|
}
|
|
if !IsNil(o.Turn) {
|
|
toSerialize["turn"] = o.Turn
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *AgentBuildTurn) UnmarshalJSON(data []byte) (err error) {
|
|
varAgentBuildTurn := _AgentBuildTurn{}
|
|
|
|
err = json.Unmarshal(data, &varAgentBuildTurn)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = AgentBuildTurn(varAgentBuildTurn)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "actor")
|
|
delete(additionalProperties, "at")
|
|
delete(additionalProperties, "body")
|
|
delete(additionalProperties, "commit")
|
|
delete(additionalProperties, "kind")
|
|
delete(additionalProperties, "subject")
|
|
delete(additionalProperties, "turn")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableAgentBuildTurn struct {
|
|
value *AgentBuildTurn
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableAgentBuildTurn) Get() *AgentBuildTurn {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableAgentBuildTurn) Set(val *AgentBuildTurn) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableAgentBuildTurn) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableAgentBuildTurn) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableAgentBuildTurn(val *AgentBuildTurn) *NullableAgentBuildTurn {
|
|
return &NullableAgentBuildTurn{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableAgentBuildTurn) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableAgentBuildTurn) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|