Files
sdk/model_websearch_web_result.go

269 lines
7.1 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 WebsearchWebResult type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &WebsearchWebResult{}
// WebsearchWebResult struct for WebsearchWebResult
type WebsearchWebResult struct {
// Content is the ENGINE's snippet — the few lines shown under the title, not the page's text. Read the page itself with POST /v1/crawl.
Content *string `json:"content,omitempty"`
// Engine names the backend that found this hit, so one engine's view of a query can be told from another's.
Engine *string `json:"engine,omitempty"`
// Title is the page's title.
Title *string `json:"title,omitempty"`
// URL is the page's address, as the engine reported it.
Url *string `json:"url,omitempty"`
AdditionalProperties map[string]interface{}
}
type _WebsearchWebResult WebsearchWebResult
// NewWebsearchWebResult instantiates a new WebsearchWebResult 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 NewWebsearchWebResult() *WebsearchWebResult {
this := WebsearchWebResult{}
return &this
}
// NewWebsearchWebResultWithDefaults instantiates a new WebsearchWebResult 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 NewWebsearchWebResultWithDefaults() *WebsearchWebResult {
this := WebsearchWebResult{}
return &this
}
// GetContent returns the Content field value if set, zero value otherwise.
func (o *WebsearchWebResult) GetContent() string {
if o == nil || IsNil(o.Content) {
var ret string
return ret
}
return *o.Content
}
// GetContentOk returns a tuple with the Content field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WebsearchWebResult) GetContentOk() (*string, bool) {
if o == nil || IsNil(o.Content) {
return nil, false
}
return o.Content, true
}
// HasContent returns a boolean if a field has been set.
func (o *WebsearchWebResult) HasContent() bool {
if o != nil && !IsNil(o.Content) {
return true
}
return false
}
// SetContent gets a reference to the given string and assigns it to the Content field.
func (o *WebsearchWebResult) SetContent(v string) {
o.Content = &v
}
// GetEngine returns the Engine field value if set, zero value otherwise.
func (o *WebsearchWebResult) GetEngine() string {
if o == nil || IsNil(o.Engine) {
var ret string
return ret
}
return *o.Engine
}
// GetEngineOk returns a tuple with the Engine field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WebsearchWebResult) GetEngineOk() (*string, bool) {
if o == nil || IsNil(o.Engine) {
return nil, false
}
return o.Engine, true
}
// HasEngine returns a boolean if a field has been set.
func (o *WebsearchWebResult) HasEngine() bool {
if o != nil && !IsNil(o.Engine) {
return true
}
return false
}
// SetEngine gets a reference to the given string and assigns it to the Engine field.
func (o *WebsearchWebResult) SetEngine(v string) {
o.Engine = &v
}
// GetTitle returns the Title field value if set, zero value otherwise.
func (o *WebsearchWebResult) GetTitle() string {
if o == nil || IsNil(o.Title) {
var ret string
return ret
}
return *o.Title
}
// GetTitleOk returns a tuple with the Title field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WebsearchWebResult) GetTitleOk() (*string, bool) {
if o == nil || IsNil(o.Title) {
return nil, false
}
return o.Title, true
}
// HasTitle returns a boolean if a field has been set.
func (o *WebsearchWebResult) HasTitle() bool {
if o != nil && !IsNil(o.Title) {
return true
}
return false
}
// SetTitle gets a reference to the given string and assigns it to the Title field.
func (o *WebsearchWebResult) SetTitle(v string) {
o.Title = &v
}
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *WebsearchWebResult) GetUrl() string {
if o == nil || IsNil(o.Url) {
var ret string
return ret
}
return *o.Url
}
// GetUrlOk returns a tuple with the Url field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WebsearchWebResult) GetUrlOk() (*string, bool) {
if o == nil || IsNil(o.Url) {
return nil, false
}
return o.Url, true
}
// HasUrl returns a boolean if a field has been set.
func (o *WebsearchWebResult) HasUrl() bool {
if o != nil && !IsNil(o.Url) {
return true
}
return false
}
// SetUrl gets a reference to the given string and assigns it to the Url field.
func (o *WebsearchWebResult) SetUrl(v string) {
o.Url = &v
}
func (o WebsearchWebResult) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o WebsearchWebResult) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Content) {
toSerialize["content"] = o.Content
}
if !IsNil(o.Engine) {
toSerialize["engine"] = o.Engine
}
if !IsNil(o.Title) {
toSerialize["title"] = o.Title
}
if !IsNil(o.Url) {
toSerialize["url"] = o.Url
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *WebsearchWebResult) UnmarshalJSON(data []byte) (err error) {
varWebsearchWebResult := _WebsearchWebResult{}
err = json.Unmarshal(data, &varWebsearchWebResult)
if err != nil {
return err
}
*o = WebsearchWebResult(varWebsearchWebResult)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "content")
delete(additionalProperties, "engine")
delete(additionalProperties, "title")
delete(additionalProperties, "url")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableWebsearchWebResult struct {
value *WebsearchWebResult
isSet bool
}
func (v NullableWebsearchWebResult) Get() *WebsearchWebResult {
return v.value
}
func (v *NullableWebsearchWebResult) Set(val *WebsearchWebResult) {
v.value = val
v.isSet = true
}
func (v NullableWebsearchWebResult) IsSet() bool {
return v.isSet
}
func (v *NullableWebsearchWebResult) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableWebsearchWebResult(val *WebsearchWebResult) *NullableWebsearchWebResult {
return &NullableWebsearchWebResult{value: val, isSet: true}
}
func (v NullableWebsearchWebResult) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableWebsearchWebResult) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}