mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
383 lines
9.7 KiB
Go
383 lines
9.7 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 EmailTally type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &EmailTally{}
|
|
|
|
// EmailTally struct for EmailTally
|
|
type EmailTally struct {
|
|
// Bounced is messages that bounced, hard or soft (SendGrid's dropped included).
|
|
Bounced *int64 `json:"bounced,omitempty"`
|
|
// Clicked is messages a link of which was clicked.
|
|
Clicked *int64 `json:"clicked,omitempty"`
|
|
// Complained is messages reported as spam.
|
|
Complained *int64 `json:"complained,omitempty"`
|
|
// Delivered is messages the receiving server took.
|
|
Delivered *int64 `json:"delivered,omitempty"`
|
|
// Opened is messages opened.
|
|
Opened *int64 `json:"opened,omitempty"`
|
|
// Sent is messages the provider accepted.
|
|
Sent *int64 `json:"sent,omitempty"`
|
|
// Unsubscribed is messages whose recipient unsubscribed at the provider.
|
|
Unsubscribed *int64 `json:"unsubscribed,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _EmailTally EmailTally
|
|
|
|
// NewEmailTally instantiates a new EmailTally 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 NewEmailTally() *EmailTally {
|
|
this := EmailTally{}
|
|
return &this
|
|
}
|
|
|
|
// NewEmailTallyWithDefaults instantiates a new EmailTally 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 NewEmailTallyWithDefaults() *EmailTally {
|
|
this := EmailTally{}
|
|
return &this
|
|
}
|
|
|
|
// GetBounced returns the Bounced field value if set, zero value otherwise.
|
|
func (o *EmailTally) GetBounced() int64 {
|
|
if o == nil || IsNil(o.Bounced) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Bounced
|
|
}
|
|
|
|
// GetBouncedOk returns a tuple with the Bounced field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EmailTally) GetBouncedOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Bounced) {
|
|
return nil, false
|
|
}
|
|
return o.Bounced, true
|
|
}
|
|
|
|
// HasBounced returns a boolean if a field has been set.
|
|
func (o *EmailTally) HasBounced() bool {
|
|
if o != nil && !IsNil(o.Bounced) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetBounced gets a reference to the given int64 and assigns it to the Bounced field.
|
|
func (o *EmailTally) SetBounced(v int64) {
|
|
o.Bounced = &v
|
|
}
|
|
|
|
// GetClicked returns the Clicked field value if set, zero value otherwise.
|
|
func (o *EmailTally) GetClicked() int64 {
|
|
if o == nil || IsNil(o.Clicked) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Clicked
|
|
}
|
|
|
|
// GetClickedOk returns a tuple with the Clicked field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EmailTally) GetClickedOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Clicked) {
|
|
return nil, false
|
|
}
|
|
return o.Clicked, true
|
|
}
|
|
|
|
// HasClicked returns a boolean if a field has been set.
|
|
func (o *EmailTally) HasClicked() bool {
|
|
if o != nil && !IsNil(o.Clicked) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetClicked gets a reference to the given int64 and assigns it to the Clicked field.
|
|
func (o *EmailTally) SetClicked(v int64) {
|
|
o.Clicked = &v
|
|
}
|
|
|
|
// GetComplained returns the Complained field value if set, zero value otherwise.
|
|
func (o *EmailTally) GetComplained() int64 {
|
|
if o == nil || IsNil(o.Complained) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Complained
|
|
}
|
|
|
|
// GetComplainedOk returns a tuple with the Complained field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EmailTally) GetComplainedOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Complained) {
|
|
return nil, false
|
|
}
|
|
return o.Complained, true
|
|
}
|
|
|
|
// HasComplained returns a boolean if a field has been set.
|
|
func (o *EmailTally) HasComplained() bool {
|
|
if o != nil && !IsNil(o.Complained) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetComplained gets a reference to the given int64 and assigns it to the Complained field.
|
|
func (o *EmailTally) SetComplained(v int64) {
|
|
o.Complained = &v
|
|
}
|
|
|
|
// GetDelivered returns the Delivered field value if set, zero value otherwise.
|
|
func (o *EmailTally) GetDelivered() int64 {
|
|
if o == nil || IsNil(o.Delivered) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Delivered
|
|
}
|
|
|
|
// GetDeliveredOk returns a tuple with the Delivered field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EmailTally) GetDeliveredOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Delivered) {
|
|
return nil, false
|
|
}
|
|
return o.Delivered, true
|
|
}
|
|
|
|
// HasDelivered returns a boolean if a field has been set.
|
|
func (o *EmailTally) HasDelivered() bool {
|
|
if o != nil && !IsNil(o.Delivered) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDelivered gets a reference to the given int64 and assigns it to the Delivered field.
|
|
func (o *EmailTally) SetDelivered(v int64) {
|
|
o.Delivered = &v
|
|
}
|
|
|
|
// GetOpened returns the Opened field value if set, zero value otherwise.
|
|
func (o *EmailTally) GetOpened() int64 {
|
|
if o == nil || IsNil(o.Opened) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Opened
|
|
}
|
|
|
|
// GetOpenedOk returns a tuple with the Opened field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EmailTally) GetOpenedOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Opened) {
|
|
return nil, false
|
|
}
|
|
return o.Opened, true
|
|
}
|
|
|
|
// HasOpened returns a boolean if a field has been set.
|
|
func (o *EmailTally) HasOpened() bool {
|
|
if o != nil && !IsNil(o.Opened) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetOpened gets a reference to the given int64 and assigns it to the Opened field.
|
|
func (o *EmailTally) SetOpened(v int64) {
|
|
o.Opened = &v
|
|
}
|
|
|
|
// GetSent returns the Sent field value if set, zero value otherwise.
|
|
func (o *EmailTally) GetSent() int64 {
|
|
if o == nil || IsNil(o.Sent) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Sent
|
|
}
|
|
|
|
// GetSentOk returns a tuple with the Sent field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EmailTally) GetSentOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Sent) {
|
|
return nil, false
|
|
}
|
|
return o.Sent, true
|
|
}
|
|
|
|
// HasSent returns a boolean if a field has been set.
|
|
func (o *EmailTally) HasSent() bool {
|
|
if o != nil && !IsNil(o.Sent) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSent gets a reference to the given int64 and assigns it to the Sent field.
|
|
func (o *EmailTally) SetSent(v int64) {
|
|
o.Sent = &v
|
|
}
|
|
|
|
// GetUnsubscribed returns the Unsubscribed field value if set, zero value otherwise.
|
|
func (o *EmailTally) GetUnsubscribed() int64 {
|
|
if o == nil || IsNil(o.Unsubscribed) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Unsubscribed
|
|
}
|
|
|
|
// GetUnsubscribedOk returns a tuple with the Unsubscribed field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EmailTally) GetUnsubscribedOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Unsubscribed) {
|
|
return nil, false
|
|
}
|
|
return o.Unsubscribed, true
|
|
}
|
|
|
|
// HasUnsubscribed returns a boolean if a field has been set.
|
|
func (o *EmailTally) HasUnsubscribed() bool {
|
|
if o != nil && !IsNil(o.Unsubscribed) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUnsubscribed gets a reference to the given int64 and assigns it to the Unsubscribed field.
|
|
func (o *EmailTally) SetUnsubscribed(v int64) {
|
|
o.Unsubscribed = &v
|
|
}
|
|
|
|
func (o EmailTally) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o EmailTally) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Bounced) {
|
|
toSerialize["bounced"] = o.Bounced
|
|
}
|
|
if !IsNil(o.Clicked) {
|
|
toSerialize["clicked"] = o.Clicked
|
|
}
|
|
if !IsNil(o.Complained) {
|
|
toSerialize["complained"] = o.Complained
|
|
}
|
|
if !IsNil(o.Delivered) {
|
|
toSerialize["delivered"] = o.Delivered
|
|
}
|
|
if !IsNil(o.Opened) {
|
|
toSerialize["opened"] = o.Opened
|
|
}
|
|
if !IsNil(o.Sent) {
|
|
toSerialize["sent"] = o.Sent
|
|
}
|
|
if !IsNil(o.Unsubscribed) {
|
|
toSerialize["unsubscribed"] = o.Unsubscribed
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *EmailTally) UnmarshalJSON(data []byte) (err error) {
|
|
varEmailTally := _EmailTally{}
|
|
|
|
err = json.Unmarshal(data, &varEmailTally)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = EmailTally(varEmailTally)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "bounced")
|
|
delete(additionalProperties, "clicked")
|
|
delete(additionalProperties, "complained")
|
|
delete(additionalProperties, "delivered")
|
|
delete(additionalProperties, "opened")
|
|
delete(additionalProperties, "sent")
|
|
delete(additionalProperties, "unsubscribed")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableEmailTally struct {
|
|
value *EmailTally
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableEmailTally) Get() *EmailTally {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableEmailTally) Set(val *EmailTally) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableEmailTally) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableEmailTally) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableEmailTally(val *EmailTally) *NullableEmailTally {
|
|
return &NullableEmailTally{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableEmailTally) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableEmailTally) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|