Files
sdk/model_task_comment.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 TaskComment type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TaskComment{}
// TaskComment struct for TaskComment
type TaskComment struct {
// Author is who wrote it: their name, else their forge login.
Author *string `json:"author,omitempty"`
// Body is what was written, as markdown.
Body *string `json:"body,omitempty"`
// CreatedAt is when it was written, RFC 3339.
CreatedAt *string `json:"createdAt,omitempty"`
// ID is the forge's id for the comment.
Id *int64 `json:"id,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TaskComment TaskComment
// NewTaskComment instantiates a new TaskComment 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 NewTaskComment() *TaskComment {
this := TaskComment{}
return &this
}
// NewTaskCommentWithDefaults instantiates a new TaskComment 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 NewTaskCommentWithDefaults() *TaskComment {
this := TaskComment{}
return &this
}
// GetAuthor returns the Author field value if set, zero value otherwise.
func (o *TaskComment) GetAuthor() string {
if o == nil || IsNil(o.Author) {
var ret string
return ret
}
return *o.Author
}
// GetAuthorOk returns a tuple with the Author field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TaskComment) GetAuthorOk() (*string, bool) {
if o == nil || IsNil(o.Author) {
return nil, false
}
return o.Author, true
}
// HasAuthor returns a boolean if a field has been set.
func (o *TaskComment) HasAuthor() bool {
if o != nil && !IsNil(o.Author) {
return true
}
return false
}
// SetAuthor gets a reference to the given string and assigns it to the Author field.
func (o *TaskComment) SetAuthor(v string) {
o.Author = &v
}
// GetBody returns the Body field value if set, zero value otherwise.
func (o *TaskComment) GetBody() string {
if o == nil || IsNil(o.Body) {
var ret string
return ret
}
return *o.Body
}
// GetBodyOk returns a tuple with the Body field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TaskComment) GetBodyOk() (*string, bool) {
if o == nil || IsNil(o.Body) {
return nil, false
}
return o.Body, true
}
// HasBody returns a boolean if a field has been set.
func (o *TaskComment) HasBody() bool {
if o != nil && !IsNil(o.Body) {
return true
}
return false
}
// SetBody gets a reference to the given string and assigns it to the Body field.
func (o *TaskComment) SetBody(v string) {
o.Body = &v
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *TaskComment) GetCreatedAt() string {
if o == nil || IsNil(o.CreatedAt) {
var ret string
return ret
}
return *o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TaskComment) GetCreatedAtOk() (*string, bool) {
if o == nil || IsNil(o.CreatedAt) {
return nil, false
}
return o.CreatedAt, true
}
// HasCreatedAt returns a boolean if a field has been set.
func (o *TaskComment) HasCreatedAt() bool {
if o != nil && !IsNil(o.CreatedAt) {
return true
}
return false
}
// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field.
func (o *TaskComment) SetCreatedAt(v string) {
o.CreatedAt = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *TaskComment) GetId() int64 {
if o == nil || IsNil(o.Id) {
var ret int64
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 *TaskComment) GetIdOk() (*int64, 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 *TaskComment) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given int64 and assigns it to the Id field.
func (o *TaskComment) SetId(v int64) {
o.Id = &v
}
func (o TaskComment) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TaskComment) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Author) {
toSerialize["author"] = o.Author
}
if !IsNil(o.Body) {
toSerialize["body"] = o.Body
}
if !IsNil(o.CreatedAt) {
toSerialize["createdAt"] = o.CreatedAt
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TaskComment) UnmarshalJSON(data []byte) (err error) {
varTaskComment := _TaskComment{}
err = json.Unmarshal(data, &varTaskComment)
if err != nil {
return err
}
*o = TaskComment(varTaskComment)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "author")
delete(additionalProperties, "body")
delete(additionalProperties, "createdAt")
delete(additionalProperties, "id")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTaskComment struct {
value *TaskComment
isSet bool
}
func (v NullableTaskComment) Get() *TaskComment {
return v.value
}
func (v *NullableTaskComment) Set(val *TaskComment) {
v.value = val
v.isSet = true
}
func (v NullableTaskComment) IsSet() bool {
return v.isSet
}
func (v *NullableTaskComment) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTaskComment(val *TaskComment) *NullableTaskComment {
return &NullableTaskComment{value: val, isSet: true}
}
func (v NullableTaskComment) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTaskComment) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}