Files
sdk/model_agent_session_progress.go

307 lines
9.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 AgentSessionProgress type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AgentSessionProgress{}
// AgentSessionProgress struct for AgentSessionProgress
type AgentSessionProgress struct {
// Activity is the one line saying what the run is doing right now (\"running the reaper's tests\"), up to 120 characters, in the model's words. Empty when nothing has estimated it yet.
Activity *string `json:"activity,omitempty"`
// At is when this was determined, RFC 3339 in UTC to the second. Read it as the estimate's AGE: an estimate is not refreshed while nothing has happened, and a stale one beside a run that is still moving is itself worth seeing. Empty when nothing has estimated it yet.
At *string `json:"at,omitempty"`
// Estimated says a MODEL produced this, from the run's transcript, and it may be wrong. False means the session's own row said it: a finished run is 100% because it finished, not because anything guessed. Never treat a true here as a measurement — it is the reason to look, not the answer.
Estimated *bool `json:"estimated,omitempty"`
// Pct is how much of the run is done, 0 to 100. THE KEY IS ABSENT when progress is indeterminate — a run nobody can estimate is not a run that has done nothing, and rendering the second for the first is the mistake this omission exists to make impossible. Read `phase` before reaching for it.
Pct *int64 `json:"pct,omitempty"`
// Phase is what shape the run is in: queued, running, blocked, done, error, or unknown when nothing has estimated it yet. blocked means the transcript shows the run waiting on something — an approval, a credential, an answer — which is the one state the running surface cannot report about itself. error only ever comes from the session's own terminal status. queued is the run's own word that it is accepted and waiting for a place to start.
Phase *string `json:"phase,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AgentSessionProgress AgentSessionProgress
// NewAgentSessionProgress instantiates a new AgentSessionProgress 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 NewAgentSessionProgress() *AgentSessionProgress {
this := AgentSessionProgress{}
return &this
}
// NewAgentSessionProgressWithDefaults instantiates a new AgentSessionProgress 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 NewAgentSessionProgressWithDefaults() *AgentSessionProgress {
this := AgentSessionProgress{}
return &this
}
// GetActivity returns the Activity field value if set, zero value otherwise.
func (o *AgentSessionProgress) GetActivity() string {
if o == nil || IsNil(o.Activity) {
var ret string
return ret
}
return *o.Activity
}
// GetActivityOk returns a tuple with the Activity field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentSessionProgress) GetActivityOk() (*string, bool) {
if o == nil || IsNil(o.Activity) {
return nil, false
}
return o.Activity, true
}
// HasActivity returns a boolean if a field has been set.
func (o *AgentSessionProgress) HasActivity() bool {
if o != nil && !IsNil(o.Activity) {
return true
}
return false
}
// SetActivity gets a reference to the given string and assigns it to the Activity field.
func (o *AgentSessionProgress) SetActivity(v string) {
o.Activity = &v
}
// GetAt returns the At field value if set, zero value otherwise.
func (o *AgentSessionProgress) 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 *AgentSessionProgress) 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 *AgentSessionProgress) 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 *AgentSessionProgress) SetAt(v string) {
o.At = &v
}
// GetEstimated returns the Estimated field value if set, zero value otherwise.
func (o *AgentSessionProgress) GetEstimated() bool {
if o == nil || IsNil(o.Estimated) {
var ret bool
return ret
}
return *o.Estimated
}
// GetEstimatedOk returns a tuple with the Estimated field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentSessionProgress) GetEstimatedOk() (*bool, bool) {
if o == nil || IsNil(o.Estimated) {
return nil, false
}
return o.Estimated, true
}
// HasEstimated returns a boolean if a field has been set.
func (o *AgentSessionProgress) HasEstimated() bool {
if o != nil && !IsNil(o.Estimated) {
return true
}
return false
}
// SetEstimated gets a reference to the given bool and assigns it to the Estimated field.
func (o *AgentSessionProgress) SetEstimated(v bool) {
o.Estimated = &v
}
// GetPct returns the Pct field value if set, zero value otherwise.
func (o *AgentSessionProgress) GetPct() int64 {
if o == nil || IsNil(o.Pct) {
var ret int64
return ret
}
return *o.Pct
}
// GetPctOk returns a tuple with the Pct field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentSessionProgress) GetPctOk() (*int64, bool) {
if o == nil || IsNil(o.Pct) {
return nil, false
}
return o.Pct, true
}
// HasPct returns a boolean if a field has been set.
func (o *AgentSessionProgress) HasPct() bool {
if o != nil && !IsNil(o.Pct) {
return true
}
return false
}
// SetPct gets a reference to the given int64 and assigns it to the Pct field.
func (o *AgentSessionProgress) SetPct(v int64) {
o.Pct = &v
}
// GetPhase returns the Phase field value if set, zero value otherwise.
func (o *AgentSessionProgress) GetPhase() string {
if o == nil || IsNil(o.Phase) {
var ret string
return ret
}
return *o.Phase
}
// GetPhaseOk returns a tuple with the Phase field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentSessionProgress) GetPhaseOk() (*string, bool) {
if o == nil || IsNil(o.Phase) {
return nil, false
}
return o.Phase, true
}
// HasPhase returns a boolean if a field has been set.
func (o *AgentSessionProgress) HasPhase() bool {
if o != nil && !IsNil(o.Phase) {
return true
}
return false
}
// SetPhase gets a reference to the given string and assigns it to the Phase field.
func (o *AgentSessionProgress) SetPhase(v string) {
o.Phase = &v
}
func (o AgentSessionProgress) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AgentSessionProgress) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Activity) {
toSerialize["activity"] = o.Activity
}
if !IsNil(o.At) {
toSerialize["at"] = o.At
}
if !IsNil(o.Estimated) {
toSerialize["estimated"] = o.Estimated
}
if !IsNil(o.Pct) {
toSerialize["pct"] = o.Pct
}
if !IsNil(o.Phase) {
toSerialize["phase"] = o.Phase
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AgentSessionProgress) UnmarshalJSON(data []byte) (err error) {
varAgentSessionProgress := _AgentSessionProgress{}
err = json.Unmarshal(data, &varAgentSessionProgress)
if err != nil {
return err
}
*o = AgentSessionProgress(varAgentSessionProgress)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "activity")
delete(additionalProperties, "at")
delete(additionalProperties, "estimated")
delete(additionalProperties, "pct")
delete(additionalProperties, "phase")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAgentSessionProgress struct {
value *AgentSessionProgress
isSet bool
}
func (v NullableAgentSessionProgress) Get() *AgentSessionProgress {
return v.value
}
func (v *NullableAgentSessionProgress) Set(val *AgentSessionProgress) {
v.value = val
v.isSet = true
}
func (v NullableAgentSessionProgress) IsSet() bool {
return v.isSet
}
func (v *NullableAgentSessionProgress) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAgentSessionProgress(val *AgentSessionProgress) *NullableAgentSessionProgress {
return &NullableAgentSessionProgress{value: val, isSet: true}
}
func (v NullableAgentSessionProgress) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAgentSessionProgress) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}