Files
sdk/model_train_report_in.go

269 lines
6.6 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 TrainReportIn type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TrainReportIn{}
// TrainReportIn struct for TrainReportIn
type TrainReportIn struct {
// Events are the task's new events, in order.
Events []interface{} `json:"events,omitempty"`
// ID names the job, from the path.
Id *string `json:"id,omitempty"`
// Lease is the task's lease, as the claim answered it.
Lease *string `json:"lease,omitempty"`
// Task is the reporting task.
Task *string `json:"task,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TrainReportIn TrainReportIn
// NewTrainReportIn instantiates a new TrainReportIn 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 NewTrainReportIn() *TrainReportIn {
this := TrainReportIn{}
return &this
}
// NewTrainReportInWithDefaults instantiates a new TrainReportIn 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 NewTrainReportInWithDefaults() *TrainReportIn {
this := TrainReportIn{}
return &this
}
// GetEvents returns the Events field value if set, zero value otherwise.
func (o *TrainReportIn) GetEvents() []interface{} {
if o == nil || IsNil(o.Events) {
var ret []interface{}
return ret
}
return o.Events
}
// GetEventsOk returns a tuple with the Events field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainReportIn) GetEventsOk() ([]interface{}, bool) {
if o == nil || IsNil(o.Events) {
return nil, false
}
return o.Events, true
}
// HasEvents returns a boolean if a field has been set.
func (o *TrainReportIn) HasEvents() bool {
if o != nil && !IsNil(o.Events) {
return true
}
return false
}
// SetEvents gets a reference to the given []interface{} and assigns it to the Events field.
func (o *TrainReportIn) SetEvents(v []interface{}) {
o.Events = v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *TrainReportIn) 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 *TrainReportIn) 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 *TrainReportIn) 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 *TrainReportIn) SetId(v string) {
o.Id = &v
}
// GetLease returns the Lease field value if set, zero value otherwise.
func (o *TrainReportIn) GetLease() string {
if o == nil || IsNil(o.Lease) {
var ret string
return ret
}
return *o.Lease
}
// GetLeaseOk returns a tuple with the Lease field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainReportIn) GetLeaseOk() (*string, bool) {
if o == nil || IsNil(o.Lease) {
return nil, false
}
return o.Lease, true
}
// HasLease returns a boolean if a field has been set.
func (o *TrainReportIn) HasLease() bool {
if o != nil && !IsNil(o.Lease) {
return true
}
return false
}
// SetLease gets a reference to the given string and assigns it to the Lease field.
func (o *TrainReportIn) SetLease(v string) {
o.Lease = &v
}
// GetTask returns the Task field value if set, zero value otherwise.
func (o *TrainReportIn) 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 *TrainReportIn) 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 *TrainReportIn) 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 *TrainReportIn) SetTask(v string) {
o.Task = &v
}
func (o TrainReportIn) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TrainReportIn) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Events) {
toSerialize["events"] = o.Events
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Lease) {
toSerialize["lease"] = o.Lease
}
if !IsNil(o.Task) {
toSerialize["task"] = o.Task
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TrainReportIn) UnmarshalJSON(data []byte) (err error) {
varTrainReportIn := _TrainReportIn{}
err = json.Unmarshal(data, &varTrainReportIn)
if err != nil {
return err
}
*o = TrainReportIn(varTrainReportIn)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "events")
delete(additionalProperties, "id")
delete(additionalProperties, "lease")
delete(additionalProperties, "task")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTrainReportIn struct {
value *TrainReportIn
isSet bool
}
func (v NullableTrainReportIn) Get() *TrainReportIn {
return v.value
}
func (v *NullableTrainReportIn) Set(val *TrainReportIn) {
v.value = val
v.isSet = true
}
func (v NullableTrainReportIn) IsSet() bool {
return v.isSet
}
func (v *NullableTrainReportIn) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTrainReportIn(val *TrainReportIn) *NullableTrainReportIn {
return &NullableTrainReportIn{value: val, isSet: true}
}
func (v NullableTrainReportIn) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTrainReportIn) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}