Files
sdk/model_provider_slack_send_message_in.go

231 lines
6.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 ProviderSlackSendMessageIn type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ProviderSlackSendMessageIn{}
// ProviderSlackSendMessageIn struct for ProviderSlackSendMessageIn
type ProviderSlackSendMessageIn struct {
// Channel is a Slack channel ID, name (#hanzo-gtm), or Slack channel mention.
Channel *string `json:"channel,omitempty"`
// Text is the message to post as Hanzo, up to 40000 characters.
Text *string `json:"text,omitempty"`
// ThreadTS optionally replies under this parent message's exact ts.
ThreadTs *string `json:"thread_ts,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ProviderSlackSendMessageIn ProviderSlackSendMessageIn
// NewProviderSlackSendMessageIn instantiates a new ProviderSlackSendMessageIn 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 NewProviderSlackSendMessageIn() *ProviderSlackSendMessageIn {
this := ProviderSlackSendMessageIn{}
return &this
}
// NewProviderSlackSendMessageInWithDefaults instantiates a new ProviderSlackSendMessageIn 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 NewProviderSlackSendMessageInWithDefaults() *ProviderSlackSendMessageIn {
this := ProviderSlackSendMessageIn{}
return &this
}
// GetChannel returns the Channel field value if set, zero value otherwise.
func (o *ProviderSlackSendMessageIn) 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 *ProviderSlackSendMessageIn) 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 *ProviderSlackSendMessageIn) 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 *ProviderSlackSendMessageIn) SetChannel(v string) {
o.Channel = &v
}
// GetText returns the Text field value if set, zero value otherwise.
func (o *ProviderSlackSendMessageIn) 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 *ProviderSlackSendMessageIn) 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 *ProviderSlackSendMessageIn) 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 *ProviderSlackSendMessageIn) SetText(v string) {
o.Text = &v
}
// GetThreadTs returns the ThreadTs field value if set, zero value otherwise.
func (o *ProviderSlackSendMessageIn) 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 *ProviderSlackSendMessageIn) 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 *ProviderSlackSendMessageIn) 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 *ProviderSlackSendMessageIn) SetThreadTs(v string) {
o.ThreadTs = &v
}
func (o ProviderSlackSendMessageIn) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ProviderSlackSendMessageIn) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Channel) {
toSerialize["channel"] = o.Channel
}
if !IsNil(o.Text) {
toSerialize["text"] = o.Text
}
if !IsNil(o.ThreadTs) {
toSerialize["thread_ts"] = o.ThreadTs
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ProviderSlackSendMessageIn) UnmarshalJSON(data []byte) (err error) {
varProviderSlackSendMessageIn := _ProviderSlackSendMessageIn{}
err = json.Unmarshal(data, &varProviderSlackSendMessageIn)
if err != nil {
return err
}
*o = ProviderSlackSendMessageIn(varProviderSlackSendMessageIn)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "channel")
delete(additionalProperties, "text")
delete(additionalProperties, "thread_ts")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableProviderSlackSendMessageIn struct {
value *ProviderSlackSendMessageIn
isSet bool
}
func (v NullableProviderSlackSendMessageIn) Get() *ProviderSlackSendMessageIn {
return v.value
}
func (v *NullableProviderSlackSendMessageIn) Set(val *ProviderSlackSendMessageIn) {
v.value = val
v.isSet = true
}
func (v NullableProviderSlackSendMessageIn) IsSet() bool {
return v.isSet
}
func (v *NullableProviderSlackSendMessageIn) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableProviderSlackSendMessageIn(val *ProviderSlackSendMessageIn) *NullableProviderSlackSendMessageIn {
return &NullableProviderSlackSendMessageIn{value: val, isSet: true}
}
func (v NullableProviderSlackSendMessageIn) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableProviderSlackSendMessageIn) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}