Files
sdk/model_ask_web_question.go

307 lines
8.1 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 AskWebQuestion type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AskWebQuestion{}
// AskWebQuestion struct for AskWebQuestion
type AskWebQuestion struct {
// Language narrows the search to a locale, BCP-47-ish (\"en\", \"ja\"). Empty means no narrowing.
Language *string `json:"language,omitempty"`
// MaxSources caps how many pages are read. Empty means the mode's own budget.
MaxSources *int64 `json:"max_sources,omitempty"`
// Mode is how much work to do: `search` (fast, one pass), `news` (recency biased), `research` (a plan and several rounds) or `deep` (the widest survey). Empty means research.
Mode *string `json:"mode,omitempty"`
// Q is the question, in plain language. Required.
Q *string `json:"q,omitempty"`
// Sources narrows where the evidence comes from: any of `web`, `news`, `academic`, `github`, `reddit`, `x`. Each becomes a site-scoped search, so `[\"x\"]` researches X/Twitter posts rather than the open web.
Sources []string `json:"sources,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AskWebQuestion AskWebQuestion
// NewAskWebQuestion instantiates a new AskWebQuestion 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 NewAskWebQuestion() *AskWebQuestion {
this := AskWebQuestion{}
return &this
}
// NewAskWebQuestionWithDefaults instantiates a new AskWebQuestion 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 NewAskWebQuestionWithDefaults() *AskWebQuestion {
this := AskWebQuestion{}
return &this
}
// GetLanguage returns the Language field value if set, zero value otherwise.
func (o *AskWebQuestion) 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 *AskWebQuestion) 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 *AskWebQuestion) 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 *AskWebQuestion) SetLanguage(v string) {
o.Language = &v
}
// GetMaxSources returns the MaxSources field value if set, zero value otherwise.
func (o *AskWebQuestion) GetMaxSources() int64 {
if o == nil || IsNil(o.MaxSources) {
var ret int64
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 *AskWebQuestion) GetMaxSourcesOk() (*int64, 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 *AskWebQuestion) HasMaxSources() bool {
if o != nil && !IsNil(o.MaxSources) {
return true
}
return false
}
// SetMaxSources gets a reference to the given int64 and assigns it to the MaxSources field.
func (o *AskWebQuestion) SetMaxSources(v int64) {
o.MaxSources = &v
}
// GetMode returns the Mode field value if set, zero value otherwise.
func (o *AskWebQuestion) 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 *AskWebQuestion) 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 *AskWebQuestion) 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 *AskWebQuestion) SetMode(v string) {
o.Mode = &v
}
// GetQ returns the Q field value if set, zero value otherwise.
func (o *AskWebQuestion) 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 *AskWebQuestion) 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 *AskWebQuestion) 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 *AskWebQuestion) SetQ(v string) {
o.Q = &v
}
// GetSources returns the Sources field value if set, zero value otherwise.
func (o *AskWebQuestion) 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 *AskWebQuestion) 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 *AskWebQuestion) 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 *AskWebQuestion) SetSources(v []string) {
o.Sources = v
}
func (o AskWebQuestion) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AskWebQuestion) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Language) {
toSerialize["language"] = o.Language
}
if !IsNil(o.MaxSources) {
toSerialize["max_sources"] = o.MaxSources
}
if !IsNil(o.Mode) {
toSerialize["mode"] = o.Mode
}
if !IsNil(o.Q) {
toSerialize["q"] = o.Q
}
if !IsNil(o.Sources) {
toSerialize["sources"] = o.Sources
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AskWebQuestion) UnmarshalJSON(data []byte) (err error) {
varAskWebQuestion := _AskWebQuestion{}
err = json.Unmarshal(data, &varAskWebQuestion)
if err != nil {
return err
}
*o = AskWebQuestion(varAskWebQuestion)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "language")
delete(additionalProperties, "max_sources")
delete(additionalProperties, "mode")
delete(additionalProperties, "q")
delete(additionalProperties, "sources")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAskWebQuestion struct {
value *AskWebQuestion
isSet bool
}
func (v NullableAskWebQuestion) Get() *AskWebQuestion {
return v.value
}
func (v *NullableAskWebQuestion) Set(val *AskWebQuestion) {
v.value = val
v.isSet = true
}
func (v NullableAskWebQuestion) IsSet() bool {
return v.isSet
}
func (v *NullableAskWebQuestion) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAskWebQuestion(val *AskWebQuestion) *NullableAskWebQuestion {
return &NullableAskWebQuestion{value: val, isSet: true}
}
func (v NullableAskWebQuestion) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAskWebQuestion) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}