mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
497 lines
13 KiB
Go
497 lines
13 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 AgentBuildSummary type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &AgentBuildSummary{}
|
|
|
|
// AgentBuildSummary struct for AgentBuildSummary
|
|
type AgentBuildSummary 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 is still going.
|
|
EndedAt *string `json:"endedAt,omitempty"`
|
|
// Org and Project are the build's public ADDRESS — the pair the full story is read at, and the pair a visitor sees in the URL bar. Not a tenant key: this index is anonymous and lists only what authors published.
|
|
Org *string `json:"org,omitempty"`
|
|
// Project is the product's slug, the second 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 agent session behind the build, and the value its commits name in their `Hanzo-Session:` trailer.
|
|
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 — so a card can show a build still being written.
|
|
Status *string `json:"status,omitempty"`
|
|
// Title is the human line for the card. Sent even when empty, like every field here, because that is what this route has always sent.
|
|
Title *string `json:"title,omitempty"`
|
|
// Turns is HOW MANY turns the transcript holds — a COUNT, unlike the `turn` on each turn of the full story, which is that turn's position. The full read returns at most 1000 of them; this number is not capped.
|
|
Turns *int64 `json:"turns,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _AgentBuildSummary AgentBuildSummary
|
|
|
|
// NewAgentBuildSummary instantiates a new AgentBuildSummary 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 NewAgentBuildSummary() *AgentBuildSummary {
|
|
this := AgentBuildSummary{}
|
|
return &this
|
|
}
|
|
|
|
// NewAgentBuildSummaryWithDefaults instantiates a new AgentBuildSummary 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 NewAgentBuildSummaryWithDefaults() *AgentBuildSummary {
|
|
this := AgentBuildSummary{}
|
|
return &this
|
|
}
|
|
|
|
// GetAgent returns the Agent field value if set, zero value otherwise.
|
|
func (o *AgentBuildSummary) 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 *AgentBuildSummary) 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 *AgentBuildSummary) 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 *AgentBuildSummary) SetAgent(v string) {
|
|
o.Agent = &v
|
|
}
|
|
|
|
// GetEndedAt returns the EndedAt field value if set, zero value otherwise.
|
|
func (o *AgentBuildSummary) 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 *AgentBuildSummary) 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 *AgentBuildSummary) 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 *AgentBuildSummary) SetEndedAt(v string) {
|
|
o.EndedAt = &v
|
|
}
|
|
|
|
// GetOrg returns the Org field value if set, zero value otherwise.
|
|
func (o *AgentBuildSummary) 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 *AgentBuildSummary) 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 *AgentBuildSummary) 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 *AgentBuildSummary) SetOrg(v string) {
|
|
o.Org = &v
|
|
}
|
|
|
|
// GetProject returns the Project field value if set, zero value otherwise.
|
|
func (o *AgentBuildSummary) 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 *AgentBuildSummary) 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 *AgentBuildSummary) 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 *AgentBuildSummary) SetProject(v string) {
|
|
o.Project = &v
|
|
}
|
|
|
|
// GetRepo returns the Repo field value if set, zero value otherwise.
|
|
func (o *AgentBuildSummary) 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 *AgentBuildSummary) 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 *AgentBuildSummary) 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 *AgentBuildSummary) SetRepo(v string) {
|
|
o.Repo = &v
|
|
}
|
|
|
|
// GetSession returns the Session field value if set, zero value otherwise.
|
|
func (o *AgentBuildSummary) 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 *AgentBuildSummary) 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 *AgentBuildSummary) 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 *AgentBuildSummary) SetSession(v string) {
|
|
o.Session = &v
|
|
}
|
|
|
|
// GetStartedAt returns the StartedAt field value if set, zero value otherwise.
|
|
func (o *AgentBuildSummary) 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 *AgentBuildSummary) 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 *AgentBuildSummary) 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 *AgentBuildSummary) SetStartedAt(v string) {
|
|
o.StartedAt = &v
|
|
}
|
|
|
|
// GetStatus returns the Status field value if set, zero value otherwise.
|
|
func (o *AgentBuildSummary) 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 *AgentBuildSummary) 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 *AgentBuildSummary) 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 *AgentBuildSummary) SetStatus(v string) {
|
|
o.Status = &v
|
|
}
|
|
|
|
// GetTitle returns the Title field value if set, zero value otherwise.
|
|
func (o *AgentBuildSummary) 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 *AgentBuildSummary) 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 *AgentBuildSummary) 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 *AgentBuildSummary) SetTitle(v string) {
|
|
o.Title = &v
|
|
}
|
|
|
|
// GetTurns returns the Turns field value if set, zero value otherwise.
|
|
func (o *AgentBuildSummary) GetTurns() int64 {
|
|
if o == nil || IsNil(o.Turns) {
|
|
var ret int64
|
|
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 *AgentBuildSummary) GetTurnsOk() (*int64, 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 *AgentBuildSummary) HasTurns() bool {
|
|
if o != nil && !IsNil(o.Turns) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTurns gets a reference to the given int64 and assigns it to the Turns field.
|
|
func (o *AgentBuildSummary) SetTurns(v int64) {
|
|
o.Turns = &v
|
|
}
|
|
|
|
func (o AgentBuildSummary) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o AgentBuildSummary) 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.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
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *AgentBuildSummary) UnmarshalJSON(data []byte) (err error) {
|
|
varAgentBuildSummary := _AgentBuildSummary{}
|
|
|
|
err = json.Unmarshal(data, &varAgentBuildSummary)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = AgentBuildSummary(varAgentBuildSummary)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "agent")
|
|
delete(additionalProperties, "endedAt")
|
|
delete(additionalProperties, "org")
|
|
delete(additionalProperties, "project")
|
|
delete(additionalProperties, "repo")
|
|
delete(additionalProperties, "session")
|
|
delete(additionalProperties, "startedAt")
|
|
delete(additionalProperties, "status")
|
|
delete(additionalProperties, "title")
|
|
delete(additionalProperties, "turns")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableAgentBuildSummary struct {
|
|
value *AgentBuildSummary
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableAgentBuildSummary) Get() *AgentBuildSummary {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableAgentBuildSummary) Set(val *AgentBuildSummary) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableAgentBuildSummary) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableAgentBuildSummary) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableAgentBuildSummary(val *AgentBuildSummary) *NullableAgentBuildSummary {
|
|
return &NullableAgentBuildSummary{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableAgentBuildSummary) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableAgentBuildSummary) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|