Files
sdk/model_graph_graph_triple.go

345 lines
9.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"
)
// checks if the GraphGraphTriple type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GraphGraphTriple{}
// GraphGraphTriple struct for GraphGraphTriple
type GraphGraphTriple struct {
// Names is the author's declaration that Object is an entity and the assertion is an EDGE, written `[[key]]`. Absent, the relation is a property of Subject. It is read from the notation and never guessed from the value's shape.
Names *bool `json:"names,omitempty"`
// Object is what the relation points at. When Names is true it has been unwrapped from its `[[…]]` and is another entity's key.
Object *string `json:"object,omitempty"`
// Predicate is the relation, exactly as the line spells it before the `::`. This surface holds no vocabulary, so it renames nothing.
Predicate *string `json:"predicate,omitempty"`
// Reason is why filing it would be refused: the declared schema, or a declaration from a caller who is not an admin of the organization. Present only on a member of Refused.
Reason *string `json:"reason,omitempty"`
// Section is which section of the source stated it, counting from zero. It is the second half of every resulting assertion's evidence, `<source>#<section>`.
Section *int64 `json:"section,omitempty"`
// Subject is the entity the statement is about: the nearest heading above the line, or the request's own subject where no heading has appeared yet.
Subject *string `json:"subject,omitempty"`
AdditionalProperties map[string]interface{}
}
type _GraphGraphTriple GraphGraphTriple
// NewGraphGraphTriple instantiates a new GraphGraphTriple 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 NewGraphGraphTriple() *GraphGraphTriple {
this := GraphGraphTriple{}
return &this
}
// NewGraphGraphTripleWithDefaults instantiates a new GraphGraphTriple 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 NewGraphGraphTripleWithDefaults() *GraphGraphTriple {
this := GraphGraphTriple{}
return &this
}
// GetNames returns the Names field value if set, zero value otherwise.
func (o *GraphGraphTriple) GetNames() bool {
if o == nil || IsNil(o.Names) {
var ret bool
return ret
}
return *o.Names
}
// GetNamesOk returns a tuple with the Names field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphTriple) GetNamesOk() (*bool, bool) {
if o == nil || IsNil(o.Names) {
return nil, false
}
return o.Names, true
}
// HasNames returns a boolean if a field has been set.
func (o *GraphGraphTriple) HasNames() bool {
if o != nil && !IsNil(o.Names) {
return true
}
return false
}
// SetNames gets a reference to the given bool and assigns it to the Names field.
func (o *GraphGraphTriple) SetNames(v bool) {
o.Names = &v
}
// GetObject returns the Object field value if set, zero value otherwise.
func (o *GraphGraphTriple) GetObject() string {
if o == nil || IsNil(o.Object) {
var ret string
return ret
}
return *o.Object
}
// GetObjectOk returns a tuple with the Object field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphTriple) GetObjectOk() (*string, bool) {
if o == nil || IsNil(o.Object) {
return nil, false
}
return o.Object, true
}
// HasObject returns a boolean if a field has been set.
func (o *GraphGraphTriple) HasObject() bool {
if o != nil && !IsNil(o.Object) {
return true
}
return false
}
// SetObject gets a reference to the given string and assigns it to the Object field.
func (o *GraphGraphTriple) SetObject(v string) {
o.Object = &v
}
// GetPredicate returns the Predicate field value if set, zero value otherwise.
func (o *GraphGraphTriple) GetPredicate() string {
if o == nil || IsNil(o.Predicate) {
var ret string
return ret
}
return *o.Predicate
}
// GetPredicateOk returns a tuple with the Predicate field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphTriple) GetPredicateOk() (*string, bool) {
if o == nil || IsNil(o.Predicate) {
return nil, false
}
return o.Predicate, true
}
// HasPredicate returns a boolean if a field has been set.
func (o *GraphGraphTriple) HasPredicate() bool {
if o != nil && !IsNil(o.Predicate) {
return true
}
return false
}
// SetPredicate gets a reference to the given string and assigns it to the Predicate field.
func (o *GraphGraphTriple) SetPredicate(v string) {
o.Predicate = &v
}
// GetReason returns the Reason field value if set, zero value otherwise.
func (o *GraphGraphTriple) GetReason() string {
if o == nil || IsNil(o.Reason) {
var ret string
return ret
}
return *o.Reason
}
// GetReasonOk returns a tuple with the Reason field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphTriple) GetReasonOk() (*string, bool) {
if o == nil || IsNil(o.Reason) {
return nil, false
}
return o.Reason, true
}
// HasReason returns a boolean if a field has been set.
func (o *GraphGraphTriple) HasReason() bool {
if o != nil && !IsNil(o.Reason) {
return true
}
return false
}
// SetReason gets a reference to the given string and assigns it to the Reason field.
func (o *GraphGraphTriple) SetReason(v string) {
o.Reason = &v
}
// GetSection returns the Section field value if set, zero value otherwise.
func (o *GraphGraphTriple) GetSection() int64 {
if o == nil || IsNil(o.Section) {
var ret int64
return ret
}
return *o.Section
}
// GetSectionOk returns a tuple with the Section field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphTriple) GetSectionOk() (*int64, bool) {
if o == nil || IsNil(o.Section) {
return nil, false
}
return o.Section, true
}
// HasSection returns a boolean if a field has been set.
func (o *GraphGraphTriple) HasSection() bool {
if o != nil && !IsNil(o.Section) {
return true
}
return false
}
// SetSection gets a reference to the given int64 and assigns it to the Section field.
func (o *GraphGraphTriple) SetSection(v int64) {
o.Section = &v
}
// GetSubject returns the Subject field value if set, zero value otherwise.
func (o *GraphGraphTriple) GetSubject() string {
if o == nil || IsNil(o.Subject) {
var ret string
return ret
}
return *o.Subject
}
// GetSubjectOk returns a tuple with the Subject field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphTriple) GetSubjectOk() (*string, bool) {
if o == nil || IsNil(o.Subject) {
return nil, false
}
return o.Subject, true
}
// HasSubject returns a boolean if a field has been set.
func (o *GraphGraphTriple) HasSubject() bool {
if o != nil && !IsNil(o.Subject) {
return true
}
return false
}
// SetSubject gets a reference to the given string and assigns it to the Subject field.
func (o *GraphGraphTriple) SetSubject(v string) {
o.Subject = &v
}
func (o GraphGraphTriple) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GraphGraphTriple) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Names) {
toSerialize["names"] = o.Names
}
if !IsNil(o.Object) {
toSerialize["object"] = o.Object
}
if !IsNil(o.Predicate) {
toSerialize["predicate"] = o.Predicate
}
if !IsNil(o.Reason) {
toSerialize["reason"] = o.Reason
}
if !IsNil(o.Section) {
toSerialize["section"] = o.Section
}
if !IsNil(o.Subject) {
toSerialize["subject"] = o.Subject
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GraphGraphTriple) UnmarshalJSON(data []byte) (err error) {
varGraphGraphTriple := _GraphGraphTriple{}
err = json.Unmarshal(data, &varGraphGraphTriple)
if err != nil {
return err
}
*o = GraphGraphTriple(varGraphGraphTriple)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "names")
delete(additionalProperties, "object")
delete(additionalProperties, "predicate")
delete(additionalProperties, "reason")
delete(additionalProperties, "section")
delete(additionalProperties, "subject")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGraphGraphTriple struct {
value *GraphGraphTriple
isSet bool
}
func (v NullableGraphGraphTriple) Get() *GraphGraphTriple {
return v.value
}
func (v *NullableGraphGraphTriple) Set(val *GraphGraphTriple) {
v.value = val
v.isSet = true
}
func (v NullableGraphGraphTriple) IsSet() bool {
return v.isSet
}
func (v *NullableGraphGraphTriple) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGraphGraphTriple(val *GraphGraphTriple) *NullableGraphGraphTriple {
return &NullableGraphGraphTriple{value: val, isSet: true}
}
func (v NullableGraphGraphTriple) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGraphGraphTriple) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}