Files
sdk/model_email_stats.go

460 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"
"time"
)
// checks if the EmailStats type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EmailStats{}
// EmailStats struct for EmailStats
type EmailStats struct {
// Campaign is the one campaign counted, when the request named one.
Campaign *string `json:"campaign,omitempty"`
// Campaigns is the range by campaign, the most sent first, at most 200; empty when the request named a campaign.
Campaigns []EmailPart `json:"campaigns,omitempty"`
// Interval is day or hour: the step of Series.
Interval *string `json:"interval,omitempty"`
// Provider is the one rail counted, when the request named one.
Provider *string `json:"provider,omitempty"`
// Providers is the range by provider.
Providers []EmailPart `json:"providers,omitempty"`
// Series is every day or hour of the range in order, empty ones included.
Series []EmailPoint `json:"series,omitempty"`
// Since is the start of the range, UTC.
Since *time.Time `json:"since,omitempty"`
// Totals is the whole range.
Totals *EmailTally `json:"totals,omitempty"`
// Until is the end of the range, UTC, not included.
Until *time.Time `json:"until,omitempty"`
AdditionalProperties map[string]interface{}
}
type _EmailStats EmailStats
// NewEmailStats instantiates a new EmailStats 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 NewEmailStats() *EmailStats {
this := EmailStats{}
return &this
}
// NewEmailStatsWithDefaults instantiates a new EmailStats 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 NewEmailStatsWithDefaults() *EmailStats {
this := EmailStats{}
return &this
}
// GetCampaign returns the Campaign field value if set, zero value otherwise.
func (o *EmailStats) GetCampaign() string {
if o == nil || IsNil(o.Campaign) {
var ret string
return ret
}
return *o.Campaign
}
// GetCampaignOk returns a tuple with the Campaign field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EmailStats) GetCampaignOk() (*string, bool) {
if o == nil || IsNil(o.Campaign) {
return nil, false
}
return o.Campaign, true
}
// HasCampaign returns a boolean if a field has been set.
func (o *EmailStats) HasCampaign() bool {
if o != nil && !IsNil(o.Campaign) {
return true
}
return false
}
// SetCampaign gets a reference to the given string and assigns it to the Campaign field.
func (o *EmailStats) SetCampaign(v string) {
o.Campaign = &v
}
// GetCampaigns returns the Campaigns field value if set, zero value otherwise.
func (o *EmailStats) GetCampaigns() []EmailPart {
if o == nil || IsNil(o.Campaigns) {
var ret []EmailPart
return ret
}
return o.Campaigns
}
// GetCampaignsOk returns a tuple with the Campaigns field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EmailStats) GetCampaignsOk() ([]EmailPart, bool) {
if o == nil || IsNil(o.Campaigns) {
return nil, false
}
return o.Campaigns, true
}
// HasCampaigns returns a boolean if a field has been set.
func (o *EmailStats) HasCampaigns() bool {
if o != nil && !IsNil(o.Campaigns) {
return true
}
return false
}
// SetCampaigns gets a reference to the given []EmailPart and assigns it to the Campaigns field.
func (o *EmailStats) SetCampaigns(v []EmailPart) {
o.Campaigns = v
}
// GetInterval returns the Interval field value if set, zero value otherwise.
func (o *EmailStats) 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 *EmailStats) 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 *EmailStats) 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 *EmailStats) SetInterval(v string) {
o.Interval = &v
}
// GetProvider returns the Provider field value if set, zero value otherwise.
func (o *EmailStats) GetProvider() string {
if o == nil || IsNil(o.Provider) {
var ret string
return ret
}
return *o.Provider
}
// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EmailStats) GetProviderOk() (*string, bool) {
if o == nil || IsNil(o.Provider) {
return nil, false
}
return o.Provider, true
}
// HasProvider returns a boolean if a field has been set.
func (o *EmailStats) HasProvider() bool {
if o != nil && !IsNil(o.Provider) {
return true
}
return false
}
// SetProvider gets a reference to the given string and assigns it to the Provider field.
func (o *EmailStats) SetProvider(v string) {
o.Provider = &v
}
// GetProviders returns the Providers field value if set, zero value otherwise.
func (o *EmailStats) GetProviders() []EmailPart {
if o == nil || IsNil(o.Providers) {
var ret []EmailPart
return ret
}
return o.Providers
}
// GetProvidersOk returns a tuple with the Providers field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EmailStats) GetProvidersOk() ([]EmailPart, bool) {
if o == nil || IsNil(o.Providers) {
return nil, false
}
return o.Providers, true
}
// HasProviders returns a boolean if a field has been set.
func (o *EmailStats) HasProviders() bool {
if o != nil && !IsNil(o.Providers) {
return true
}
return false
}
// SetProviders gets a reference to the given []EmailPart and assigns it to the Providers field.
func (o *EmailStats) SetProviders(v []EmailPart) {
o.Providers = v
}
// GetSeries returns the Series field value if set, zero value otherwise.
func (o *EmailStats) GetSeries() []EmailPoint {
if o == nil || IsNil(o.Series) {
var ret []EmailPoint
return ret
}
return o.Series
}
// GetSeriesOk returns a tuple with the Series field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EmailStats) GetSeriesOk() ([]EmailPoint, bool) {
if o == nil || IsNil(o.Series) {
return nil, false
}
return o.Series, true
}
// HasSeries returns a boolean if a field has been set.
func (o *EmailStats) HasSeries() bool {
if o != nil && !IsNil(o.Series) {
return true
}
return false
}
// SetSeries gets a reference to the given []EmailPoint and assigns it to the Series field.
func (o *EmailStats) SetSeries(v []EmailPoint) {
o.Series = v
}
// GetSince returns the Since field value if set, zero value otherwise.
func (o *EmailStats) GetSince() time.Time {
if o == nil || IsNil(o.Since) {
var ret time.Time
return ret
}
return *o.Since
}
// GetSinceOk returns a tuple with the Since field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EmailStats) GetSinceOk() (*time.Time, bool) {
if o == nil || IsNil(o.Since) {
return nil, false
}
return o.Since, true
}
// HasSince returns a boolean if a field has been set.
func (o *EmailStats) HasSince() bool {
if o != nil && !IsNil(o.Since) {
return true
}
return false
}
// SetSince gets a reference to the given time.Time and assigns it to the Since field.
func (o *EmailStats) SetSince(v time.Time) {
o.Since = &v
}
// GetTotals returns the Totals field value if set, zero value otherwise.
func (o *EmailStats) GetTotals() EmailTally {
if o == nil || IsNil(o.Totals) {
var ret EmailTally
return ret
}
return *o.Totals
}
// GetTotalsOk returns a tuple with the Totals field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EmailStats) GetTotalsOk() (*EmailTally, bool) {
if o == nil || IsNil(o.Totals) {
return nil, false
}
return o.Totals, true
}
// HasTotals returns a boolean if a field has been set.
func (o *EmailStats) HasTotals() bool {
if o != nil && !IsNil(o.Totals) {
return true
}
return false
}
// SetTotals gets a reference to the given EmailTally and assigns it to the Totals field.
func (o *EmailStats) SetTotals(v EmailTally) {
o.Totals = &v
}
// GetUntil returns the Until field value if set, zero value otherwise.
func (o *EmailStats) GetUntil() time.Time {
if o == nil || IsNil(o.Until) {
var ret time.Time
return ret
}
return *o.Until
}
// GetUntilOk returns a tuple with the Until field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EmailStats) GetUntilOk() (*time.Time, bool) {
if o == nil || IsNil(o.Until) {
return nil, false
}
return o.Until, true
}
// HasUntil returns a boolean if a field has been set.
func (o *EmailStats) HasUntil() bool {
if o != nil && !IsNil(o.Until) {
return true
}
return false
}
// SetUntil gets a reference to the given time.Time and assigns it to the Until field.
func (o *EmailStats) SetUntil(v time.Time) {
o.Until = &v
}
func (o EmailStats) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EmailStats) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Campaign) {
toSerialize["campaign"] = o.Campaign
}
if !IsNil(o.Campaigns) {
toSerialize["campaigns"] = o.Campaigns
}
if !IsNil(o.Interval) {
toSerialize["interval"] = o.Interval
}
if !IsNil(o.Provider) {
toSerialize["provider"] = o.Provider
}
if !IsNil(o.Providers) {
toSerialize["providers"] = o.Providers
}
if !IsNil(o.Series) {
toSerialize["series"] = o.Series
}
if !IsNil(o.Since) {
toSerialize["since"] = o.Since
}
if !IsNil(o.Totals) {
toSerialize["totals"] = o.Totals
}
if !IsNil(o.Until) {
toSerialize["until"] = o.Until
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *EmailStats) UnmarshalJSON(data []byte) (err error) {
varEmailStats := _EmailStats{}
err = json.Unmarshal(data, &varEmailStats)
if err != nil {
return err
}
*o = EmailStats(varEmailStats)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "campaign")
delete(additionalProperties, "campaigns")
delete(additionalProperties, "interval")
delete(additionalProperties, "provider")
delete(additionalProperties, "providers")
delete(additionalProperties, "series")
delete(additionalProperties, "since")
delete(additionalProperties, "totals")
delete(additionalProperties, "until")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableEmailStats struct {
value *EmailStats
isSet bool
}
func (v NullableEmailStats) Get() *EmailStats {
return v.value
}
func (v *NullableEmailStats) Set(val *EmailStats) {
v.value = val
v.isSet = true
}
func (v NullableEmailStats) IsSet() bool {
return v.isSet
}
func (v *NullableEmailStats) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEmailStats(val *EmailStats) *NullableEmailStats {
return &NullableEmailStats{value: val, isSet: true}
}
func (v NullableEmailStats) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEmailStats) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}