Files
sdk/model_openai_hate.go

191 lines
4.7 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 OpenaiHate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &OpenaiHate{}
// OpenaiHate struct for OpenaiHate
type OpenaiHate struct {
Filtered *bool `json:"filtered,omitempty"`
Severity *string `json:"severity,omitempty"`
AdditionalProperties map[string]interface{}
}
type _OpenaiHate OpenaiHate
// NewOpenaiHate instantiates a new OpenaiHate 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 NewOpenaiHate() *OpenaiHate {
this := OpenaiHate{}
return &this
}
// NewOpenaiHateWithDefaults instantiates a new OpenaiHate 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 NewOpenaiHateWithDefaults() *OpenaiHate {
this := OpenaiHate{}
return &this
}
// GetFiltered returns the Filtered field value if set, zero value otherwise.
func (o *OpenaiHate) GetFiltered() bool {
if o == nil || IsNil(o.Filtered) {
var ret bool
return ret
}
return *o.Filtered
}
// GetFilteredOk returns a tuple with the Filtered field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiHate) GetFilteredOk() (*bool, bool) {
if o == nil || IsNil(o.Filtered) {
return nil, false
}
return o.Filtered, true
}
// HasFiltered returns a boolean if a field has been set.
func (o *OpenaiHate) HasFiltered() bool {
if o != nil && !IsNil(o.Filtered) {
return true
}
return false
}
// SetFiltered gets a reference to the given bool and assigns it to the Filtered field.
func (o *OpenaiHate) SetFiltered(v bool) {
o.Filtered = &v
}
// GetSeverity returns the Severity field value if set, zero value otherwise.
func (o *OpenaiHate) GetSeverity() string {
if o == nil || IsNil(o.Severity) {
var ret string
return ret
}
return *o.Severity
}
// GetSeverityOk returns a tuple with the Severity field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiHate) GetSeverityOk() (*string, bool) {
if o == nil || IsNil(o.Severity) {
return nil, false
}
return o.Severity, true
}
// HasSeverity returns a boolean if a field has been set.
func (o *OpenaiHate) HasSeverity() bool {
if o != nil && !IsNil(o.Severity) {
return true
}
return false
}
// SetSeverity gets a reference to the given string and assigns it to the Severity field.
func (o *OpenaiHate) SetSeverity(v string) {
o.Severity = &v
}
func (o OpenaiHate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o OpenaiHate) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Filtered) {
toSerialize["filtered"] = o.Filtered
}
if !IsNil(o.Severity) {
toSerialize["severity"] = o.Severity
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *OpenaiHate) UnmarshalJSON(data []byte) (err error) {
varOpenaiHate := _OpenaiHate{}
err = json.Unmarshal(data, &varOpenaiHate)
if err != nil {
return err
}
*o = OpenaiHate(varOpenaiHate)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "filtered")
delete(additionalProperties, "severity")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableOpenaiHate struct {
value *OpenaiHate
isSet bool
}
func (v NullableOpenaiHate) Get() *OpenaiHate {
return v.value
}
func (v *NullableOpenaiHate) Set(val *OpenaiHate) {
v.value = val
v.isSet = true
}
func (v NullableOpenaiHate) IsSet() bool {
return v.isSet
}
func (v *NullableOpenaiHate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableOpenaiHate(val *OpenaiHate) *NullableOpenaiHate {
return &NullableOpenaiHate{value: val, isSet: true}
}
func (v NullableOpenaiHate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableOpenaiHate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}