mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
611 lines
17 KiB
Go
611 lines
17 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 EmailSendMessageInput type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &EmailSendMessageInput{}
|
|
|
|
// EmailSendMessageInput struct for EmailSendMessageInput
|
|
type EmailSendMessageInput struct {
|
|
// Body is an alias for Text for backward compatibility.
|
|
Body *string `json:"body,omitempty"`
|
|
// Campaign tags the messages: 1 to 128 letters, digits, '-' or '_', which is what an SES message tag may hold. Every link carries it as utm_campaign, the provider carries it back on every event, and the stats count by it.
|
|
Campaign *string `json:"campaign,omitempty"`
|
|
// From is the sender address. If empty, the provider credential's from-email is used.
|
|
From *string `json:"from,omitempty"`
|
|
// Headers provides optional custom MIME headers.
|
|
Headers map[string]string `json:"headers,omitempty"`
|
|
// HTML is the HTML body.
|
|
Html *string `json:"html,omitempty"`
|
|
// IdempotencyKey names the send, so a retried request sends each recipient's message once: the same key and recipient name the same message.
|
|
IdempotencyKey *string `json:"idempotency_key,omitempty"`
|
|
// Provider pins the rail, ses or sendgrid. Empty is the org's default (PUT /v1/email/provider), else ses, else sendgrid, whichever the org holds credentials for.
|
|
Provider *string `json:"provider,omitempty"`
|
|
// Subject is the message subject.
|
|
Subject *string `json:"subject,omitempty"`
|
|
// Sync is accepted for backwards compatibility with notify sends.
|
|
Sync *string `json:"sync,omitempty"`
|
|
// TemplateID optionally references a built-in template.
|
|
TemplateId *string `json:"template_id,omitempty"`
|
|
TemplateVars interface{} `json:"template_vars,omitempty"`
|
|
// Text is the plain text body.
|
|
Text *string `json:"text,omitempty"`
|
|
// To lists destination recipient addresses. Each gets a message of its own.
|
|
To []string `json:"to,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _EmailSendMessageInput EmailSendMessageInput
|
|
|
|
// NewEmailSendMessageInput instantiates a new EmailSendMessageInput 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 NewEmailSendMessageInput() *EmailSendMessageInput {
|
|
this := EmailSendMessageInput{}
|
|
return &this
|
|
}
|
|
|
|
// NewEmailSendMessageInputWithDefaults instantiates a new EmailSendMessageInput 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 NewEmailSendMessageInputWithDefaults() *EmailSendMessageInput {
|
|
this := EmailSendMessageInput{}
|
|
return &this
|
|
}
|
|
|
|
// GetBody returns the Body field value if set, zero value otherwise.
|
|
func (o *EmailSendMessageInput) GetBody() string {
|
|
if o == nil || IsNil(o.Body) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Body
|
|
}
|
|
|
|
// GetBodyOk returns a tuple with the Body field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EmailSendMessageInput) GetBodyOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Body) {
|
|
return nil, false
|
|
}
|
|
return o.Body, true
|
|
}
|
|
|
|
// HasBody returns a boolean if a field has been set.
|
|
func (o *EmailSendMessageInput) HasBody() bool {
|
|
if o != nil && !IsNil(o.Body) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetBody gets a reference to the given string and assigns it to the Body field.
|
|
func (o *EmailSendMessageInput) SetBody(v string) {
|
|
o.Body = &v
|
|
}
|
|
|
|
// GetCampaign returns the Campaign field value if set, zero value otherwise.
|
|
func (o *EmailSendMessageInput) 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 *EmailSendMessageInput) 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 *EmailSendMessageInput) 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 *EmailSendMessageInput) SetCampaign(v string) {
|
|
o.Campaign = &v
|
|
}
|
|
|
|
// GetFrom returns the From field value if set, zero value otherwise.
|
|
func (o *EmailSendMessageInput) GetFrom() string {
|
|
if o == nil || IsNil(o.From) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.From
|
|
}
|
|
|
|
// GetFromOk returns a tuple with the From field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EmailSendMessageInput) GetFromOk() (*string, bool) {
|
|
if o == nil || IsNil(o.From) {
|
|
return nil, false
|
|
}
|
|
return o.From, true
|
|
}
|
|
|
|
// HasFrom returns a boolean if a field has been set.
|
|
func (o *EmailSendMessageInput) HasFrom() bool {
|
|
if o != nil && !IsNil(o.From) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetFrom gets a reference to the given string and assigns it to the From field.
|
|
func (o *EmailSendMessageInput) SetFrom(v string) {
|
|
o.From = &v
|
|
}
|
|
|
|
// GetHeaders returns the Headers field value if set, zero value otherwise.
|
|
func (o *EmailSendMessageInput) GetHeaders() map[string]string {
|
|
if o == nil || IsNil(o.Headers) {
|
|
var ret map[string]string
|
|
return ret
|
|
}
|
|
return o.Headers
|
|
}
|
|
|
|
// GetHeadersOk returns a tuple with the Headers field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EmailSendMessageInput) GetHeadersOk() (map[string]string, bool) {
|
|
if o == nil || IsNil(o.Headers) {
|
|
return map[string]string{}, false
|
|
}
|
|
return o.Headers, true
|
|
}
|
|
|
|
// HasHeaders returns a boolean if a field has been set.
|
|
func (o *EmailSendMessageInput) HasHeaders() bool {
|
|
if o != nil && !IsNil(o.Headers) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetHeaders gets a reference to the given map[string]string and assigns it to the Headers field.
|
|
func (o *EmailSendMessageInput) SetHeaders(v map[string]string) {
|
|
o.Headers = v
|
|
}
|
|
|
|
// GetHtml returns the Html field value if set, zero value otherwise.
|
|
func (o *EmailSendMessageInput) GetHtml() string {
|
|
if o == nil || IsNil(o.Html) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Html
|
|
}
|
|
|
|
// GetHtmlOk returns a tuple with the Html field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EmailSendMessageInput) GetHtmlOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Html) {
|
|
return nil, false
|
|
}
|
|
return o.Html, true
|
|
}
|
|
|
|
// HasHtml returns a boolean if a field has been set.
|
|
func (o *EmailSendMessageInput) HasHtml() bool {
|
|
if o != nil && !IsNil(o.Html) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetHtml gets a reference to the given string and assigns it to the Html field.
|
|
func (o *EmailSendMessageInput) SetHtml(v string) {
|
|
o.Html = &v
|
|
}
|
|
|
|
// GetIdempotencyKey returns the IdempotencyKey field value if set, zero value otherwise.
|
|
func (o *EmailSendMessageInput) GetIdempotencyKey() string {
|
|
if o == nil || IsNil(o.IdempotencyKey) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.IdempotencyKey
|
|
}
|
|
|
|
// GetIdempotencyKeyOk returns a tuple with the IdempotencyKey field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EmailSendMessageInput) GetIdempotencyKeyOk() (*string, bool) {
|
|
if o == nil || IsNil(o.IdempotencyKey) {
|
|
return nil, false
|
|
}
|
|
return o.IdempotencyKey, true
|
|
}
|
|
|
|
// HasIdempotencyKey returns a boolean if a field has been set.
|
|
func (o *EmailSendMessageInput) HasIdempotencyKey() bool {
|
|
if o != nil && !IsNil(o.IdempotencyKey) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetIdempotencyKey gets a reference to the given string and assigns it to the IdempotencyKey field.
|
|
func (o *EmailSendMessageInput) SetIdempotencyKey(v string) {
|
|
o.IdempotencyKey = &v
|
|
}
|
|
|
|
// GetProvider returns the Provider field value if set, zero value otherwise.
|
|
func (o *EmailSendMessageInput) 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 *EmailSendMessageInput) 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 *EmailSendMessageInput) 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 *EmailSendMessageInput) SetProvider(v string) {
|
|
o.Provider = &v
|
|
}
|
|
|
|
// GetSubject returns the Subject field value if set, zero value otherwise.
|
|
func (o *EmailSendMessageInput) GetSubject() string {
|
|
if o == nil || IsNil(o.Subject) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Subject
|
|
}
|
|
|
|
// GetSubjectOk returns a tuple with the Subject field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EmailSendMessageInput) GetSubjectOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Subject) {
|
|
return nil, false
|
|
}
|
|
return o.Subject, true
|
|
}
|
|
|
|
// HasSubject returns a boolean if a field has been set.
|
|
func (o *EmailSendMessageInput) HasSubject() bool {
|
|
if o != nil && !IsNil(o.Subject) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSubject gets a reference to the given string and assigns it to the Subject field.
|
|
func (o *EmailSendMessageInput) SetSubject(v string) {
|
|
o.Subject = &v
|
|
}
|
|
|
|
// GetSync returns the Sync field value if set, zero value otherwise.
|
|
func (o *EmailSendMessageInput) GetSync() string {
|
|
if o == nil || IsNil(o.Sync) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Sync
|
|
}
|
|
|
|
// GetSyncOk returns a tuple with the Sync field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EmailSendMessageInput) GetSyncOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Sync) {
|
|
return nil, false
|
|
}
|
|
return o.Sync, true
|
|
}
|
|
|
|
// HasSync returns a boolean if a field has been set.
|
|
func (o *EmailSendMessageInput) HasSync() bool {
|
|
if o != nil && !IsNil(o.Sync) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSync gets a reference to the given string and assigns it to the Sync field.
|
|
func (o *EmailSendMessageInput) SetSync(v string) {
|
|
o.Sync = &v
|
|
}
|
|
|
|
// GetTemplateId returns the TemplateId field value if set, zero value otherwise.
|
|
func (o *EmailSendMessageInput) GetTemplateId() string {
|
|
if o == nil || IsNil(o.TemplateId) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.TemplateId
|
|
}
|
|
|
|
// GetTemplateIdOk returns a tuple with the TemplateId field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EmailSendMessageInput) GetTemplateIdOk() (*string, bool) {
|
|
if o == nil || IsNil(o.TemplateId) {
|
|
return nil, false
|
|
}
|
|
return o.TemplateId, true
|
|
}
|
|
|
|
// HasTemplateId returns a boolean if a field has been set.
|
|
func (o *EmailSendMessageInput) HasTemplateId() bool {
|
|
if o != nil && !IsNil(o.TemplateId) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTemplateId gets a reference to the given string and assigns it to the TemplateId field.
|
|
func (o *EmailSendMessageInput) SetTemplateId(v string) {
|
|
o.TemplateId = &v
|
|
}
|
|
|
|
// GetTemplateVars returns the TemplateVars field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *EmailSendMessageInput) GetTemplateVars() interface{} {
|
|
if o == nil {
|
|
var ret interface{}
|
|
return ret
|
|
}
|
|
return o.TemplateVars
|
|
}
|
|
|
|
// GetTemplateVarsOk returns a tuple with the TemplateVars field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
|
func (o *EmailSendMessageInput) GetTemplateVarsOk() (*interface{}, bool) {
|
|
if o == nil || IsNil(o.TemplateVars) {
|
|
return nil, false
|
|
}
|
|
return &o.TemplateVars, true
|
|
}
|
|
|
|
// HasTemplateVars returns a boolean if a field has been set.
|
|
func (o *EmailSendMessageInput) HasTemplateVars() bool {
|
|
if o != nil && !IsNil(o.TemplateVars) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTemplateVars gets a reference to the given interface{} and assigns it to the TemplateVars field.
|
|
func (o *EmailSendMessageInput) SetTemplateVars(v interface{}) {
|
|
o.TemplateVars = v
|
|
}
|
|
|
|
// GetText returns the Text field value if set, zero value otherwise.
|
|
func (o *EmailSendMessageInput) GetText() string {
|
|
if o == nil || IsNil(o.Text) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Text
|
|
}
|
|
|
|
// GetTextOk returns a tuple with the Text field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EmailSendMessageInput) GetTextOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Text) {
|
|
return nil, false
|
|
}
|
|
return o.Text, true
|
|
}
|
|
|
|
// HasText returns a boolean if a field has been set.
|
|
func (o *EmailSendMessageInput) HasText() bool {
|
|
if o != nil && !IsNil(o.Text) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetText gets a reference to the given string and assigns it to the Text field.
|
|
func (o *EmailSendMessageInput) SetText(v string) {
|
|
o.Text = &v
|
|
}
|
|
|
|
// GetTo returns the To field value if set, zero value otherwise.
|
|
func (o *EmailSendMessageInput) GetTo() []string {
|
|
if o == nil || IsNil(o.To) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.To
|
|
}
|
|
|
|
// GetToOk returns a tuple with the To field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EmailSendMessageInput) GetToOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.To) {
|
|
return nil, false
|
|
}
|
|
return o.To, true
|
|
}
|
|
|
|
// HasTo returns a boolean if a field has been set.
|
|
func (o *EmailSendMessageInput) HasTo() bool {
|
|
if o != nil && !IsNil(o.To) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTo gets a reference to the given []string and assigns it to the To field.
|
|
func (o *EmailSendMessageInput) SetTo(v []string) {
|
|
o.To = v
|
|
}
|
|
|
|
func (o EmailSendMessageInput) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o EmailSendMessageInput) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Body) {
|
|
toSerialize["body"] = o.Body
|
|
}
|
|
if !IsNil(o.Campaign) {
|
|
toSerialize["campaign"] = o.Campaign
|
|
}
|
|
if !IsNil(o.From) {
|
|
toSerialize["from"] = o.From
|
|
}
|
|
if !IsNil(o.Headers) {
|
|
toSerialize["headers"] = o.Headers
|
|
}
|
|
if !IsNil(o.Html) {
|
|
toSerialize["html"] = o.Html
|
|
}
|
|
if !IsNil(o.IdempotencyKey) {
|
|
toSerialize["idempotency_key"] = o.IdempotencyKey
|
|
}
|
|
if !IsNil(o.Provider) {
|
|
toSerialize["provider"] = o.Provider
|
|
}
|
|
if !IsNil(o.Subject) {
|
|
toSerialize["subject"] = o.Subject
|
|
}
|
|
if !IsNil(o.Sync) {
|
|
toSerialize["sync"] = o.Sync
|
|
}
|
|
if !IsNil(o.TemplateId) {
|
|
toSerialize["template_id"] = o.TemplateId
|
|
}
|
|
if o.TemplateVars != nil {
|
|
toSerialize["template_vars"] = o.TemplateVars
|
|
}
|
|
if !IsNil(o.Text) {
|
|
toSerialize["text"] = o.Text
|
|
}
|
|
if !IsNil(o.To) {
|
|
toSerialize["to"] = o.To
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *EmailSendMessageInput) UnmarshalJSON(data []byte) (err error) {
|
|
varEmailSendMessageInput := _EmailSendMessageInput{}
|
|
|
|
err = json.Unmarshal(data, &varEmailSendMessageInput)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = EmailSendMessageInput(varEmailSendMessageInput)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "body")
|
|
delete(additionalProperties, "campaign")
|
|
delete(additionalProperties, "from")
|
|
delete(additionalProperties, "headers")
|
|
delete(additionalProperties, "html")
|
|
delete(additionalProperties, "idempotency_key")
|
|
delete(additionalProperties, "provider")
|
|
delete(additionalProperties, "subject")
|
|
delete(additionalProperties, "sync")
|
|
delete(additionalProperties, "template_id")
|
|
delete(additionalProperties, "template_vars")
|
|
delete(additionalProperties, "text")
|
|
delete(additionalProperties, "to")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableEmailSendMessageInput struct {
|
|
value *EmailSendMessageInput
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableEmailSendMessageInput) Get() *EmailSendMessageInput {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableEmailSendMessageInput) Set(val *EmailSendMessageInput) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableEmailSendMessageInput) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableEmailSendMessageInput) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableEmailSendMessageInput(val *EmailSendMessageInput) *NullableEmailSendMessageInput {
|
|
return &NullableEmailSendMessageInput{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableEmailSendMessageInput) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableEmailSendMessageInput) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|