Files
sdk/model_agent_build_view.go

573 lines
16 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 AgentBuildView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AgentBuildView{}
// AgentBuildView struct for AgentBuildView
type AgentBuildView struct {
// Agent is the label the surface that did the work calls itself by.
Agent *string `json:"agent,omitempty"`
// EndedAt is when it finished, same format. Empty means it has not — the build is still going.
EndedAt *string `json:"endedAt,omitempty"`
// Model is the model that did the work, taken from the FIRST turn whose body names one — a transcript states it, this route does not resolve it. Empty when no turn said.
Model *string `json:"model,omitempty"`
// Org is the org that published this build, echoed from the URL. It is part of the build's public ADDRESS and not a tenant key — this route is anonymous, and the only rows it can reach are ones an author explicitly published.
Org *string `json:"org,omitempty"`
// Project is the product's slug, the other half of that address.
Project *string `json:"project,omitempty"`
// Repo is the repository the work was done in, as the session reported it.
Repo *string `json:"repo,omitempty"`
// Session is the id of the agent session this story IS — the same value a produced commit carries in its `Hanzo-Session:` trailer, which is what ties the repository's history to this page.
Session *string `json:"session,omitempty"`
// StartedAt is when the session opened, RFC 3339 in UTC.
StartedAt *string `json:"startedAt,omitempty"`
// Status is the session's own: running, paused, done or error. A build can be read while it is still being written, so this is not always terminal — and an `error` build is still a readable story, not a missing page.
Status *string `json:"status,omitempty"`
// Title is the human line the session was opened or renamed with. Empty when nobody gave it one.
Title *string `json:"title,omitempty"`
// Turns is the whole transcript, oldest first, capped at 1000: a published build is a story to read down, not an archive to page.
Turns []AgentBuildTurn `json:"turns,omitempty"`
// Verify is the exact command that re-derives every commit binding below straight from git, so nothing here has to be taken on trust.
Verify *string `json:"verify,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AgentBuildView AgentBuildView
// NewAgentBuildView instantiates a new AgentBuildView 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 NewAgentBuildView() *AgentBuildView {
this := AgentBuildView{}
return &this
}
// NewAgentBuildViewWithDefaults instantiates a new AgentBuildView 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 NewAgentBuildViewWithDefaults() *AgentBuildView {
this := AgentBuildView{}
return &this
}
// GetAgent returns the Agent field value if set, zero value otherwise.
func (o *AgentBuildView) GetAgent() string {
if o == nil || IsNil(o.Agent) {
var ret string
return ret
}
return *o.Agent
}
// GetAgentOk returns a tuple with the Agent field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentBuildView) GetAgentOk() (*string, bool) {
if o == nil || IsNil(o.Agent) {
return nil, false
}
return o.Agent, true
}
// HasAgent returns a boolean if a field has been set.
func (o *AgentBuildView) HasAgent() bool {
if o != nil && !IsNil(o.Agent) {
return true
}
return false
}
// SetAgent gets a reference to the given string and assigns it to the Agent field.
func (o *AgentBuildView) SetAgent(v string) {
o.Agent = &v
}
// GetEndedAt returns the EndedAt field value if set, zero value otherwise.
func (o *AgentBuildView) GetEndedAt() string {
if o == nil || IsNil(o.EndedAt) {
var ret string
return ret
}
return *o.EndedAt
}
// GetEndedAtOk returns a tuple with the EndedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentBuildView) GetEndedAtOk() (*string, bool) {
if o == nil || IsNil(o.EndedAt) {
return nil, false
}
return o.EndedAt, true
}
// HasEndedAt returns a boolean if a field has been set.
func (o *AgentBuildView) HasEndedAt() bool {
if o != nil && !IsNil(o.EndedAt) {
return true
}
return false
}
// SetEndedAt gets a reference to the given string and assigns it to the EndedAt field.
func (o *AgentBuildView) SetEndedAt(v string) {
o.EndedAt = &v
}
// GetModel returns the Model field value if set, zero value otherwise.
func (o *AgentBuildView) GetModel() string {
if o == nil || IsNil(o.Model) {
var ret string
return ret
}
return *o.Model
}
// GetModelOk returns a tuple with the Model field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentBuildView) GetModelOk() (*string, bool) {
if o == nil || IsNil(o.Model) {
return nil, false
}
return o.Model, true
}
// HasModel returns a boolean if a field has been set.
func (o *AgentBuildView) HasModel() bool {
if o != nil && !IsNil(o.Model) {
return true
}
return false
}
// SetModel gets a reference to the given string and assigns it to the Model field.
func (o *AgentBuildView) SetModel(v string) {
o.Model = &v
}
// GetOrg returns the Org field value if set, zero value otherwise.
func (o *AgentBuildView) GetOrg() string {
if o == nil || IsNil(o.Org) {
var ret string
return ret
}
return *o.Org
}
// GetOrgOk returns a tuple with the Org field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentBuildView) GetOrgOk() (*string, bool) {
if o == nil || IsNil(o.Org) {
return nil, false
}
return o.Org, true
}
// HasOrg returns a boolean if a field has been set.
func (o *AgentBuildView) HasOrg() bool {
if o != nil && !IsNil(o.Org) {
return true
}
return false
}
// SetOrg gets a reference to the given string and assigns it to the Org field.
func (o *AgentBuildView) SetOrg(v string) {
o.Org = &v
}
// GetProject returns the Project field value if set, zero value otherwise.
func (o *AgentBuildView) GetProject() string {
if o == nil || IsNil(o.Project) {
var ret string
return ret
}
return *o.Project
}
// GetProjectOk returns a tuple with the Project field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentBuildView) GetProjectOk() (*string, bool) {
if o == nil || IsNil(o.Project) {
return nil, false
}
return o.Project, true
}
// HasProject returns a boolean if a field has been set.
func (o *AgentBuildView) HasProject() bool {
if o != nil && !IsNil(o.Project) {
return true
}
return false
}
// SetProject gets a reference to the given string and assigns it to the Project field.
func (o *AgentBuildView) SetProject(v string) {
o.Project = &v
}
// GetRepo returns the Repo field value if set, zero value otherwise.
func (o *AgentBuildView) GetRepo() string {
if o == nil || IsNil(o.Repo) {
var ret string
return ret
}
return *o.Repo
}
// GetRepoOk returns a tuple with the Repo field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentBuildView) GetRepoOk() (*string, bool) {
if o == nil || IsNil(o.Repo) {
return nil, false
}
return o.Repo, true
}
// HasRepo returns a boolean if a field has been set.
func (o *AgentBuildView) HasRepo() bool {
if o != nil && !IsNil(o.Repo) {
return true
}
return false
}
// SetRepo gets a reference to the given string and assigns it to the Repo field.
func (o *AgentBuildView) SetRepo(v string) {
o.Repo = &v
}
// GetSession returns the Session field value if set, zero value otherwise.
func (o *AgentBuildView) GetSession() string {
if o == nil || IsNil(o.Session) {
var ret string
return ret
}
return *o.Session
}
// GetSessionOk returns a tuple with the Session field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentBuildView) GetSessionOk() (*string, bool) {
if o == nil || IsNil(o.Session) {
return nil, false
}
return o.Session, true
}
// HasSession returns a boolean if a field has been set.
func (o *AgentBuildView) HasSession() bool {
if o != nil && !IsNil(o.Session) {
return true
}
return false
}
// SetSession gets a reference to the given string and assigns it to the Session field.
func (o *AgentBuildView) SetSession(v string) {
o.Session = &v
}
// GetStartedAt returns the StartedAt field value if set, zero value otherwise.
func (o *AgentBuildView) GetStartedAt() string {
if o == nil || IsNil(o.StartedAt) {
var ret string
return ret
}
return *o.StartedAt
}
// GetStartedAtOk returns a tuple with the StartedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentBuildView) GetStartedAtOk() (*string, bool) {
if o == nil || IsNil(o.StartedAt) {
return nil, false
}
return o.StartedAt, true
}
// HasStartedAt returns a boolean if a field has been set.
func (o *AgentBuildView) HasStartedAt() bool {
if o != nil && !IsNil(o.StartedAt) {
return true
}
return false
}
// SetStartedAt gets a reference to the given string and assigns it to the StartedAt field.
func (o *AgentBuildView) SetStartedAt(v string) {
o.StartedAt = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *AgentBuildView) GetStatus() string {
if o == nil || IsNil(o.Status) {
var ret string
return ret
}
return *o.Status
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentBuildView) GetStatusOk() (*string, bool) {
if o == nil || IsNil(o.Status) {
return nil, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *AgentBuildView) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *AgentBuildView) SetStatus(v string) {
o.Status = &v
}
// GetTitle returns the Title field value if set, zero value otherwise.
func (o *AgentBuildView) GetTitle() string {
if o == nil || IsNil(o.Title) {
var ret string
return ret
}
return *o.Title
}
// GetTitleOk returns a tuple with the Title field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentBuildView) GetTitleOk() (*string, bool) {
if o == nil || IsNil(o.Title) {
return nil, false
}
return o.Title, true
}
// HasTitle returns a boolean if a field has been set.
func (o *AgentBuildView) HasTitle() bool {
if o != nil && !IsNil(o.Title) {
return true
}
return false
}
// SetTitle gets a reference to the given string and assigns it to the Title field.
func (o *AgentBuildView) SetTitle(v string) {
o.Title = &v
}
// GetTurns returns the Turns field value if set, zero value otherwise.
func (o *AgentBuildView) GetTurns() []AgentBuildTurn {
if o == nil || IsNil(o.Turns) {
var ret []AgentBuildTurn
return ret
}
return o.Turns
}
// GetTurnsOk returns a tuple with the Turns field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentBuildView) GetTurnsOk() ([]AgentBuildTurn, bool) {
if o == nil || IsNil(o.Turns) {
return nil, false
}
return o.Turns, true
}
// HasTurns returns a boolean if a field has been set.
func (o *AgentBuildView) HasTurns() bool {
if o != nil && !IsNil(o.Turns) {
return true
}
return false
}
// SetTurns gets a reference to the given []AgentBuildTurn and assigns it to the Turns field.
func (o *AgentBuildView) SetTurns(v []AgentBuildTurn) {
o.Turns = v
}
// GetVerify returns the Verify field value if set, zero value otherwise.
func (o *AgentBuildView) GetVerify() string {
if o == nil || IsNil(o.Verify) {
var ret string
return ret
}
return *o.Verify
}
// GetVerifyOk returns a tuple with the Verify field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentBuildView) GetVerifyOk() (*string, bool) {
if o == nil || IsNil(o.Verify) {
return nil, false
}
return o.Verify, true
}
// HasVerify returns a boolean if a field has been set.
func (o *AgentBuildView) HasVerify() bool {
if o != nil && !IsNil(o.Verify) {
return true
}
return false
}
// SetVerify gets a reference to the given string and assigns it to the Verify field.
func (o *AgentBuildView) SetVerify(v string) {
o.Verify = &v
}
func (o AgentBuildView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AgentBuildView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Agent) {
toSerialize["agent"] = o.Agent
}
if !IsNil(o.EndedAt) {
toSerialize["endedAt"] = o.EndedAt
}
if !IsNil(o.Model) {
toSerialize["model"] = o.Model
}
if !IsNil(o.Org) {
toSerialize["org"] = o.Org
}
if !IsNil(o.Project) {
toSerialize["project"] = o.Project
}
if !IsNil(o.Repo) {
toSerialize["repo"] = o.Repo
}
if !IsNil(o.Session) {
toSerialize["session"] = o.Session
}
if !IsNil(o.StartedAt) {
toSerialize["startedAt"] = o.StartedAt
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.Title) {
toSerialize["title"] = o.Title
}
if !IsNil(o.Turns) {
toSerialize["turns"] = o.Turns
}
if !IsNil(o.Verify) {
toSerialize["verify"] = o.Verify
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AgentBuildView) UnmarshalJSON(data []byte) (err error) {
varAgentBuildView := _AgentBuildView{}
err = json.Unmarshal(data, &varAgentBuildView)
if err != nil {
return err
}
*o = AgentBuildView(varAgentBuildView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "agent")
delete(additionalProperties, "endedAt")
delete(additionalProperties, "model")
delete(additionalProperties, "org")
delete(additionalProperties, "project")
delete(additionalProperties, "repo")
delete(additionalProperties, "session")
delete(additionalProperties, "startedAt")
delete(additionalProperties, "status")
delete(additionalProperties, "title")
delete(additionalProperties, "turns")
delete(additionalProperties, "verify")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAgentBuildView struct {
value *AgentBuildView
isSet bool
}
func (v NullableAgentBuildView) Get() *AgentBuildView {
return v.value
}
func (v *NullableAgentBuildView) Set(val *AgentBuildView) {
v.value = val
v.isSet = true
}
func (v NullableAgentBuildView) IsSet() bool {
return v.isSet
}
func (v *NullableAgentBuildView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAgentBuildView(val *AgentBuildView) *NullableAgentBuildView {
return &NullableAgentBuildView{value: val, isSet: true}
}
func (v NullableAgentBuildView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAgentBuildView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}