Files
sdk/model_graph_graph_apple_in.go

358 lines
10 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 GraphGraphAppleIn type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GraphGraphAppleIn{}
// GraphGraphAppleIn struct for GraphGraphAppleIn
type GraphGraphAppleIn struct {
// At is the valid instant of the snapshot, RFC 3339. Required.
At string `json:"at"`
// Expired is the withdrawn rows from expired_stable_graph. Each is filed with an until instant so it stays in the bitemporal record and surfaces in graphEntity's expired list without holding in live resolution.
Expired []GraphGraphAppleTriple `json:"expired,omitempty"`
// Owner is the entity key for the device owner (\"(Me)\"). When set, entities flagged with nm_isCurrentUser are linked to Owner via `same`, and high-confidence kinship scorecard columns emit edges from Owner.
Owner *string `json:"owner,omitempty"`
// Scorecards is the per-person kinship probability rows from entityTagging.db.
Scorecards []GraphGraphAppleScorecard `json:"scorecards,omitempty"`
// Source names the device or store this snapshot came from. Absent defaults to apple/intelligence-platform.
Source *string `json:"source,omitempty"`
// Triples is the live rows from stable_graph. Reified two-row edges sharing a relationship_id are paired into edges automatically.
Triples []GraphGraphAppleTriple `json:"triples,omitempty"`
AdditionalProperties map[string]interface{}
}
type _GraphGraphAppleIn GraphGraphAppleIn
// NewGraphGraphAppleIn instantiates a new GraphGraphAppleIn 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 NewGraphGraphAppleIn(at string) *GraphGraphAppleIn {
this := GraphGraphAppleIn{}
this.At = at
return &this
}
// NewGraphGraphAppleInWithDefaults instantiates a new GraphGraphAppleIn 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 NewGraphGraphAppleInWithDefaults() *GraphGraphAppleIn {
this := GraphGraphAppleIn{}
return &this
}
// GetAt returns the At field value
func (o *GraphGraphAppleIn) GetAt() string {
if o == nil {
var ret string
return ret
}
return o.At
}
// GetAtOk returns a tuple with the At field value
// and a boolean to check if the value has been set.
func (o *GraphGraphAppleIn) GetAtOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.At, true
}
// SetAt sets field value
func (o *GraphGraphAppleIn) SetAt(v string) {
o.At = v
}
// GetExpired returns the Expired field value if set, zero value otherwise.
func (o *GraphGraphAppleIn) GetExpired() []GraphGraphAppleTriple {
if o == nil || IsNil(o.Expired) {
var ret []GraphGraphAppleTriple
return ret
}
return o.Expired
}
// GetExpiredOk returns a tuple with the Expired field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphAppleIn) GetExpiredOk() ([]GraphGraphAppleTriple, bool) {
if o == nil || IsNil(o.Expired) {
return nil, false
}
return o.Expired, true
}
// HasExpired returns a boolean if a field has been set.
func (o *GraphGraphAppleIn) HasExpired() bool {
if o != nil && !IsNil(o.Expired) {
return true
}
return false
}
// SetExpired gets a reference to the given []GraphGraphAppleTriple and assigns it to the Expired field.
func (o *GraphGraphAppleIn) SetExpired(v []GraphGraphAppleTriple) {
o.Expired = v
}
// GetOwner returns the Owner field value if set, zero value otherwise.
func (o *GraphGraphAppleIn) GetOwner() string {
if o == nil || IsNil(o.Owner) {
var ret string
return ret
}
return *o.Owner
}
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphAppleIn) GetOwnerOk() (*string, bool) {
if o == nil || IsNil(o.Owner) {
return nil, false
}
return o.Owner, true
}
// HasOwner returns a boolean if a field has been set.
func (o *GraphGraphAppleIn) HasOwner() bool {
if o != nil && !IsNil(o.Owner) {
return true
}
return false
}
// SetOwner gets a reference to the given string and assigns it to the Owner field.
func (o *GraphGraphAppleIn) SetOwner(v string) {
o.Owner = &v
}
// GetScorecards returns the Scorecards field value if set, zero value otherwise.
func (o *GraphGraphAppleIn) GetScorecards() []GraphGraphAppleScorecard {
if o == nil || IsNil(o.Scorecards) {
var ret []GraphGraphAppleScorecard
return ret
}
return o.Scorecards
}
// GetScorecardsOk returns a tuple with the Scorecards field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphAppleIn) GetScorecardsOk() ([]GraphGraphAppleScorecard, bool) {
if o == nil || IsNil(o.Scorecards) {
return nil, false
}
return o.Scorecards, true
}
// HasScorecards returns a boolean if a field has been set.
func (o *GraphGraphAppleIn) HasScorecards() bool {
if o != nil && !IsNil(o.Scorecards) {
return true
}
return false
}
// SetScorecards gets a reference to the given []GraphGraphAppleScorecard and assigns it to the Scorecards field.
func (o *GraphGraphAppleIn) SetScorecards(v []GraphGraphAppleScorecard) {
o.Scorecards = v
}
// GetSource returns the Source field value if set, zero value otherwise.
func (o *GraphGraphAppleIn) GetSource() string {
if o == nil || IsNil(o.Source) {
var ret string
return ret
}
return *o.Source
}
// GetSourceOk returns a tuple with the Source field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphAppleIn) GetSourceOk() (*string, bool) {
if o == nil || IsNil(o.Source) {
return nil, false
}
return o.Source, true
}
// HasSource returns a boolean if a field has been set.
func (o *GraphGraphAppleIn) HasSource() bool {
if o != nil && !IsNil(o.Source) {
return true
}
return false
}
// SetSource gets a reference to the given string and assigns it to the Source field.
func (o *GraphGraphAppleIn) SetSource(v string) {
o.Source = &v
}
// GetTriples returns the Triples field value if set, zero value otherwise.
func (o *GraphGraphAppleIn) GetTriples() []GraphGraphAppleTriple {
if o == nil || IsNil(o.Triples) {
var ret []GraphGraphAppleTriple
return ret
}
return o.Triples
}
// GetTriplesOk returns a tuple with the Triples field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphAppleIn) GetTriplesOk() ([]GraphGraphAppleTriple, bool) {
if o == nil || IsNil(o.Triples) {
return nil, false
}
return o.Triples, true
}
// HasTriples returns a boolean if a field has been set.
func (o *GraphGraphAppleIn) HasTriples() bool {
if o != nil && !IsNil(o.Triples) {
return true
}
return false
}
// SetTriples gets a reference to the given []GraphGraphAppleTriple and assigns it to the Triples field.
func (o *GraphGraphAppleIn) SetTriples(v []GraphGraphAppleTriple) {
o.Triples = v
}
func (o GraphGraphAppleIn) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GraphGraphAppleIn) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["at"] = o.At
if !IsNil(o.Expired) {
toSerialize["expired"] = o.Expired
}
if !IsNil(o.Owner) {
toSerialize["owner"] = o.Owner
}
if !IsNil(o.Scorecards) {
toSerialize["scorecards"] = o.Scorecards
}
if !IsNil(o.Source) {
toSerialize["source"] = o.Source
}
if !IsNil(o.Triples) {
toSerialize["triples"] = o.Triples
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GraphGraphAppleIn) 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{
"at",
}
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)
}
}
varGraphGraphAppleIn := _GraphGraphAppleIn{}
err = json.Unmarshal(data, &varGraphGraphAppleIn)
if err != nil {
return err
}
*o = GraphGraphAppleIn(varGraphGraphAppleIn)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "at")
delete(additionalProperties, "expired")
delete(additionalProperties, "owner")
delete(additionalProperties, "scorecards")
delete(additionalProperties, "source")
delete(additionalProperties, "triples")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGraphGraphAppleIn struct {
value *GraphGraphAppleIn
isSet bool
}
func (v NullableGraphGraphAppleIn) Get() *GraphGraphAppleIn {
return v.value
}
func (v *NullableGraphGraphAppleIn) Set(val *GraphGraphAppleIn) {
v.value = val
v.isSet = true
}
func (v NullableGraphGraphAppleIn) IsSet() bool {
return v.isSet
}
func (v *NullableGraphGraphAppleIn) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGraphGraphAppleIn(val *GraphGraphAppleIn) *NullableGraphGraphAppleIn {
return &NullableGraphGraphAppleIn{value: val, isSet: true}
}
func (v NullableGraphGraphAppleIn) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGraphGraphAppleIn) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}