Files
sdk/model_graph_graph_entity_property.go

307 lines
8.7 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 GraphGraphEntityProperty type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GraphGraphEntityProperty{}
// GraphGraphEntityProperty struct for GraphGraphEntityProperty
type GraphGraphEntityProperty struct {
// Conflicts is every weaker account of the winner's moment that names a different value, strongest first.
Conflicts []GraphWireFact `json:"conflicts,omitempty"`
// Contested is true exactly when Conflicts is not empty.
Contested *bool `json:"contested,omitempty"`
// Relation is the scalar relation's key.
Relation *string `json:"relation,omitempty"`
// Value is the winning scalar value holding at the point.
Value *string `json:"value,omitempty"`
// Winner is the assertion that speaks for this relation at the point.
Winner *GraphWireFact `json:"winner,omitempty"`
AdditionalProperties map[string]interface{}
}
type _GraphGraphEntityProperty GraphGraphEntityProperty
// NewGraphGraphEntityProperty instantiates a new GraphGraphEntityProperty 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 NewGraphGraphEntityProperty() *GraphGraphEntityProperty {
this := GraphGraphEntityProperty{}
return &this
}
// NewGraphGraphEntityPropertyWithDefaults instantiates a new GraphGraphEntityProperty 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 NewGraphGraphEntityPropertyWithDefaults() *GraphGraphEntityProperty {
this := GraphGraphEntityProperty{}
return &this
}
// GetConflicts returns the Conflicts field value if set, zero value otherwise.
func (o *GraphGraphEntityProperty) GetConflicts() []GraphWireFact {
if o == nil || IsNil(o.Conflicts) {
var ret []GraphWireFact
return ret
}
return o.Conflicts
}
// GetConflictsOk returns a tuple with the Conflicts field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphEntityProperty) GetConflictsOk() ([]GraphWireFact, bool) {
if o == nil || IsNil(o.Conflicts) {
return nil, false
}
return o.Conflicts, true
}
// HasConflicts returns a boolean if a field has been set.
func (o *GraphGraphEntityProperty) HasConflicts() bool {
if o != nil && !IsNil(o.Conflicts) {
return true
}
return false
}
// SetConflicts gets a reference to the given []GraphWireFact and assigns it to the Conflicts field.
func (o *GraphGraphEntityProperty) SetConflicts(v []GraphWireFact) {
o.Conflicts = v
}
// GetContested returns the Contested field value if set, zero value otherwise.
func (o *GraphGraphEntityProperty) GetContested() bool {
if o == nil || IsNil(o.Contested) {
var ret bool
return ret
}
return *o.Contested
}
// GetContestedOk returns a tuple with the Contested field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphEntityProperty) GetContestedOk() (*bool, bool) {
if o == nil || IsNil(o.Contested) {
return nil, false
}
return o.Contested, true
}
// HasContested returns a boolean if a field has been set.
func (o *GraphGraphEntityProperty) HasContested() bool {
if o != nil && !IsNil(o.Contested) {
return true
}
return false
}
// SetContested gets a reference to the given bool and assigns it to the Contested field.
func (o *GraphGraphEntityProperty) SetContested(v bool) {
o.Contested = &v
}
// GetRelation returns the Relation field value if set, zero value otherwise.
func (o *GraphGraphEntityProperty) GetRelation() string {
if o == nil || IsNil(o.Relation) {
var ret string
return ret
}
return *o.Relation
}
// GetRelationOk returns a tuple with the Relation field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphEntityProperty) GetRelationOk() (*string, bool) {
if o == nil || IsNil(o.Relation) {
return nil, false
}
return o.Relation, true
}
// HasRelation returns a boolean if a field has been set.
func (o *GraphGraphEntityProperty) HasRelation() bool {
if o != nil && !IsNil(o.Relation) {
return true
}
return false
}
// SetRelation gets a reference to the given string and assigns it to the Relation field.
func (o *GraphGraphEntityProperty) SetRelation(v string) {
o.Relation = &v
}
// GetValue returns the Value field value if set, zero value otherwise.
func (o *GraphGraphEntityProperty) GetValue() string {
if o == nil || IsNil(o.Value) {
var ret string
return ret
}
return *o.Value
}
// GetValueOk returns a tuple with the Value field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphEntityProperty) GetValueOk() (*string, bool) {
if o == nil || IsNil(o.Value) {
return nil, false
}
return o.Value, true
}
// HasValue returns a boolean if a field has been set.
func (o *GraphGraphEntityProperty) HasValue() bool {
if o != nil && !IsNil(o.Value) {
return true
}
return false
}
// SetValue gets a reference to the given string and assigns it to the Value field.
func (o *GraphGraphEntityProperty) SetValue(v string) {
o.Value = &v
}
// GetWinner returns the Winner field value if set, zero value otherwise.
func (o *GraphGraphEntityProperty) GetWinner() GraphWireFact {
if o == nil || IsNil(o.Winner) {
var ret GraphWireFact
return ret
}
return *o.Winner
}
// GetWinnerOk returns a tuple with the Winner field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphEntityProperty) GetWinnerOk() (*GraphWireFact, bool) {
if o == nil || IsNil(o.Winner) {
return nil, false
}
return o.Winner, true
}
// HasWinner returns a boolean if a field has been set.
func (o *GraphGraphEntityProperty) HasWinner() bool {
if o != nil && !IsNil(o.Winner) {
return true
}
return false
}
// SetWinner gets a reference to the given GraphWireFact and assigns it to the Winner field.
func (o *GraphGraphEntityProperty) SetWinner(v GraphWireFact) {
o.Winner = &v
}
func (o GraphGraphEntityProperty) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GraphGraphEntityProperty) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Conflicts) {
toSerialize["conflicts"] = o.Conflicts
}
if !IsNil(o.Contested) {
toSerialize["contested"] = o.Contested
}
if !IsNil(o.Relation) {
toSerialize["relation"] = o.Relation
}
if !IsNil(o.Value) {
toSerialize["value"] = o.Value
}
if !IsNil(o.Winner) {
toSerialize["winner"] = o.Winner
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GraphGraphEntityProperty) UnmarshalJSON(data []byte) (err error) {
varGraphGraphEntityProperty := _GraphGraphEntityProperty{}
err = json.Unmarshal(data, &varGraphGraphEntityProperty)
if err != nil {
return err
}
*o = GraphGraphEntityProperty(varGraphGraphEntityProperty)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "conflicts")
delete(additionalProperties, "contested")
delete(additionalProperties, "relation")
delete(additionalProperties, "value")
delete(additionalProperties, "winner")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGraphGraphEntityProperty struct {
value *GraphGraphEntityProperty
isSet bool
}
func (v NullableGraphGraphEntityProperty) Get() *GraphGraphEntityProperty {
return v.value
}
func (v *NullableGraphGraphEntityProperty) Set(val *GraphGraphEntityProperty) {
v.value = val
v.isSet = true
}
func (v NullableGraphGraphEntityProperty) IsSet() bool {
return v.isSet
}
func (v *NullableGraphGraphEntityProperty) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGraphGraphEntityProperty(val *GraphGraphEntityProperty) *NullableGraphGraphEntityProperty {
return &NullableGraphGraphEntityProperty{value: val, isSet: true}
}
func (v NullableGraphGraphEntityProperty) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGraphGraphEntityProperty) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}