mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
274 lines
7.3 KiB
Go
274 lines
7.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 GraphGraphResolveIn type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &GraphGraphResolveIn{}
|
|
|
|
// GraphGraphResolveIn struct for GraphGraphResolveIn
|
|
type GraphGraphResolveIn 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 is the instant of the world to answer about, RFC 3339: what held then. Absent is now.
|
|
AsOf *string `json:"as_of,omitempty"`
|
|
// Entity is the thing to answer about. Required.
|
|
Entity string `json:"entity"`
|
|
// Relation is the one relation to settle. Required: this answers a single (entity, relation) pair, never a whole entity at once.
|
|
Relation string `json:"relation"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _GraphGraphResolveIn GraphGraphResolveIn
|
|
|
|
// NewGraphGraphResolveIn instantiates a new GraphGraphResolveIn 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 NewGraphGraphResolveIn(entity string, relation string) *GraphGraphResolveIn {
|
|
this := GraphGraphResolveIn{}
|
|
this.Entity = entity
|
|
this.Relation = relation
|
|
return &this
|
|
}
|
|
|
|
// NewGraphGraphResolveInWithDefaults instantiates a new GraphGraphResolveIn 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 NewGraphGraphResolveInWithDefaults() *GraphGraphResolveIn {
|
|
this := GraphGraphResolveIn{}
|
|
return &this
|
|
}
|
|
|
|
// GetAsKnown returns the AsKnown field value if set, zero value otherwise.
|
|
func (o *GraphGraphResolveIn) 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 *GraphGraphResolveIn) 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 *GraphGraphResolveIn) 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 *GraphGraphResolveIn) SetAsKnown(v string) {
|
|
o.AsKnown = &v
|
|
}
|
|
|
|
// GetAsOf returns the AsOf field value if set, zero value otherwise.
|
|
func (o *GraphGraphResolveIn) 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 *GraphGraphResolveIn) 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 *GraphGraphResolveIn) 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 *GraphGraphResolveIn) SetAsOf(v string) {
|
|
o.AsOf = &v
|
|
}
|
|
|
|
// GetEntity returns the Entity field value
|
|
func (o *GraphGraphResolveIn) GetEntity() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.Entity
|
|
}
|
|
|
|
// GetEntityOk returns a tuple with the Entity field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GraphGraphResolveIn) GetEntityOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Entity, true
|
|
}
|
|
|
|
// SetEntity sets field value
|
|
func (o *GraphGraphResolveIn) SetEntity(v string) {
|
|
o.Entity = v
|
|
}
|
|
|
|
// GetRelation returns the Relation field value
|
|
func (o *GraphGraphResolveIn) GetRelation() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.Relation
|
|
}
|
|
|
|
// GetRelationOk returns a tuple with the Relation field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GraphGraphResolveIn) GetRelationOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Relation, true
|
|
}
|
|
|
|
// SetRelation sets field value
|
|
func (o *GraphGraphResolveIn) SetRelation(v string) {
|
|
o.Relation = v
|
|
}
|
|
|
|
func (o GraphGraphResolveIn) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o GraphGraphResolveIn) 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
|
|
}
|
|
toSerialize["entity"] = o.Entity
|
|
toSerialize["relation"] = o.Relation
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *GraphGraphResolveIn) 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{
|
|
"entity",
|
|
"relation",
|
|
}
|
|
|
|
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)
|
|
}
|
|
}
|
|
|
|
varGraphGraphResolveIn := _GraphGraphResolveIn{}
|
|
|
|
err = json.Unmarshal(data, &varGraphGraphResolveIn)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = GraphGraphResolveIn(varGraphGraphResolveIn)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "as_known")
|
|
delete(additionalProperties, "as_of")
|
|
delete(additionalProperties, "entity")
|
|
delete(additionalProperties, "relation")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableGraphGraphResolveIn struct {
|
|
value *GraphGraphResolveIn
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableGraphGraphResolveIn) Get() *GraphGraphResolveIn {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableGraphGraphResolveIn) Set(val *GraphGraphResolveIn) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableGraphGraphResolveIn) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableGraphGraphResolveIn) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableGraphGraphResolveIn(val *GraphGraphResolveIn) *NullableGraphGraphResolveIn {
|
|
return &NullableGraphGraphResolveIn{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableGraphGraphResolveIn) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableGraphGraphResolveIn) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|