Files
sdk/model_openai_chat_completion_response.go

413 lines
12 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 OpenaiChatCompletionResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &OpenaiChatCompletionResponse{}
// OpenaiChatCompletionResponse struct for OpenaiChatCompletionResponse
type OpenaiChatCompletionResponse struct {
Choices []OpenaiChatCompletionChoice `json:"choices,omitempty"`
Created *int32 `json:"created,omitempty"`
Id *string `json:"id,omitempty"`
Model *string `json:"model,omitempty"`
Object *string `json:"object,omitempty"`
PromptFilterResults []OpenaiPromptFilterResult `json:"prompt_filter_results,omitempty"`
SystemFingerprint *string `json:"system_fingerprint,omitempty"`
Usage *OpenaiUsage `json:"usage,omitempty"`
AdditionalProperties map[string]interface{}
}
type _OpenaiChatCompletionResponse OpenaiChatCompletionResponse
// NewOpenaiChatCompletionResponse instantiates a new OpenaiChatCompletionResponse 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 NewOpenaiChatCompletionResponse() *OpenaiChatCompletionResponse {
this := OpenaiChatCompletionResponse{}
return &this
}
// NewOpenaiChatCompletionResponseWithDefaults instantiates a new OpenaiChatCompletionResponse 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 NewOpenaiChatCompletionResponseWithDefaults() *OpenaiChatCompletionResponse {
this := OpenaiChatCompletionResponse{}
return &this
}
// GetChoices returns the Choices field value if set, zero value otherwise.
func (o *OpenaiChatCompletionResponse) GetChoices() []OpenaiChatCompletionChoice {
if o == nil || IsNil(o.Choices) {
var ret []OpenaiChatCompletionChoice
return ret
}
return o.Choices
}
// GetChoicesOk returns a tuple with the Choices field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiChatCompletionResponse) GetChoicesOk() ([]OpenaiChatCompletionChoice, bool) {
if o == nil || IsNil(o.Choices) {
return nil, false
}
return o.Choices, true
}
// HasChoices returns a boolean if a field has been set.
func (o *OpenaiChatCompletionResponse) HasChoices() bool {
if o != nil && !IsNil(o.Choices) {
return true
}
return false
}
// SetChoices gets a reference to the given []OpenaiChatCompletionChoice and assigns it to the Choices field.
func (o *OpenaiChatCompletionResponse) SetChoices(v []OpenaiChatCompletionChoice) {
o.Choices = v
}
// GetCreated returns the Created field value if set, zero value otherwise.
func (o *OpenaiChatCompletionResponse) GetCreated() int32 {
if o == nil || IsNil(o.Created) {
var ret int32
return ret
}
return *o.Created
}
// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiChatCompletionResponse) GetCreatedOk() (*int32, bool) {
if o == nil || IsNil(o.Created) {
return nil, false
}
return o.Created, true
}
// HasCreated returns a boolean if a field has been set.
func (o *OpenaiChatCompletionResponse) HasCreated() bool {
if o != nil && !IsNil(o.Created) {
return true
}
return false
}
// SetCreated gets a reference to the given int32 and assigns it to the Created field.
func (o *OpenaiChatCompletionResponse) SetCreated(v int32) {
o.Created = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *OpenaiChatCompletionResponse) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiChatCompletionResponse) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *OpenaiChatCompletionResponse) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *OpenaiChatCompletionResponse) SetId(v string) {
o.Id = &v
}
// GetModel returns the Model field value if set, zero value otherwise.
func (o *OpenaiChatCompletionResponse) GetModel() string {
if o == nil || IsNil(o.Model) {
var ret string
return ret
}
return *o.Model
}
// GetModelOk returns a tuple with the Model field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiChatCompletionResponse) GetModelOk() (*string, bool) {
if o == nil || IsNil(o.Model) {
return nil, false
}
return o.Model, true
}
// HasModel returns a boolean if a field has been set.
func (o *OpenaiChatCompletionResponse) HasModel() bool {
if o != nil && !IsNil(o.Model) {
return true
}
return false
}
// SetModel gets a reference to the given string and assigns it to the Model field.
func (o *OpenaiChatCompletionResponse) SetModel(v string) {
o.Model = &v
}
// GetObject returns the Object field value if set, zero value otherwise.
func (o *OpenaiChatCompletionResponse) GetObject() string {
if o == nil || IsNil(o.Object) {
var ret string
return ret
}
return *o.Object
}
// GetObjectOk returns a tuple with the Object field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiChatCompletionResponse) GetObjectOk() (*string, bool) {
if o == nil || IsNil(o.Object) {
return nil, false
}
return o.Object, true
}
// HasObject returns a boolean if a field has been set.
func (o *OpenaiChatCompletionResponse) HasObject() bool {
if o != nil && !IsNil(o.Object) {
return true
}
return false
}
// SetObject gets a reference to the given string and assigns it to the Object field.
func (o *OpenaiChatCompletionResponse) SetObject(v string) {
o.Object = &v
}
// GetPromptFilterResults returns the PromptFilterResults field value if set, zero value otherwise.
func (o *OpenaiChatCompletionResponse) GetPromptFilterResults() []OpenaiPromptFilterResult {
if o == nil || IsNil(o.PromptFilterResults) {
var ret []OpenaiPromptFilterResult
return ret
}
return o.PromptFilterResults
}
// GetPromptFilterResultsOk returns a tuple with the PromptFilterResults field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiChatCompletionResponse) GetPromptFilterResultsOk() ([]OpenaiPromptFilterResult, bool) {
if o == nil || IsNil(o.PromptFilterResults) {
return nil, false
}
return o.PromptFilterResults, true
}
// HasPromptFilterResults returns a boolean if a field has been set.
func (o *OpenaiChatCompletionResponse) HasPromptFilterResults() bool {
if o != nil && !IsNil(o.PromptFilterResults) {
return true
}
return false
}
// SetPromptFilterResults gets a reference to the given []OpenaiPromptFilterResult and assigns it to the PromptFilterResults field.
func (o *OpenaiChatCompletionResponse) SetPromptFilterResults(v []OpenaiPromptFilterResult) {
o.PromptFilterResults = v
}
// GetSystemFingerprint returns the SystemFingerprint field value if set, zero value otherwise.
func (o *OpenaiChatCompletionResponse) GetSystemFingerprint() string {
if o == nil || IsNil(o.SystemFingerprint) {
var ret string
return ret
}
return *o.SystemFingerprint
}
// GetSystemFingerprintOk returns a tuple with the SystemFingerprint field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiChatCompletionResponse) GetSystemFingerprintOk() (*string, bool) {
if o == nil || IsNil(o.SystemFingerprint) {
return nil, false
}
return o.SystemFingerprint, true
}
// HasSystemFingerprint returns a boolean if a field has been set.
func (o *OpenaiChatCompletionResponse) HasSystemFingerprint() bool {
if o != nil && !IsNil(o.SystemFingerprint) {
return true
}
return false
}
// SetSystemFingerprint gets a reference to the given string and assigns it to the SystemFingerprint field.
func (o *OpenaiChatCompletionResponse) SetSystemFingerprint(v string) {
o.SystemFingerprint = &v
}
// GetUsage returns the Usage field value if set, zero value otherwise.
func (o *OpenaiChatCompletionResponse) GetUsage() OpenaiUsage {
if o == nil || IsNil(o.Usage) {
var ret OpenaiUsage
return ret
}
return *o.Usage
}
// GetUsageOk returns a tuple with the Usage field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenaiChatCompletionResponse) GetUsageOk() (*OpenaiUsage, bool) {
if o == nil || IsNil(o.Usage) {
return nil, false
}
return o.Usage, true
}
// HasUsage returns a boolean if a field has been set.
func (o *OpenaiChatCompletionResponse) HasUsage() bool {
if o != nil && !IsNil(o.Usage) {
return true
}
return false
}
// SetUsage gets a reference to the given OpenaiUsage and assigns it to the Usage field.
func (o *OpenaiChatCompletionResponse) SetUsage(v OpenaiUsage) {
o.Usage = &v
}
func (o OpenaiChatCompletionResponse) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o OpenaiChatCompletionResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Choices) {
toSerialize["choices"] = o.Choices
}
if !IsNil(o.Created) {
toSerialize["created"] = o.Created
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Model) {
toSerialize["model"] = o.Model
}
if !IsNil(o.Object) {
toSerialize["object"] = o.Object
}
if !IsNil(o.PromptFilterResults) {
toSerialize["prompt_filter_results"] = o.PromptFilterResults
}
if !IsNil(o.SystemFingerprint) {
toSerialize["system_fingerprint"] = o.SystemFingerprint
}
if !IsNil(o.Usage) {
toSerialize["usage"] = o.Usage
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *OpenaiChatCompletionResponse) UnmarshalJSON(data []byte) (err error) {
varOpenaiChatCompletionResponse := _OpenaiChatCompletionResponse{}
err = json.Unmarshal(data, &varOpenaiChatCompletionResponse)
if err != nil {
return err
}
*o = OpenaiChatCompletionResponse(varOpenaiChatCompletionResponse)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "choices")
delete(additionalProperties, "created")
delete(additionalProperties, "id")
delete(additionalProperties, "model")
delete(additionalProperties, "object")
delete(additionalProperties, "prompt_filter_results")
delete(additionalProperties, "system_fingerprint")
delete(additionalProperties, "usage")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableOpenaiChatCompletionResponse struct {
value *OpenaiChatCompletionResponse
isSet bool
}
func (v NullableOpenaiChatCompletionResponse) Get() *OpenaiChatCompletionResponse {
return v.value
}
func (v *NullableOpenaiChatCompletionResponse) Set(val *OpenaiChatCompletionResponse) {
v.value = val
v.isSet = true
}
func (v NullableOpenaiChatCompletionResponse) IsSet() bool {
return v.isSet
}
func (v *NullableOpenaiChatCompletionResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableOpenaiChatCompletionResponse(val *OpenaiChatCompletionResponse) *NullableOpenaiChatCompletionResponse {
return &NullableOpenaiChatCompletionResponse{value: val, isSet: true}
}
func (v NullableOpenaiChatCompletionResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableOpenaiChatCompletionResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}