mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
269 lines
7.7 KiB
Go
269 lines
7.7 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 ContentStateGraph type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &ContentStateGraph{}
|
|
|
|
// ContentStateGraph struct for ContentStateGraph
|
|
type ContentStateGraph struct {
|
|
// Initial is the state a fresh document starts in — \"draft\". A stored document with no status at all is read as this too.
|
|
Initial *string `json:"initial,omitempty"`
|
|
// Live is the ONE state that is publicly readable — \"published\". The site pulls only documents in it, so reaching Live IS site-publish; every other state is invisible to a reader.
|
|
Live *string `json:"live,omitempty"`
|
|
// States is every lifecycle state in canonical order: draft, in_review, approved, queued, published, archived. The console lays its board columns out in exactly this order, so the order is part of the answer.
|
|
States []string `json:"states,omitempty"`
|
|
// Transitions maps each state to the states it may move to. A target absent from a state's list is REFUSED, at the endpoint and again at the storage boundary — this is the whole rule, not a hint for the UI. A state never lists itself; a move that changes nothing is always legal.
|
|
Transitions map[string][]string `json:"transitions,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _ContentStateGraph ContentStateGraph
|
|
|
|
// NewContentStateGraph instantiates a new ContentStateGraph 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 NewContentStateGraph() *ContentStateGraph {
|
|
this := ContentStateGraph{}
|
|
return &this
|
|
}
|
|
|
|
// NewContentStateGraphWithDefaults instantiates a new ContentStateGraph 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 NewContentStateGraphWithDefaults() *ContentStateGraph {
|
|
this := ContentStateGraph{}
|
|
return &this
|
|
}
|
|
|
|
// GetInitial returns the Initial field value if set, zero value otherwise.
|
|
func (o *ContentStateGraph) GetInitial() string {
|
|
if o == nil || IsNil(o.Initial) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Initial
|
|
}
|
|
|
|
// GetInitialOk returns a tuple with the Initial field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ContentStateGraph) GetInitialOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Initial) {
|
|
return nil, false
|
|
}
|
|
return o.Initial, true
|
|
}
|
|
|
|
// HasInitial returns a boolean if a field has been set.
|
|
func (o *ContentStateGraph) HasInitial() bool {
|
|
if o != nil && !IsNil(o.Initial) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetInitial gets a reference to the given string and assigns it to the Initial field.
|
|
func (o *ContentStateGraph) SetInitial(v string) {
|
|
o.Initial = &v
|
|
}
|
|
|
|
// GetLive returns the Live field value if set, zero value otherwise.
|
|
func (o *ContentStateGraph) GetLive() string {
|
|
if o == nil || IsNil(o.Live) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Live
|
|
}
|
|
|
|
// GetLiveOk returns a tuple with the Live field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ContentStateGraph) GetLiveOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Live) {
|
|
return nil, false
|
|
}
|
|
return o.Live, true
|
|
}
|
|
|
|
// HasLive returns a boolean if a field has been set.
|
|
func (o *ContentStateGraph) HasLive() bool {
|
|
if o != nil && !IsNil(o.Live) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLive gets a reference to the given string and assigns it to the Live field.
|
|
func (o *ContentStateGraph) SetLive(v string) {
|
|
o.Live = &v
|
|
}
|
|
|
|
// GetStates returns the States field value if set, zero value otherwise.
|
|
func (o *ContentStateGraph) GetStates() []string {
|
|
if o == nil || IsNil(o.States) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.States
|
|
}
|
|
|
|
// GetStatesOk returns a tuple with the States field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ContentStateGraph) GetStatesOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.States) {
|
|
return nil, false
|
|
}
|
|
return o.States, true
|
|
}
|
|
|
|
// HasStates returns a boolean if a field has been set.
|
|
func (o *ContentStateGraph) HasStates() bool {
|
|
if o != nil && !IsNil(o.States) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStates gets a reference to the given []string and assigns it to the States field.
|
|
func (o *ContentStateGraph) SetStates(v []string) {
|
|
o.States = v
|
|
}
|
|
|
|
// GetTransitions returns the Transitions field value if set, zero value otherwise.
|
|
func (o *ContentStateGraph) GetTransitions() map[string][]string {
|
|
if o == nil || IsNil(o.Transitions) {
|
|
var ret map[string][]string
|
|
return ret
|
|
}
|
|
return o.Transitions
|
|
}
|
|
|
|
// GetTransitionsOk returns a tuple with the Transitions field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ContentStateGraph) GetTransitionsOk() (map[string][]string, bool) {
|
|
if o == nil || IsNil(o.Transitions) {
|
|
return map[string][]string{}, false
|
|
}
|
|
return o.Transitions, true
|
|
}
|
|
|
|
// HasTransitions returns a boolean if a field has been set.
|
|
func (o *ContentStateGraph) HasTransitions() bool {
|
|
if o != nil && !IsNil(o.Transitions) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTransitions gets a reference to the given map[string][]string and assigns it to the Transitions field.
|
|
func (o *ContentStateGraph) SetTransitions(v map[string][]string) {
|
|
o.Transitions = v
|
|
}
|
|
|
|
func (o ContentStateGraph) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o ContentStateGraph) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Initial) {
|
|
toSerialize["initial"] = o.Initial
|
|
}
|
|
if !IsNil(o.Live) {
|
|
toSerialize["live"] = o.Live
|
|
}
|
|
if !IsNil(o.States) {
|
|
toSerialize["states"] = o.States
|
|
}
|
|
if !IsNil(o.Transitions) {
|
|
toSerialize["transitions"] = o.Transitions
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *ContentStateGraph) UnmarshalJSON(data []byte) (err error) {
|
|
varContentStateGraph := _ContentStateGraph{}
|
|
|
|
err = json.Unmarshal(data, &varContentStateGraph)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = ContentStateGraph(varContentStateGraph)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "initial")
|
|
delete(additionalProperties, "live")
|
|
delete(additionalProperties, "states")
|
|
delete(additionalProperties, "transitions")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableContentStateGraph struct {
|
|
value *ContentStateGraph
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableContentStateGraph) Get() *ContentStateGraph {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableContentStateGraph) Set(val *ContentStateGraph) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableContentStateGraph) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableContentStateGraph) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableContentStateGraph(val *ContentStateGraph) *NullableContentStateGraph {
|
|
return &NullableContentStateGraph{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableContentStateGraph) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableContentStateGraph) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|