Files
sdk/model_graph_graph_declared.go

269 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"
)
// checks if the GraphGraphDeclared type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GraphGraphDeclared{}
// GraphGraphDeclared struct for GraphGraphDeclared
type GraphGraphDeclared struct {
// Cardinality is how many values the relation holds at once: one, or many. Absent is the default — one for a property, many for an edge.
Cardinality *string `json:"cardinality,omitempty"`
// Domain is the type the entity asserting it must have. Absent is any.
Domain *string `json:"domain,omitempty"`
// Range is the type the entity it points at must have; a relation with a range is an edge. Absent is any.
Range *string `json:"range,omitempty"`
// Relation is the relation declared, without its `relation:` prefix.
Relation *string `json:"relation,omitempty"`
AdditionalProperties map[string]interface{}
}
type _GraphGraphDeclared GraphGraphDeclared
// NewGraphGraphDeclared instantiates a new GraphGraphDeclared 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 NewGraphGraphDeclared() *GraphGraphDeclared {
this := GraphGraphDeclared{}
return &this
}
// NewGraphGraphDeclaredWithDefaults instantiates a new GraphGraphDeclared 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 NewGraphGraphDeclaredWithDefaults() *GraphGraphDeclared {
this := GraphGraphDeclared{}
return &this
}
// GetCardinality returns the Cardinality field value if set, zero value otherwise.
func (o *GraphGraphDeclared) GetCardinality() string {
if o == nil || IsNil(o.Cardinality) {
var ret string
return ret
}
return *o.Cardinality
}
// GetCardinalityOk returns a tuple with the Cardinality field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphDeclared) GetCardinalityOk() (*string, bool) {
if o == nil || IsNil(o.Cardinality) {
return nil, false
}
return o.Cardinality, true
}
// HasCardinality returns a boolean if a field has been set.
func (o *GraphGraphDeclared) HasCardinality() bool {
if o != nil && !IsNil(o.Cardinality) {
return true
}
return false
}
// SetCardinality gets a reference to the given string and assigns it to the Cardinality field.
func (o *GraphGraphDeclared) SetCardinality(v string) {
o.Cardinality = &v
}
// GetDomain returns the Domain field value if set, zero value otherwise.
func (o *GraphGraphDeclared) GetDomain() string {
if o == nil || IsNil(o.Domain) {
var ret string
return ret
}
return *o.Domain
}
// GetDomainOk returns a tuple with the Domain field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphDeclared) GetDomainOk() (*string, bool) {
if o == nil || IsNil(o.Domain) {
return nil, false
}
return o.Domain, true
}
// HasDomain returns a boolean if a field has been set.
func (o *GraphGraphDeclared) HasDomain() bool {
if o != nil && !IsNil(o.Domain) {
return true
}
return false
}
// SetDomain gets a reference to the given string and assigns it to the Domain field.
func (o *GraphGraphDeclared) SetDomain(v string) {
o.Domain = &v
}
// GetRange returns the Range field value if set, zero value otherwise.
func (o *GraphGraphDeclared) GetRange() string {
if o == nil || IsNil(o.Range) {
var ret string
return ret
}
return *o.Range
}
// GetRangeOk returns a tuple with the Range field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphDeclared) GetRangeOk() (*string, bool) {
if o == nil || IsNil(o.Range) {
return nil, false
}
return o.Range, true
}
// HasRange returns a boolean if a field has been set.
func (o *GraphGraphDeclared) HasRange() bool {
if o != nil && !IsNil(o.Range) {
return true
}
return false
}
// SetRange gets a reference to the given string and assigns it to the Range field.
func (o *GraphGraphDeclared) SetRange(v string) {
o.Range = &v
}
// GetRelation returns the Relation field value if set, zero value otherwise.
func (o *GraphGraphDeclared) 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 *GraphGraphDeclared) 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 *GraphGraphDeclared) 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 *GraphGraphDeclared) SetRelation(v string) {
o.Relation = &v
}
func (o GraphGraphDeclared) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GraphGraphDeclared) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Cardinality) {
toSerialize["cardinality"] = o.Cardinality
}
if !IsNil(o.Domain) {
toSerialize["domain"] = o.Domain
}
if !IsNil(o.Range) {
toSerialize["range"] = o.Range
}
if !IsNil(o.Relation) {
toSerialize["relation"] = o.Relation
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GraphGraphDeclared) UnmarshalJSON(data []byte) (err error) {
varGraphGraphDeclared := _GraphGraphDeclared{}
err = json.Unmarshal(data, &varGraphGraphDeclared)
if err != nil {
return err
}
*o = GraphGraphDeclared(varGraphGraphDeclared)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "cardinality")
delete(additionalProperties, "domain")
delete(additionalProperties, "range")
delete(additionalProperties, "relation")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGraphGraphDeclared struct {
value *GraphGraphDeclared
isSet bool
}
func (v NullableGraphGraphDeclared) Get() *GraphGraphDeclared {
return v.value
}
func (v *NullableGraphGraphDeclared) Set(val *GraphGraphDeclared) {
v.value = val
v.isSet = true
}
func (v NullableGraphGraphDeclared) IsSet() bool {
return v.isSet
}
func (v *NullableGraphGraphDeclared) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGraphGraphDeclared(val *GraphGraphDeclared) *NullableGraphGraphDeclared {
return &NullableGraphGraphDeclared{value: val, isSet: true}
}
func (v NullableGraphGraphDeclared) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGraphGraphDeclared) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}