Files
sdk/model_event_web_overview.go

345 lines
9.2 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 EventWebOverview type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EventWebOverview{}
// EventWebOverview struct for EventWebOverview
type EventWebOverview struct {
// Available is false when the product-event table could not be read — the lens is reported missing rather than as zeros that look like real traffic.
Available *bool `json:"available,omitempty"`
// Pageviews is how many $pageview events landed in the window.
Pageviews *int64 `json:"pageviews,omitempty"`
// Reason says why the lens is unavailable. Omitted when it is available.
Reason *string `json:"reason,omitempty"`
// Sessions is how many distinct visits they span.
Sessions *int64 `json:"sessions,omitempty"`
// Source is the warehouse table the lens read.
Source *string `json:"source,omitempty"`
// Visitors is how many distinct people those pageviews came from.
Visitors *int64 `json:"visitors,omitempty"`
AdditionalProperties map[string]interface{}
}
type _EventWebOverview EventWebOverview
// NewEventWebOverview instantiates a new EventWebOverview 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 NewEventWebOverview() *EventWebOverview {
this := EventWebOverview{}
return &this
}
// NewEventWebOverviewWithDefaults instantiates a new EventWebOverview 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 NewEventWebOverviewWithDefaults() *EventWebOverview {
this := EventWebOverview{}
return &this
}
// GetAvailable returns the Available field value if set, zero value otherwise.
func (o *EventWebOverview) 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 *EventWebOverview) 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 *EventWebOverview) 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 *EventWebOverview) SetAvailable(v bool) {
o.Available = &v
}
// GetPageviews returns the Pageviews field value if set, zero value otherwise.
func (o *EventWebOverview) 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 *EventWebOverview) 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 *EventWebOverview) 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 *EventWebOverview) SetPageviews(v int64) {
o.Pageviews = &v
}
// GetReason returns the Reason field value if set, zero value otherwise.
func (o *EventWebOverview) GetReason() string {
if o == nil || IsNil(o.Reason) {
var ret string
return ret
}
return *o.Reason
}
// GetReasonOk returns a tuple with the Reason field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EventWebOverview) GetReasonOk() (*string, bool) {
if o == nil || IsNil(o.Reason) {
return nil, false
}
return o.Reason, true
}
// HasReason returns a boolean if a field has been set.
func (o *EventWebOverview) HasReason() bool {
if o != nil && !IsNil(o.Reason) {
return true
}
return false
}
// SetReason gets a reference to the given string and assigns it to the Reason field.
func (o *EventWebOverview) SetReason(v string) {
o.Reason = &v
}
// GetSessions returns the Sessions field value if set, zero value otherwise.
func (o *EventWebOverview) GetSessions() int64 {
if o == nil || IsNil(o.Sessions) {
var ret int64
return ret
}
return *o.Sessions
}
// GetSessionsOk returns a tuple with the Sessions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EventWebOverview) GetSessionsOk() (*int64, bool) {
if o == nil || IsNil(o.Sessions) {
return nil, false
}
return o.Sessions, true
}
// HasSessions returns a boolean if a field has been set.
func (o *EventWebOverview) HasSessions() bool {
if o != nil && !IsNil(o.Sessions) {
return true
}
return false
}
// SetSessions gets a reference to the given int64 and assigns it to the Sessions field.
func (o *EventWebOverview) SetSessions(v int64) {
o.Sessions = &v
}
// GetSource returns the Source field value if set, zero value otherwise.
func (o *EventWebOverview) GetSource() string {
if o == nil || IsNil(o.Source) {
var ret string
return ret
}
return *o.Source
}
// GetSourceOk returns a tuple with the Source field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EventWebOverview) GetSourceOk() (*string, bool) {
if o == nil || IsNil(o.Source) {
return nil, false
}
return o.Source, true
}
// HasSource returns a boolean if a field has been set.
func (o *EventWebOverview) HasSource() bool {
if o != nil && !IsNil(o.Source) {
return true
}
return false
}
// SetSource gets a reference to the given string and assigns it to the Source field.
func (o *EventWebOverview) SetSource(v string) {
o.Source = &v
}
// GetVisitors returns the Visitors field value if set, zero value otherwise.
func (o *EventWebOverview) 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 *EventWebOverview) 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 *EventWebOverview) 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 *EventWebOverview) SetVisitors(v int64) {
o.Visitors = &v
}
func (o EventWebOverview) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EventWebOverview) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Available) {
toSerialize["available"] = o.Available
}
if !IsNil(o.Pageviews) {
toSerialize["pageviews"] = o.Pageviews
}
if !IsNil(o.Reason) {
toSerialize["reason"] = o.Reason
}
if !IsNil(o.Sessions) {
toSerialize["sessions"] = o.Sessions
}
if !IsNil(o.Source) {
toSerialize["source"] = o.Source
}
if !IsNil(o.Visitors) {
toSerialize["visitors"] = o.Visitors
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *EventWebOverview) UnmarshalJSON(data []byte) (err error) {
varEventWebOverview := _EventWebOverview{}
err = json.Unmarshal(data, &varEventWebOverview)
if err != nil {
return err
}
*o = EventWebOverview(varEventWebOverview)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "available")
delete(additionalProperties, "pageviews")
delete(additionalProperties, "reason")
delete(additionalProperties, "sessions")
delete(additionalProperties, "source")
delete(additionalProperties, "visitors")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableEventWebOverview struct {
value *EventWebOverview
isSet bool
}
func (v NullableEventWebOverview) Get() *EventWebOverview {
return v.value
}
func (v *NullableEventWebOverview) Set(val *EventWebOverview) {
v.value = val
v.isSet = true
}
func (v NullableEventWebOverview) IsSet() bool {
return v.isSet
}
func (v *NullableEventWebOverview) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEventWebOverview(val *EventWebOverview) *NullableEventWebOverview {
return &NullableEventWebOverview{value: val, isSet: true}
}
func (v NullableEventWebOverview) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEventWebOverview) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}