Files
sdk/model_model_search_result.go

302 lines
7.6 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 ModelSearchResult type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ModelSearchResult{}
// ModelSearchResult struct for ModelSearchResult
type ModelSearchResult struct {
Icon *string `json:"icon,omitempty"`
Index *int32 `json:"index,omitempty"`
SiteName *string `json:"site_name,omitempty"`
Title *string `json:"title,omitempty"`
Url *string `json:"url,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ModelSearchResult ModelSearchResult
// NewModelSearchResult instantiates a new ModelSearchResult 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 NewModelSearchResult() *ModelSearchResult {
this := ModelSearchResult{}
return &this
}
// NewModelSearchResultWithDefaults instantiates a new ModelSearchResult 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 NewModelSearchResultWithDefaults() *ModelSearchResult {
this := ModelSearchResult{}
return &this
}
// GetIcon returns the Icon field value if set, zero value otherwise.
func (o *ModelSearchResult) GetIcon() string {
if o == nil || IsNil(o.Icon) {
var ret string
return ret
}
return *o.Icon
}
// GetIconOk returns a tuple with the Icon field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelSearchResult) GetIconOk() (*string, bool) {
if o == nil || IsNil(o.Icon) {
return nil, false
}
return o.Icon, true
}
// HasIcon returns a boolean if a field has been set.
func (o *ModelSearchResult) HasIcon() bool {
if o != nil && !IsNil(o.Icon) {
return true
}
return false
}
// SetIcon gets a reference to the given string and assigns it to the Icon field.
func (o *ModelSearchResult) SetIcon(v string) {
o.Icon = &v
}
// GetIndex returns the Index field value if set, zero value otherwise.
func (o *ModelSearchResult) GetIndex() int32 {
if o == nil || IsNil(o.Index) {
var ret int32
return ret
}
return *o.Index
}
// GetIndexOk returns a tuple with the Index field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelSearchResult) GetIndexOk() (*int32, bool) {
if o == nil || IsNil(o.Index) {
return nil, false
}
return o.Index, true
}
// HasIndex returns a boolean if a field has been set.
func (o *ModelSearchResult) HasIndex() bool {
if o != nil && !IsNil(o.Index) {
return true
}
return false
}
// SetIndex gets a reference to the given int32 and assigns it to the Index field.
func (o *ModelSearchResult) SetIndex(v int32) {
o.Index = &v
}
// GetSiteName returns the SiteName field value if set, zero value otherwise.
func (o *ModelSearchResult) GetSiteName() string {
if o == nil || IsNil(o.SiteName) {
var ret string
return ret
}
return *o.SiteName
}
// GetSiteNameOk returns a tuple with the SiteName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelSearchResult) GetSiteNameOk() (*string, bool) {
if o == nil || IsNil(o.SiteName) {
return nil, false
}
return o.SiteName, true
}
// HasSiteName returns a boolean if a field has been set.
func (o *ModelSearchResult) HasSiteName() bool {
if o != nil && !IsNil(o.SiteName) {
return true
}
return false
}
// SetSiteName gets a reference to the given string and assigns it to the SiteName field.
func (o *ModelSearchResult) SetSiteName(v string) {
o.SiteName = &v
}
// GetTitle returns the Title field value if set, zero value otherwise.
func (o *ModelSearchResult) 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 *ModelSearchResult) 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 *ModelSearchResult) 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 *ModelSearchResult) SetTitle(v string) {
o.Title = &v
}
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *ModelSearchResult) 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 *ModelSearchResult) 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 *ModelSearchResult) 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 *ModelSearchResult) SetUrl(v string) {
o.Url = &v
}
func (o ModelSearchResult) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ModelSearchResult) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Icon) {
toSerialize["icon"] = o.Icon
}
if !IsNil(o.Index) {
toSerialize["index"] = o.Index
}
if !IsNil(o.SiteName) {
toSerialize["site_name"] = o.SiteName
}
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 *ModelSearchResult) UnmarshalJSON(data []byte) (err error) {
varModelSearchResult := _ModelSearchResult{}
err = json.Unmarshal(data, &varModelSearchResult)
if err != nil {
return err
}
*o = ModelSearchResult(varModelSearchResult)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "icon")
delete(additionalProperties, "index")
delete(additionalProperties, "site_name")
delete(additionalProperties, "title")
delete(additionalProperties, "url")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableModelSearchResult struct {
value *ModelSearchResult
isSet bool
}
func (v NullableModelSearchResult) Get() *ModelSearchResult {
return v.value
}
func (v *NullableModelSearchResult) Set(val *ModelSearchResult) {
v.value = val
v.isSet = true
}
func (v NullableModelSearchResult) IsSet() bool {
return v.isSet
}
func (v *NullableModelSearchResult) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableModelSearchResult(val *ModelSearchResult) *NullableModelSearchResult {
return &NullableModelSearchResult{value: val, isSet: true}
}
func (v NullableModelSearchResult) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableModelSearchResult) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}