Files
sdk/model_websearch_web_search_query.go

193 lines
5.3 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 WebsearchWebSearchQuery type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &WebsearchWebSearchQuery{}
// WebsearchWebSearchQuery struct for WebsearchWebSearchQuery
type WebsearchWebSearchQuery struct {
// Language narrows the engines to a locale, BCP-47-ish (\"en\", \"ja\", \"de\"). Empty means no narrowing.
Language *string `json:"language,omitempty"`
// Q is the query. Required — an empty one is refused rather than answered with the whole web.
Q *string `json:"q,omitempty"`
AdditionalProperties map[string]interface{}
}
type _WebsearchWebSearchQuery WebsearchWebSearchQuery
// NewWebsearchWebSearchQuery instantiates a new WebsearchWebSearchQuery 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 NewWebsearchWebSearchQuery() *WebsearchWebSearchQuery {
this := WebsearchWebSearchQuery{}
return &this
}
// NewWebsearchWebSearchQueryWithDefaults instantiates a new WebsearchWebSearchQuery 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 NewWebsearchWebSearchQueryWithDefaults() *WebsearchWebSearchQuery {
this := WebsearchWebSearchQuery{}
return &this
}
// GetLanguage returns the Language field value if set, zero value otherwise.
func (o *WebsearchWebSearchQuery) 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 *WebsearchWebSearchQuery) 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 *WebsearchWebSearchQuery) 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 *WebsearchWebSearchQuery) SetLanguage(v string) {
o.Language = &v
}
// GetQ returns the Q field value if set, zero value otherwise.
func (o *WebsearchWebSearchQuery) 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 *WebsearchWebSearchQuery) 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 *WebsearchWebSearchQuery) 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 *WebsearchWebSearchQuery) SetQ(v string) {
o.Q = &v
}
func (o WebsearchWebSearchQuery) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o WebsearchWebSearchQuery) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Language) {
toSerialize["language"] = o.Language
}
if !IsNil(o.Q) {
toSerialize["q"] = o.Q
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *WebsearchWebSearchQuery) UnmarshalJSON(data []byte) (err error) {
varWebsearchWebSearchQuery := _WebsearchWebSearchQuery{}
err = json.Unmarshal(data, &varWebsearchWebSearchQuery)
if err != nil {
return err
}
*o = WebsearchWebSearchQuery(varWebsearchWebSearchQuery)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "language")
delete(additionalProperties, "q")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableWebsearchWebSearchQuery struct {
value *WebsearchWebSearchQuery
isSet bool
}
func (v NullableWebsearchWebSearchQuery) Get() *WebsearchWebSearchQuery {
return v.value
}
func (v *NullableWebsearchWebSearchQuery) Set(val *WebsearchWebSearchQuery) {
v.value = val
v.isSet = true
}
func (v NullableWebsearchWebSearchQuery) IsSet() bool {
return v.isSet
}
func (v *NullableWebsearchWebSearchQuery) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableWebsearchWebSearchQuery(val *WebsearchWebSearchQuery) *NullableWebsearchWebSearchQuery {
return &NullableWebsearchWebSearchQuery{value: val, isSet: true}
}
func (v NullableWebsearchWebSearchQuery) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableWebsearchWebSearchQuery) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}