Files
sdk/model_task_channel_work.go

307 lines
8.5 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 TaskChannelWork type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TaskChannelWork{}
// TaskChannelWork struct for TaskChannelWork
type TaskChannelWork struct {
// Channel is the channel these counts are for, echoed back as it was resolved.
Channel *string `json:"channel,omitempty"`
// Open is how many items are still work: everything whose status does not end it. It is the number a channel header shows.
Open *int64 `json:"open,omitempty"`
// Status is the count per board column, carrying EVERY column this surface knows — an empty column reads 0 rather than being absent, so a caller can render the board without inventing the vocabulary. The keys are the same closed set every other operation here validates against.
Status map[string]int64 `json:"status,omitempty"`
// Total is every item bound to this channel, settled ones included, so Total minus Open is what the channel has finished.
Total *int64 `json:"total,omitempty"`
// Updated is when anything in this channel's work last moved, in unix seconds. ABSENT when the channel has no work at all: zero would read as the epoch, and a channel nobody has filed anything in has no last activity rather than an infinitely old one. Total is 0 in exactly that case.
Updated *int64 `json:"updated,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TaskChannelWork TaskChannelWork
// NewTaskChannelWork instantiates a new TaskChannelWork 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 NewTaskChannelWork() *TaskChannelWork {
this := TaskChannelWork{}
return &this
}
// NewTaskChannelWorkWithDefaults instantiates a new TaskChannelWork 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 NewTaskChannelWorkWithDefaults() *TaskChannelWork {
this := TaskChannelWork{}
return &this
}
// GetChannel returns the Channel field value if set, zero value otherwise.
func (o *TaskChannelWork) GetChannel() string {
if o == nil || IsNil(o.Channel) {
var ret string
return ret
}
return *o.Channel
}
// GetChannelOk returns a tuple with the Channel field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TaskChannelWork) GetChannelOk() (*string, bool) {
if o == nil || IsNil(o.Channel) {
return nil, false
}
return o.Channel, true
}
// HasChannel returns a boolean if a field has been set.
func (o *TaskChannelWork) HasChannel() bool {
if o != nil && !IsNil(o.Channel) {
return true
}
return false
}
// SetChannel gets a reference to the given string and assigns it to the Channel field.
func (o *TaskChannelWork) SetChannel(v string) {
o.Channel = &v
}
// GetOpen returns the Open field value if set, zero value otherwise.
func (o *TaskChannelWork) GetOpen() int64 {
if o == nil || IsNil(o.Open) {
var ret int64
return ret
}
return *o.Open
}
// GetOpenOk returns a tuple with the Open field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TaskChannelWork) GetOpenOk() (*int64, bool) {
if o == nil || IsNil(o.Open) {
return nil, false
}
return o.Open, true
}
// HasOpen returns a boolean if a field has been set.
func (o *TaskChannelWork) HasOpen() bool {
if o != nil && !IsNil(o.Open) {
return true
}
return false
}
// SetOpen gets a reference to the given int64 and assigns it to the Open field.
func (o *TaskChannelWork) SetOpen(v int64) {
o.Open = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *TaskChannelWork) GetStatus() map[string]int64 {
if o == nil || IsNil(o.Status) {
var ret map[string]int64
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 *TaskChannelWork) GetStatusOk() (map[string]int64, bool) {
if o == nil || IsNil(o.Status) {
return map[string]int64{}, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *TaskChannelWork) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given map[string]int64 and assigns it to the Status field.
func (o *TaskChannelWork) SetStatus(v map[string]int64) {
o.Status = v
}
// GetTotal returns the Total field value if set, zero value otherwise.
func (o *TaskChannelWork) GetTotal() int64 {
if o == nil || IsNil(o.Total) {
var ret int64
return ret
}
return *o.Total
}
// GetTotalOk returns a tuple with the Total field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TaskChannelWork) GetTotalOk() (*int64, bool) {
if o == nil || IsNil(o.Total) {
return nil, false
}
return o.Total, true
}
// HasTotal returns a boolean if a field has been set.
func (o *TaskChannelWork) HasTotal() bool {
if o != nil && !IsNil(o.Total) {
return true
}
return false
}
// SetTotal gets a reference to the given int64 and assigns it to the Total field.
func (o *TaskChannelWork) SetTotal(v int64) {
o.Total = &v
}
// GetUpdated returns the Updated field value if set, zero value otherwise.
func (o *TaskChannelWork) GetUpdated() int64 {
if o == nil || IsNil(o.Updated) {
var ret int64
return ret
}
return *o.Updated
}
// GetUpdatedOk returns a tuple with the Updated field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TaskChannelWork) GetUpdatedOk() (*int64, bool) {
if o == nil || IsNil(o.Updated) {
return nil, false
}
return o.Updated, true
}
// HasUpdated returns a boolean if a field has been set.
func (o *TaskChannelWork) HasUpdated() bool {
if o != nil && !IsNil(o.Updated) {
return true
}
return false
}
// SetUpdated gets a reference to the given int64 and assigns it to the Updated field.
func (o *TaskChannelWork) SetUpdated(v int64) {
o.Updated = &v
}
func (o TaskChannelWork) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TaskChannelWork) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Channel) {
toSerialize["channel"] = o.Channel
}
if !IsNil(o.Open) {
toSerialize["open"] = o.Open
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.Total) {
toSerialize["total"] = o.Total
}
if !IsNil(o.Updated) {
toSerialize["updated"] = o.Updated
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TaskChannelWork) UnmarshalJSON(data []byte) (err error) {
varTaskChannelWork := _TaskChannelWork{}
err = json.Unmarshal(data, &varTaskChannelWork)
if err != nil {
return err
}
*o = TaskChannelWork(varTaskChannelWork)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "channel")
delete(additionalProperties, "open")
delete(additionalProperties, "status")
delete(additionalProperties, "total")
delete(additionalProperties, "updated")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTaskChannelWork struct {
value *TaskChannelWork
isSet bool
}
func (v NullableTaskChannelWork) Get() *TaskChannelWork {
return v.value
}
func (v *NullableTaskChannelWork) Set(val *TaskChannelWork) {
v.value = val
v.isSet = true
}
func (v NullableTaskChannelWork) IsSet() bool {
return v.isSet
}
func (v *NullableTaskChannelWork) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTaskChannelWork(val *TaskChannelWork) *NullableTaskChannelWork {
return &NullableTaskChannelWork{value: val, isSet: true}
}
func (v NullableTaskChannelWork) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTaskChannelWork) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}