mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
307 lines
8.5 KiB
Go
307 lines
8.5 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 WebsearchSearchEngineOption type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &WebsearchSearchEngineOption{}
|
|
|
|
// WebsearchSearchEngineOption struct for WebsearchSearchEngineOption
|
|
type WebsearchSearchEngineOption struct {
|
|
// Default is the count used when none is set. Absent for a text option, whose default is unset.
|
|
Default *int64 `json:"default,omitempty"`
|
|
// Max is the most count the engine accepts. Absent for a text option.
|
|
Max *int64 `json:"max,omitempty"`
|
|
// Min is the least count the engine accepts. Absent for a text option.
|
|
Min *int64 `json:"min,omitempty"`
|
|
// Name is the option: `count`, `language` or `region`.
|
|
Name *string `json:"name,omitempty"`
|
|
// Param is the engine's own query parameter the option sets, such as `t` or `rb` for Mojeek.
|
|
Param *string `json:"param,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _WebsearchSearchEngineOption WebsearchSearchEngineOption
|
|
|
|
// NewWebsearchSearchEngineOption instantiates a new WebsearchSearchEngineOption 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 NewWebsearchSearchEngineOption() *WebsearchSearchEngineOption {
|
|
this := WebsearchSearchEngineOption{}
|
|
return &this
|
|
}
|
|
|
|
// NewWebsearchSearchEngineOptionWithDefaults instantiates a new WebsearchSearchEngineOption 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 NewWebsearchSearchEngineOptionWithDefaults() *WebsearchSearchEngineOption {
|
|
this := WebsearchSearchEngineOption{}
|
|
return &this
|
|
}
|
|
|
|
// GetDefault returns the Default field value if set, zero value otherwise.
|
|
func (o *WebsearchSearchEngineOption) GetDefault() int64 {
|
|
if o == nil || IsNil(o.Default) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Default
|
|
}
|
|
|
|
// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WebsearchSearchEngineOption) GetDefaultOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Default) {
|
|
return nil, false
|
|
}
|
|
return o.Default, true
|
|
}
|
|
|
|
// HasDefault returns a boolean if a field has been set.
|
|
func (o *WebsearchSearchEngineOption) HasDefault() bool {
|
|
if o != nil && !IsNil(o.Default) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDefault gets a reference to the given int64 and assigns it to the Default field.
|
|
func (o *WebsearchSearchEngineOption) SetDefault(v int64) {
|
|
o.Default = &v
|
|
}
|
|
|
|
// GetMax returns the Max field value if set, zero value otherwise.
|
|
func (o *WebsearchSearchEngineOption) GetMax() int64 {
|
|
if o == nil || IsNil(o.Max) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Max
|
|
}
|
|
|
|
// GetMaxOk returns a tuple with the Max field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WebsearchSearchEngineOption) GetMaxOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Max) {
|
|
return nil, false
|
|
}
|
|
return o.Max, true
|
|
}
|
|
|
|
// HasMax returns a boolean if a field has been set.
|
|
func (o *WebsearchSearchEngineOption) HasMax() bool {
|
|
if o != nil && !IsNil(o.Max) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMax gets a reference to the given int64 and assigns it to the Max field.
|
|
func (o *WebsearchSearchEngineOption) SetMax(v int64) {
|
|
o.Max = &v
|
|
}
|
|
|
|
// GetMin returns the Min field value if set, zero value otherwise.
|
|
func (o *WebsearchSearchEngineOption) GetMin() int64 {
|
|
if o == nil || IsNil(o.Min) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Min
|
|
}
|
|
|
|
// GetMinOk returns a tuple with the Min field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WebsearchSearchEngineOption) GetMinOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Min) {
|
|
return nil, false
|
|
}
|
|
return o.Min, true
|
|
}
|
|
|
|
// HasMin returns a boolean if a field has been set.
|
|
func (o *WebsearchSearchEngineOption) HasMin() bool {
|
|
if o != nil && !IsNil(o.Min) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMin gets a reference to the given int64 and assigns it to the Min field.
|
|
func (o *WebsearchSearchEngineOption) SetMin(v int64) {
|
|
o.Min = &v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *WebsearchSearchEngineOption) GetName() string {
|
|
if o == nil || IsNil(o.Name) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Name
|
|
}
|
|
|
|
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WebsearchSearchEngineOption) GetNameOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Name) {
|
|
return nil, false
|
|
}
|
|
return o.Name, true
|
|
}
|
|
|
|
// HasName returns a boolean if a field has been set.
|
|
func (o *WebsearchSearchEngineOption) HasName() bool {
|
|
if o != nil && !IsNil(o.Name) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetName gets a reference to the given string and assigns it to the Name field.
|
|
func (o *WebsearchSearchEngineOption) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetParam returns the Param field value if set, zero value otherwise.
|
|
func (o *WebsearchSearchEngineOption) GetParam() string {
|
|
if o == nil || IsNil(o.Param) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Param
|
|
}
|
|
|
|
// GetParamOk returns a tuple with the Param field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WebsearchSearchEngineOption) GetParamOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Param) {
|
|
return nil, false
|
|
}
|
|
return o.Param, true
|
|
}
|
|
|
|
// HasParam returns a boolean if a field has been set.
|
|
func (o *WebsearchSearchEngineOption) HasParam() bool {
|
|
if o != nil && !IsNil(o.Param) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetParam gets a reference to the given string and assigns it to the Param field.
|
|
func (o *WebsearchSearchEngineOption) SetParam(v string) {
|
|
o.Param = &v
|
|
}
|
|
|
|
func (o WebsearchSearchEngineOption) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o WebsearchSearchEngineOption) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Default) {
|
|
toSerialize["default"] = o.Default
|
|
}
|
|
if !IsNil(o.Max) {
|
|
toSerialize["max"] = o.Max
|
|
}
|
|
if !IsNil(o.Min) {
|
|
toSerialize["min"] = o.Min
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.Param) {
|
|
toSerialize["param"] = o.Param
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *WebsearchSearchEngineOption) UnmarshalJSON(data []byte) (err error) {
|
|
varWebsearchSearchEngineOption := _WebsearchSearchEngineOption{}
|
|
|
|
err = json.Unmarshal(data, &varWebsearchSearchEngineOption)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = WebsearchSearchEngineOption(varWebsearchSearchEngineOption)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "default")
|
|
delete(additionalProperties, "max")
|
|
delete(additionalProperties, "min")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "param")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableWebsearchSearchEngineOption struct {
|
|
value *WebsearchSearchEngineOption
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableWebsearchSearchEngineOption) Get() *WebsearchSearchEngineOption {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableWebsearchSearchEngineOption) Set(val *WebsearchSearchEngineOption) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableWebsearchSearchEngineOption) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableWebsearchSearchEngineOption) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableWebsearchSearchEngineOption(val *WebsearchSearchEngineOption) *NullableWebsearchSearchEngineOption {
|
|
return &NullableWebsearchSearchEngineOption{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableWebsearchSearchEngineOption) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableWebsearchSearchEngineOption) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|