Files
sdk/model_content_storefront_result.go

269 lines
8.0 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 ContentStorefrontResult type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ContentStorefrontResult{}
// ContentStorefrontResult struct for ContentStorefrontResult
type ContentStorefrontResult struct {
// ImageURL is the absolute URL the listing's headerImage now points at. The image is REFERENCED, not copied — it stays in the org's studio output bucket, so removing it there empties the storefront tile.
ImageUrl *string `json:"imageUrl,omitempty"`
// Slug is the product handle the image was attached to. It IS the asset's `design` field — that equality is the whole join between the studio and the catalog, which is why an asset with no design produces no storefront result at all.
Slug *string `json:"slug,omitempty"`
// Status is one of \"published\" (the product image was set), \"not_configured\" (no commerce edge, no store provisioned for the org, or a token that is not admin on the store — a fail-closed no-op) or \"failed\" (commerce answered and errored). None of the three fails the transition that produced it.
Status *string `json:"status,omitempty"`
// Store is the commerce store id the image landed in, resolved for the org mid-call. Present only on \"published\": a result that never got that far carries none.
Store *string `json:"store,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ContentStorefrontResult ContentStorefrontResult
// NewContentStorefrontResult instantiates a new ContentStorefrontResult 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 NewContentStorefrontResult() *ContentStorefrontResult {
this := ContentStorefrontResult{}
return &this
}
// NewContentStorefrontResultWithDefaults instantiates a new ContentStorefrontResult 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 NewContentStorefrontResultWithDefaults() *ContentStorefrontResult {
this := ContentStorefrontResult{}
return &this
}
// GetImageUrl returns the ImageUrl field value if set, zero value otherwise.
func (o *ContentStorefrontResult) GetImageUrl() string {
if o == nil || IsNil(o.ImageUrl) {
var ret string
return ret
}
return *o.ImageUrl
}
// GetImageUrlOk returns a tuple with the ImageUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ContentStorefrontResult) GetImageUrlOk() (*string, bool) {
if o == nil || IsNil(o.ImageUrl) {
return nil, false
}
return o.ImageUrl, true
}
// HasImageUrl returns a boolean if a field has been set.
func (o *ContentStorefrontResult) HasImageUrl() bool {
if o != nil && !IsNil(o.ImageUrl) {
return true
}
return false
}
// SetImageUrl gets a reference to the given string and assigns it to the ImageUrl field.
func (o *ContentStorefrontResult) SetImageUrl(v string) {
o.ImageUrl = &v
}
// GetSlug returns the Slug field value if set, zero value otherwise.
func (o *ContentStorefrontResult) GetSlug() string {
if o == nil || IsNil(o.Slug) {
var ret string
return ret
}
return *o.Slug
}
// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ContentStorefrontResult) GetSlugOk() (*string, bool) {
if o == nil || IsNil(o.Slug) {
return nil, false
}
return o.Slug, true
}
// HasSlug returns a boolean if a field has been set.
func (o *ContentStorefrontResult) HasSlug() bool {
if o != nil && !IsNil(o.Slug) {
return true
}
return false
}
// SetSlug gets a reference to the given string and assigns it to the Slug field.
func (o *ContentStorefrontResult) SetSlug(v string) {
o.Slug = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *ContentStorefrontResult) GetStatus() string {
if o == nil || IsNil(o.Status) {
var ret string
return ret
}
return *o.Status
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ContentStorefrontResult) GetStatusOk() (*string, bool) {
if o == nil || IsNil(o.Status) {
return nil, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *ContentStorefrontResult) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *ContentStorefrontResult) SetStatus(v string) {
o.Status = &v
}
// GetStore returns the Store field value if set, zero value otherwise.
func (o *ContentStorefrontResult) GetStore() string {
if o == nil || IsNil(o.Store) {
var ret string
return ret
}
return *o.Store
}
// GetStoreOk returns a tuple with the Store field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ContentStorefrontResult) GetStoreOk() (*string, bool) {
if o == nil || IsNil(o.Store) {
return nil, false
}
return o.Store, true
}
// HasStore returns a boolean if a field has been set.
func (o *ContentStorefrontResult) HasStore() bool {
if o != nil && !IsNil(o.Store) {
return true
}
return false
}
// SetStore gets a reference to the given string and assigns it to the Store field.
func (o *ContentStorefrontResult) SetStore(v string) {
o.Store = &v
}
func (o ContentStorefrontResult) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ContentStorefrontResult) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ImageUrl) {
toSerialize["imageUrl"] = o.ImageUrl
}
if !IsNil(o.Slug) {
toSerialize["slug"] = o.Slug
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.Store) {
toSerialize["store"] = o.Store
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ContentStorefrontResult) UnmarshalJSON(data []byte) (err error) {
varContentStorefrontResult := _ContentStorefrontResult{}
err = json.Unmarshal(data, &varContentStorefrontResult)
if err != nil {
return err
}
*o = ContentStorefrontResult(varContentStorefrontResult)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "imageUrl")
delete(additionalProperties, "slug")
delete(additionalProperties, "status")
delete(additionalProperties, "store")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableContentStorefrontResult struct {
value *ContentStorefrontResult
isSet bool
}
func (v NullableContentStorefrontResult) Get() *ContentStorefrontResult {
return v.value
}
func (v *NullableContentStorefrontResult) Set(val *ContentStorefrontResult) {
v.value = val
v.isSet = true
}
func (v NullableContentStorefrontResult) IsSet() bool {
return v.isSet
}
func (v *NullableContentStorefrontResult) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableContentStorefrontResult(val *ContentStorefrontResult) *NullableContentStorefrontResult {
return &NullableContentStorefrontResult{value: val, isSet: true}
}
func (v NullableContentStorefrontResult) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableContentStorefrontResult) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}