Files
sdk/model_graph_graph_answer_out.go

535 lines
15 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 GraphGraphAnswerOut type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GraphGraphAnswerOut{}
// GraphGraphAnswerOut struct for GraphGraphAnswerOut
type GraphGraphAnswerOut struct {
// Answer is the answer, in prose.
Answer *string `json:"answer,omitempty"`
// AsKnown is the knowledge instant it was taken at, RFC 3339, the same way.
AsKnown *string `json:"as_known,omitempty"`
// AsOf is the instant the graph was read at, RFC 3339: the one asked for, or the server's clock when none was.
AsOf *string `json:"as_of,omitempty"`
// Asked is how many communities were read.
Asked *int64 `json:"asked,omitempty"`
// Assertions are the IDs of every assertion the answer rests on, ascending.
Assertions []string `json:"assertions,omitempty"`
// Calls is how many model calls the answer made, each billed to the calling organization.
Calls *int64 `json:"calls,omitempty"`
// Clipped says the answer did not read all it gathered: a community held more facts than one call carries, or more members than one answer reads, and kept the ones the question named and then the most connected; a member held more than 64 assertions and kept its newest; or the findings held more than the answering call carries and kept the highest scored.
Clipped *bool `json:"clipped,omitempty"`
// Communities are every community the answer rests on, ascending.
Communities []int64 `json:"communities,omitempty"`
// Findings are the findings the answer cites, most relevant first.
Findings []GraphGraphFinding `json:"findings,omitempty"`
// Grounded is false when no community held a fact bearing on the question, or the findings did not answer it. Answer is then empty: an answer resting on nothing is not one this plane gives.
Grounded *bool `json:"grounded,omitempty"`
// Skipped is how many were not, because one answer makes at most eight map calls and reads at most 2048 entities. They are the ones the question's words ranked last.
Skipped *int64 `json:"skipped,omitempty"`
AdditionalProperties map[string]interface{}
}
type _GraphGraphAnswerOut GraphGraphAnswerOut
// NewGraphGraphAnswerOut instantiates a new GraphGraphAnswerOut 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 NewGraphGraphAnswerOut() *GraphGraphAnswerOut {
this := GraphGraphAnswerOut{}
return &this
}
// NewGraphGraphAnswerOutWithDefaults instantiates a new GraphGraphAnswerOut 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 NewGraphGraphAnswerOutWithDefaults() *GraphGraphAnswerOut {
this := GraphGraphAnswerOut{}
return &this
}
// GetAnswer returns the Answer field value if set, zero value otherwise.
func (o *GraphGraphAnswerOut) 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 *GraphGraphAnswerOut) 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 *GraphGraphAnswerOut) 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 *GraphGraphAnswerOut) SetAnswer(v string) {
o.Answer = &v
}
// GetAsKnown returns the AsKnown field value if set, zero value otherwise.
func (o *GraphGraphAnswerOut) GetAsKnown() string {
if o == nil || IsNil(o.AsKnown) {
var ret string
return ret
}
return *o.AsKnown
}
// GetAsKnownOk returns a tuple with the AsKnown field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphAnswerOut) GetAsKnownOk() (*string, bool) {
if o == nil || IsNil(o.AsKnown) {
return nil, false
}
return o.AsKnown, true
}
// HasAsKnown returns a boolean if a field has been set.
func (o *GraphGraphAnswerOut) HasAsKnown() bool {
if o != nil && !IsNil(o.AsKnown) {
return true
}
return false
}
// SetAsKnown gets a reference to the given string and assigns it to the AsKnown field.
func (o *GraphGraphAnswerOut) SetAsKnown(v string) {
o.AsKnown = &v
}
// GetAsOf returns the AsOf field value if set, zero value otherwise.
func (o *GraphGraphAnswerOut) GetAsOf() string {
if o == nil || IsNil(o.AsOf) {
var ret string
return ret
}
return *o.AsOf
}
// GetAsOfOk returns a tuple with the AsOf field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphAnswerOut) GetAsOfOk() (*string, bool) {
if o == nil || IsNil(o.AsOf) {
return nil, false
}
return o.AsOf, true
}
// HasAsOf returns a boolean if a field has been set.
func (o *GraphGraphAnswerOut) HasAsOf() bool {
if o != nil && !IsNil(o.AsOf) {
return true
}
return false
}
// SetAsOf gets a reference to the given string and assigns it to the AsOf field.
func (o *GraphGraphAnswerOut) SetAsOf(v string) {
o.AsOf = &v
}
// GetAsked returns the Asked field value if set, zero value otherwise.
func (o *GraphGraphAnswerOut) GetAsked() int64 {
if o == nil || IsNil(o.Asked) {
var ret int64
return ret
}
return *o.Asked
}
// GetAskedOk returns a tuple with the Asked field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphAnswerOut) GetAskedOk() (*int64, bool) {
if o == nil || IsNil(o.Asked) {
return nil, false
}
return o.Asked, true
}
// HasAsked returns a boolean if a field has been set.
func (o *GraphGraphAnswerOut) HasAsked() bool {
if o != nil && !IsNil(o.Asked) {
return true
}
return false
}
// SetAsked gets a reference to the given int64 and assigns it to the Asked field.
func (o *GraphGraphAnswerOut) SetAsked(v int64) {
o.Asked = &v
}
// GetAssertions returns the Assertions field value if set, zero value otherwise.
func (o *GraphGraphAnswerOut) GetAssertions() []string {
if o == nil || IsNil(o.Assertions) {
var ret []string
return ret
}
return o.Assertions
}
// GetAssertionsOk returns a tuple with the Assertions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphAnswerOut) GetAssertionsOk() ([]string, bool) {
if o == nil || IsNil(o.Assertions) {
return nil, false
}
return o.Assertions, true
}
// HasAssertions returns a boolean if a field has been set.
func (o *GraphGraphAnswerOut) HasAssertions() bool {
if o != nil && !IsNil(o.Assertions) {
return true
}
return false
}
// SetAssertions gets a reference to the given []string and assigns it to the Assertions field.
func (o *GraphGraphAnswerOut) SetAssertions(v []string) {
o.Assertions = v
}
// GetCalls returns the Calls field value if set, zero value otherwise.
func (o *GraphGraphAnswerOut) GetCalls() int64 {
if o == nil || IsNil(o.Calls) {
var ret int64
return ret
}
return *o.Calls
}
// GetCallsOk returns a tuple with the Calls field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphAnswerOut) GetCallsOk() (*int64, bool) {
if o == nil || IsNil(o.Calls) {
return nil, false
}
return o.Calls, true
}
// HasCalls returns a boolean if a field has been set.
func (o *GraphGraphAnswerOut) HasCalls() bool {
if o != nil && !IsNil(o.Calls) {
return true
}
return false
}
// SetCalls gets a reference to the given int64 and assigns it to the Calls field.
func (o *GraphGraphAnswerOut) SetCalls(v int64) {
o.Calls = &v
}
// GetClipped returns the Clipped field value if set, zero value otherwise.
func (o *GraphGraphAnswerOut) GetClipped() bool {
if o == nil || IsNil(o.Clipped) {
var ret bool
return ret
}
return *o.Clipped
}
// GetClippedOk returns a tuple with the Clipped field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphAnswerOut) GetClippedOk() (*bool, bool) {
if o == nil || IsNil(o.Clipped) {
return nil, false
}
return o.Clipped, true
}
// HasClipped returns a boolean if a field has been set.
func (o *GraphGraphAnswerOut) HasClipped() bool {
if o != nil && !IsNil(o.Clipped) {
return true
}
return false
}
// SetClipped gets a reference to the given bool and assigns it to the Clipped field.
func (o *GraphGraphAnswerOut) SetClipped(v bool) {
o.Clipped = &v
}
// GetCommunities returns the Communities field value if set, zero value otherwise.
func (o *GraphGraphAnswerOut) GetCommunities() []int64 {
if o == nil || IsNil(o.Communities) {
var ret []int64
return ret
}
return o.Communities
}
// GetCommunitiesOk returns a tuple with the Communities field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphAnswerOut) GetCommunitiesOk() ([]int64, bool) {
if o == nil || IsNil(o.Communities) {
return nil, false
}
return o.Communities, true
}
// HasCommunities returns a boolean if a field has been set.
func (o *GraphGraphAnswerOut) HasCommunities() bool {
if o != nil && !IsNil(o.Communities) {
return true
}
return false
}
// SetCommunities gets a reference to the given []int64 and assigns it to the Communities field.
func (o *GraphGraphAnswerOut) SetCommunities(v []int64) {
o.Communities = v
}
// GetFindings returns the Findings field value if set, zero value otherwise.
func (o *GraphGraphAnswerOut) GetFindings() []GraphGraphFinding {
if o == nil || IsNil(o.Findings) {
var ret []GraphGraphFinding
return ret
}
return o.Findings
}
// GetFindingsOk returns a tuple with the Findings field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphAnswerOut) GetFindingsOk() ([]GraphGraphFinding, bool) {
if o == nil || IsNil(o.Findings) {
return nil, false
}
return o.Findings, true
}
// HasFindings returns a boolean if a field has been set.
func (o *GraphGraphAnswerOut) HasFindings() bool {
if o != nil && !IsNil(o.Findings) {
return true
}
return false
}
// SetFindings gets a reference to the given []GraphGraphFinding and assigns it to the Findings field.
func (o *GraphGraphAnswerOut) SetFindings(v []GraphGraphFinding) {
o.Findings = v
}
// GetGrounded returns the Grounded field value if set, zero value otherwise.
func (o *GraphGraphAnswerOut) GetGrounded() bool {
if o == nil || IsNil(o.Grounded) {
var ret bool
return ret
}
return *o.Grounded
}
// GetGroundedOk returns a tuple with the Grounded field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphAnswerOut) GetGroundedOk() (*bool, bool) {
if o == nil || IsNil(o.Grounded) {
return nil, false
}
return o.Grounded, true
}
// HasGrounded returns a boolean if a field has been set.
func (o *GraphGraphAnswerOut) HasGrounded() bool {
if o != nil && !IsNil(o.Grounded) {
return true
}
return false
}
// SetGrounded gets a reference to the given bool and assigns it to the Grounded field.
func (o *GraphGraphAnswerOut) SetGrounded(v bool) {
o.Grounded = &v
}
// GetSkipped returns the Skipped field value if set, zero value otherwise.
func (o *GraphGraphAnswerOut) GetSkipped() int64 {
if o == nil || IsNil(o.Skipped) {
var ret int64
return ret
}
return *o.Skipped
}
// GetSkippedOk returns a tuple with the Skipped field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphAnswerOut) GetSkippedOk() (*int64, bool) {
if o == nil || IsNil(o.Skipped) {
return nil, false
}
return o.Skipped, true
}
// HasSkipped returns a boolean if a field has been set.
func (o *GraphGraphAnswerOut) HasSkipped() bool {
if o != nil && !IsNil(o.Skipped) {
return true
}
return false
}
// SetSkipped gets a reference to the given int64 and assigns it to the Skipped field.
func (o *GraphGraphAnswerOut) SetSkipped(v int64) {
o.Skipped = &v
}
func (o GraphGraphAnswerOut) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GraphGraphAnswerOut) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Answer) {
toSerialize["answer"] = o.Answer
}
if !IsNil(o.AsKnown) {
toSerialize["as_known"] = o.AsKnown
}
if !IsNil(o.AsOf) {
toSerialize["as_of"] = o.AsOf
}
if !IsNil(o.Asked) {
toSerialize["asked"] = o.Asked
}
if !IsNil(o.Assertions) {
toSerialize["assertions"] = o.Assertions
}
if !IsNil(o.Calls) {
toSerialize["calls"] = o.Calls
}
if !IsNil(o.Clipped) {
toSerialize["clipped"] = o.Clipped
}
if !IsNil(o.Communities) {
toSerialize["communities"] = o.Communities
}
if !IsNil(o.Findings) {
toSerialize["findings"] = o.Findings
}
if !IsNil(o.Grounded) {
toSerialize["grounded"] = o.Grounded
}
if !IsNil(o.Skipped) {
toSerialize["skipped"] = o.Skipped
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GraphGraphAnswerOut) UnmarshalJSON(data []byte) (err error) {
varGraphGraphAnswerOut := _GraphGraphAnswerOut{}
err = json.Unmarshal(data, &varGraphGraphAnswerOut)
if err != nil {
return err
}
*o = GraphGraphAnswerOut(varGraphGraphAnswerOut)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "answer")
delete(additionalProperties, "as_known")
delete(additionalProperties, "as_of")
delete(additionalProperties, "asked")
delete(additionalProperties, "assertions")
delete(additionalProperties, "calls")
delete(additionalProperties, "clipped")
delete(additionalProperties, "communities")
delete(additionalProperties, "findings")
delete(additionalProperties, "grounded")
delete(additionalProperties, "skipped")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGraphGraphAnswerOut struct {
value *GraphGraphAnswerOut
isSet bool
}
func (v NullableGraphGraphAnswerOut) Get() *GraphGraphAnswerOut {
return v.value
}
func (v *NullableGraphGraphAnswerOut) Set(val *GraphGraphAnswerOut) {
v.value = val
v.isSet = true
}
func (v NullableGraphGraphAnswerOut) IsSet() bool {
return v.isSet
}
func (v *NullableGraphGraphAnswerOut) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGraphGraphAnswerOut(val *GraphGraphAnswerOut) *NullableGraphGraphAnswerOut {
return &NullableGraphGraphAnswerOut{value: val, isSet: true}
}
func (v NullableGraphGraphAnswerOut) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGraphGraphAnswerOut) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}