model_action_slack_destination.go•4.77 kB
/*
Metoro API
API for managing Metoro environments, alerts, and dashboards.
API version: 1.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package model
import (
"encoding/json"
)
// checks if the ActionSlackDestination type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ActionSlackDestination{}
// ActionSlackDestination struct for ActionSlackDestination
type ActionSlackDestination struct {
// Slack channel to send alert to
Channel *string `json:"channel,omitempty"`
// Whether to notify the channel when the alert is resolved
NotifyOnResolve *bool `json:"notifyOnResolve,omitempty"`
}
// NewActionSlackDestination instantiates a new ActionSlackDestination 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 NewActionSlackDestination() *ActionSlackDestination {
this := ActionSlackDestination{}
var notifyOnResolve bool = false
this.NotifyOnResolve = ¬ifyOnResolve
return &this
}
// NewActionSlackDestinationWithDefaults instantiates a new ActionSlackDestination 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 NewActionSlackDestinationWithDefaults() *ActionSlackDestination {
this := ActionSlackDestination{}
var notifyOnResolve bool = false
this.NotifyOnResolve = ¬ifyOnResolve
return &this
}
// GetChannel returns the Channel field value if set, zero value otherwise.
func (o *ActionSlackDestination) 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 *ActionSlackDestination) 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 *ActionSlackDestination) 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 *ActionSlackDestination) SetChannel(v string) {
o.Channel = &v
}
// GetNotifyOnResolve returns the NotifyOnResolve field value if set, zero value otherwise.
func (o *ActionSlackDestination) GetNotifyOnResolve() bool {
if o == nil || IsNil(o.NotifyOnResolve) {
var ret bool
return ret
}
return *o.NotifyOnResolve
}
// GetNotifyOnResolveOk returns a tuple with the NotifyOnResolve field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ActionSlackDestination) GetNotifyOnResolveOk() (*bool, bool) {
if o == nil || IsNil(o.NotifyOnResolve) {
return nil, false
}
return o.NotifyOnResolve, true
}
// HasNotifyOnResolve returns a boolean if a field has been set.
func (o *ActionSlackDestination) HasNotifyOnResolve() bool {
if o != nil && !IsNil(o.NotifyOnResolve) {
return true
}
return false
}
// SetNotifyOnResolve gets a reference to the given bool and assigns it to the NotifyOnResolve field.
func (o *ActionSlackDestination) SetNotifyOnResolve(v bool) {
o.NotifyOnResolve = &v
}
func (o ActionSlackDestination) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ActionSlackDestination) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Channel) {
toSerialize["channel"] = o.Channel
}
if !IsNil(o.NotifyOnResolve) {
toSerialize["notifyOnResolve"] = o.NotifyOnResolve
}
return toSerialize, nil
}
type NullableActionSlackDestination struct {
value *ActionSlackDestination
isSet bool
}
func (v NullableActionSlackDestination) Get() *ActionSlackDestination {
return v.value
}
func (v *NullableActionSlackDestination) Set(val *ActionSlackDestination) {
v.value = val
v.isSet = true
}
func (v NullableActionSlackDestination) IsSet() bool {
return v.isSet
}
func (v *NullableActionSlackDestination) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableActionSlackDestination(val *ActionSlackDestination) *NullableActionSlackDestination {
return &NullableActionSlackDestination{value: val, isSet: true}
}
func (v NullableActionSlackDestination) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableActionSlackDestination) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}