Files
sdk/model_books_ask_response.go

269 lines
7.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 BooksAskResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BooksAskResponse{}
// BooksAskResponse struct for BooksAskResponse
type BooksAskResponse struct {
// Answer is one or two sentences answering the question, every number in it taken from Figures.
Answer *string `json:"answer,omitempty"`
// Figures are the grounded numbers the answer states, each already formatted.
Figures []BooksFigure `json:"figures,omitempty"`
// Followups are sharper questions to ask next, chosen from the same intent.
Followups []string `json:"followups,omitempty"`
// Sources name the books reports the figures were computed from — \"pnl\", \"position\", \"trial\".
Sources []string `json:"sources,omitempty"`
AdditionalProperties map[string]interface{}
}
type _BooksAskResponse BooksAskResponse
// NewBooksAskResponse instantiates a new BooksAskResponse 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 NewBooksAskResponse() *BooksAskResponse {
this := BooksAskResponse{}
return &this
}
// NewBooksAskResponseWithDefaults instantiates a new BooksAskResponse 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 NewBooksAskResponseWithDefaults() *BooksAskResponse {
this := BooksAskResponse{}
return &this
}
// GetAnswer returns the Answer field value if set, zero value otherwise.
func (o *BooksAskResponse) GetAnswer() string {
if o == nil || IsNil(o.Answer) {
var ret string
return ret
}
return *o.Answer
}
// GetAnswerOk returns a tuple with the Answer field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BooksAskResponse) GetAnswerOk() (*string, bool) {
if o == nil || IsNil(o.Answer) {
return nil, false
}
return o.Answer, true
}
// HasAnswer returns a boolean if a field has been set.
func (o *BooksAskResponse) HasAnswer() bool {
if o != nil && !IsNil(o.Answer) {
return true
}
return false
}
// SetAnswer gets a reference to the given string and assigns it to the Answer field.
func (o *BooksAskResponse) SetAnswer(v string) {
o.Answer = &v
}
// GetFigures returns the Figures field value if set, zero value otherwise.
func (o *BooksAskResponse) GetFigures() []BooksFigure {
if o == nil || IsNil(o.Figures) {
var ret []BooksFigure
return ret
}
return o.Figures
}
// GetFiguresOk returns a tuple with the Figures field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BooksAskResponse) GetFiguresOk() ([]BooksFigure, bool) {
if o == nil || IsNil(o.Figures) {
return nil, false
}
return o.Figures, true
}
// HasFigures returns a boolean if a field has been set.
func (o *BooksAskResponse) HasFigures() bool {
if o != nil && !IsNil(o.Figures) {
return true
}
return false
}
// SetFigures gets a reference to the given []BooksFigure and assigns it to the Figures field.
func (o *BooksAskResponse) SetFigures(v []BooksFigure) {
o.Figures = v
}
// GetFollowups returns the Followups field value if set, zero value otherwise.
func (o *BooksAskResponse) GetFollowups() []string {
if o == nil || IsNil(o.Followups) {
var ret []string
return ret
}
return o.Followups
}
// GetFollowupsOk returns a tuple with the Followups field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BooksAskResponse) GetFollowupsOk() ([]string, bool) {
if o == nil || IsNil(o.Followups) {
return nil, false
}
return o.Followups, true
}
// HasFollowups returns a boolean if a field has been set.
func (o *BooksAskResponse) HasFollowups() bool {
if o != nil && !IsNil(o.Followups) {
return true
}
return false
}
// SetFollowups gets a reference to the given []string and assigns it to the Followups field.
func (o *BooksAskResponse) SetFollowups(v []string) {
o.Followups = v
}
// GetSources returns the Sources field value if set, zero value otherwise.
func (o *BooksAskResponse) GetSources() []string {
if o == nil || IsNil(o.Sources) {
var ret []string
return ret
}
return o.Sources
}
// GetSourcesOk returns a tuple with the Sources field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BooksAskResponse) GetSourcesOk() ([]string, bool) {
if o == nil || IsNil(o.Sources) {
return nil, false
}
return o.Sources, true
}
// HasSources returns a boolean if a field has been set.
func (o *BooksAskResponse) HasSources() bool {
if o != nil && !IsNil(o.Sources) {
return true
}
return false
}
// SetSources gets a reference to the given []string and assigns it to the Sources field.
func (o *BooksAskResponse) SetSources(v []string) {
o.Sources = v
}
func (o BooksAskResponse) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BooksAskResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Answer) {
toSerialize["answer"] = o.Answer
}
if !IsNil(o.Figures) {
toSerialize["figures"] = o.Figures
}
if !IsNil(o.Followups) {
toSerialize["followups"] = o.Followups
}
if !IsNil(o.Sources) {
toSerialize["sources"] = o.Sources
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *BooksAskResponse) UnmarshalJSON(data []byte) (err error) {
varBooksAskResponse := _BooksAskResponse{}
err = json.Unmarshal(data, &varBooksAskResponse)
if err != nil {
return err
}
*o = BooksAskResponse(varBooksAskResponse)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "answer")
delete(additionalProperties, "figures")
delete(additionalProperties, "followups")
delete(additionalProperties, "sources")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableBooksAskResponse struct {
value *BooksAskResponse
isSet bool
}
func (v NullableBooksAskResponse) Get() *BooksAskResponse {
return v.value
}
func (v *NullableBooksAskResponse) Set(val *BooksAskResponse) {
v.value = val
v.isSet = true
}
func (v NullableBooksAskResponse) IsSet() bool {
return v.isSet
}
func (v *NullableBooksAskResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBooksAskResponse(val *BooksAskResponse) *NullableBooksAskResponse {
return &NullableBooksAskResponse{value: val, isSet: true}
}
func (v NullableBooksAskResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBooksAskResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}