Files
sdk/model_provider_slack_message.go

421 lines
11 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 ProviderSlackMessage type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ProviderSlackMessage{}
// ProviderSlackMessage struct for ProviderSlackMessage
type ProviderSlackMessage struct {
// BotID identifies a bot author when present.
BotId *string `json:"bot_id,omitempty"`
// Files are the files attached to this message. Read one's bytes with GET /v1/provider/slack/file?id=<id>; nothing here is the content.
Files []ProviderSlackFile `json:"files,omitempty"`
// ReplyCount indicates whether a parent has replies to fetch separately.
ReplyCount *int64 `json:"reply_count,omitempty"`
// Subtype distinguishes messages from channel events.
Subtype *string `json:"subtype,omitempty"`
// Text is the message in Slack's formatting.
Text *string `json:"text,omitempty"`
// ThreadTS is the parent timestamp for a threaded message.
ThreadTs *string `json:"thread_ts,omitempty"`
// TS is Slack's exact message timestamp and ID; retain it as a string.
Ts *string `json:"ts,omitempty"`
// User is the author's Slack user ID.
User *string `json:"user,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ProviderSlackMessage ProviderSlackMessage
// NewProviderSlackMessage instantiates a new ProviderSlackMessage 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 NewProviderSlackMessage() *ProviderSlackMessage {
this := ProviderSlackMessage{}
return &this
}
// NewProviderSlackMessageWithDefaults instantiates a new ProviderSlackMessage 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 NewProviderSlackMessageWithDefaults() *ProviderSlackMessage {
this := ProviderSlackMessage{}
return &this
}
// GetBotId returns the BotId field value if set, zero value otherwise.
func (o *ProviderSlackMessage) GetBotId() string {
if o == nil || IsNil(o.BotId) {
var ret string
return ret
}
return *o.BotId
}
// GetBotIdOk returns a tuple with the BotId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderSlackMessage) GetBotIdOk() (*string, bool) {
if o == nil || IsNil(o.BotId) {
return nil, false
}
return o.BotId, true
}
// HasBotId returns a boolean if a field has been set.
func (o *ProviderSlackMessage) HasBotId() bool {
if o != nil && !IsNil(o.BotId) {
return true
}
return false
}
// SetBotId gets a reference to the given string and assigns it to the BotId field.
func (o *ProviderSlackMessage) SetBotId(v string) {
o.BotId = &v
}
// GetFiles returns the Files field value if set, zero value otherwise.
func (o *ProviderSlackMessage) GetFiles() []ProviderSlackFile {
if o == nil || IsNil(o.Files) {
var ret []ProviderSlackFile
return ret
}
return o.Files
}
// GetFilesOk returns a tuple with the Files field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderSlackMessage) GetFilesOk() ([]ProviderSlackFile, bool) {
if o == nil || IsNil(o.Files) {
return nil, false
}
return o.Files, true
}
// HasFiles returns a boolean if a field has been set.
func (o *ProviderSlackMessage) HasFiles() bool {
if o != nil && !IsNil(o.Files) {
return true
}
return false
}
// SetFiles gets a reference to the given []ProviderSlackFile and assigns it to the Files field.
func (o *ProviderSlackMessage) SetFiles(v []ProviderSlackFile) {
o.Files = v
}
// GetReplyCount returns the ReplyCount field value if set, zero value otherwise.
func (o *ProviderSlackMessage) GetReplyCount() int64 {
if o == nil || IsNil(o.ReplyCount) {
var ret int64
return ret
}
return *o.ReplyCount
}
// GetReplyCountOk returns a tuple with the ReplyCount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderSlackMessage) GetReplyCountOk() (*int64, bool) {
if o == nil || IsNil(o.ReplyCount) {
return nil, false
}
return o.ReplyCount, true
}
// HasReplyCount returns a boolean if a field has been set.
func (o *ProviderSlackMessage) HasReplyCount() bool {
if o != nil && !IsNil(o.ReplyCount) {
return true
}
return false
}
// SetReplyCount gets a reference to the given int64 and assigns it to the ReplyCount field.
func (o *ProviderSlackMessage) SetReplyCount(v int64) {
o.ReplyCount = &v
}
// GetSubtype returns the Subtype field value if set, zero value otherwise.
func (o *ProviderSlackMessage) GetSubtype() string {
if o == nil || IsNil(o.Subtype) {
var ret string
return ret
}
return *o.Subtype
}
// GetSubtypeOk returns a tuple with the Subtype field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderSlackMessage) GetSubtypeOk() (*string, bool) {
if o == nil || IsNil(o.Subtype) {
return nil, false
}
return o.Subtype, true
}
// HasSubtype returns a boolean if a field has been set.
func (o *ProviderSlackMessage) HasSubtype() bool {
if o != nil && !IsNil(o.Subtype) {
return true
}
return false
}
// SetSubtype gets a reference to the given string and assigns it to the Subtype field.
func (o *ProviderSlackMessage) SetSubtype(v string) {
o.Subtype = &v
}
// GetText returns the Text field value if set, zero value otherwise.
func (o *ProviderSlackMessage) GetText() string {
if o == nil || IsNil(o.Text) {
var ret string
return ret
}
return *o.Text
}
// GetTextOk returns a tuple with the Text field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderSlackMessage) GetTextOk() (*string, bool) {
if o == nil || IsNil(o.Text) {
return nil, false
}
return o.Text, true
}
// HasText returns a boolean if a field has been set.
func (o *ProviderSlackMessage) HasText() bool {
if o != nil && !IsNil(o.Text) {
return true
}
return false
}
// SetText gets a reference to the given string and assigns it to the Text field.
func (o *ProviderSlackMessage) SetText(v string) {
o.Text = &v
}
// GetThreadTs returns the ThreadTs field value if set, zero value otherwise.
func (o *ProviderSlackMessage) GetThreadTs() string {
if o == nil || IsNil(o.ThreadTs) {
var ret string
return ret
}
return *o.ThreadTs
}
// GetThreadTsOk returns a tuple with the ThreadTs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderSlackMessage) GetThreadTsOk() (*string, bool) {
if o == nil || IsNil(o.ThreadTs) {
return nil, false
}
return o.ThreadTs, true
}
// HasThreadTs returns a boolean if a field has been set.
func (o *ProviderSlackMessage) HasThreadTs() bool {
if o != nil && !IsNil(o.ThreadTs) {
return true
}
return false
}
// SetThreadTs gets a reference to the given string and assigns it to the ThreadTs field.
func (o *ProviderSlackMessage) SetThreadTs(v string) {
o.ThreadTs = &v
}
// GetTs returns the Ts field value if set, zero value otherwise.
func (o *ProviderSlackMessage) GetTs() string {
if o == nil || IsNil(o.Ts) {
var ret string
return ret
}
return *o.Ts
}
// GetTsOk returns a tuple with the Ts field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderSlackMessage) GetTsOk() (*string, bool) {
if o == nil || IsNil(o.Ts) {
return nil, false
}
return o.Ts, true
}
// HasTs returns a boolean if a field has been set.
func (o *ProviderSlackMessage) HasTs() bool {
if o != nil && !IsNil(o.Ts) {
return true
}
return false
}
// SetTs gets a reference to the given string and assigns it to the Ts field.
func (o *ProviderSlackMessage) SetTs(v string) {
o.Ts = &v
}
// GetUser returns the User field value if set, zero value otherwise.
func (o *ProviderSlackMessage) GetUser() string {
if o == nil || IsNil(o.User) {
var ret string
return ret
}
return *o.User
}
// GetUserOk returns a tuple with the User field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderSlackMessage) GetUserOk() (*string, bool) {
if o == nil || IsNil(o.User) {
return nil, false
}
return o.User, true
}
// HasUser returns a boolean if a field has been set.
func (o *ProviderSlackMessage) HasUser() bool {
if o != nil && !IsNil(o.User) {
return true
}
return false
}
// SetUser gets a reference to the given string and assigns it to the User field.
func (o *ProviderSlackMessage) SetUser(v string) {
o.User = &v
}
func (o ProviderSlackMessage) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ProviderSlackMessage) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.BotId) {
toSerialize["bot_id"] = o.BotId
}
if !IsNil(o.Files) {
toSerialize["files"] = o.Files
}
if !IsNil(o.ReplyCount) {
toSerialize["reply_count"] = o.ReplyCount
}
if !IsNil(o.Subtype) {
toSerialize["subtype"] = o.Subtype
}
if !IsNil(o.Text) {
toSerialize["text"] = o.Text
}
if !IsNil(o.ThreadTs) {
toSerialize["thread_ts"] = o.ThreadTs
}
if !IsNil(o.Ts) {
toSerialize["ts"] = o.Ts
}
if !IsNil(o.User) {
toSerialize["user"] = o.User
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ProviderSlackMessage) UnmarshalJSON(data []byte) (err error) {
varProviderSlackMessage := _ProviderSlackMessage{}
err = json.Unmarshal(data, &varProviderSlackMessage)
if err != nil {
return err
}
*o = ProviderSlackMessage(varProviderSlackMessage)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "bot_id")
delete(additionalProperties, "files")
delete(additionalProperties, "reply_count")
delete(additionalProperties, "subtype")
delete(additionalProperties, "text")
delete(additionalProperties, "thread_ts")
delete(additionalProperties, "ts")
delete(additionalProperties, "user")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableProviderSlackMessage struct {
value *ProviderSlackMessage
isSet bool
}
func (v NullableProviderSlackMessage) Get() *ProviderSlackMessage {
return v.value
}
func (v *NullableProviderSlackMessage) Set(val *ProviderSlackMessage) {
v.value = val
v.isSet = true
}
func (v NullableProviderSlackMessage) IsSet() bool {
return v.isSet
}
func (v *NullableProviderSlackMessage) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableProviderSlackMessage(val *ProviderSlackMessage) *NullableProviderSlackMessage {
return &NullableProviderSlackMessage{value: val, isSet: true}
}
func (v NullableProviderSlackMessage) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableProviderSlackMessage) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}