Files
sdk/model_ask_request.go

524 lines
13 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 AskRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AskRequest{}
// AskRequest struct for AskRequest
type AskRequest struct {
FollowUps *bool `json:"followUps,omitempty"`
Language *string `json:"language,omitempty"`
MaxQueries *int32 `json:"maxQueries,omitempty"`
MaxSources *int32 `json:"maxSources,omitempty"`
Mode *string `json:"mode,omitempty"`
Model *string `json:"model,omitempty"`
Q *string `json:"q,omitempty"`
Question *string `json:"question,omitempty"`
Sources []string `json:"sources,omitempty"`
Stream *bool `json:"stream,omitempty"`
System *string `json:"system,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AskRequest AskRequest
// NewAskRequest instantiates a new AskRequest 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 NewAskRequest() *AskRequest {
this := AskRequest{}
return &this
}
// NewAskRequestWithDefaults instantiates a new AskRequest 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 NewAskRequestWithDefaults() *AskRequest {
this := AskRequest{}
return &this
}
// GetFollowUps returns the FollowUps field value if set, zero value otherwise.
func (o *AskRequest) GetFollowUps() bool {
if o == nil || IsNil(o.FollowUps) {
var ret bool
return ret
}
return *o.FollowUps
}
// GetFollowUpsOk returns a tuple with the FollowUps field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AskRequest) GetFollowUpsOk() (*bool, bool) {
if o == nil || IsNil(o.FollowUps) {
return nil, false
}
return o.FollowUps, true
}
// HasFollowUps returns a boolean if a field has been set.
func (o *AskRequest) HasFollowUps() bool {
if o != nil && !IsNil(o.FollowUps) {
return true
}
return false
}
// SetFollowUps gets a reference to the given bool and assigns it to the FollowUps field.
func (o *AskRequest) SetFollowUps(v bool) {
o.FollowUps = &v
}
// GetLanguage returns the Language field value if set, zero value otherwise.
func (o *AskRequest) GetLanguage() string {
if o == nil || IsNil(o.Language) {
var ret string
return ret
}
return *o.Language
}
// GetLanguageOk returns a tuple with the Language field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AskRequest) GetLanguageOk() (*string, bool) {
if o == nil || IsNil(o.Language) {
return nil, false
}
return o.Language, true
}
// HasLanguage returns a boolean if a field has been set.
func (o *AskRequest) HasLanguage() bool {
if o != nil && !IsNil(o.Language) {
return true
}
return false
}
// SetLanguage gets a reference to the given string and assigns it to the Language field.
func (o *AskRequest) SetLanguage(v string) {
o.Language = &v
}
// GetMaxQueries returns the MaxQueries field value if set, zero value otherwise.
func (o *AskRequest) GetMaxQueries() int32 {
if o == nil || IsNil(o.MaxQueries) {
var ret int32
return ret
}
return *o.MaxQueries
}
// GetMaxQueriesOk returns a tuple with the MaxQueries field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AskRequest) GetMaxQueriesOk() (*int32, bool) {
if o == nil || IsNil(o.MaxQueries) {
return nil, false
}
return o.MaxQueries, true
}
// HasMaxQueries returns a boolean if a field has been set.
func (o *AskRequest) HasMaxQueries() bool {
if o != nil && !IsNil(o.MaxQueries) {
return true
}
return false
}
// SetMaxQueries gets a reference to the given int32 and assigns it to the MaxQueries field.
func (o *AskRequest) SetMaxQueries(v int32) {
o.MaxQueries = &v
}
// GetMaxSources returns the MaxSources field value if set, zero value otherwise.
func (o *AskRequest) GetMaxSources() int32 {
if o == nil || IsNil(o.MaxSources) {
var ret int32
return ret
}
return *o.MaxSources
}
// GetMaxSourcesOk returns a tuple with the MaxSources field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AskRequest) GetMaxSourcesOk() (*int32, bool) {
if o == nil || IsNil(o.MaxSources) {
return nil, false
}
return o.MaxSources, true
}
// HasMaxSources returns a boolean if a field has been set.
func (o *AskRequest) HasMaxSources() bool {
if o != nil && !IsNil(o.MaxSources) {
return true
}
return false
}
// SetMaxSources gets a reference to the given int32 and assigns it to the MaxSources field.
func (o *AskRequest) SetMaxSources(v int32) {
o.MaxSources = &v
}
// GetMode returns the Mode field value if set, zero value otherwise.
func (o *AskRequest) GetMode() string {
if o == nil || IsNil(o.Mode) {
var ret string
return ret
}
return *o.Mode
}
// GetModeOk returns a tuple with the Mode field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AskRequest) GetModeOk() (*string, bool) {
if o == nil || IsNil(o.Mode) {
return nil, false
}
return o.Mode, true
}
// HasMode returns a boolean if a field has been set.
func (o *AskRequest) HasMode() bool {
if o != nil && !IsNil(o.Mode) {
return true
}
return false
}
// SetMode gets a reference to the given string and assigns it to the Mode field.
func (o *AskRequest) SetMode(v string) {
o.Mode = &v
}
// GetModel returns the Model field value if set, zero value otherwise.
func (o *AskRequest) 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 *AskRequest) 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 *AskRequest) 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 *AskRequest) SetModel(v string) {
o.Model = &v
}
// GetQ returns the Q field value if set, zero value otherwise.
func (o *AskRequest) GetQ() string {
if o == nil || IsNil(o.Q) {
var ret string
return ret
}
return *o.Q
}
// GetQOk returns a tuple with the Q field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AskRequest) GetQOk() (*string, bool) {
if o == nil || IsNil(o.Q) {
return nil, false
}
return o.Q, true
}
// HasQ returns a boolean if a field has been set.
func (o *AskRequest) HasQ() bool {
if o != nil && !IsNil(o.Q) {
return true
}
return false
}
// SetQ gets a reference to the given string and assigns it to the Q field.
func (o *AskRequest) SetQ(v string) {
o.Q = &v
}
// GetQuestion returns the Question field value if set, zero value otherwise.
func (o *AskRequest) GetQuestion() string {
if o == nil || IsNil(o.Question) {
var ret string
return ret
}
return *o.Question
}
// GetQuestionOk returns a tuple with the Question field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AskRequest) GetQuestionOk() (*string, bool) {
if o == nil || IsNil(o.Question) {
return nil, false
}
return o.Question, true
}
// HasQuestion returns a boolean if a field has been set.
func (o *AskRequest) HasQuestion() bool {
if o != nil && !IsNil(o.Question) {
return true
}
return false
}
// SetQuestion gets a reference to the given string and assigns it to the Question field.
func (o *AskRequest) SetQuestion(v string) {
o.Question = &v
}
// GetSources returns the Sources field value if set, zero value otherwise.
func (o *AskRequest) GetSources() []string {
if o == nil || IsNil(o.Sources) {
var ret []string
return ret
}
return o.Sources
}
// GetSourcesOk returns a tuple with the Sources field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AskRequest) GetSourcesOk() ([]string, bool) {
if o == nil || IsNil(o.Sources) {
return nil, false
}
return o.Sources, true
}
// HasSources returns a boolean if a field has been set.
func (o *AskRequest) HasSources() bool {
if o != nil && !IsNil(o.Sources) {
return true
}
return false
}
// SetSources gets a reference to the given []string and assigns it to the Sources field.
func (o *AskRequest) SetSources(v []string) {
o.Sources = v
}
// GetStream returns the Stream field value if set, zero value otherwise.
func (o *AskRequest) GetStream() bool {
if o == nil || IsNil(o.Stream) {
var ret bool
return ret
}
return *o.Stream
}
// GetStreamOk returns a tuple with the Stream field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AskRequest) GetStreamOk() (*bool, bool) {
if o == nil || IsNil(o.Stream) {
return nil, false
}
return o.Stream, true
}
// HasStream returns a boolean if a field has been set.
func (o *AskRequest) HasStream() bool {
if o != nil && !IsNil(o.Stream) {
return true
}
return false
}
// SetStream gets a reference to the given bool and assigns it to the Stream field.
func (o *AskRequest) SetStream(v bool) {
o.Stream = &v
}
// GetSystem returns the System field value if set, zero value otherwise.
func (o *AskRequest) GetSystem() string {
if o == nil || IsNil(o.System) {
var ret string
return ret
}
return *o.System
}
// GetSystemOk returns a tuple with the System field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AskRequest) GetSystemOk() (*string, bool) {
if o == nil || IsNil(o.System) {
return nil, false
}
return o.System, true
}
// HasSystem returns a boolean if a field has been set.
func (o *AskRequest) HasSystem() bool {
if o != nil && !IsNil(o.System) {
return true
}
return false
}
// SetSystem gets a reference to the given string and assigns it to the System field.
func (o *AskRequest) SetSystem(v string) {
o.System = &v
}
func (o AskRequest) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AskRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.FollowUps) {
toSerialize["followUps"] = o.FollowUps
}
if !IsNil(o.Language) {
toSerialize["language"] = o.Language
}
if !IsNil(o.MaxQueries) {
toSerialize["maxQueries"] = o.MaxQueries
}
if !IsNil(o.MaxSources) {
toSerialize["maxSources"] = o.MaxSources
}
if !IsNil(o.Mode) {
toSerialize["mode"] = o.Mode
}
if !IsNil(o.Model) {
toSerialize["model"] = o.Model
}
if !IsNil(o.Q) {
toSerialize["q"] = o.Q
}
if !IsNil(o.Question) {
toSerialize["question"] = o.Question
}
if !IsNil(o.Sources) {
toSerialize["sources"] = o.Sources
}
if !IsNil(o.Stream) {
toSerialize["stream"] = o.Stream
}
if !IsNil(o.System) {
toSerialize["system"] = o.System
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AskRequest) UnmarshalJSON(data []byte) (err error) {
varAskRequest := _AskRequest{}
err = json.Unmarshal(data, &varAskRequest)
if err != nil {
return err
}
*o = AskRequest(varAskRequest)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "followUps")
delete(additionalProperties, "language")
delete(additionalProperties, "maxQueries")
delete(additionalProperties, "maxSources")
delete(additionalProperties, "mode")
delete(additionalProperties, "model")
delete(additionalProperties, "q")
delete(additionalProperties, "question")
delete(additionalProperties, "sources")
delete(additionalProperties, "stream")
delete(additionalProperties, "system")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAskRequest struct {
value *AskRequest
isSet bool
}
func (v NullableAskRequest) Get() *AskRequest {
return v.value
}
func (v *NullableAskRequest) Set(val *AskRequest) {
v.value = val
v.isSet = true
}
func (v NullableAskRequest) IsSet() bool {
return v.isSet
}
func (v *NullableAskRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAskRequest(val *AskRequest) *NullableAskRequest {
return &NullableAskRequest{value: val, isSet: true}
}
func (v NullableAskRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAskRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}