mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
231 lines
6.2 KiB
Go
231 lines
6.2 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 WebsearchWebEngine type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &WebsearchWebEngine{}
|
|
|
|
// WebsearchWebEngine struct for WebsearchWebEngine
|
|
type WebsearchWebEngine struct {
|
|
// Name is the engine, matching the `engine` stamped on each result.
|
|
Name *string `json:"name,omitempty"`
|
|
// Outcome is \"answered\", \"blind\" or \"failed\" — see outcome.go. \"blind\" means the page came back and no results could be read out of it.
|
|
Outcome *string `json:"outcome,omitempty"`
|
|
// Results is how many hits this engine contributed, before the merge deduplicated them against the others.
|
|
Results *int64 `json:"results,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _WebsearchWebEngine WebsearchWebEngine
|
|
|
|
// NewWebsearchWebEngine instantiates a new WebsearchWebEngine 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 NewWebsearchWebEngine() *WebsearchWebEngine {
|
|
this := WebsearchWebEngine{}
|
|
return &this
|
|
}
|
|
|
|
// NewWebsearchWebEngineWithDefaults instantiates a new WebsearchWebEngine 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 NewWebsearchWebEngineWithDefaults() *WebsearchWebEngine {
|
|
this := WebsearchWebEngine{}
|
|
return &this
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *WebsearchWebEngine) 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 *WebsearchWebEngine) 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 *WebsearchWebEngine) 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 *WebsearchWebEngine) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetOutcome returns the Outcome field value if set, zero value otherwise.
|
|
func (o *WebsearchWebEngine) GetOutcome() string {
|
|
if o == nil || IsNil(o.Outcome) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Outcome
|
|
}
|
|
|
|
// GetOutcomeOk returns a tuple with the Outcome field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WebsearchWebEngine) GetOutcomeOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Outcome) {
|
|
return nil, false
|
|
}
|
|
return o.Outcome, true
|
|
}
|
|
|
|
// HasOutcome returns a boolean if a field has been set.
|
|
func (o *WebsearchWebEngine) HasOutcome() bool {
|
|
if o != nil && !IsNil(o.Outcome) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetOutcome gets a reference to the given string and assigns it to the Outcome field.
|
|
func (o *WebsearchWebEngine) SetOutcome(v string) {
|
|
o.Outcome = &v
|
|
}
|
|
|
|
// GetResults returns the Results field value if set, zero value otherwise.
|
|
func (o *WebsearchWebEngine) GetResults() int64 {
|
|
if o == nil || IsNil(o.Results) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Results
|
|
}
|
|
|
|
// GetResultsOk returns a tuple with the Results field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WebsearchWebEngine) GetResultsOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Results) {
|
|
return nil, false
|
|
}
|
|
return o.Results, true
|
|
}
|
|
|
|
// HasResults returns a boolean if a field has been set.
|
|
func (o *WebsearchWebEngine) HasResults() bool {
|
|
if o != nil && !IsNil(o.Results) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetResults gets a reference to the given int64 and assigns it to the Results field.
|
|
func (o *WebsearchWebEngine) SetResults(v int64) {
|
|
o.Results = &v
|
|
}
|
|
|
|
func (o WebsearchWebEngine) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o WebsearchWebEngine) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.Outcome) {
|
|
toSerialize["outcome"] = o.Outcome
|
|
}
|
|
if !IsNil(o.Results) {
|
|
toSerialize["results"] = o.Results
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *WebsearchWebEngine) UnmarshalJSON(data []byte) (err error) {
|
|
varWebsearchWebEngine := _WebsearchWebEngine{}
|
|
|
|
err = json.Unmarshal(data, &varWebsearchWebEngine)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = WebsearchWebEngine(varWebsearchWebEngine)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "outcome")
|
|
delete(additionalProperties, "results")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableWebsearchWebEngine struct {
|
|
value *WebsearchWebEngine
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableWebsearchWebEngine) Get() *WebsearchWebEngine {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableWebsearchWebEngine) Set(val *WebsearchWebEngine) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableWebsearchWebEngine) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableWebsearchWebEngine) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableWebsearchWebEngine(val *WebsearchWebEngine) *NullableWebsearchWebEngine {
|
|
return &NullableWebsearchWebEngine{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableWebsearchWebEngine) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableWebsearchWebEngine) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|