Files
sdk/model_agent_activity_view.go

307 lines
8.1 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 AgentActivityView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AgentActivityView{}
// AgentActivityView struct for AgentActivityView
type AgentActivityView struct {
// agent name
Agent *string `json:"agent,omitempty"`
// RFC3339 UTC
At *string `json:"at,omitempty"`
// ID identifies the event, and its shape says which kind it is: a run event carries the run's own id, while an agent event is the agent id suffixed \":created\" or \":updated\". Unique within a feed, and not an address — there is nothing to fetch it by.
Id *string `json:"id,omitempty"`
// invoked|failed|created|updated (from real events)
Kind *string `json:"kind,omitempty"`
// Message is the line to render, already bounded: \"Invoked <model>\" for a run that worked, the run's own error truncated to 200 characters for one that did not (or \"Run failed\" when it said nothing), and a fixed phrase for the two agent events. Nothing here is invented — every event is a row that exists.
Message *string `json:"message,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AgentActivityView AgentActivityView
// NewAgentActivityView instantiates a new AgentActivityView 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 NewAgentActivityView() *AgentActivityView {
this := AgentActivityView{}
return &this
}
// NewAgentActivityViewWithDefaults instantiates a new AgentActivityView 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 NewAgentActivityViewWithDefaults() *AgentActivityView {
this := AgentActivityView{}
return &this
}
// GetAgent returns the Agent field value if set, zero value otherwise.
func (o *AgentActivityView) 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 *AgentActivityView) 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 *AgentActivityView) 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 *AgentActivityView) SetAgent(v string) {
o.Agent = &v
}
// GetAt returns the At field value if set, zero value otherwise.
func (o *AgentActivityView) 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 *AgentActivityView) 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 *AgentActivityView) 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 *AgentActivityView) SetAt(v string) {
o.At = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *AgentActivityView) 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 *AgentActivityView) 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 *AgentActivityView) 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 *AgentActivityView) SetId(v string) {
o.Id = &v
}
// GetKind returns the Kind field value if set, zero value otherwise.
func (o *AgentActivityView) 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 *AgentActivityView) 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 *AgentActivityView) 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 *AgentActivityView) SetKind(v string) {
o.Kind = &v
}
// GetMessage returns the Message field value if set, zero value otherwise.
func (o *AgentActivityView) GetMessage() string {
if o == nil || IsNil(o.Message) {
var ret string
return ret
}
return *o.Message
}
// GetMessageOk returns a tuple with the Message field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentActivityView) GetMessageOk() (*string, bool) {
if o == nil || IsNil(o.Message) {
return nil, false
}
return o.Message, true
}
// HasMessage returns a boolean if a field has been set.
func (o *AgentActivityView) HasMessage() bool {
if o != nil && !IsNil(o.Message) {
return true
}
return false
}
// SetMessage gets a reference to the given string and assigns it to the Message field.
func (o *AgentActivityView) SetMessage(v string) {
o.Message = &v
}
func (o AgentActivityView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AgentActivityView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Agent) {
toSerialize["agent"] = o.Agent
}
if !IsNil(o.At) {
toSerialize["at"] = o.At
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Kind) {
toSerialize["kind"] = o.Kind
}
if !IsNil(o.Message) {
toSerialize["message"] = o.Message
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AgentActivityView) UnmarshalJSON(data []byte) (err error) {
varAgentActivityView := _AgentActivityView{}
err = json.Unmarshal(data, &varAgentActivityView)
if err != nil {
return err
}
*o = AgentActivityView(varAgentActivityView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "agent")
delete(additionalProperties, "at")
delete(additionalProperties, "id")
delete(additionalProperties, "kind")
delete(additionalProperties, "message")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAgentActivityView struct {
value *AgentActivityView
isSet bool
}
func (v NullableAgentActivityView) Get() *AgentActivityView {
return v.value
}
func (v *NullableAgentActivityView) Set(val *AgentActivityView) {
v.value = val
v.isSet = true
}
func (v NullableAgentActivityView) IsSet() bool {
return v.isSet
}
func (v *NullableAgentActivityView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAgentActivityView(val *AgentActivityView) *NullableAgentActivityView {
return &NullableAgentActivityView{value: val, isSet: true}
}
func (v NullableAgentActivityView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAgentActivityView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}