Files
sdk/model_o11y_threading_config.go

191 lines
5.1 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 O11yThreadingConfig type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &O11yThreadingConfig{}
// O11yThreadingConfig struct for O11yThreadingConfig
type O11yThreadingConfig struct {
Enabled *bool `json:"enabled,omitempty"`
ThreadByDate *string `json:"thread_by_date,omitempty"`
AdditionalProperties map[string]interface{}
}
type _O11yThreadingConfig O11yThreadingConfig
// NewO11yThreadingConfig instantiates a new O11yThreadingConfig 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 NewO11yThreadingConfig() *O11yThreadingConfig {
this := O11yThreadingConfig{}
return &this
}
// NewO11yThreadingConfigWithDefaults instantiates a new O11yThreadingConfig 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 NewO11yThreadingConfigWithDefaults() *O11yThreadingConfig {
this := O11yThreadingConfig{}
return &this
}
// GetEnabled returns the Enabled field value if set, zero value otherwise.
func (o *O11yThreadingConfig) GetEnabled() bool {
if o == nil || IsNil(o.Enabled) {
var ret bool
return ret
}
return *o.Enabled
}
// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yThreadingConfig) GetEnabledOk() (*bool, bool) {
if o == nil || IsNil(o.Enabled) {
return nil, false
}
return o.Enabled, true
}
// HasEnabled returns a boolean if a field has been set.
func (o *O11yThreadingConfig) HasEnabled() bool {
if o != nil && !IsNil(o.Enabled) {
return true
}
return false
}
// SetEnabled gets a reference to the given bool and assigns it to the Enabled field.
func (o *O11yThreadingConfig) SetEnabled(v bool) {
o.Enabled = &v
}
// GetThreadByDate returns the ThreadByDate field value if set, zero value otherwise.
func (o *O11yThreadingConfig) GetThreadByDate() string {
if o == nil || IsNil(o.ThreadByDate) {
var ret string
return ret
}
return *o.ThreadByDate
}
// GetThreadByDateOk returns a tuple with the ThreadByDate field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yThreadingConfig) GetThreadByDateOk() (*string, bool) {
if o == nil || IsNil(o.ThreadByDate) {
return nil, false
}
return o.ThreadByDate, true
}
// HasThreadByDate returns a boolean if a field has been set.
func (o *O11yThreadingConfig) HasThreadByDate() bool {
if o != nil && !IsNil(o.ThreadByDate) {
return true
}
return false
}
// SetThreadByDate gets a reference to the given string and assigns it to the ThreadByDate field.
func (o *O11yThreadingConfig) SetThreadByDate(v string) {
o.ThreadByDate = &v
}
func (o O11yThreadingConfig) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o O11yThreadingConfig) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Enabled) {
toSerialize["enabled"] = o.Enabled
}
if !IsNil(o.ThreadByDate) {
toSerialize["thread_by_date"] = o.ThreadByDate
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *O11yThreadingConfig) UnmarshalJSON(data []byte) (err error) {
varO11yThreadingConfig := _O11yThreadingConfig{}
err = json.Unmarshal(data, &varO11yThreadingConfig)
if err != nil {
return err
}
*o = O11yThreadingConfig(varO11yThreadingConfig)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "enabled")
delete(additionalProperties, "thread_by_date")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableO11yThreadingConfig struct {
value *O11yThreadingConfig
isSet bool
}
func (v NullableO11yThreadingConfig) Get() *O11yThreadingConfig {
return v.value
}
func (v *NullableO11yThreadingConfig) Set(val *O11yThreadingConfig) {
v.value = val
v.isSet = true
}
func (v NullableO11yThreadingConfig) IsSet() bool {
return v.isSet
}
func (v *NullableO11yThreadingConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableO11yThreadingConfig(val *O11yThreadingConfig) *NullableO11yThreadingConfig {
return &NullableO11yThreadingConfig{value: val, isSet: true}
}
func (v NullableO11yThreadingConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableO11yThreadingConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}