Files
sdk/model_event_commerce_overview.go

345 lines
9.4 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 EventCommerceOverview type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EventCommerceOverview{}
// EventCommerceOverview struct for EventCommerceOverview
type EventCommerceOverview struct {
// AOV is average order value — Revenue/Orders, rounded to two places. Zero when there were no orders.
Aov *float64 `json:"aov,omitempty"`
// Available is false when the product-event table could not be read — the lens is reported missing rather than as zeros that look like no sales.
Available *bool `json:"available,omitempty"`
// Orders is how many order_completed events landed in the window.
Orders *int64 `json:"orders,omitempty"`
// Reason says why the lens is unavailable. Omitted when it is available.
Reason *string `json:"reason,omitempty"`
// Revenue is the total those orders carried, in the events' own currency unit.
Revenue *float64 `json:"revenue,omitempty"`
// Source is the warehouse table the lens read.
Source *string `json:"source,omitempty"`
AdditionalProperties map[string]interface{}
}
type _EventCommerceOverview EventCommerceOverview
// NewEventCommerceOverview instantiates a new EventCommerceOverview 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 NewEventCommerceOverview() *EventCommerceOverview {
this := EventCommerceOverview{}
return &this
}
// NewEventCommerceOverviewWithDefaults instantiates a new EventCommerceOverview 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 NewEventCommerceOverviewWithDefaults() *EventCommerceOverview {
this := EventCommerceOverview{}
return &this
}
// GetAov returns the Aov field value if set, zero value otherwise.
func (o *EventCommerceOverview) GetAov() float64 {
if o == nil || IsNil(o.Aov) {
var ret float64
return ret
}
return *o.Aov
}
// GetAovOk returns a tuple with the Aov field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EventCommerceOverview) GetAovOk() (*float64, bool) {
if o == nil || IsNil(o.Aov) {
return nil, false
}
return o.Aov, true
}
// HasAov returns a boolean if a field has been set.
func (o *EventCommerceOverview) HasAov() bool {
if o != nil && !IsNil(o.Aov) {
return true
}
return false
}
// SetAov gets a reference to the given float64 and assigns it to the Aov field.
func (o *EventCommerceOverview) SetAov(v float64) {
o.Aov = &v
}
// GetAvailable returns the Available field value if set, zero value otherwise.
func (o *EventCommerceOverview) 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 *EventCommerceOverview) 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 *EventCommerceOverview) 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 *EventCommerceOverview) SetAvailable(v bool) {
o.Available = &v
}
// GetOrders returns the Orders field value if set, zero value otherwise.
func (o *EventCommerceOverview) 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 *EventCommerceOverview) 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 *EventCommerceOverview) 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 *EventCommerceOverview) SetOrders(v int64) {
o.Orders = &v
}
// GetReason returns the Reason field value if set, zero value otherwise.
func (o *EventCommerceOverview) 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 *EventCommerceOverview) 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 *EventCommerceOverview) 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 *EventCommerceOverview) SetReason(v string) {
o.Reason = &v
}
// GetRevenue returns the Revenue field value if set, zero value otherwise.
func (o *EventCommerceOverview) 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 *EventCommerceOverview) 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 *EventCommerceOverview) 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 *EventCommerceOverview) SetRevenue(v float64) {
o.Revenue = &v
}
// GetSource returns the Source field value if set, zero value otherwise.
func (o *EventCommerceOverview) 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 *EventCommerceOverview) 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 *EventCommerceOverview) 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 *EventCommerceOverview) SetSource(v string) {
o.Source = &v
}
func (o EventCommerceOverview) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EventCommerceOverview) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Aov) {
toSerialize["aov"] = o.Aov
}
if !IsNil(o.Available) {
toSerialize["available"] = o.Available
}
if !IsNil(o.Orders) {
toSerialize["orders"] = o.Orders
}
if !IsNil(o.Reason) {
toSerialize["reason"] = o.Reason
}
if !IsNil(o.Revenue) {
toSerialize["revenue"] = o.Revenue
}
if !IsNil(o.Source) {
toSerialize["source"] = o.Source
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *EventCommerceOverview) UnmarshalJSON(data []byte) (err error) {
varEventCommerceOverview := _EventCommerceOverview{}
err = json.Unmarshal(data, &varEventCommerceOverview)
if err != nil {
return err
}
*o = EventCommerceOverview(varEventCommerceOverview)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "aov")
delete(additionalProperties, "available")
delete(additionalProperties, "orders")
delete(additionalProperties, "reason")
delete(additionalProperties, "revenue")
delete(additionalProperties, "source")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableEventCommerceOverview struct {
value *EventCommerceOverview
isSet bool
}
func (v NullableEventCommerceOverview) Get() *EventCommerceOverview {
return v.value
}
func (v *NullableEventCommerceOverview) Set(val *EventCommerceOverview) {
v.value = val
v.isSet = true
}
func (v NullableEventCommerceOverview) IsSet() bool {
return v.isSet
}
func (v *NullableEventCommerceOverview) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEventCommerceOverview(val *EventCommerceOverview) *NullableEventCommerceOverview {
return &NullableEventCommerceOverview{value: val, isSet: true}
}
func (v NullableEventCommerceOverview) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEventCommerceOverview) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}