mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
231 lines
6.8 KiB
Go
231 lines
6.8 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 WebsearchSearchEngineOptions type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &WebsearchSearchEngineOptions{}
|
|
|
|
// WebsearchSearchEngineOptions struct for WebsearchSearchEngineOptions
|
|
type WebsearchSearchEngineOptions struct {
|
|
// Count is how many hits the engine is asked for per search. 0 or absent on a write means the engine's default; a read reports the value in force.
|
|
Count *int64 `json:"count,omitempty"`
|
|
// Language is the default language the engine is asked in, as a tag like `en` or `en-US`. A search that names its own language overrides it.
|
|
Language *string `json:"language,omitempty"`
|
|
// Region is a two-letter country code the engine favours, like `GB`. Stored upper case.
|
|
Region *string `json:"region,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _WebsearchSearchEngineOptions WebsearchSearchEngineOptions
|
|
|
|
// NewWebsearchSearchEngineOptions instantiates a new WebsearchSearchEngineOptions 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 NewWebsearchSearchEngineOptions() *WebsearchSearchEngineOptions {
|
|
this := WebsearchSearchEngineOptions{}
|
|
return &this
|
|
}
|
|
|
|
// NewWebsearchSearchEngineOptionsWithDefaults instantiates a new WebsearchSearchEngineOptions 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 NewWebsearchSearchEngineOptionsWithDefaults() *WebsearchSearchEngineOptions {
|
|
this := WebsearchSearchEngineOptions{}
|
|
return &this
|
|
}
|
|
|
|
// GetCount returns the Count field value if set, zero value otherwise.
|
|
func (o *WebsearchSearchEngineOptions) GetCount() int64 {
|
|
if o == nil || IsNil(o.Count) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Count
|
|
}
|
|
|
|
// GetCountOk returns a tuple with the Count field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WebsearchSearchEngineOptions) GetCountOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Count) {
|
|
return nil, false
|
|
}
|
|
return o.Count, true
|
|
}
|
|
|
|
// HasCount returns a boolean if a field has been set.
|
|
func (o *WebsearchSearchEngineOptions) HasCount() bool {
|
|
if o != nil && !IsNil(o.Count) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCount gets a reference to the given int64 and assigns it to the Count field.
|
|
func (o *WebsearchSearchEngineOptions) SetCount(v int64) {
|
|
o.Count = &v
|
|
}
|
|
|
|
// GetLanguage returns the Language field value if set, zero value otherwise.
|
|
func (o *WebsearchSearchEngineOptions) 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 *WebsearchSearchEngineOptions) 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 *WebsearchSearchEngineOptions) 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 *WebsearchSearchEngineOptions) SetLanguage(v string) {
|
|
o.Language = &v
|
|
}
|
|
|
|
// GetRegion returns the Region field value if set, zero value otherwise.
|
|
func (o *WebsearchSearchEngineOptions) GetRegion() string {
|
|
if o == nil || IsNil(o.Region) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Region
|
|
}
|
|
|
|
// GetRegionOk returns a tuple with the Region field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WebsearchSearchEngineOptions) GetRegionOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Region) {
|
|
return nil, false
|
|
}
|
|
return o.Region, true
|
|
}
|
|
|
|
// HasRegion returns a boolean if a field has been set.
|
|
func (o *WebsearchSearchEngineOptions) HasRegion() bool {
|
|
if o != nil && !IsNil(o.Region) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRegion gets a reference to the given string and assigns it to the Region field.
|
|
func (o *WebsearchSearchEngineOptions) SetRegion(v string) {
|
|
o.Region = &v
|
|
}
|
|
|
|
func (o WebsearchSearchEngineOptions) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o WebsearchSearchEngineOptions) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Count) {
|
|
toSerialize["count"] = o.Count
|
|
}
|
|
if !IsNil(o.Language) {
|
|
toSerialize["language"] = o.Language
|
|
}
|
|
if !IsNil(o.Region) {
|
|
toSerialize["region"] = o.Region
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *WebsearchSearchEngineOptions) UnmarshalJSON(data []byte) (err error) {
|
|
varWebsearchSearchEngineOptions := _WebsearchSearchEngineOptions{}
|
|
|
|
err = json.Unmarshal(data, &varWebsearchSearchEngineOptions)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = WebsearchSearchEngineOptions(varWebsearchSearchEngineOptions)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "count")
|
|
delete(additionalProperties, "language")
|
|
delete(additionalProperties, "region")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableWebsearchSearchEngineOptions struct {
|
|
value *WebsearchSearchEngineOptions
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableWebsearchSearchEngineOptions) Get() *WebsearchSearchEngineOptions {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableWebsearchSearchEngineOptions) Set(val *WebsearchSearchEngineOptions) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableWebsearchSearchEngineOptions) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableWebsearchSearchEngineOptions) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableWebsearchSearchEngineOptions(val *WebsearchSearchEngineOptions) *NullableWebsearchSearchEngineOptions {
|
|
return &NullableWebsearchSearchEngineOptions{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableWebsearchSearchEngineOptions) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableWebsearchSearchEngineOptions) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|