Files
sdk/model_train_event.go

269 lines
6.4 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 TrainEvent type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TrainEvent{}
// TrainEvent struct for TrainEvent
type TrainEvent struct {
// At is when it was recorded, unix seconds.
At *int64 `json:"at,omitempty"`
Event interface{} `json:"event,omitempty"`
// Seq orders the job's events from 1.
Seq *int64 `json:"seq,omitempty"`
// Task is the task that reported it.
Task *string `json:"task,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TrainEvent TrainEvent
// NewTrainEvent instantiates a new TrainEvent 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 NewTrainEvent() *TrainEvent {
this := TrainEvent{}
return &this
}
// NewTrainEventWithDefaults instantiates a new TrainEvent 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 NewTrainEventWithDefaults() *TrainEvent {
this := TrainEvent{}
return &this
}
// GetAt returns the At field value if set, zero value otherwise.
func (o *TrainEvent) GetAt() int64 {
if o == nil || IsNil(o.At) {
var ret int64
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 *TrainEvent) GetAtOk() (*int64, 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 *TrainEvent) HasAt() bool {
if o != nil && !IsNil(o.At) {
return true
}
return false
}
// SetAt gets a reference to the given int64 and assigns it to the At field.
func (o *TrainEvent) SetAt(v int64) {
o.At = &v
}
// GetEvent returns the Event field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *TrainEvent) GetEvent() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Event
}
// GetEventOk returns a tuple with the Event field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *TrainEvent) GetEventOk() (*interface{}, bool) {
if o == nil || IsNil(o.Event) {
return nil, false
}
return &o.Event, true
}
// HasEvent returns a boolean if a field has been set.
func (o *TrainEvent) HasEvent() bool {
if o != nil && !IsNil(o.Event) {
return true
}
return false
}
// SetEvent gets a reference to the given interface{} and assigns it to the Event field.
func (o *TrainEvent) SetEvent(v interface{}) {
o.Event = v
}
// GetSeq returns the Seq field value if set, zero value otherwise.
func (o *TrainEvent) GetSeq() int64 {
if o == nil || IsNil(o.Seq) {
var ret int64
return ret
}
return *o.Seq
}
// GetSeqOk returns a tuple with the Seq field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainEvent) GetSeqOk() (*int64, bool) {
if o == nil || IsNil(o.Seq) {
return nil, false
}
return o.Seq, true
}
// HasSeq returns a boolean if a field has been set.
func (o *TrainEvent) HasSeq() bool {
if o != nil && !IsNil(o.Seq) {
return true
}
return false
}
// SetSeq gets a reference to the given int64 and assigns it to the Seq field.
func (o *TrainEvent) SetSeq(v int64) {
o.Seq = &v
}
// GetTask returns the Task field value if set, zero value otherwise.
func (o *TrainEvent) GetTask() string {
if o == nil || IsNil(o.Task) {
var ret string
return ret
}
return *o.Task
}
// GetTaskOk returns a tuple with the Task field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainEvent) GetTaskOk() (*string, bool) {
if o == nil || IsNil(o.Task) {
return nil, false
}
return o.Task, true
}
// HasTask returns a boolean if a field has been set.
func (o *TrainEvent) HasTask() bool {
if o != nil && !IsNil(o.Task) {
return true
}
return false
}
// SetTask gets a reference to the given string and assigns it to the Task field.
func (o *TrainEvent) SetTask(v string) {
o.Task = &v
}
func (o TrainEvent) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TrainEvent) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.At) {
toSerialize["at"] = o.At
}
if o.Event != nil {
toSerialize["event"] = o.Event
}
if !IsNil(o.Seq) {
toSerialize["seq"] = o.Seq
}
if !IsNil(o.Task) {
toSerialize["task"] = o.Task
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TrainEvent) UnmarshalJSON(data []byte) (err error) {
varTrainEvent := _TrainEvent{}
err = json.Unmarshal(data, &varTrainEvent)
if err != nil {
return err
}
*o = TrainEvent(varTrainEvent)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "at")
delete(additionalProperties, "event")
delete(additionalProperties, "seq")
delete(additionalProperties, "task")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTrainEvent struct {
value *TrainEvent
isSet bool
}
func (v NullableTrainEvent) Get() *TrainEvent {
return v.value
}
func (v *NullableTrainEvent) Set(val *TrainEvent) {
v.value = val
v.isSet = true
}
func (v NullableTrainEvent) IsSet() bool {
return v.isSet
}
func (v *NullableTrainEvent) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTrainEvent(val *TrainEvent) *NullableTrainEvent {
return &NullableTrainEvent{value: val, isSet: true}
}
func (v NullableTrainEvent) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTrainEvent) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}