Files
sdk/model_openai_profanity.go

191 lines
4.9 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 OpenaiProfanity type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &OpenaiProfanity{}
// OpenaiProfanity struct for OpenaiProfanity
type OpenaiProfanity struct {
Detected *bool `json:"detected,omitempty"`
Filtered *bool `json:"filtered,omitempty"`
AdditionalProperties map[string]interface{}
}
type _OpenaiProfanity OpenaiProfanity
// NewOpenaiProfanity instantiates a new OpenaiProfanity 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 NewOpenaiProfanity() *OpenaiProfanity {
this := OpenaiProfanity{}
return &this
}
// NewOpenaiProfanityWithDefaults instantiates a new OpenaiProfanity 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 NewOpenaiProfanityWithDefaults() *OpenaiProfanity {
this := OpenaiProfanity{}
return &this
}
// GetDetected returns the Detected field value if set, zero value otherwise.
func (o *OpenaiProfanity) GetDetected() bool {
if o == nil || IsNil(o.Detected) {
var ret bool
return ret
}
return *o.Detected
}
// GetDetectedOk returns a tuple with the Detected field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiProfanity) GetDetectedOk() (*bool, bool) {
if o == nil || IsNil(o.Detected) {
return nil, false
}
return o.Detected, true
}
// HasDetected returns a boolean if a field has been set.
func (o *OpenaiProfanity) HasDetected() bool {
if o != nil && !IsNil(o.Detected) {
return true
}
return false
}
// SetDetected gets a reference to the given bool and assigns it to the Detected field.
func (o *OpenaiProfanity) SetDetected(v bool) {
o.Detected = &v
}
// GetFiltered returns the Filtered field value if set, zero value otherwise.
func (o *OpenaiProfanity) 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 *OpenaiProfanity) 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 *OpenaiProfanity) 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 *OpenaiProfanity) SetFiltered(v bool) {
o.Filtered = &v
}
func (o OpenaiProfanity) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o OpenaiProfanity) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Detected) {
toSerialize["detected"] = o.Detected
}
if !IsNil(o.Filtered) {
toSerialize["filtered"] = o.Filtered
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *OpenaiProfanity) UnmarshalJSON(data []byte) (err error) {
varOpenaiProfanity := _OpenaiProfanity{}
err = json.Unmarshal(data, &varOpenaiProfanity)
if err != nil {
return err
}
*o = OpenaiProfanity(varOpenaiProfanity)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "detected")
delete(additionalProperties, "filtered")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableOpenaiProfanity struct {
value *OpenaiProfanity
isSet bool
}
func (v NullableOpenaiProfanity) Get() *OpenaiProfanity {
return v.value
}
func (v *NullableOpenaiProfanity) Set(val *OpenaiProfanity) {
v.value = val
v.isSet = true
}
func (v NullableOpenaiProfanity) IsSet() bool {
return v.isSet
}
func (v *NullableOpenaiProfanity) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableOpenaiProfanity(val *OpenaiProfanity) *NullableOpenaiProfanity {
return &NullableOpenaiProfanity{value: val, isSet: true}
}
func (v NullableOpenaiProfanity) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableOpenaiProfanity) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}