Files
sdk/model_openai_self_harm.go

191 lines
4.8 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 OpenaiSelfHarm type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &OpenaiSelfHarm{}
// OpenaiSelfHarm struct for OpenaiSelfHarm
type OpenaiSelfHarm struct {
Filtered *bool `json:"filtered,omitempty"`
Severity *string `json:"severity,omitempty"`
AdditionalProperties map[string]interface{}
}
type _OpenaiSelfHarm OpenaiSelfHarm
// NewOpenaiSelfHarm instantiates a new OpenaiSelfHarm 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 NewOpenaiSelfHarm() *OpenaiSelfHarm {
this := OpenaiSelfHarm{}
return &this
}
// NewOpenaiSelfHarmWithDefaults instantiates a new OpenaiSelfHarm 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 NewOpenaiSelfHarmWithDefaults() *OpenaiSelfHarm {
this := OpenaiSelfHarm{}
return &this
}
// GetFiltered returns the Filtered field value if set, zero value otherwise.
func (o *OpenaiSelfHarm) 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 *OpenaiSelfHarm) 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 *OpenaiSelfHarm) 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 *OpenaiSelfHarm) SetFiltered(v bool) {
o.Filtered = &v
}
// GetSeverity returns the Severity field value if set, zero value otherwise.
func (o *OpenaiSelfHarm) 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 *OpenaiSelfHarm) 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 *OpenaiSelfHarm) 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 *OpenaiSelfHarm) SetSeverity(v string) {
o.Severity = &v
}
func (o OpenaiSelfHarm) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o OpenaiSelfHarm) 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 *OpenaiSelfHarm) UnmarshalJSON(data []byte) (err error) {
varOpenaiSelfHarm := _OpenaiSelfHarm{}
err = json.Unmarshal(data, &varOpenaiSelfHarm)
if err != nil {
return err
}
*o = OpenaiSelfHarm(varOpenaiSelfHarm)
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 NullableOpenaiSelfHarm struct {
value *OpenaiSelfHarm
isSet bool
}
func (v NullableOpenaiSelfHarm) Get() *OpenaiSelfHarm {
return v.value
}
func (v *NullableOpenaiSelfHarm) Set(val *OpenaiSelfHarm) {
v.value = val
v.isSet = true
}
func (v NullableOpenaiSelfHarm) IsSet() bool {
return v.isSet
}
func (v *NullableOpenaiSelfHarm) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableOpenaiSelfHarm(val *OpenaiSelfHarm) *NullableOpenaiSelfHarm {
return &NullableOpenaiSelfHarm{value: val, isSet: true}
}
func (v NullableOpenaiSelfHarm) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableOpenaiSelfHarm) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}