Files
sdk/model_graph_graph_path_in.go

350 lines
9.3 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 GraphGraphPathIn type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GraphGraphPathIn{}
// GraphGraphPathIn struct for GraphGraphPathIn
type GraphGraphPathIn 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 finds the path through the graph as it stood at an instant of the world, RFC 3339: an edge that did not hold then is not crossed. Absent is now.
AsOf *string `json:"as_of,omitempty"`
// Direction is out, in or both. Out crosses each edge from its entity to its value; in crosses it backwards; both crosses it either way. Absent is out.
Direction *string `json:"direction,omitempty"`
// From is the entity the path starts at. Required.
From string `json:"from"`
// Relations is the edge relations a path may cross. Absent crosses every relation. A causal chain is this list naming the relations that mean cause — `caused_by` and `influenced` under the decision convention. At most 256.
Relations []string `json:"relations,omitempty"`
// To is the entity the path ends at. Required.
To string `json:"to"`
AdditionalProperties map[string]interface{}
}
type _GraphGraphPathIn GraphGraphPathIn
// NewGraphGraphPathIn instantiates a new GraphGraphPathIn 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 NewGraphGraphPathIn(from string, to string) *GraphGraphPathIn {
this := GraphGraphPathIn{}
this.From = from
this.To = to
return &this
}
// NewGraphGraphPathInWithDefaults instantiates a new GraphGraphPathIn 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 NewGraphGraphPathInWithDefaults() *GraphGraphPathIn {
this := GraphGraphPathIn{}
return &this
}
// GetAsKnown returns the AsKnown field value if set, zero value otherwise.
func (o *GraphGraphPathIn) 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 *GraphGraphPathIn) 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 *GraphGraphPathIn) 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 *GraphGraphPathIn) SetAsKnown(v string) {
o.AsKnown = &v
}
// GetAsOf returns the AsOf field value if set, zero value otherwise.
func (o *GraphGraphPathIn) 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 *GraphGraphPathIn) 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 *GraphGraphPathIn) 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 *GraphGraphPathIn) SetAsOf(v string) {
o.AsOf = &v
}
// GetDirection returns the Direction field value if set, zero value otherwise.
func (o *GraphGraphPathIn) GetDirection() string {
if o == nil || IsNil(o.Direction) {
var ret string
return ret
}
return *o.Direction
}
// GetDirectionOk returns a tuple with the Direction field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphPathIn) GetDirectionOk() (*string, bool) {
if o == nil || IsNil(o.Direction) {
return nil, false
}
return o.Direction, true
}
// HasDirection returns a boolean if a field has been set.
func (o *GraphGraphPathIn) HasDirection() bool {
if o != nil && !IsNil(o.Direction) {
return true
}
return false
}
// SetDirection gets a reference to the given string and assigns it to the Direction field.
func (o *GraphGraphPathIn) SetDirection(v string) {
o.Direction = &v
}
// GetFrom returns the From field value
func (o *GraphGraphPathIn) GetFrom() string {
if o == nil {
var ret string
return ret
}
return o.From
}
// GetFromOk returns a tuple with the From field value
// and a boolean to check if the value has been set.
func (o *GraphGraphPathIn) GetFromOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.From, true
}
// SetFrom sets field value
func (o *GraphGraphPathIn) SetFrom(v string) {
o.From = v
}
// GetRelations returns the Relations field value if set, zero value otherwise.
func (o *GraphGraphPathIn) GetRelations() []string {
if o == nil || IsNil(o.Relations) {
var ret []string
return ret
}
return o.Relations
}
// GetRelationsOk returns a tuple with the Relations field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphPathIn) GetRelationsOk() ([]string, bool) {
if o == nil || IsNil(o.Relations) {
return nil, false
}
return o.Relations, true
}
// HasRelations returns a boolean if a field has been set.
func (o *GraphGraphPathIn) HasRelations() bool {
if o != nil && !IsNil(o.Relations) {
return true
}
return false
}
// SetRelations gets a reference to the given []string and assigns it to the Relations field.
func (o *GraphGraphPathIn) SetRelations(v []string) {
o.Relations = v
}
// GetTo returns the To field value
func (o *GraphGraphPathIn) GetTo() string {
if o == nil {
var ret string
return ret
}
return o.To
}
// GetToOk returns a tuple with the To field value
// and a boolean to check if the value has been set.
func (o *GraphGraphPathIn) GetToOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.To, true
}
// SetTo sets field value
func (o *GraphGraphPathIn) SetTo(v string) {
o.To = v
}
func (o GraphGraphPathIn) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GraphGraphPathIn) 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.Direction) {
toSerialize["direction"] = o.Direction
}
toSerialize["from"] = o.From
if !IsNil(o.Relations) {
toSerialize["relations"] = o.Relations
}
toSerialize["to"] = o.To
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GraphGraphPathIn) 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{
"from",
"to",
}
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)
}
}
varGraphGraphPathIn := _GraphGraphPathIn{}
err = json.Unmarshal(data, &varGraphGraphPathIn)
if err != nil {
return err
}
*o = GraphGraphPathIn(varGraphGraphPathIn)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "as_known")
delete(additionalProperties, "as_of")
delete(additionalProperties, "direction")
delete(additionalProperties, "from")
delete(additionalProperties, "relations")
delete(additionalProperties, "to")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGraphGraphPathIn struct {
value *GraphGraphPathIn
isSet bool
}
func (v NullableGraphGraphPathIn) Get() *GraphGraphPathIn {
return v.value
}
func (v *NullableGraphGraphPathIn) Set(val *GraphGraphPathIn) {
v.value = val
v.isSet = true
}
func (v NullableGraphGraphPathIn) IsSet() bool {
return v.isSet
}
func (v *NullableGraphGraphPathIn) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGraphGraphPathIn(val *GraphGraphPathIn) *NullableGraphGraphPathIn {
return &NullableGraphGraphPathIn{value: val, isSet: true}
}
func (v NullableGraphGraphPathIn) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGraphGraphPathIn) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}