mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
307 lines
9.4 KiB
Go
307 lines
9.4 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 GraphGraphDeriveIn type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &GraphGraphDeriveIn{}
|
|
|
|
// GraphGraphDeriveIn struct for GraphGraphDeriveIn
|
|
type GraphGraphDeriveIn struct {
|
|
// AsKnown is how much this plane had heard, RFC 3339 — of the statements and of the rules — so a past answer is reproducible. Absent is now.
|
|
AsKnown *string `json:"as_known,omitempty"`
|
|
// AsOf derives from the graph as it stood at an instant of the world, RFC 3339: the statements that held then. Absent is now.
|
|
AsOf *string `json:"as_of,omitempty"`
|
|
// File files each tuple Derived lists as an assertion: (subject, predicate, object) from the instant it was derived at, open, its source the rule, its evidence the rule's ID, its confidence the decay, and an edge when the object is an entity by its proof. It requires an admin of the organization, the graph as it stands now — no as_of, as_known or without — and predicates with two arguments. It is refused whole when a relation that holds one value at a time would keep only one of the values a subject is concluded or asserted to have, and when a conclusion is about a `relation:` or `rule:` key. Each is judged as any assertion is, and the write is on the audit trail before it commits. A filed conclusion is an assertion like any other: it does not fall when a support later does.
|
|
File *bool `json:"file,omitempty"`
|
|
// Predicates are what to derive: every tuple the rules in force conclude of each, with its proof. Each must be the head of a rule in force, asserted as (`rule:<name>`, `rule`, `<text>`) — for example `ancestor(X, Z) :- parent(X, Y), ancestor(Y, Z)`. At least one, at most 256.
|
|
Predicates []string `json:"predicates,omitempty"`
|
|
// Without is assertion IDs, of statements or of rules, to derive without as though they had never been filed. The derivation then runs twice, and Lost and Gained say what that changes. Each must be a row this derivation reads. At most 256.
|
|
Without []string `json:"without,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _GraphGraphDeriveIn GraphGraphDeriveIn
|
|
|
|
// NewGraphGraphDeriveIn instantiates a new GraphGraphDeriveIn 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 NewGraphGraphDeriveIn() *GraphGraphDeriveIn {
|
|
this := GraphGraphDeriveIn{}
|
|
return &this
|
|
}
|
|
|
|
// NewGraphGraphDeriveInWithDefaults instantiates a new GraphGraphDeriveIn 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 NewGraphGraphDeriveInWithDefaults() *GraphGraphDeriveIn {
|
|
this := GraphGraphDeriveIn{}
|
|
return &this
|
|
}
|
|
|
|
// GetAsKnown returns the AsKnown field value if set, zero value otherwise.
|
|
func (o *GraphGraphDeriveIn) 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 *GraphGraphDeriveIn) 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 *GraphGraphDeriveIn) 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 *GraphGraphDeriveIn) SetAsKnown(v string) {
|
|
o.AsKnown = &v
|
|
}
|
|
|
|
// GetAsOf returns the AsOf field value if set, zero value otherwise.
|
|
func (o *GraphGraphDeriveIn) 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 *GraphGraphDeriveIn) 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 *GraphGraphDeriveIn) 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 *GraphGraphDeriveIn) SetAsOf(v string) {
|
|
o.AsOf = &v
|
|
}
|
|
|
|
// GetFile returns the File field value if set, zero value otherwise.
|
|
func (o *GraphGraphDeriveIn) GetFile() bool {
|
|
if o == nil || IsNil(o.File) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.File
|
|
}
|
|
|
|
// GetFileOk returns a tuple with the File field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GraphGraphDeriveIn) GetFileOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.File) {
|
|
return nil, false
|
|
}
|
|
return o.File, true
|
|
}
|
|
|
|
// HasFile returns a boolean if a field has been set.
|
|
func (o *GraphGraphDeriveIn) HasFile() bool {
|
|
if o != nil && !IsNil(o.File) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetFile gets a reference to the given bool and assigns it to the File field.
|
|
func (o *GraphGraphDeriveIn) SetFile(v bool) {
|
|
o.File = &v
|
|
}
|
|
|
|
// GetPredicates returns the Predicates field value if set, zero value otherwise.
|
|
func (o *GraphGraphDeriveIn) GetPredicates() []string {
|
|
if o == nil || IsNil(o.Predicates) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.Predicates
|
|
}
|
|
|
|
// GetPredicatesOk returns a tuple with the Predicates field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GraphGraphDeriveIn) GetPredicatesOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.Predicates) {
|
|
return nil, false
|
|
}
|
|
return o.Predicates, true
|
|
}
|
|
|
|
// HasPredicates returns a boolean if a field has been set.
|
|
func (o *GraphGraphDeriveIn) HasPredicates() bool {
|
|
if o != nil && !IsNil(o.Predicates) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPredicates gets a reference to the given []string and assigns it to the Predicates field.
|
|
func (o *GraphGraphDeriveIn) SetPredicates(v []string) {
|
|
o.Predicates = v
|
|
}
|
|
|
|
// GetWithout returns the Without field value if set, zero value otherwise.
|
|
func (o *GraphGraphDeriveIn) GetWithout() []string {
|
|
if o == nil || IsNil(o.Without) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.Without
|
|
}
|
|
|
|
// GetWithoutOk returns a tuple with the Without field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GraphGraphDeriveIn) GetWithoutOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.Without) {
|
|
return nil, false
|
|
}
|
|
return o.Without, true
|
|
}
|
|
|
|
// HasWithout returns a boolean if a field has been set.
|
|
func (o *GraphGraphDeriveIn) HasWithout() bool {
|
|
if o != nil && !IsNil(o.Without) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetWithout gets a reference to the given []string and assigns it to the Without field.
|
|
func (o *GraphGraphDeriveIn) SetWithout(v []string) {
|
|
o.Without = v
|
|
}
|
|
|
|
func (o GraphGraphDeriveIn) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o GraphGraphDeriveIn) 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.File) {
|
|
toSerialize["file"] = o.File
|
|
}
|
|
if !IsNil(o.Predicates) {
|
|
toSerialize["predicates"] = o.Predicates
|
|
}
|
|
if !IsNil(o.Without) {
|
|
toSerialize["without"] = o.Without
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *GraphGraphDeriveIn) UnmarshalJSON(data []byte) (err error) {
|
|
varGraphGraphDeriveIn := _GraphGraphDeriveIn{}
|
|
|
|
err = json.Unmarshal(data, &varGraphGraphDeriveIn)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = GraphGraphDeriveIn(varGraphGraphDeriveIn)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "as_known")
|
|
delete(additionalProperties, "as_of")
|
|
delete(additionalProperties, "file")
|
|
delete(additionalProperties, "predicates")
|
|
delete(additionalProperties, "without")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableGraphGraphDeriveIn struct {
|
|
value *GraphGraphDeriveIn
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableGraphGraphDeriveIn) Get() *GraphGraphDeriveIn {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableGraphGraphDeriveIn) Set(val *GraphGraphDeriveIn) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableGraphGraphDeriveIn) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableGraphGraphDeriveIn) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableGraphGraphDeriveIn(val *GraphGraphDeriveIn) *NullableGraphGraphDeriveIn {
|
|
return &NullableGraphGraphDeriveIn{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableGraphGraphDeriveIn) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableGraphGraphDeriveIn) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|