mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
244 lines
6.6 KiB
Go
244 lines
6.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"
|
|
"fmt"
|
|
)
|
|
|
|
// checks if the GraphGraphAnswerIn type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &GraphGraphAnswerIn{}
|
|
|
|
// GraphGraphAnswerIn struct for GraphGraphAnswerIn
|
|
type GraphGraphAnswerIn struct {
|
|
// AsKnown is how much this plane had heard, RFC 3339: the answer as it would have been given then, which is what makes a past answer reproducible. Absent is now.
|
|
AsKnown *string `json:"as_known,omitempty"`
|
|
// AsOf answers from the graph as it stood at an instant of the world, RFC 3339: what held then. Absent is now.
|
|
AsOf *string `json:"as_of,omitempty"`
|
|
// Question is what to answer, in words, 1000 bytes at most. Its words also decide which communities are read first, so naming the things it is about is what aims it.
|
|
Question string `json:"question"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _GraphGraphAnswerIn GraphGraphAnswerIn
|
|
|
|
// NewGraphGraphAnswerIn instantiates a new GraphGraphAnswerIn 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 NewGraphGraphAnswerIn(question string) *GraphGraphAnswerIn {
|
|
this := GraphGraphAnswerIn{}
|
|
this.Question = question
|
|
return &this
|
|
}
|
|
|
|
// NewGraphGraphAnswerInWithDefaults instantiates a new GraphGraphAnswerIn 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 NewGraphGraphAnswerInWithDefaults() *GraphGraphAnswerIn {
|
|
this := GraphGraphAnswerIn{}
|
|
return &this
|
|
}
|
|
|
|
// GetAsKnown returns the AsKnown field value if set, zero value otherwise.
|
|
func (o *GraphGraphAnswerIn) 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 *GraphGraphAnswerIn) 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 *GraphGraphAnswerIn) 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 *GraphGraphAnswerIn) SetAsKnown(v string) {
|
|
o.AsKnown = &v
|
|
}
|
|
|
|
// GetAsOf returns the AsOf field value if set, zero value otherwise.
|
|
func (o *GraphGraphAnswerIn) 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 *GraphGraphAnswerIn) 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 *GraphGraphAnswerIn) 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 *GraphGraphAnswerIn) SetAsOf(v string) {
|
|
o.AsOf = &v
|
|
}
|
|
|
|
// GetQuestion returns the Question field value
|
|
func (o *GraphGraphAnswerIn) GetQuestion() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.Question
|
|
}
|
|
|
|
// GetQuestionOk returns a tuple with the Question field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GraphGraphAnswerIn) GetQuestionOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Question, true
|
|
}
|
|
|
|
// SetQuestion sets field value
|
|
func (o *GraphGraphAnswerIn) SetQuestion(v string) {
|
|
o.Question = v
|
|
}
|
|
|
|
func (o GraphGraphAnswerIn) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o GraphGraphAnswerIn) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.AsKnown) {
|
|
toSerialize["as_known"] = o.AsKnown
|
|
}
|
|
if !IsNil(o.AsOf) {
|
|
toSerialize["as_of"] = o.AsOf
|
|
}
|
|
toSerialize["question"] = o.Question
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *GraphGraphAnswerIn) UnmarshalJSON(data []byte) (err error) {
|
|
// This validates that all required properties are included in the JSON object
|
|
// by unmarshalling the object into a generic map with string keys and checking
|
|
// that every required field exists as a key in the generic map.
|
|
requiredProperties := []string{
|
|
"question",
|
|
}
|
|
|
|
allProperties := make(map[string]interface{})
|
|
|
|
err = json.Unmarshal(data, &allProperties)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
for _, requiredProperty := range requiredProperties {
|
|
if _, exists := allProperties[requiredProperty]; !exists {
|
|
return fmt.Errorf("no value given for required property %v", requiredProperty)
|
|
}
|
|
}
|
|
|
|
varGraphGraphAnswerIn := _GraphGraphAnswerIn{}
|
|
|
|
err = json.Unmarshal(data, &varGraphGraphAnswerIn)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = GraphGraphAnswerIn(varGraphGraphAnswerIn)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "as_known")
|
|
delete(additionalProperties, "as_of")
|
|
delete(additionalProperties, "question")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableGraphGraphAnswerIn struct {
|
|
value *GraphGraphAnswerIn
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableGraphGraphAnswerIn) Get() *GraphGraphAnswerIn {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableGraphGraphAnswerIn) Set(val *GraphGraphAnswerIn) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableGraphGraphAnswerIn) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableGraphGraphAnswerIn) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableGraphGraphAnswerIn(val *GraphGraphAnswerIn) *NullableGraphGraphAnswerIn {
|
|
return &NullableGraphGraphAnswerIn{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableGraphGraphAnswerIn) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableGraphGraphAnswerIn) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|