Files
sdk/model_index_index_task.go

345 lines
8.9 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 IndexIndexTask type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IndexIndexTask{}
// IndexIndexTask struct for IndexIndexTask
type IndexIndexTask struct {
// EnqueuedAt, StartedAt and FinishedAt are the same instant: the write was applied before its task id was minted.
EnqueuedAt *string `json:"enqueuedAt,omitempty"`
// FinishedAt is when the write completed.
FinishedAt *string `json:"finishedAt,omitempty"`
// StartedAt is when the write began.
StartedAt *string `json:"startedAt,omitempty"`
// Status is always `succeeded`.
Status *string `json:"status,omitempty"`
// Type names the kind of write, for a client that inspects it.
Type *string `json:"type,omitempty"`
// UID echoes the task id that was asked about.
Uid *int64 `json:"uid,omitempty"`
AdditionalProperties map[string]interface{}
}
type _IndexIndexTask IndexIndexTask
// NewIndexIndexTask instantiates a new IndexIndexTask 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 NewIndexIndexTask() *IndexIndexTask {
this := IndexIndexTask{}
return &this
}
// NewIndexIndexTaskWithDefaults instantiates a new IndexIndexTask 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 NewIndexIndexTaskWithDefaults() *IndexIndexTask {
this := IndexIndexTask{}
return &this
}
// GetEnqueuedAt returns the EnqueuedAt field value if set, zero value otherwise.
func (o *IndexIndexTask) GetEnqueuedAt() string {
if o == nil || IsNil(o.EnqueuedAt) {
var ret string
return ret
}
return *o.EnqueuedAt
}
// GetEnqueuedAtOk returns a tuple with the EnqueuedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IndexIndexTask) GetEnqueuedAtOk() (*string, bool) {
if o == nil || IsNil(o.EnqueuedAt) {
return nil, false
}
return o.EnqueuedAt, true
}
// HasEnqueuedAt returns a boolean if a field has been set.
func (o *IndexIndexTask) HasEnqueuedAt() bool {
if o != nil && !IsNil(o.EnqueuedAt) {
return true
}
return false
}
// SetEnqueuedAt gets a reference to the given string and assigns it to the EnqueuedAt field.
func (o *IndexIndexTask) SetEnqueuedAt(v string) {
o.EnqueuedAt = &v
}
// GetFinishedAt returns the FinishedAt field value if set, zero value otherwise.
func (o *IndexIndexTask) GetFinishedAt() string {
if o == nil || IsNil(o.FinishedAt) {
var ret string
return ret
}
return *o.FinishedAt
}
// GetFinishedAtOk returns a tuple with the FinishedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IndexIndexTask) GetFinishedAtOk() (*string, bool) {
if o == nil || IsNil(o.FinishedAt) {
return nil, false
}
return o.FinishedAt, true
}
// HasFinishedAt returns a boolean if a field has been set.
func (o *IndexIndexTask) HasFinishedAt() bool {
if o != nil && !IsNil(o.FinishedAt) {
return true
}
return false
}
// SetFinishedAt gets a reference to the given string and assigns it to the FinishedAt field.
func (o *IndexIndexTask) SetFinishedAt(v string) {
o.FinishedAt = &v
}
// GetStartedAt returns the StartedAt field value if set, zero value otherwise.
func (o *IndexIndexTask) 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 *IndexIndexTask) 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 *IndexIndexTask) 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 *IndexIndexTask) SetStartedAt(v string) {
o.StartedAt = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *IndexIndexTask) 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 *IndexIndexTask) 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 *IndexIndexTask) 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 *IndexIndexTask) SetStatus(v string) {
o.Status = &v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *IndexIndexTask) GetType() string {
if o == nil || IsNil(o.Type) {
var ret string
return ret
}
return *o.Type
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IndexIndexTask) GetTypeOk() (*string, bool) {
if o == nil || IsNil(o.Type) {
return nil, false
}
return o.Type, true
}
// HasType returns a boolean if a field has been set.
func (o *IndexIndexTask) HasType() bool {
if o != nil && !IsNil(o.Type) {
return true
}
return false
}
// SetType gets a reference to the given string and assigns it to the Type field.
func (o *IndexIndexTask) SetType(v string) {
o.Type = &v
}
// GetUid returns the Uid field value if set, zero value otherwise.
func (o *IndexIndexTask) GetUid() int64 {
if o == nil || IsNil(o.Uid) {
var ret int64
return ret
}
return *o.Uid
}
// GetUidOk returns a tuple with the Uid field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IndexIndexTask) GetUidOk() (*int64, bool) {
if o == nil || IsNil(o.Uid) {
return nil, false
}
return o.Uid, true
}
// HasUid returns a boolean if a field has been set.
func (o *IndexIndexTask) HasUid() bool {
if o != nil && !IsNil(o.Uid) {
return true
}
return false
}
// SetUid gets a reference to the given int64 and assigns it to the Uid field.
func (o *IndexIndexTask) SetUid(v int64) {
o.Uid = &v
}
func (o IndexIndexTask) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IndexIndexTask) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.EnqueuedAt) {
toSerialize["enqueuedAt"] = o.EnqueuedAt
}
if !IsNil(o.FinishedAt) {
toSerialize["finishedAt"] = o.FinishedAt
}
if !IsNil(o.StartedAt) {
toSerialize["startedAt"] = o.StartedAt
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
if !IsNil(o.Uid) {
toSerialize["uid"] = o.Uid
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IndexIndexTask) UnmarshalJSON(data []byte) (err error) {
varIndexIndexTask := _IndexIndexTask{}
err = json.Unmarshal(data, &varIndexIndexTask)
if err != nil {
return err
}
*o = IndexIndexTask(varIndexIndexTask)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "enqueuedAt")
delete(additionalProperties, "finishedAt")
delete(additionalProperties, "startedAt")
delete(additionalProperties, "status")
delete(additionalProperties, "type")
delete(additionalProperties, "uid")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIndexIndexTask struct {
value *IndexIndexTask
isSet bool
}
func (v NullableIndexIndexTask) Get() *IndexIndexTask {
return v.value
}
func (v *NullableIndexIndexTask) Set(val *IndexIndexTask) {
v.value = val
v.isSet = true
}
func (v NullableIndexIndexTask) IsSet() bool {
return v.isSet
}
func (v *NullableIndexIndexTask) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableIndexIndexTask(val *IndexIndexTask) *NullableIndexIndexTask {
return &NullableIndexIndexTask{value: val, isSet: true}
}
func (v NullableIndexIndexTask) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableIndexIndexTask) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}