mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
198 lines
5.4 KiB
Go
198 lines
5.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"
|
|
"fmt"
|
|
)
|
|
|
|
// checks if the GraphGraphEraseIn type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &GraphGraphEraseIn{}
|
|
|
|
// GraphGraphEraseIn struct for GraphGraphEraseIn
|
|
type GraphGraphEraseIn struct {
|
|
// Entity is the key to erase. Every assertion ABOUT it and every edge pointing AT it is removed, under every spelling it may have been filed under — its NFC key, that key decomposed, and the bytes sent — so a subject filed before keys were folded goes with the rest; a property whose scalar happens to spell it is not a reference and stays. Required, 512 bytes at most.
|
|
Entity string `json:"entity"`
|
|
// Reason is why, as the audit trail will keep it — a request number, a legal basis. It outlives the erasure, so it may not contain the entity: refused when it does. Required, 512 bytes at most.
|
|
Reason string `json:"reason"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _GraphGraphEraseIn GraphGraphEraseIn
|
|
|
|
// NewGraphGraphEraseIn instantiates a new GraphGraphEraseIn 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 NewGraphGraphEraseIn(entity string, reason string) *GraphGraphEraseIn {
|
|
this := GraphGraphEraseIn{}
|
|
this.Entity = entity
|
|
this.Reason = reason
|
|
return &this
|
|
}
|
|
|
|
// NewGraphGraphEraseInWithDefaults instantiates a new GraphGraphEraseIn 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 NewGraphGraphEraseInWithDefaults() *GraphGraphEraseIn {
|
|
this := GraphGraphEraseIn{}
|
|
return &this
|
|
}
|
|
|
|
// GetEntity returns the Entity field value
|
|
func (o *GraphGraphEraseIn) 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 *GraphGraphEraseIn) GetEntityOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Entity, true
|
|
}
|
|
|
|
// SetEntity sets field value
|
|
func (o *GraphGraphEraseIn) SetEntity(v string) {
|
|
o.Entity = v
|
|
}
|
|
|
|
// GetReason returns the Reason field value
|
|
func (o *GraphGraphEraseIn) GetReason() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.Reason
|
|
}
|
|
|
|
// GetReasonOk returns a tuple with the Reason field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GraphGraphEraseIn) GetReasonOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Reason, true
|
|
}
|
|
|
|
// SetReason sets field value
|
|
func (o *GraphGraphEraseIn) SetReason(v string) {
|
|
o.Reason = v
|
|
}
|
|
|
|
func (o GraphGraphEraseIn) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o GraphGraphEraseIn) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
toSerialize["entity"] = o.Entity
|
|
toSerialize["reason"] = o.Reason
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *GraphGraphEraseIn) 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",
|
|
"reason",
|
|
}
|
|
|
|
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)
|
|
}
|
|
}
|
|
|
|
varGraphGraphEraseIn := _GraphGraphEraseIn{}
|
|
|
|
err = json.Unmarshal(data, &varGraphGraphEraseIn)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = GraphGraphEraseIn(varGraphGraphEraseIn)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "entity")
|
|
delete(additionalProperties, "reason")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableGraphGraphEraseIn struct {
|
|
value *GraphGraphEraseIn
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableGraphGraphEraseIn) Get() *GraphGraphEraseIn {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableGraphGraphEraseIn) Set(val *GraphGraphEraseIn) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableGraphGraphEraseIn) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableGraphGraphEraseIn) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableGraphGraphEraseIn(val *GraphGraphEraseIn) *NullableGraphGraphEraseIn {
|
|
return &NullableGraphGraphEraseIn{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableGraphGraphEraseIn) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableGraphGraphEraseIn) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|