mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
269 lines
7.1 KiB
Go
269 lines
7.1 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 EventBreakdownRow type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &EventBreakdownRow{}
|
|
|
|
// EventBreakdownRow struct for EventBreakdownRow
|
|
type EventBreakdownRow struct {
|
|
// Key is the bucket: a requested path, a referrer domain (\"(direct)\" for none or a same-origin one), or a utm_source (\"(none)\" when absent).
|
|
Key *string `json:"key,omitempty"`
|
|
// Pageviews is how many $pageview events fell in this bucket.
|
|
Pageviews *int64 `json:"pageviews,omitempty"`
|
|
// Pct is this bucket's share of ALL in-window pageviews, 0..100, one decimal — not of the returned rows, so a top-N shows the long tail honestly.
|
|
Pct *float64 `json:"pct,omitempty"`
|
|
// Visitors is how many distinct people they came from.
|
|
Visitors *int64 `json:"visitors,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _EventBreakdownRow EventBreakdownRow
|
|
|
|
// NewEventBreakdownRow instantiates a new EventBreakdownRow 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 NewEventBreakdownRow() *EventBreakdownRow {
|
|
this := EventBreakdownRow{}
|
|
return &this
|
|
}
|
|
|
|
// NewEventBreakdownRowWithDefaults instantiates a new EventBreakdownRow 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 NewEventBreakdownRowWithDefaults() *EventBreakdownRow {
|
|
this := EventBreakdownRow{}
|
|
return &this
|
|
}
|
|
|
|
// GetKey returns the Key field value if set, zero value otherwise.
|
|
func (o *EventBreakdownRow) GetKey() string {
|
|
if o == nil || IsNil(o.Key) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Key
|
|
}
|
|
|
|
// GetKeyOk returns a tuple with the Key field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventBreakdownRow) GetKeyOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Key) {
|
|
return nil, false
|
|
}
|
|
return o.Key, true
|
|
}
|
|
|
|
// HasKey returns a boolean if a field has been set.
|
|
func (o *EventBreakdownRow) HasKey() bool {
|
|
if o != nil && !IsNil(o.Key) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetKey gets a reference to the given string and assigns it to the Key field.
|
|
func (o *EventBreakdownRow) SetKey(v string) {
|
|
o.Key = &v
|
|
}
|
|
|
|
// GetPageviews returns the Pageviews field value if set, zero value otherwise.
|
|
func (o *EventBreakdownRow) 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 *EventBreakdownRow) 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 *EventBreakdownRow) 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 *EventBreakdownRow) SetPageviews(v int64) {
|
|
o.Pageviews = &v
|
|
}
|
|
|
|
// GetPct returns the Pct field value if set, zero value otherwise.
|
|
func (o *EventBreakdownRow) GetPct() float64 {
|
|
if o == nil || IsNil(o.Pct) {
|
|
var ret float64
|
|
return ret
|
|
}
|
|
return *o.Pct
|
|
}
|
|
|
|
// GetPctOk returns a tuple with the Pct field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventBreakdownRow) GetPctOk() (*float64, bool) {
|
|
if o == nil || IsNil(o.Pct) {
|
|
return nil, false
|
|
}
|
|
return o.Pct, true
|
|
}
|
|
|
|
// HasPct returns a boolean if a field has been set.
|
|
func (o *EventBreakdownRow) HasPct() bool {
|
|
if o != nil && !IsNil(o.Pct) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPct gets a reference to the given float64 and assigns it to the Pct field.
|
|
func (o *EventBreakdownRow) SetPct(v float64) {
|
|
o.Pct = &v
|
|
}
|
|
|
|
// GetVisitors returns the Visitors field value if set, zero value otherwise.
|
|
func (o *EventBreakdownRow) 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 *EventBreakdownRow) 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 *EventBreakdownRow) 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 *EventBreakdownRow) SetVisitors(v int64) {
|
|
o.Visitors = &v
|
|
}
|
|
|
|
func (o EventBreakdownRow) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o EventBreakdownRow) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Key) {
|
|
toSerialize["key"] = o.Key
|
|
}
|
|
if !IsNil(o.Pageviews) {
|
|
toSerialize["pageviews"] = o.Pageviews
|
|
}
|
|
if !IsNil(o.Pct) {
|
|
toSerialize["pct"] = o.Pct
|
|
}
|
|
if !IsNil(o.Visitors) {
|
|
toSerialize["visitors"] = o.Visitors
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *EventBreakdownRow) UnmarshalJSON(data []byte) (err error) {
|
|
varEventBreakdownRow := _EventBreakdownRow{}
|
|
|
|
err = json.Unmarshal(data, &varEventBreakdownRow)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = EventBreakdownRow(varEventBreakdownRow)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "key")
|
|
delete(additionalProperties, "pageviews")
|
|
delete(additionalProperties, "pct")
|
|
delete(additionalProperties, "visitors")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableEventBreakdownRow struct {
|
|
value *EventBreakdownRow
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableEventBreakdownRow) Get() *EventBreakdownRow {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableEventBreakdownRow) Set(val *EventBreakdownRow) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableEventBreakdownRow) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableEventBreakdownRow) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableEventBreakdownRow(val *EventBreakdownRow) *NullableEventBreakdownRow {
|
|
return &NullableEventBreakdownRow{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableEventBreakdownRow) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableEventBreakdownRow) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|