mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
168 lines
4.6 KiB
Go
168 lines
4.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"
|
|
"fmt"
|
|
)
|
|
|
|
// checks if the GraphGraphAssertIn type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &GraphGraphAssertIn{}
|
|
|
|
// GraphGraphAssertIn struct for GraphGraphAssertIn
|
|
type GraphGraphAssertIn struct {
|
|
// Assertions is the batch. Each member is judged on its own: one refusal does not discard the rest, because a caller redelivering five facts must not lose four of them to one malformed fifth.
|
|
Assertions []GraphGraphFact `json:"assertions"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _GraphGraphAssertIn GraphGraphAssertIn
|
|
|
|
// NewGraphGraphAssertIn instantiates a new GraphGraphAssertIn 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 NewGraphGraphAssertIn(assertions []GraphGraphFact) *GraphGraphAssertIn {
|
|
this := GraphGraphAssertIn{}
|
|
this.Assertions = assertions
|
|
return &this
|
|
}
|
|
|
|
// NewGraphGraphAssertInWithDefaults instantiates a new GraphGraphAssertIn 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 NewGraphGraphAssertInWithDefaults() *GraphGraphAssertIn {
|
|
this := GraphGraphAssertIn{}
|
|
return &this
|
|
}
|
|
|
|
// GetAssertions returns the Assertions field value
|
|
func (o *GraphGraphAssertIn) GetAssertions() []GraphGraphFact {
|
|
if o == nil {
|
|
var ret []GraphGraphFact
|
|
return ret
|
|
}
|
|
|
|
return o.Assertions
|
|
}
|
|
|
|
// GetAssertionsOk returns a tuple with the Assertions field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GraphGraphAssertIn) GetAssertionsOk() ([]GraphGraphFact, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return o.Assertions, true
|
|
}
|
|
|
|
// SetAssertions sets field value
|
|
func (o *GraphGraphAssertIn) SetAssertions(v []GraphGraphFact) {
|
|
o.Assertions = v
|
|
}
|
|
|
|
func (o GraphGraphAssertIn) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o GraphGraphAssertIn) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
toSerialize["assertions"] = o.Assertions
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *GraphGraphAssertIn) 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{
|
|
"assertions",
|
|
}
|
|
|
|
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)
|
|
}
|
|
}
|
|
|
|
varGraphGraphAssertIn := _GraphGraphAssertIn{}
|
|
|
|
err = json.Unmarshal(data, &varGraphGraphAssertIn)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = GraphGraphAssertIn(varGraphGraphAssertIn)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "assertions")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableGraphGraphAssertIn struct {
|
|
value *GraphGraphAssertIn
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableGraphGraphAssertIn) Get() *GraphGraphAssertIn {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableGraphGraphAssertIn) Set(val *GraphGraphAssertIn) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableGraphGraphAssertIn) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableGraphGraphAssertIn) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableGraphGraphAssertIn(val *GraphGraphAssertIn) *NullableGraphGraphAssertIn {
|
|
return &NullableGraphGraphAssertIn{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableGraphGraphAssertIn) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableGraphGraphAssertIn) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|