mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
345 lines
10 KiB
Go
345 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"
|
|
)
|
|
|
|
// checks if the ContentTransitionResult type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &ContentTransitionResult{}
|
|
|
|
// ContentTransitionResult struct for ContentTransitionResult
|
|
type ContentTransitionResult struct {
|
|
// Distribution is the channel fan-out this move triggered. Present ONLY on the move to published, the single edge that distributes — so its absence means no fan-out was attempted, never that one failed quietly. A fan-out that DID fail is present carrying its own honest status, because distribution never rolls the status change back.
|
|
Distribution *ContentPublishResult `json:"distribution,omitempty"`
|
|
// DocType is the content type that moved — Campaign, SocialPost or Asset — echoed from the path.
|
|
Doctype *string `json:"doctype,omitempty"`
|
|
// From is the state the item held when it was read. A document carrying no status yet reads as \"draft\".
|
|
From *string `json:"from,omitempty"`
|
|
// Name is the document that moved, echoed from the path.
|
|
Name *string `json:"name,omitempty"`
|
|
// Storefront is the catalog side effect, present only when a published Asset was product imagery — it carries a design and a kind of ecom, product or lifestyle. Absent for everything else, so absence reads as \"not catalog imagery\" rather than \"the catalog failed\".
|
|
Storefront *ContentStorefrontResult `json:"storefront,omitempty"`
|
|
// To is the state it holds now. From == To on an idempotent re-transition, which is legal and is where a caller that lost a publish race lands.
|
|
To *string `json:"to,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _ContentTransitionResult ContentTransitionResult
|
|
|
|
// NewContentTransitionResult instantiates a new ContentTransitionResult 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 NewContentTransitionResult() *ContentTransitionResult {
|
|
this := ContentTransitionResult{}
|
|
return &this
|
|
}
|
|
|
|
// NewContentTransitionResultWithDefaults instantiates a new ContentTransitionResult 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 NewContentTransitionResultWithDefaults() *ContentTransitionResult {
|
|
this := ContentTransitionResult{}
|
|
return &this
|
|
}
|
|
|
|
// GetDistribution returns the Distribution field value if set, zero value otherwise.
|
|
func (o *ContentTransitionResult) GetDistribution() ContentPublishResult {
|
|
if o == nil || IsNil(o.Distribution) {
|
|
var ret ContentPublishResult
|
|
return ret
|
|
}
|
|
return *o.Distribution
|
|
}
|
|
|
|
// GetDistributionOk returns a tuple with the Distribution field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ContentTransitionResult) GetDistributionOk() (*ContentPublishResult, bool) {
|
|
if o == nil || IsNil(o.Distribution) {
|
|
return nil, false
|
|
}
|
|
return o.Distribution, true
|
|
}
|
|
|
|
// HasDistribution returns a boolean if a field has been set.
|
|
func (o *ContentTransitionResult) HasDistribution() bool {
|
|
if o != nil && !IsNil(o.Distribution) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDistribution gets a reference to the given ContentPublishResult and assigns it to the Distribution field.
|
|
func (o *ContentTransitionResult) SetDistribution(v ContentPublishResult) {
|
|
o.Distribution = &v
|
|
}
|
|
|
|
// GetDoctype returns the Doctype field value if set, zero value otherwise.
|
|
func (o *ContentTransitionResult) GetDoctype() string {
|
|
if o == nil || IsNil(o.Doctype) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Doctype
|
|
}
|
|
|
|
// GetDoctypeOk returns a tuple with the Doctype field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ContentTransitionResult) GetDoctypeOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Doctype) {
|
|
return nil, false
|
|
}
|
|
return o.Doctype, true
|
|
}
|
|
|
|
// HasDoctype returns a boolean if a field has been set.
|
|
func (o *ContentTransitionResult) HasDoctype() bool {
|
|
if o != nil && !IsNil(o.Doctype) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDoctype gets a reference to the given string and assigns it to the Doctype field.
|
|
func (o *ContentTransitionResult) SetDoctype(v string) {
|
|
o.Doctype = &v
|
|
}
|
|
|
|
// GetFrom returns the From field value if set, zero value otherwise.
|
|
func (o *ContentTransitionResult) GetFrom() string {
|
|
if o == nil || IsNil(o.From) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.From
|
|
}
|
|
|
|
// GetFromOk returns a tuple with the From field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ContentTransitionResult) GetFromOk() (*string, bool) {
|
|
if o == nil || IsNil(o.From) {
|
|
return nil, false
|
|
}
|
|
return o.From, true
|
|
}
|
|
|
|
// HasFrom returns a boolean if a field has been set.
|
|
func (o *ContentTransitionResult) HasFrom() bool {
|
|
if o != nil && !IsNil(o.From) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetFrom gets a reference to the given string and assigns it to the From field.
|
|
func (o *ContentTransitionResult) SetFrom(v string) {
|
|
o.From = &v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *ContentTransitionResult) GetName() string {
|
|
if o == nil || IsNil(o.Name) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Name
|
|
}
|
|
|
|
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ContentTransitionResult) GetNameOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Name) {
|
|
return nil, false
|
|
}
|
|
return o.Name, true
|
|
}
|
|
|
|
// HasName returns a boolean if a field has been set.
|
|
func (o *ContentTransitionResult) HasName() bool {
|
|
if o != nil && !IsNil(o.Name) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetName gets a reference to the given string and assigns it to the Name field.
|
|
func (o *ContentTransitionResult) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetStorefront returns the Storefront field value if set, zero value otherwise.
|
|
func (o *ContentTransitionResult) GetStorefront() ContentStorefrontResult {
|
|
if o == nil || IsNil(o.Storefront) {
|
|
var ret ContentStorefrontResult
|
|
return ret
|
|
}
|
|
return *o.Storefront
|
|
}
|
|
|
|
// GetStorefrontOk returns a tuple with the Storefront field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ContentTransitionResult) GetStorefrontOk() (*ContentStorefrontResult, bool) {
|
|
if o == nil || IsNil(o.Storefront) {
|
|
return nil, false
|
|
}
|
|
return o.Storefront, true
|
|
}
|
|
|
|
// HasStorefront returns a boolean if a field has been set.
|
|
func (o *ContentTransitionResult) HasStorefront() bool {
|
|
if o != nil && !IsNil(o.Storefront) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStorefront gets a reference to the given ContentStorefrontResult and assigns it to the Storefront field.
|
|
func (o *ContentTransitionResult) SetStorefront(v ContentStorefrontResult) {
|
|
o.Storefront = &v
|
|
}
|
|
|
|
// GetTo returns the To field value if set, zero value otherwise.
|
|
func (o *ContentTransitionResult) GetTo() string {
|
|
if o == nil || IsNil(o.To) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.To
|
|
}
|
|
|
|
// GetToOk returns a tuple with the To field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ContentTransitionResult) GetToOk() (*string, bool) {
|
|
if o == nil || IsNil(o.To) {
|
|
return nil, false
|
|
}
|
|
return o.To, true
|
|
}
|
|
|
|
// HasTo returns a boolean if a field has been set.
|
|
func (o *ContentTransitionResult) HasTo() bool {
|
|
if o != nil && !IsNil(o.To) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTo gets a reference to the given string and assigns it to the To field.
|
|
func (o *ContentTransitionResult) SetTo(v string) {
|
|
o.To = &v
|
|
}
|
|
|
|
func (o ContentTransitionResult) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o ContentTransitionResult) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Distribution) {
|
|
toSerialize["distribution"] = o.Distribution
|
|
}
|
|
if !IsNil(o.Doctype) {
|
|
toSerialize["doctype"] = o.Doctype
|
|
}
|
|
if !IsNil(o.From) {
|
|
toSerialize["from"] = o.From
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.Storefront) {
|
|
toSerialize["storefront"] = o.Storefront
|
|
}
|
|
if !IsNil(o.To) {
|
|
toSerialize["to"] = o.To
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *ContentTransitionResult) UnmarshalJSON(data []byte) (err error) {
|
|
varContentTransitionResult := _ContentTransitionResult{}
|
|
|
|
err = json.Unmarshal(data, &varContentTransitionResult)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = ContentTransitionResult(varContentTransitionResult)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "distribution")
|
|
delete(additionalProperties, "doctype")
|
|
delete(additionalProperties, "from")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "storefront")
|
|
delete(additionalProperties, "to")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableContentTransitionResult struct {
|
|
value *ContentTransitionResult
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableContentTransitionResult) Get() *ContentTransitionResult {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableContentTransitionResult) Set(val *ContentTransitionResult) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableContentTransitionResult) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableContentTransitionResult) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableContentTransitionResult(val *ContentTransitionResult) *NullableContentTransitionResult {
|
|
return &NullableContentTransitionResult{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableContentTransitionResult) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableContentTransitionResult) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|