mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
497 lines
13 KiB
Go
497 lines
13 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 EventTop type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &EventTop{}
|
|
|
|
// EventTop struct for EventTop
|
|
type EventTop struct {
|
|
// End is the window's exclusive upper bound, RFC3339 UTC.
|
|
End *string `json:"end,omitempty"`
|
|
// Impersonated is which events products, topPages, topReferrers and topSources counted against the mark a platform operator leaves acting as someone else: exclude (the tenant's own traffic), include, or only. Models reads the usage ledger, which carries no mark.
|
|
Impersonated *string `json:"impersonated,omitempty"`
|
|
// Models ranks the window's LLM models by spend — real per-org data.
|
|
Models *EventTopModels `json:"models,omitempty"`
|
|
// Products ranks the window's products by revenue.
|
|
Products *EventTopProducts `json:"products,omitempty"`
|
|
// Range is the window that was actually applied: 24h, 7d, 30d or custom.
|
|
Range *string `json:"range,omitempty"`
|
|
// Scope names the tenant these rankings belong to.
|
|
Scope *EventScope `json:"scope,omitempty"`
|
|
// Start is the window's inclusive lower bound, RFC3339 UTC.
|
|
Start *string `json:"start,omitempty"`
|
|
// Pages ranks the paths visitors requested, by pageviews.
|
|
TopPages *EventBreakdown `json:"topPages,omitempty"`
|
|
// Referrers ranks the external domains visitors arrived from, by pageviews.
|
|
TopReferrers *EventBreakdown `json:"topReferrers,omitempty"`
|
|
// Sources ranks the utm_source campaigns visitors arrived on, by pageviews.
|
|
TopSources *EventBreakdown `json:"topSources,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _EventTop EventTop
|
|
|
|
// NewEventTop instantiates a new EventTop 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 NewEventTop() *EventTop {
|
|
this := EventTop{}
|
|
return &this
|
|
}
|
|
|
|
// NewEventTopWithDefaults instantiates a new EventTop 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 NewEventTopWithDefaults() *EventTop {
|
|
this := EventTop{}
|
|
return &this
|
|
}
|
|
|
|
// GetEnd returns the End field value if set, zero value otherwise.
|
|
func (o *EventTop) GetEnd() string {
|
|
if o == nil || IsNil(o.End) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.End
|
|
}
|
|
|
|
// GetEndOk returns a tuple with the End field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventTop) GetEndOk() (*string, bool) {
|
|
if o == nil || IsNil(o.End) {
|
|
return nil, false
|
|
}
|
|
return o.End, true
|
|
}
|
|
|
|
// HasEnd returns a boolean if a field has been set.
|
|
func (o *EventTop) HasEnd() bool {
|
|
if o != nil && !IsNil(o.End) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetEnd gets a reference to the given string and assigns it to the End field.
|
|
func (o *EventTop) SetEnd(v string) {
|
|
o.End = &v
|
|
}
|
|
|
|
// GetImpersonated returns the Impersonated field value if set, zero value otherwise.
|
|
func (o *EventTop) GetImpersonated() string {
|
|
if o == nil || IsNil(o.Impersonated) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Impersonated
|
|
}
|
|
|
|
// GetImpersonatedOk returns a tuple with the Impersonated field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventTop) GetImpersonatedOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Impersonated) {
|
|
return nil, false
|
|
}
|
|
return o.Impersonated, true
|
|
}
|
|
|
|
// HasImpersonated returns a boolean if a field has been set.
|
|
func (o *EventTop) HasImpersonated() bool {
|
|
if o != nil && !IsNil(o.Impersonated) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetImpersonated gets a reference to the given string and assigns it to the Impersonated field.
|
|
func (o *EventTop) SetImpersonated(v string) {
|
|
o.Impersonated = &v
|
|
}
|
|
|
|
// GetModels returns the Models field value if set, zero value otherwise.
|
|
func (o *EventTop) GetModels() EventTopModels {
|
|
if o == nil || IsNil(o.Models) {
|
|
var ret EventTopModels
|
|
return ret
|
|
}
|
|
return *o.Models
|
|
}
|
|
|
|
// GetModelsOk returns a tuple with the Models field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventTop) GetModelsOk() (*EventTopModels, bool) {
|
|
if o == nil || IsNil(o.Models) {
|
|
return nil, false
|
|
}
|
|
return o.Models, true
|
|
}
|
|
|
|
// HasModels returns a boolean if a field has been set.
|
|
func (o *EventTop) HasModels() bool {
|
|
if o != nil && !IsNil(o.Models) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetModels gets a reference to the given EventTopModels and assigns it to the Models field.
|
|
func (o *EventTop) SetModels(v EventTopModels) {
|
|
o.Models = &v
|
|
}
|
|
|
|
// GetProducts returns the Products field value if set, zero value otherwise.
|
|
func (o *EventTop) GetProducts() EventTopProducts {
|
|
if o == nil || IsNil(o.Products) {
|
|
var ret EventTopProducts
|
|
return ret
|
|
}
|
|
return *o.Products
|
|
}
|
|
|
|
// GetProductsOk returns a tuple with the Products field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventTop) GetProductsOk() (*EventTopProducts, bool) {
|
|
if o == nil || IsNil(o.Products) {
|
|
return nil, false
|
|
}
|
|
return o.Products, true
|
|
}
|
|
|
|
// HasProducts returns a boolean if a field has been set.
|
|
func (o *EventTop) HasProducts() bool {
|
|
if o != nil && !IsNil(o.Products) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetProducts gets a reference to the given EventTopProducts and assigns it to the Products field.
|
|
func (o *EventTop) SetProducts(v EventTopProducts) {
|
|
o.Products = &v
|
|
}
|
|
|
|
// GetRange returns the Range field value if set, zero value otherwise.
|
|
func (o *EventTop) GetRange() string {
|
|
if o == nil || IsNil(o.Range) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Range
|
|
}
|
|
|
|
// GetRangeOk returns a tuple with the Range field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventTop) GetRangeOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Range) {
|
|
return nil, false
|
|
}
|
|
return o.Range, true
|
|
}
|
|
|
|
// HasRange returns a boolean if a field has been set.
|
|
func (o *EventTop) HasRange() bool {
|
|
if o != nil && !IsNil(o.Range) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRange gets a reference to the given string and assigns it to the Range field.
|
|
func (o *EventTop) SetRange(v string) {
|
|
o.Range = &v
|
|
}
|
|
|
|
// GetScope returns the Scope field value if set, zero value otherwise.
|
|
func (o *EventTop) GetScope() EventScope {
|
|
if o == nil || IsNil(o.Scope) {
|
|
var ret EventScope
|
|
return ret
|
|
}
|
|
return *o.Scope
|
|
}
|
|
|
|
// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventTop) GetScopeOk() (*EventScope, bool) {
|
|
if o == nil || IsNil(o.Scope) {
|
|
return nil, false
|
|
}
|
|
return o.Scope, true
|
|
}
|
|
|
|
// HasScope returns a boolean if a field has been set.
|
|
func (o *EventTop) HasScope() bool {
|
|
if o != nil && !IsNil(o.Scope) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetScope gets a reference to the given EventScope and assigns it to the Scope field.
|
|
func (o *EventTop) SetScope(v EventScope) {
|
|
o.Scope = &v
|
|
}
|
|
|
|
// GetStart returns the Start field value if set, zero value otherwise.
|
|
func (o *EventTop) GetStart() string {
|
|
if o == nil || IsNil(o.Start) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Start
|
|
}
|
|
|
|
// GetStartOk returns a tuple with the Start field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventTop) GetStartOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Start) {
|
|
return nil, false
|
|
}
|
|
return o.Start, true
|
|
}
|
|
|
|
// HasStart returns a boolean if a field has been set.
|
|
func (o *EventTop) HasStart() bool {
|
|
if o != nil && !IsNil(o.Start) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStart gets a reference to the given string and assigns it to the Start field.
|
|
func (o *EventTop) SetStart(v string) {
|
|
o.Start = &v
|
|
}
|
|
|
|
// GetTopPages returns the TopPages field value if set, zero value otherwise.
|
|
func (o *EventTop) GetTopPages() EventBreakdown {
|
|
if o == nil || IsNil(o.TopPages) {
|
|
var ret EventBreakdown
|
|
return ret
|
|
}
|
|
return *o.TopPages
|
|
}
|
|
|
|
// GetTopPagesOk returns a tuple with the TopPages field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventTop) GetTopPagesOk() (*EventBreakdown, bool) {
|
|
if o == nil || IsNil(o.TopPages) {
|
|
return nil, false
|
|
}
|
|
return o.TopPages, true
|
|
}
|
|
|
|
// HasTopPages returns a boolean if a field has been set.
|
|
func (o *EventTop) HasTopPages() bool {
|
|
if o != nil && !IsNil(o.TopPages) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTopPages gets a reference to the given EventBreakdown and assigns it to the TopPages field.
|
|
func (o *EventTop) SetTopPages(v EventBreakdown) {
|
|
o.TopPages = &v
|
|
}
|
|
|
|
// GetTopReferrers returns the TopReferrers field value if set, zero value otherwise.
|
|
func (o *EventTop) GetTopReferrers() EventBreakdown {
|
|
if o == nil || IsNil(o.TopReferrers) {
|
|
var ret EventBreakdown
|
|
return ret
|
|
}
|
|
return *o.TopReferrers
|
|
}
|
|
|
|
// GetTopReferrersOk returns a tuple with the TopReferrers field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventTop) GetTopReferrersOk() (*EventBreakdown, bool) {
|
|
if o == nil || IsNil(o.TopReferrers) {
|
|
return nil, false
|
|
}
|
|
return o.TopReferrers, true
|
|
}
|
|
|
|
// HasTopReferrers returns a boolean if a field has been set.
|
|
func (o *EventTop) HasTopReferrers() bool {
|
|
if o != nil && !IsNil(o.TopReferrers) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTopReferrers gets a reference to the given EventBreakdown and assigns it to the TopReferrers field.
|
|
func (o *EventTop) SetTopReferrers(v EventBreakdown) {
|
|
o.TopReferrers = &v
|
|
}
|
|
|
|
// GetTopSources returns the TopSources field value if set, zero value otherwise.
|
|
func (o *EventTop) GetTopSources() EventBreakdown {
|
|
if o == nil || IsNil(o.TopSources) {
|
|
var ret EventBreakdown
|
|
return ret
|
|
}
|
|
return *o.TopSources
|
|
}
|
|
|
|
// GetTopSourcesOk returns a tuple with the TopSources field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventTop) GetTopSourcesOk() (*EventBreakdown, bool) {
|
|
if o == nil || IsNil(o.TopSources) {
|
|
return nil, false
|
|
}
|
|
return o.TopSources, true
|
|
}
|
|
|
|
// HasTopSources returns a boolean if a field has been set.
|
|
func (o *EventTop) HasTopSources() bool {
|
|
if o != nil && !IsNil(o.TopSources) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTopSources gets a reference to the given EventBreakdown and assigns it to the TopSources field.
|
|
func (o *EventTop) SetTopSources(v EventBreakdown) {
|
|
o.TopSources = &v
|
|
}
|
|
|
|
func (o EventTop) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o EventTop) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.End) {
|
|
toSerialize["end"] = o.End
|
|
}
|
|
if !IsNil(o.Impersonated) {
|
|
toSerialize["impersonated"] = o.Impersonated
|
|
}
|
|
if !IsNil(o.Models) {
|
|
toSerialize["models"] = o.Models
|
|
}
|
|
if !IsNil(o.Products) {
|
|
toSerialize["products"] = o.Products
|
|
}
|
|
if !IsNil(o.Range) {
|
|
toSerialize["range"] = o.Range
|
|
}
|
|
if !IsNil(o.Scope) {
|
|
toSerialize["scope"] = o.Scope
|
|
}
|
|
if !IsNil(o.Start) {
|
|
toSerialize["start"] = o.Start
|
|
}
|
|
if !IsNil(o.TopPages) {
|
|
toSerialize["topPages"] = o.TopPages
|
|
}
|
|
if !IsNil(o.TopReferrers) {
|
|
toSerialize["topReferrers"] = o.TopReferrers
|
|
}
|
|
if !IsNil(o.TopSources) {
|
|
toSerialize["topSources"] = o.TopSources
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *EventTop) UnmarshalJSON(data []byte) (err error) {
|
|
varEventTop := _EventTop{}
|
|
|
|
err = json.Unmarshal(data, &varEventTop)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = EventTop(varEventTop)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "end")
|
|
delete(additionalProperties, "impersonated")
|
|
delete(additionalProperties, "models")
|
|
delete(additionalProperties, "products")
|
|
delete(additionalProperties, "range")
|
|
delete(additionalProperties, "scope")
|
|
delete(additionalProperties, "start")
|
|
delete(additionalProperties, "topPages")
|
|
delete(additionalProperties, "topReferrers")
|
|
delete(additionalProperties, "topSources")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableEventTop struct {
|
|
value *EventTop
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableEventTop) Get() *EventTop {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableEventTop) Set(val *EventTop) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableEventTop) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableEventTop) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableEventTop(val *EventTop) *NullableEventTop {
|
|
return &NullableEventTop{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableEventTop) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableEventTop) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|