Files
sdk/model_graph_graph_path_out.go

459 lines
13 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 GraphGraphPathOut type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GraphGraphPathOut{}
// GraphGraphPathOut struct for GraphGraphPathOut
type GraphGraphPathOut struct {
// 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 path was taken at, RFC 3339: the one asked for, or the server's clock when none was.
AsOf *string `json:"as_of,omitempty"`
// Bound is the ceiling the search was held to, the same one a walk is.
Bound *int64 `json:"bound,omitempty"`
// Decay is the product of the edges' confidences: how much certainty survives the whole chain. Absent unless every edge states a confidence above zero — an unstated confidence reads as zero, and a product of numbers nobody gave measures nothing.
Decay *float64 `json:"decay,omitempty"`
// Edges is the path from From to To, one assertion per hop, each with its source, evidence and filer. An edge is listed as it was asserted, so under in or both it may point against the direction of travel.
Edges []GraphWireFact `json:"edges,omitempty"`
// Found is false when no path of in-force edges joins the two within the bound. That is an answer, not an error.
Found *bool `json:"found,omitempty"`
// Hops is how many edges the path crosses: zero when From is To, and zero when nothing was found.
Hops *int64 `json:"hops,omitempty"`
// Truncated says the bound stopped the search before a path was found, so Found false means none within the bound rather than none at all.
Truncated *bool `json:"truncated,omitempty"`
// Weakest is the edge with the lowest confidence, the first of them on a tie: the link the chain is only as strong as. Absent exactly when Decay is.
Weakest *GraphWireFact `json:"weakest,omitempty"`
AdditionalProperties map[string]interface{}
}
type _GraphGraphPathOut GraphGraphPathOut
// NewGraphGraphPathOut instantiates a new GraphGraphPathOut 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 NewGraphGraphPathOut() *GraphGraphPathOut {
this := GraphGraphPathOut{}
return &this
}
// NewGraphGraphPathOutWithDefaults instantiates a new GraphGraphPathOut 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 NewGraphGraphPathOutWithDefaults() *GraphGraphPathOut {
this := GraphGraphPathOut{}
return &this
}
// GetAsKnown returns the AsKnown field value if set, zero value otherwise.
func (o *GraphGraphPathOut) 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 *GraphGraphPathOut) 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 *GraphGraphPathOut) 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 *GraphGraphPathOut) SetAsKnown(v string) {
o.AsKnown = &v
}
// GetAsOf returns the AsOf field value if set, zero value otherwise.
func (o *GraphGraphPathOut) 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 *GraphGraphPathOut) 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 *GraphGraphPathOut) 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 *GraphGraphPathOut) SetAsOf(v string) {
o.AsOf = &v
}
// GetBound returns the Bound field value if set, zero value otherwise.
func (o *GraphGraphPathOut) GetBound() int64 {
if o == nil || IsNil(o.Bound) {
var ret int64
return ret
}
return *o.Bound
}
// GetBoundOk returns a tuple with the Bound field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphPathOut) GetBoundOk() (*int64, bool) {
if o == nil || IsNil(o.Bound) {
return nil, false
}
return o.Bound, true
}
// HasBound returns a boolean if a field has been set.
func (o *GraphGraphPathOut) HasBound() bool {
if o != nil && !IsNil(o.Bound) {
return true
}
return false
}
// SetBound gets a reference to the given int64 and assigns it to the Bound field.
func (o *GraphGraphPathOut) SetBound(v int64) {
o.Bound = &v
}
// GetDecay returns the Decay field value if set, zero value otherwise.
func (o *GraphGraphPathOut) GetDecay() float64 {
if o == nil || IsNil(o.Decay) {
var ret float64
return ret
}
return *o.Decay
}
// GetDecayOk returns a tuple with the Decay field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphPathOut) GetDecayOk() (*float64, bool) {
if o == nil || IsNil(o.Decay) {
return nil, false
}
return o.Decay, true
}
// HasDecay returns a boolean if a field has been set.
func (o *GraphGraphPathOut) HasDecay() bool {
if o != nil && !IsNil(o.Decay) {
return true
}
return false
}
// SetDecay gets a reference to the given float64 and assigns it to the Decay field.
func (o *GraphGraphPathOut) SetDecay(v float64) {
o.Decay = &v
}
// GetEdges returns the Edges field value if set, zero value otherwise.
func (o *GraphGraphPathOut) GetEdges() []GraphWireFact {
if o == nil || IsNil(o.Edges) {
var ret []GraphWireFact
return ret
}
return o.Edges
}
// GetEdgesOk returns a tuple with the Edges field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphPathOut) GetEdgesOk() ([]GraphWireFact, bool) {
if o == nil || IsNil(o.Edges) {
return nil, false
}
return o.Edges, true
}
// HasEdges returns a boolean if a field has been set.
func (o *GraphGraphPathOut) HasEdges() bool {
if o != nil && !IsNil(o.Edges) {
return true
}
return false
}
// SetEdges gets a reference to the given []GraphWireFact and assigns it to the Edges field.
func (o *GraphGraphPathOut) SetEdges(v []GraphWireFact) {
o.Edges = v
}
// GetFound returns the Found field value if set, zero value otherwise.
func (o *GraphGraphPathOut) GetFound() bool {
if o == nil || IsNil(o.Found) {
var ret bool
return ret
}
return *o.Found
}
// GetFoundOk returns a tuple with the Found field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphPathOut) GetFoundOk() (*bool, bool) {
if o == nil || IsNil(o.Found) {
return nil, false
}
return o.Found, true
}
// HasFound returns a boolean if a field has been set.
func (o *GraphGraphPathOut) HasFound() bool {
if o != nil && !IsNil(o.Found) {
return true
}
return false
}
// SetFound gets a reference to the given bool and assigns it to the Found field.
func (o *GraphGraphPathOut) SetFound(v bool) {
o.Found = &v
}
// GetHops returns the Hops field value if set, zero value otherwise.
func (o *GraphGraphPathOut) GetHops() int64 {
if o == nil || IsNil(o.Hops) {
var ret int64
return ret
}
return *o.Hops
}
// GetHopsOk returns a tuple with the Hops field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphPathOut) GetHopsOk() (*int64, bool) {
if o == nil || IsNil(o.Hops) {
return nil, false
}
return o.Hops, true
}
// HasHops returns a boolean if a field has been set.
func (o *GraphGraphPathOut) HasHops() bool {
if o != nil && !IsNil(o.Hops) {
return true
}
return false
}
// SetHops gets a reference to the given int64 and assigns it to the Hops field.
func (o *GraphGraphPathOut) SetHops(v int64) {
o.Hops = &v
}
// GetTruncated returns the Truncated field value if set, zero value otherwise.
func (o *GraphGraphPathOut) GetTruncated() bool {
if o == nil || IsNil(o.Truncated) {
var ret bool
return ret
}
return *o.Truncated
}
// GetTruncatedOk returns a tuple with the Truncated field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphPathOut) GetTruncatedOk() (*bool, bool) {
if o == nil || IsNil(o.Truncated) {
return nil, false
}
return o.Truncated, true
}
// HasTruncated returns a boolean if a field has been set.
func (o *GraphGraphPathOut) HasTruncated() bool {
if o != nil && !IsNil(o.Truncated) {
return true
}
return false
}
// SetTruncated gets a reference to the given bool and assigns it to the Truncated field.
func (o *GraphGraphPathOut) SetTruncated(v bool) {
o.Truncated = &v
}
// GetWeakest returns the Weakest field value if set, zero value otherwise.
func (o *GraphGraphPathOut) GetWeakest() GraphWireFact {
if o == nil || IsNil(o.Weakest) {
var ret GraphWireFact
return ret
}
return *o.Weakest
}
// GetWeakestOk returns a tuple with the Weakest field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphPathOut) GetWeakestOk() (*GraphWireFact, bool) {
if o == nil || IsNil(o.Weakest) {
return nil, false
}
return o.Weakest, true
}
// HasWeakest returns a boolean if a field has been set.
func (o *GraphGraphPathOut) HasWeakest() bool {
if o != nil && !IsNil(o.Weakest) {
return true
}
return false
}
// SetWeakest gets a reference to the given GraphWireFact and assigns it to the Weakest field.
func (o *GraphGraphPathOut) SetWeakest(v GraphWireFact) {
o.Weakest = &v
}
func (o GraphGraphPathOut) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GraphGraphPathOut) 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
}
if !IsNil(o.Bound) {
toSerialize["bound"] = o.Bound
}
if !IsNil(o.Decay) {
toSerialize["decay"] = o.Decay
}
if !IsNil(o.Edges) {
toSerialize["edges"] = o.Edges
}
if !IsNil(o.Found) {
toSerialize["found"] = o.Found
}
if !IsNil(o.Hops) {
toSerialize["hops"] = o.Hops
}
if !IsNil(o.Truncated) {
toSerialize["truncated"] = o.Truncated
}
if !IsNil(o.Weakest) {
toSerialize["weakest"] = o.Weakest
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GraphGraphPathOut) UnmarshalJSON(data []byte) (err error) {
varGraphGraphPathOut := _GraphGraphPathOut{}
err = json.Unmarshal(data, &varGraphGraphPathOut)
if err != nil {
return err
}
*o = GraphGraphPathOut(varGraphGraphPathOut)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "as_known")
delete(additionalProperties, "as_of")
delete(additionalProperties, "bound")
delete(additionalProperties, "decay")
delete(additionalProperties, "edges")
delete(additionalProperties, "found")
delete(additionalProperties, "hops")
delete(additionalProperties, "truncated")
delete(additionalProperties, "weakest")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGraphGraphPathOut struct {
value *GraphGraphPathOut
isSet bool
}
func (v NullableGraphGraphPathOut) Get() *GraphGraphPathOut {
return v.value
}
func (v *NullableGraphGraphPathOut) Set(val *GraphGraphPathOut) {
v.value = val
v.isSet = true
}
func (v NullableGraphGraphPathOut) IsSet() bool {
return v.isSet
}
func (v *NullableGraphGraphPathOut) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGraphGraphPathOut(val *GraphGraphPathOut) *NullableGraphGraphPathOut {
return &NullableGraphGraphPathOut{value: val, isSet: true}
}
func (v NullableGraphGraphPathOut) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGraphGraphPathOut) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}