Files
sdk/model_guide_funnel.go

383 lines
11 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 GuideFunnel type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GuideFunnel{}
// GuideFunnel struct for GuideFunnel
type GuideFunnel struct {
// Available separates \"this org has no traffic\" from \"we could not ask\". False means the warehouse was unreachable or the org has emitted nothing at all, and every count below is then a placeholder zero rather than a measurement — a caller must read this before reading any of them.
Available *bool `json:"available,omitempty"`
// Orders counts completed orders in the window — purchases, not carts started.
Orders *int64 `json:"orders,omitempty"`
// Pageviews counts page events in the window, one per view rather than per person, so a single visitor reading ten pages counts ten.
Pageviews *int64 `json:"pageviews,omitempty"`
// Revenue is the sum of the amounts those orders reported, in whatever currency the beacon stamped on them (major units, e.g. 49.5 for $49.50) — NOT cents, and not converted to a single currency. Contrast revenueCents on the profile, which is the money of record.
Revenue *float64 `json:"revenue,omitempty"`
// Signups counts completed signups in the window, the step where an anonymous visitor becomes somebody with an account.
Signups *int64 `json:"signups,omitempty"`
// Visitors is the number of DISTINCT people seen in the window, counted by the beacon's distinct id — so it is unique visitors, not sessions and not views.
Visitors *int64 `json:"visitors,omitempty"`
// WindowDays is the length of the trailing window every count covers, so a reader knows whether 40 signups is a month or a day.
WindowDays *int64 `json:"windowDays,omitempty"`
AdditionalProperties map[string]interface{}
}
type _GuideFunnel GuideFunnel
// NewGuideFunnel instantiates a new GuideFunnel 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 NewGuideFunnel() *GuideFunnel {
this := GuideFunnel{}
return &this
}
// NewGuideFunnelWithDefaults instantiates a new GuideFunnel 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 NewGuideFunnelWithDefaults() *GuideFunnel {
this := GuideFunnel{}
return &this
}
// GetAvailable returns the Available field value if set, zero value otherwise.
func (o *GuideFunnel) GetAvailable() bool {
if o == nil || IsNil(o.Available) {
var ret bool
return ret
}
return *o.Available
}
// GetAvailableOk returns a tuple with the Available field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GuideFunnel) GetAvailableOk() (*bool, bool) {
if o == nil || IsNil(o.Available) {
return nil, false
}
return o.Available, true
}
// HasAvailable returns a boolean if a field has been set.
func (o *GuideFunnel) HasAvailable() bool {
if o != nil && !IsNil(o.Available) {
return true
}
return false
}
// SetAvailable gets a reference to the given bool and assigns it to the Available field.
func (o *GuideFunnel) SetAvailable(v bool) {
o.Available = &v
}
// GetOrders returns the Orders field value if set, zero value otherwise.
func (o *GuideFunnel) GetOrders() int64 {
if o == nil || IsNil(o.Orders) {
var ret int64
return ret
}
return *o.Orders
}
// GetOrdersOk returns a tuple with the Orders field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GuideFunnel) GetOrdersOk() (*int64, bool) {
if o == nil || IsNil(o.Orders) {
return nil, false
}
return o.Orders, true
}
// HasOrders returns a boolean if a field has been set.
func (o *GuideFunnel) HasOrders() bool {
if o != nil && !IsNil(o.Orders) {
return true
}
return false
}
// SetOrders gets a reference to the given int64 and assigns it to the Orders field.
func (o *GuideFunnel) SetOrders(v int64) {
o.Orders = &v
}
// GetPageviews returns the Pageviews field value if set, zero value otherwise.
func (o *GuideFunnel) GetPageviews() int64 {
if o == nil || IsNil(o.Pageviews) {
var ret int64
return ret
}
return *o.Pageviews
}
// GetPageviewsOk returns a tuple with the Pageviews field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GuideFunnel) GetPageviewsOk() (*int64, bool) {
if o == nil || IsNil(o.Pageviews) {
return nil, false
}
return o.Pageviews, true
}
// HasPageviews returns a boolean if a field has been set.
func (o *GuideFunnel) HasPageviews() bool {
if o != nil && !IsNil(o.Pageviews) {
return true
}
return false
}
// SetPageviews gets a reference to the given int64 and assigns it to the Pageviews field.
func (o *GuideFunnel) SetPageviews(v int64) {
o.Pageviews = &v
}
// GetRevenue returns the Revenue field value if set, zero value otherwise.
func (o *GuideFunnel) GetRevenue() float64 {
if o == nil || IsNil(o.Revenue) {
var ret float64
return ret
}
return *o.Revenue
}
// GetRevenueOk returns a tuple with the Revenue field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GuideFunnel) GetRevenueOk() (*float64, bool) {
if o == nil || IsNil(o.Revenue) {
return nil, false
}
return o.Revenue, true
}
// HasRevenue returns a boolean if a field has been set.
func (o *GuideFunnel) HasRevenue() bool {
if o != nil && !IsNil(o.Revenue) {
return true
}
return false
}
// SetRevenue gets a reference to the given float64 and assigns it to the Revenue field.
func (o *GuideFunnel) SetRevenue(v float64) {
o.Revenue = &v
}
// GetSignups returns the Signups field value if set, zero value otherwise.
func (o *GuideFunnel) GetSignups() int64 {
if o == nil || IsNil(o.Signups) {
var ret int64
return ret
}
return *o.Signups
}
// GetSignupsOk returns a tuple with the Signups field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GuideFunnel) GetSignupsOk() (*int64, bool) {
if o == nil || IsNil(o.Signups) {
return nil, false
}
return o.Signups, true
}
// HasSignups returns a boolean if a field has been set.
func (o *GuideFunnel) HasSignups() bool {
if o != nil && !IsNil(o.Signups) {
return true
}
return false
}
// SetSignups gets a reference to the given int64 and assigns it to the Signups field.
func (o *GuideFunnel) SetSignups(v int64) {
o.Signups = &v
}
// GetVisitors returns the Visitors field value if set, zero value otherwise.
func (o *GuideFunnel) GetVisitors() int64 {
if o == nil || IsNil(o.Visitors) {
var ret int64
return ret
}
return *o.Visitors
}
// GetVisitorsOk returns a tuple with the Visitors field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GuideFunnel) GetVisitorsOk() (*int64, bool) {
if o == nil || IsNil(o.Visitors) {
return nil, false
}
return o.Visitors, true
}
// HasVisitors returns a boolean if a field has been set.
func (o *GuideFunnel) HasVisitors() bool {
if o != nil && !IsNil(o.Visitors) {
return true
}
return false
}
// SetVisitors gets a reference to the given int64 and assigns it to the Visitors field.
func (o *GuideFunnel) SetVisitors(v int64) {
o.Visitors = &v
}
// GetWindowDays returns the WindowDays field value if set, zero value otherwise.
func (o *GuideFunnel) GetWindowDays() int64 {
if o == nil || IsNil(o.WindowDays) {
var ret int64
return ret
}
return *o.WindowDays
}
// GetWindowDaysOk returns a tuple with the WindowDays field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GuideFunnel) GetWindowDaysOk() (*int64, bool) {
if o == nil || IsNil(o.WindowDays) {
return nil, false
}
return o.WindowDays, true
}
// HasWindowDays returns a boolean if a field has been set.
func (o *GuideFunnel) HasWindowDays() bool {
if o != nil && !IsNil(o.WindowDays) {
return true
}
return false
}
// SetWindowDays gets a reference to the given int64 and assigns it to the WindowDays field.
func (o *GuideFunnel) SetWindowDays(v int64) {
o.WindowDays = &v
}
func (o GuideFunnel) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GuideFunnel) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Available) {
toSerialize["available"] = o.Available
}
if !IsNil(o.Orders) {
toSerialize["orders"] = o.Orders
}
if !IsNil(o.Pageviews) {
toSerialize["pageviews"] = o.Pageviews
}
if !IsNil(o.Revenue) {
toSerialize["revenue"] = o.Revenue
}
if !IsNil(o.Signups) {
toSerialize["signups"] = o.Signups
}
if !IsNil(o.Visitors) {
toSerialize["visitors"] = o.Visitors
}
if !IsNil(o.WindowDays) {
toSerialize["windowDays"] = o.WindowDays
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GuideFunnel) UnmarshalJSON(data []byte) (err error) {
varGuideFunnel := _GuideFunnel{}
err = json.Unmarshal(data, &varGuideFunnel)
if err != nil {
return err
}
*o = GuideFunnel(varGuideFunnel)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "available")
delete(additionalProperties, "orders")
delete(additionalProperties, "pageviews")
delete(additionalProperties, "revenue")
delete(additionalProperties, "signups")
delete(additionalProperties, "visitors")
delete(additionalProperties, "windowDays")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGuideFunnel struct {
value *GuideFunnel
isSet bool
}
func (v NullableGuideFunnel) Get() *GuideFunnel {
return v.value
}
func (v *NullableGuideFunnel) Set(val *GuideFunnel) {
v.value = val
v.isSet = true
}
func (v NullableGuideFunnel) IsSet() bool {
return v.isSet
}
func (v *NullableGuideFunnel) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGuideFunnel(val *GuideFunnel) *NullableGuideFunnel {
return &NullableGuideFunnel{value: val, isSet: true}
}
func (v NullableGuideFunnel) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGuideFunnel) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}