Files
openapi-go-answer/model_schema_notification_channel_config.go
2023-09-26 16:20:01 +08:00

161 lines
4.7 KiB
Go

/*
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
API version: 1.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package answer_sdk
import (
"encoding/json"
)
// checks if the SchemaNotificationChannelConfig type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &SchemaNotificationChannelConfig{}
// SchemaNotificationChannelConfig struct for SchemaNotificationChannelConfig
type SchemaNotificationChannelConfig struct {
Enable *bool `json:"enable,omitempty"`
Key *ConstantNotificationChannelKey `json:"key,omitempty"`
}
// NewSchemaNotificationChannelConfig instantiates a new SchemaNotificationChannelConfig 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 NewSchemaNotificationChannelConfig() *SchemaNotificationChannelConfig {
this := SchemaNotificationChannelConfig{}
return &this
}
// NewSchemaNotificationChannelConfigWithDefaults instantiates a new SchemaNotificationChannelConfig 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 NewSchemaNotificationChannelConfigWithDefaults() *SchemaNotificationChannelConfig {
this := SchemaNotificationChannelConfig{}
return &this
}
// GetEnable returns the Enable field value if set, zero value otherwise.
func (o *SchemaNotificationChannelConfig) GetEnable() bool {
if o == nil || IsNil(o.Enable) {
var ret bool
return ret
}
return *o.Enable
}
// GetEnableOk returns a tuple with the Enable field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SchemaNotificationChannelConfig) GetEnableOk() (*bool, bool) {
if o == nil || IsNil(o.Enable) {
return nil, false
}
return o.Enable, true
}
// HasEnable returns a boolean if a field has been set.
func (o *SchemaNotificationChannelConfig) HasEnable() bool {
if o != nil && !IsNil(o.Enable) {
return true
}
return false
}
// SetEnable gets a reference to the given bool and assigns it to the Enable field.
func (o *SchemaNotificationChannelConfig) SetEnable(v bool) {
o.Enable = &v
}
// GetKey returns the Key field value if set, zero value otherwise.
func (o *SchemaNotificationChannelConfig) GetKey() ConstantNotificationChannelKey {
if o == nil || IsNil(o.Key) {
var ret ConstantNotificationChannelKey
return ret
}
return *o.Key
}
// GetKeyOk returns a tuple with the Key field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SchemaNotificationChannelConfig) GetKeyOk() (*ConstantNotificationChannelKey, bool) {
if o == nil || IsNil(o.Key) {
return nil, false
}
return o.Key, true
}
// HasKey returns a boolean if a field has been set.
func (o *SchemaNotificationChannelConfig) HasKey() bool {
if o != nil && !IsNil(o.Key) {
return true
}
return false
}
// SetKey gets a reference to the given ConstantNotificationChannelKey and assigns it to the Key field.
func (o *SchemaNotificationChannelConfig) SetKey(v ConstantNotificationChannelKey) {
o.Key = &v
}
func (o SchemaNotificationChannelConfig) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o SchemaNotificationChannelConfig) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Enable) {
toSerialize["enable"] = o.Enable
}
if !IsNil(o.Key) {
toSerialize["key"] = o.Key
}
return toSerialize, nil
}
type NullableSchemaNotificationChannelConfig struct {
value *SchemaNotificationChannelConfig
isSet bool
}
func (v NullableSchemaNotificationChannelConfig) Get() *SchemaNotificationChannelConfig {
return v.value
}
func (v *NullableSchemaNotificationChannelConfig) Set(val *SchemaNotificationChannelConfig) {
v.value = val
v.isSet = true
}
func (v NullableSchemaNotificationChannelConfig) IsSet() bool {
return v.isSet
}
func (v *NullableSchemaNotificationChannelConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSchemaNotificationChannelConfig(val *SchemaNotificationChannelConfig) *NullableSchemaNotificationChannelConfig {
return &NullableSchemaNotificationChannelConfig{value: val, isSet: true}
}
func (v NullableSchemaNotificationChannelConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSchemaNotificationChannelConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}