Files
sdk/model_email_dispatch.go

193 lines
5.1 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 EmailDispatch type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EmailDispatch{}
// EmailDispatch struct for EmailDispatch
type EmailDispatch struct {
// Messages is one message per recipient that was sent, each with its own unsubscribe link; a message the provider refused is here with status failed.
Messages []EmailMessageRecord `json:"messages,omitempty"`
// Refused is every recipient the suppression check refused. Nothing was sent to them.
Refused []EmailRefused `json:"refused,omitempty"`
AdditionalProperties map[string]interface{}
}
type _EmailDispatch EmailDispatch
// NewEmailDispatch instantiates a new EmailDispatch 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 NewEmailDispatch() *EmailDispatch {
this := EmailDispatch{}
return &this
}
// NewEmailDispatchWithDefaults instantiates a new EmailDispatch 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 NewEmailDispatchWithDefaults() *EmailDispatch {
this := EmailDispatch{}
return &this
}
// GetMessages returns the Messages field value if set, zero value otherwise.
func (o *EmailDispatch) GetMessages() []EmailMessageRecord {
if o == nil || IsNil(o.Messages) {
var ret []EmailMessageRecord
return ret
}
return o.Messages
}
// GetMessagesOk returns a tuple with the Messages field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EmailDispatch) GetMessagesOk() ([]EmailMessageRecord, bool) {
if o == nil || IsNil(o.Messages) {
return nil, false
}
return o.Messages, true
}
// HasMessages returns a boolean if a field has been set.
func (o *EmailDispatch) HasMessages() bool {
if o != nil && !IsNil(o.Messages) {
return true
}
return false
}
// SetMessages gets a reference to the given []EmailMessageRecord and assigns it to the Messages field.
func (o *EmailDispatch) SetMessages(v []EmailMessageRecord) {
o.Messages = v
}
// GetRefused returns the Refused field value if set, zero value otherwise.
func (o *EmailDispatch) GetRefused() []EmailRefused {
if o == nil || IsNil(o.Refused) {
var ret []EmailRefused
return ret
}
return o.Refused
}
// GetRefusedOk returns a tuple with the Refused field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EmailDispatch) GetRefusedOk() ([]EmailRefused, bool) {
if o == nil || IsNil(o.Refused) {
return nil, false
}
return o.Refused, true
}
// HasRefused returns a boolean if a field has been set.
func (o *EmailDispatch) HasRefused() bool {
if o != nil && !IsNil(o.Refused) {
return true
}
return false
}
// SetRefused gets a reference to the given []EmailRefused and assigns it to the Refused field.
func (o *EmailDispatch) SetRefused(v []EmailRefused) {
o.Refused = v
}
func (o EmailDispatch) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EmailDispatch) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Messages) {
toSerialize["messages"] = o.Messages
}
if !IsNil(o.Refused) {
toSerialize["refused"] = o.Refused
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *EmailDispatch) UnmarshalJSON(data []byte) (err error) {
varEmailDispatch := _EmailDispatch{}
err = json.Unmarshal(data, &varEmailDispatch)
if err != nil {
return err
}
*o = EmailDispatch(varEmailDispatch)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "messages")
delete(additionalProperties, "refused")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableEmailDispatch struct {
value *EmailDispatch
isSet bool
}
func (v NullableEmailDispatch) Get() *EmailDispatch {
return v.value
}
func (v *NullableEmailDispatch) Set(val *EmailDispatch) {
v.value = val
v.isSet = true
}
func (v NullableEmailDispatch) IsSet() bool {
return v.isSet
}
func (v *NullableEmailDispatch) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEmailDispatch(val *EmailDispatch) *NullableEmailDispatch {
return &NullableEmailDispatch{value: val, isSet: true}
}
func (v NullableEmailDispatch) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEmailDispatch) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}