Files
sdk/model_guide_analytics_view.go

193 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"
)
// checks if the GuideAnalyticsView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GuideAnalyticsView{}
// GuideAnalyticsView struct for GuideAnalyticsView
type GuideAnalyticsView struct {
// Funnel is the org's trailing-30-day traffic → signups → orders from the shared analytics warehouse; available is false when it has emitted nothing.
Funnel *GuideFunnel `json:"funnel,omitempty"`
// Recommendations are the next-best GTM actions derived from that funnel.
Recommendations []string `json:"recommendations,omitempty"`
AdditionalProperties map[string]interface{}
}
type _GuideAnalyticsView GuideAnalyticsView
// NewGuideAnalyticsView instantiates a new GuideAnalyticsView 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 NewGuideAnalyticsView() *GuideAnalyticsView {
this := GuideAnalyticsView{}
return &this
}
// NewGuideAnalyticsViewWithDefaults instantiates a new GuideAnalyticsView 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 NewGuideAnalyticsViewWithDefaults() *GuideAnalyticsView {
this := GuideAnalyticsView{}
return &this
}
// GetFunnel returns the Funnel field value if set, zero value otherwise.
func (o *GuideAnalyticsView) GetFunnel() GuideFunnel {
if o == nil || IsNil(o.Funnel) {
var ret GuideFunnel
return ret
}
return *o.Funnel
}
// GetFunnelOk returns a tuple with the Funnel field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GuideAnalyticsView) GetFunnelOk() (*GuideFunnel, bool) {
if o == nil || IsNil(o.Funnel) {
return nil, false
}
return o.Funnel, true
}
// HasFunnel returns a boolean if a field has been set.
func (o *GuideAnalyticsView) HasFunnel() bool {
if o != nil && !IsNil(o.Funnel) {
return true
}
return false
}
// SetFunnel gets a reference to the given GuideFunnel and assigns it to the Funnel field.
func (o *GuideAnalyticsView) SetFunnel(v GuideFunnel) {
o.Funnel = &v
}
// GetRecommendations returns the Recommendations field value if set, zero value otherwise.
func (o *GuideAnalyticsView) GetRecommendations() []string {
if o == nil || IsNil(o.Recommendations) {
var ret []string
return ret
}
return o.Recommendations
}
// GetRecommendationsOk returns a tuple with the Recommendations field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GuideAnalyticsView) GetRecommendationsOk() ([]string, bool) {
if o == nil || IsNil(o.Recommendations) {
return nil, false
}
return o.Recommendations, true
}
// HasRecommendations returns a boolean if a field has been set.
func (o *GuideAnalyticsView) HasRecommendations() bool {
if o != nil && !IsNil(o.Recommendations) {
return true
}
return false
}
// SetRecommendations gets a reference to the given []string and assigns it to the Recommendations field.
func (o *GuideAnalyticsView) SetRecommendations(v []string) {
o.Recommendations = v
}
func (o GuideAnalyticsView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GuideAnalyticsView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Funnel) {
toSerialize["funnel"] = o.Funnel
}
if !IsNil(o.Recommendations) {
toSerialize["recommendations"] = o.Recommendations
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GuideAnalyticsView) UnmarshalJSON(data []byte) (err error) {
varGuideAnalyticsView := _GuideAnalyticsView{}
err = json.Unmarshal(data, &varGuideAnalyticsView)
if err != nil {
return err
}
*o = GuideAnalyticsView(varGuideAnalyticsView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "funnel")
delete(additionalProperties, "recommendations")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGuideAnalyticsView struct {
value *GuideAnalyticsView
isSet bool
}
func (v NullableGuideAnalyticsView) Get() *GuideAnalyticsView {
return v.value
}
func (v *NullableGuideAnalyticsView) Set(val *GuideAnalyticsView) {
v.value = val
v.isSet = true
}
func (v NullableGuideAnalyticsView) IsSet() bool {
return v.isSet
}
func (v *NullableGuideAnalyticsView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGuideAnalyticsView(val *GuideAnalyticsView) *NullableGuideAnalyticsView {
return &NullableGuideAnalyticsView{value: val, isSet: true}
}
func (v NullableGuideAnalyticsView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGuideAnalyticsView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}