mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
459 lines
12 KiB
Go
459 lines
12 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 EventOverview type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &EventOverview{}
|
|
|
|
// EventOverview struct for EventOverview
|
|
type EventOverview struct {
|
|
// Commerce is the orders/revenue lens over product events.
|
|
Commerce *EventCommerceOverview `json:"commerce,omitempty"`
|
|
// End is the window's exclusive upper bound, RFC3339 UTC.
|
|
End *string `json:"end,omitempty"`
|
|
// Impersonated is which events web and commerce counted against the mark a platform operator leaves acting as someone else: exclude (the tenant's own traffic), include, or only. LLM reads the usage ledger, which carries no mark.
|
|
Impersonated *string `json:"impersonated,omitempty"`
|
|
// Interval is the bucket width the window implies: hour or day.
|
|
Interval *string `json:"interval,omitempty"`
|
|
// LLM is the LLM usage lens — real per-org data.
|
|
Llm *EventLLMOverview `json:"llm,omitempty"`
|
|
// Range is the window that was actually applied: 24h, 7d, 30d or custom.
|
|
Range *string `json:"range,omitempty"`
|
|
// Scope names the tenant these numbers belong to.
|
|
Scope *EventScope `json:"scope,omitempty"`
|
|
// Start is the window's inclusive lower bound, RFC3339 UTC.
|
|
Start *string `json:"start,omitempty"`
|
|
// Web is the web-traffic lens over product events.
|
|
Web *EventWebOverview `json:"web,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _EventOverview EventOverview
|
|
|
|
// NewEventOverview instantiates a new EventOverview 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 NewEventOverview() *EventOverview {
|
|
this := EventOverview{}
|
|
return &this
|
|
}
|
|
|
|
// NewEventOverviewWithDefaults instantiates a new EventOverview 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 NewEventOverviewWithDefaults() *EventOverview {
|
|
this := EventOverview{}
|
|
return &this
|
|
}
|
|
|
|
// GetCommerce returns the Commerce field value if set, zero value otherwise.
|
|
func (o *EventOverview) GetCommerce() EventCommerceOverview {
|
|
if o == nil || IsNil(o.Commerce) {
|
|
var ret EventCommerceOverview
|
|
return ret
|
|
}
|
|
return *o.Commerce
|
|
}
|
|
|
|
// GetCommerceOk returns a tuple with the Commerce field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventOverview) GetCommerceOk() (*EventCommerceOverview, bool) {
|
|
if o == nil || IsNil(o.Commerce) {
|
|
return nil, false
|
|
}
|
|
return o.Commerce, true
|
|
}
|
|
|
|
// HasCommerce returns a boolean if a field has been set.
|
|
func (o *EventOverview) HasCommerce() bool {
|
|
if o != nil && !IsNil(o.Commerce) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCommerce gets a reference to the given EventCommerceOverview and assigns it to the Commerce field.
|
|
func (o *EventOverview) SetCommerce(v EventCommerceOverview) {
|
|
o.Commerce = &v
|
|
}
|
|
|
|
// GetEnd returns the End field value if set, zero value otherwise.
|
|
func (o *EventOverview) 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 *EventOverview) 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 *EventOverview) 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 *EventOverview) SetEnd(v string) {
|
|
o.End = &v
|
|
}
|
|
|
|
// GetImpersonated returns the Impersonated field value if set, zero value otherwise.
|
|
func (o *EventOverview) 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 *EventOverview) 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 *EventOverview) 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 *EventOverview) SetImpersonated(v string) {
|
|
o.Impersonated = &v
|
|
}
|
|
|
|
// GetInterval returns the Interval field value if set, zero value otherwise.
|
|
func (o *EventOverview) GetInterval() string {
|
|
if o == nil || IsNil(o.Interval) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Interval
|
|
}
|
|
|
|
// GetIntervalOk returns a tuple with the Interval field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventOverview) GetIntervalOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Interval) {
|
|
return nil, false
|
|
}
|
|
return o.Interval, true
|
|
}
|
|
|
|
// HasInterval returns a boolean if a field has been set.
|
|
func (o *EventOverview) HasInterval() bool {
|
|
if o != nil && !IsNil(o.Interval) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetInterval gets a reference to the given string and assigns it to the Interval field.
|
|
func (o *EventOverview) SetInterval(v string) {
|
|
o.Interval = &v
|
|
}
|
|
|
|
// GetLlm returns the Llm field value if set, zero value otherwise.
|
|
func (o *EventOverview) GetLlm() EventLLMOverview {
|
|
if o == nil || IsNil(o.Llm) {
|
|
var ret EventLLMOverview
|
|
return ret
|
|
}
|
|
return *o.Llm
|
|
}
|
|
|
|
// GetLlmOk returns a tuple with the Llm field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventOverview) GetLlmOk() (*EventLLMOverview, bool) {
|
|
if o == nil || IsNil(o.Llm) {
|
|
return nil, false
|
|
}
|
|
return o.Llm, true
|
|
}
|
|
|
|
// HasLlm returns a boolean if a field has been set.
|
|
func (o *EventOverview) HasLlm() bool {
|
|
if o != nil && !IsNil(o.Llm) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLlm gets a reference to the given EventLLMOverview and assigns it to the Llm field.
|
|
func (o *EventOverview) SetLlm(v EventLLMOverview) {
|
|
o.Llm = &v
|
|
}
|
|
|
|
// GetRange returns the Range field value if set, zero value otherwise.
|
|
func (o *EventOverview) 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 *EventOverview) 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 *EventOverview) 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 *EventOverview) SetRange(v string) {
|
|
o.Range = &v
|
|
}
|
|
|
|
// GetScope returns the Scope field value if set, zero value otherwise.
|
|
func (o *EventOverview) 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 *EventOverview) 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 *EventOverview) 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 *EventOverview) SetScope(v EventScope) {
|
|
o.Scope = &v
|
|
}
|
|
|
|
// GetStart returns the Start field value if set, zero value otherwise.
|
|
func (o *EventOverview) 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 *EventOverview) 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 *EventOverview) 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 *EventOverview) SetStart(v string) {
|
|
o.Start = &v
|
|
}
|
|
|
|
// GetWeb returns the Web field value if set, zero value otherwise.
|
|
func (o *EventOverview) GetWeb() EventWebOverview {
|
|
if o == nil || IsNil(o.Web) {
|
|
var ret EventWebOverview
|
|
return ret
|
|
}
|
|
return *o.Web
|
|
}
|
|
|
|
// GetWebOk returns a tuple with the Web field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventOverview) GetWebOk() (*EventWebOverview, bool) {
|
|
if o == nil || IsNil(o.Web) {
|
|
return nil, false
|
|
}
|
|
return o.Web, true
|
|
}
|
|
|
|
// HasWeb returns a boolean if a field has been set.
|
|
func (o *EventOverview) HasWeb() bool {
|
|
if o != nil && !IsNil(o.Web) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetWeb gets a reference to the given EventWebOverview and assigns it to the Web field.
|
|
func (o *EventOverview) SetWeb(v EventWebOverview) {
|
|
o.Web = &v
|
|
}
|
|
|
|
func (o EventOverview) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o EventOverview) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Commerce) {
|
|
toSerialize["commerce"] = o.Commerce
|
|
}
|
|
if !IsNil(o.End) {
|
|
toSerialize["end"] = o.End
|
|
}
|
|
if !IsNil(o.Impersonated) {
|
|
toSerialize["impersonated"] = o.Impersonated
|
|
}
|
|
if !IsNil(o.Interval) {
|
|
toSerialize["interval"] = o.Interval
|
|
}
|
|
if !IsNil(o.Llm) {
|
|
toSerialize["llm"] = o.Llm
|
|
}
|
|
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.Web) {
|
|
toSerialize["web"] = o.Web
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *EventOverview) UnmarshalJSON(data []byte) (err error) {
|
|
varEventOverview := _EventOverview{}
|
|
|
|
err = json.Unmarshal(data, &varEventOverview)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = EventOverview(varEventOverview)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "commerce")
|
|
delete(additionalProperties, "end")
|
|
delete(additionalProperties, "impersonated")
|
|
delete(additionalProperties, "interval")
|
|
delete(additionalProperties, "llm")
|
|
delete(additionalProperties, "range")
|
|
delete(additionalProperties, "scope")
|
|
delete(additionalProperties, "start")
|
|
delete(additionalProperties, "web")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableEventOverview struct {
|
|
value *EventOverview
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableEventOverview) Get() *EventOverview {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableEventOverview) Set(val *EventOverview) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableEventOverview) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableEventOverview) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableEventOverview(val *EventOverview) *NullableEventOverview {
|
|
return &NullableEventOverview{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableEventOverview) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableEventOverview) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|