Files
sdk/model_websearch_search_engine.go

459 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 WebsearchSearchEngine type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &WebsearchSearchEngine{}
// WebsearchSearchEngine struct for WebsearchSearchEngine
type WebsearchSearchEngine struct {
// AcceptsKey is whether the engine takes an API key at all.
AcceptsKey *bool `json:"acceptsKey,omitempty"`
// Available is whether the engine answers from this cluster as things stand: it needs no key there (bing, ddg), or its key is held. Mojeek's keyless page still runs as a fallback but does not count, because it does not answer from this cluster's egress.
Available *bool `json:"available,omitempty"`
// Enabled is whether searches run it.
Enabled *bool `json:"enabled,omitempty"`
// Keyed is whether the platform holds a key for it in KMS. The key itself is never returned by any operation.
Keyed *bool `json:"keyed,omitempty"`
// Name is the engine: `mojeek`, `bing`, `brave` or `ddg`.
Name *string `json:"name,omitempty"`
// NeedsKey is whether the engine answers only with a key.
NeedsKey *bool `json:"needsKey,omitempty"`
// Options are the values the engine is asked with, defaults filled in.
Options *WebsearchSearchEngineOptions `json:"options,omitempty"`
// Order is its place among the enabled engines, from 1; 0 when disabled.
Order *int64 `json:"order,omitempty"`
// Supports lists the options the engine reads, with each one's bounds.
Supports []WebsearchSearchEngineOption `json:"supports,omitempty"`
AdditionalProperties map[string]interface{}
}
type _WebsearchSearchEngine WebsearchSearchEngine
// NewWebsearchSearchEngine instantiates a new WebsearchSearchEngine 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 NewWebsearchSearchEngine() *WebsearchSearchEngine {
this := WebsearchSearchEngine{}
return &this
}
// NewWebsearchSearchEngineWithDefaults instantiates a new WebsearchSearchEngine 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 NewWebsearchSearchEngineWithDefaults() *WebsearchSearchEngine {
this := WebsearchSearchEngine{}
return &this
}
// GetAcceptsKey returns the AcceptsKey field value if set, zero value otherwise.
func (o *WebsearchSearchEngine) GetAcceptsKey() bool {
if o == nil || IsNil(o.AcceptsKey) {
var ret bool
return ret
}
return *o.AcceptsKey
}
// GetAcceptsKeyOk returns a tuple with the AcceptsKey field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WebsearchSearchEngine) GetAcceptsKeyOk() (*bool, bool) {
if o == nil || IsNil(o.AcceptsKey) {
return nil, false
}
return o.AcceptsKey, true
}
// HasAcceptsKey returns a boolean if a field has been set.
func (o *WebsearchSearchEngine) HasAcceptsKey() bool {
if o != nil && !IsNil(o.AcceptsKey) {
return true
}
return false
}
// SetAcceptsKey gets a reference to the given bool and assigns it to the AcceptsKey field.
func (o *WebsearchSearchEngine) SetAcceptsKey(v bool) {
o.AcceptsKey = &v
}
// GetAvailable returns the Available field value if set, zero value otherwise.
func (o *WebsearchSearchEngine) GetAvailable() bool {
if o == nil || IsNil(o.Available) {
var ret bool
return ret
}
return *o.Available
}
// GetAvailableOk returns a tuple with the Available field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WebsearchSearchEngine) GetAvailableOk() (*bool, bool) {
if o == nil || IsNil(o.Available) {
return nil, false
}
return o.Available, true
}
// HasAvailable returns a boolean if a field has been set.
func (o *WebsearchSearchEngine) HasAvailable() bool {
if o != nil && !IsNil(o.Available) {
return true
}
return false
}
// SetAvailable gets a reference to the given bool and assigns it to the Available field.
func (o *WebsearchSearchEngine) SetAvailable(v bool) {
o.Available = &v
}
// GetEnabled returns the Enabled field value if set, zero value otherwise.
func (o *WebsearchSearchEngine) GetEnabled() bool {
if o == nil || IsNil(o.Enabled) {
var ret bool
return ret
}
return *o.Enabled
}
// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WebsearchSearchEngine) GetEnabledOk() (*bool, bool) {
if o == nil || IsNil(o.Enabled) {
return nil, false
}
return o.Enabled, true
}
// HasEnabled returns a boolean if a field has been set.
func (o *WebsearchSearchEngine) HasEnabled() bool {
if o != nil && !IsNil(o.Enabled) {
return true
}
return false
}
// SetEnabled gets a reference to the given bool and assigns it to the Enabled field.
func (o *WebsearchSearchEngine) SetEnabled(v bool) {
o.Enabled = &v
}
// GetKeyed returns the Keyed field value if set, zero value otherwise.
func (o *WebsearchSearchEngine) GetKeyed() bool {
if o == nil || IsNil(o.Keyed) {
var ret bool
return ret
}
return *o.Keyed
}
// GetKeyedOk returns a tuple with the Keyed field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WebsearchSearchEngine) GetKeyedOk() (*bool, bool) {
if o == nil || IsNil(o.Keyed) {
return nil, false
}
return o.Keyed, true
}
// HasKeyed returns a boolean if a field has been set.
func (o *WebsearchSearchEngine) HasKeyed() bool {
if o != nil && !IsNil(o.Keyed) {
return true
}
return false
}
// SetKeyed gets a reference to the given bool and assigns it to the Keyed field.
func (o *WebsearchSearchEngine) SetKeyed(v bool) {
o.Keyed = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *WebsearchSearchEngine) 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 *WebsearchSearchEngine) 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 *WebsearchSearchEngine) 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 *WebsearchSearchEngine) SetName(v string) {
o.Name = &v
}
// GetNeedsKey returns the NeedsKey field value if set, zero value otherwise.
func (o *WebsearchSearchEngine) GetNeedsKey() bool {
if o == nil || IsNil(o.NeedsKey) {
var ret bool
return ret
}
return *o.NeedsKey
}
// GetNeedsKeyOk returns a tuple with the NeedsKey field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WebsearchSearchEngine) GetNeedsKeyOk() (*bool, bool) {
if o == nil || IsNil(o.NeedsKey) {
return nil, false
}
return o.NeedsKey, true
}
// HasNeedsKey returns a boolean if a field has been set.
func (o *WebsearchSearchEngine) HasNeedsKey() bool {
if o != nil && !IsNil(o.NeedsKey) {
return true
}
return false
}
// SetNeedsKey gets a reference to the given bool and assigns it to the NeedsKey field.
func (o *WebsearchSearchEngine) SetNeedsKey(v bool) {
o.NeedsKey = &v
}
// GetOptions returns the Options field value if set, zero value otherwise.
func (o *WebsearchSearchEngine) GetOptions() WebsearchSearchEngineOptions {
if o == nil || IsNil(o.Options) {
var ret WebsearchSearchEngineOptions
return ret
}
return *o.Options
}
// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WebsearchSearchEngine) GetOptionsOk() (*WebsearchSearchEngineOptions, bool) {
if o == nil || IsNil(o.Options) {
return nil, false
}
return o.Options, true
}
// HasOptions returns a boolean if a field has been set.
func (o *WebsearchSearchEngine) HasOptions() bool {
if o != nil && !IsNil(o.Options) {
return true
}
return false
}
// SetOptions gets a reference to the given WebsearchSearchEngineOptions and assigns it to the Options field.
func (o *WebsearchSearchEngine) SetOptions(v WebsearchSearchEngineOptions) {
o.Options = &v
}
// GetOrder returns the Order field value if set, zero value otherwise.
func (o *WebsearchSearchEngine) GetOrder() int64 {
if o == nil || IsNil(o.Order) {
var ret int64
return ret
}
return *o.Order
}
// GetOrderOk returns a tuple with the Order field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WebsearchSearchEngine) GetOrderOk() (*int64, bool) {
if o == nil || IsNil(o.Order) {
return nil, false
}
return o.Order, true
}
// HasOrder returns a boolean if a field has been set.
func (o *WebsearchSearchEngine) HasOrder() bool {
if o != nil && !IsNil(o.Order) {
return true
}
return false
}
// SetOrder gets a reference to the given int64 and assigns it to the Order field.
func (o *WebsearchSearchEngine) SetOrder(v int64) {
o.Order = &v
}
// GetSupports returns the Supports field value if set, zero value otherwise.
func (o *WebsearchSearchEngine) GetSupports() []WebsearchSearchEngineOption {
if o == nil || IsNil(o.Supports) {
var ret []WebsearchSearchEngineOption
return ret
}
return o.Supports
}
// GetSupportsOk returns a tuple with the Supports field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WebsearchSearchEngine) GetSupportsOk() ([]WebsearchSearchEngineOption, bool) {
if o == nil || IsNil(o.Supports) {
return nil, false
}
return o.Supports, true
}
// HasSupports returns a boolean if a field has been set.
func (o *WebsearchSearchEngine) HasSupports() bool {
if o != nil && !IsNil(o.Supports) {
return true
}
return false
}
// SetSupports gets a reference to the given []WebsearchSearchEngineOption and assigns it to the Supports field.
func (o *WebsearchSearchEngine) SetSupports(v []WebsearchSearchEngineOption) {
o.Supports = v
}
func (o WebsearchSearchEngine) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o WebsearchSearchEngine) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.AcceptsKey) {
toSerialize["acceptsKey"] = o.AcceptsKey
}
if !IsNil(o.Available) {
toSerialize["available"] = o.Available
}
if !IsNil(o.Enabled) {
toSerialize["enabled"] = o.Enabled
}
if !IsNil(o.Keyed) {
toSerialize["keyed"] = o.Keyed
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.NeedsKey) {
toSerialize["needsKey"] = o.NeedsKey
}
if !IsNil(o.Options) {
toSerialize["options"] = o.Options
}
if !IsNil(o.Order) {
toSerialize["order"] = o.Order
}
if !IsNil(o.Supports) {
toSerialize["supports"] = o.Supports
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *WebsearchSearchEngine) UnmarshalJSON(data []byte) (err error) {
varWebsearchSearchEngine := _WebsearchSearchEngine{}
err = json.Unmarshal(data, &varWebsearchSearchEngine)
if err != nil {
return err
}
*o = WebsearchSearchEngine(varWebsearchSearchEngine)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "acceptsKey")
delete(additionalProperties, "available")
delete(additionalProperties, "enabled")
delete(additionalProperties, "keyed")
delete(additionalProperties, "name")
delete(additionalProperties, "needsKey")
delete(additionalProperties, "options")
delete(additionalProperties, "order")
delete(additionalProperties, "supports")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableWebsearchSearchEngine struct {
value *WebsearchSearchEngine
isSet bool
}
func (v NullableWebsearchSearchEngine) Get() *WebsearchSearchEngine {
return v.value
}
func (v *NullableWebsearchSearchEngine) Set(val *WebsearchSearchEngine) {
v.value = val
v.isSet = true
}
func (v NullableWebsearchSearchEngine) IsSet() bool {
return v.isSet
}
func (v *NullableWebsearchSearchEngine) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableWebsearchSearchEngine(val *WebsearchSearchEngine) *NullableWebsearchSearchEngine {
return &NullableWebsearchSearchEngine{value: val, isSet: true}
}
func (v NullableWebsearchSearchEngine) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableWebsearchSearchEngine) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}