mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
307 lines
8.3 KiB
Go
307 lines
8.3 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 AskSource type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &AskSource{}
|
|
|
|
// AskSource struct for AskSource
|
|
type AskSource struct {
|
|
// Engine is the search backend the hit came from: bing, ddg, mojeek or brave. Omitted when the backend did not name itself. Results are merged across backends, so two sources in one answer can carry different engines.
|
|
Engine *string `json:"engine,omitempty"`
|
|
// Favicon is a 64px icon URL derived from the host for the client to render beside the citation. It is Google's s2 service, not something we host or fetched — an empty host yields the empty string.
|
|
Favicon *string `json:"favicon,omitempty"`
|
|
// Snippet is the engine's summary of the page, clipped to 600 runes. THIS IS WHAT THE CLIENT SHOWS. What the model reads is the fetched page, which is far larger and deliberately never on the wire.
|
|
Snippet *string `json:"snippet,omitempty"`
|
|
// Title is the page title the engine reported, stripped of the bracketed furniture engines staple on (\"[PDF]\", \"(Official Site)\"). It falls back to the www-stripped host when the engine gave none, so it is never empty and is safe to use as link text.
|
|
Title *string `json:"title,omitempty"`
|
|
// URL is the page, absolute, exactly as the engine gave it. It is also the dedupe key — one source per URL, and at most hostCap per host — and what a markdown citation in the answer is checked against, so a link in the prose always matches a URL here.
|
|
Url *string `json:"url,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _AskSource AskSource
|
|
|
|
// NewAskSource instantiates a new AskSource 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 NewAskSource() *AskSource {
|
|
this := AskSource{}
|
|
return &this
|
|
}
|
|
|
|
// NewAskSourceWithDefaults instantiates a new AskSource 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 NewAskSourceWithDefaults() *AskSource {
|
|
this := AskSource{}
|
|
return &this
|
|
}
|
|
|
|
// GetEngine returns the Engine field value if set, zero value otherwise.
|
|
func (o *AskSource) 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 *AskSource) 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 *AskSource) 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 *AskSource) SetEngine(v string) {
|
|
o.Engine = &v
|
|
}
|
|
|
|
// GetFavicon returns the Favicon field value if set, zero value otherwise.
|
|
func (o *AskSource) GetFavicon() string {
|
|
if o == nil || IsNil(o.Favicon) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Favicon
|
|
}
|
|
|
|
// GetFaviconOk returns a tuple with the Favicon field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AskSource) GetFaviconOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Favicon) {
|
|
return nil, false
|
|
}
|
|
return o.Favicon, true
|
|
}
|
|
|
|
// HasFavicon returns a boolean if a field has been set.
|
|
func (o *AskSource) HasFavicon() bool {
|
|
if o != nil && !IsNil(o.Favicon) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetFavicon gets a reference to the given string and assigns it to the Favicon field.
|
|
func (o *AskSource) SetFavicon(v string) {
|
|
o.Favicon = &v
|
|
}
|
|
|
|
// GetSnippet returns the Snippet field value if set, zero value otherwise.
|
|
func (o *AskSource) GetSnippet() string {
|
|
if o == nil || IsNil(o.Snippet) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Snippet
|
|
}
|
|
|
|
// GetSnippetOk returns a tuple with the Snippet field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AskSource) GetSnippetOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Snippet) {
|
|
return nil, false
|
|
}
|
|
return o.Snippet, true
|
|
}
|
|
|
|
// HasSnippet returns a boolean if a field has been set.
|
|
func (o *AskSource) HasSnippet() bool {
|
|
if o != nil && !IsNil(o.Snippet) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSnippet gets a reference to the given string and assigns it to the Snippet field.
|
|
func (o *AskSource) SetSnippet(v string) {
|
|
o.Snippet = &v
|
|
}
|
|
|
|
// GetTitle returns the Title field value if set, zero value otherwise.
|
|
func (o *AskSource) 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 *AskSource) 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 *AskSource) 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 *AskSource) SetTitle(v string) {
|
|
o.Title = &v
|
|
}
|
|
|
|
// GetUrl returns the Url field value if set, zero value otherwise.
|
|
func (o *AskSource) 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 *AskSource) 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 *AskSource) 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 *AskSource) SetUrl(v string) {
|
|
o.Url = &v
|
|
}
|
|
|
|
func (o AskSource) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o AskSource) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Engine) {
|
|
toSerialize["engine"] = o.Engine
|
|
}
|
|
if !IsNil(o.Favicon) {
|
|
toSerialize["favicon"] = o.Favicon
|
|
}
|
|
if !IsNil(o.Snippet) {
|
|
toSerialize["snippet"] = o.Snippet
|
|
}
|
|
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 *AskSource) UnmarshalJSON(data []byte) (err error) {
|
|
varAskSource := _AskSource{}
|
|
|
|
err = json.Unmarshal(data, &varAskSource)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = AskSource(varAskSource)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "engine")
|
|
delete(additionalProperties, "favicon")
|
|
delete(additionalProperties, "snippet")
|
|
delete(additionalProperties, "title")
|
|
delete(additionalProperties, "url")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableAskSource struct {
|
|
value *AskSource
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableAskSource) Get() *AskSource {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableAskSource) Set(val *AskSource) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableAskSource) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableAskSource) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableAskSource(val *AskSource) *NullableAskSource {
|
|
return &NullableAskSource{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableAskSource) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableAskSource) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|