Files
sdk/model_notify_notify_send.go

459 lines
13 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 NotifyNotifySend type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &NotifyNotifySend{}
// NotifyNotifySend struct for NotifyNotifySend
type NotifyNotifySend struct {
// Body is the message text, sent verbatim when present — the no-template path.
Body *string `json:"body,omitempty"`
// Channel selects the delivery channel, sms or email. The per-channel routes (/send/sms, /send/email) pin it, overriding whatever the body names; on the generic route it is required.
Channel *string `json:"channel,omitempty"`
// Event is the event name, which doubles as the template id when TemplateID is empty — the IAM OTP path sends event=iam.otp_sent and nothing else.
Event *string `json:"event,omitempty"`
// Provider pins a provider service name (twilio, plivo, twilio_email, mail). Empty picks the one whose org credentials are actually configured in KMS.
Provider *string `json:"provider,omitempty"`
// Subject is the message subject, carried on the email channel only.
Subject *string `json:"subject,omitempty"`
// Sync must be exactly \"true\": delivery here is synchronous, and anything else answers 503 because the queue plane that would run an async dispatch is owned elsewhere. Over REST it rides as ?sync=true (the URL binds over the body); a by-name call states it in its arguments.
Sync *string `json:"sync,omitempty"`
// TemplateID selects a built-in template when Body is empty.
TemplateId *string `json:"template_id,omitempty"`
TemplateVars interface{} `json:"template_vars,omitempty"`
// To is the destination address per recipient — a phone number for sms, an email address for email. Several recipients fan out into one provider call each, and the response shape follows the count (see the items field).
To []string `json:"to,omitempty"`
AdditionalProperties map[string]interface{}
}
type _NotifyNotifySend NotifyNotifySend
// NewNotifyNotifySend instantiates a new NotifyNotifySend 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 NewNotifyNotifySend() *NotifyNotifySend {
this := NotifyNotifySend{}
return &this
}
// NewNotifyNotifySendWithDefaults instantiates a new NotifyNotifySend 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 NewNotifyNotifySendWithDefaults() *NotifyNotifySend {
this := NotifyNotifySend{}
return &this
}
// GetBody returns the Body field value if set, zero value otherwise.
func (o *NotifyNotifySend) 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 *NotifyNotifySend) 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 *NotifyNotifySend) 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 *NotifyNotifySend) SetBody(v string) {
o.Body = &v
}
// GetChannel returns the Channel field value if set, zero value otherwise.
func (o *NotifyNotifySend) GetChannel() string {
if o == nil || IsNil(o.Channel) {
var ret string
return ret
}
return *o.Channel
}
// GetChannelOk returns a tuple with the Channel field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NotifyNotifySend) GetChannelOk() (*string, bool) {
if o == nil || IsNil(o.Channel) {
return nil, false
}
return o.Channel, true
}
// HasChannel returns a boolean if a field has been set.
func (o *NotifyNotifySend) HasChannel() bool {
if o != nil && !IsNil(o.Channel) {
return true
}
return false
}
// SetChannel gets a reference to the given string and assigns it to the Channel field.
func (o *NotifyNotifySend) SetChannel(v string) {
o.Channel = &v
}
// GetEvent returns the Event field value if set, zero value otherwise.
func (o *NotifyNotifySend) GetEvent() string {
if o == nil || IsNil(o.Event) {
var ret string
return ret
}
return *o.Event
}
// GetEventOk returns a tuple with the Event field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NotifyNotifySend) GetEventOk() (*string, bool) {
if o == nil || IsNil(o.Event) {
return nil, false
}
return o.Event, true
}
// HasEvent returns a boolean if a field has been set.
func (o *NotifyNotifySend) HasEvent() bool {
if o != nil && !IsNil(o.Event) {
return true
}
return false
}
// SetEvent gets a reference to the given string and assigns it to the Event field.
func (o *NotifyNotifySend) SetEvent(v string) {
o.Event = &v
}
// GetProvider returns the Provider field value if set, zero value otherwise.
func (o *NotifyNotifySend) 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 *NotifyNotifySend) 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 *NotifyNotifySend) 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 *NotifyNotifySend) SetProvider(v string) {
o.Provider = &v
}
// GetSubject returns the Subject field value if set, zero value otherwise.
func (o *NotifyNotifySend) 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 *NotifyNotifySend) 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 *NotifyNotifySend) 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 *NotifyNotifySend) SetSubject(v string) {
o.Subject = &v
}
// GetSync returns the Sync field value if set, zero value otherwise.
func (o *NotifyNotifySend) 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 *NotifyNotifySend) 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 *NotifyNotifySend) 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 *NotifyNotifySend) SetSync(v string) {
o.Sync = &v
}
// GetTemplateId returns the TemplateId field value if set, zero value otherwise.
func (o *NotifyNotifySend) 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 *NotifyNotifySend) 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 *NotifyNotifySend) 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 *NotifyNotifySend) 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 *NotifyNotifySend) 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 *NotifyNotifySend) 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 *NotifyNotifySend) 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 *NotifyNotifySend) SetTemplateVars(v interface{}) {
o.TemplateVars = v
}
// GetTo returns the To field value if set, zero value otherwise.
func (o *NotifyNotifySend) 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 *NotifyNotifySend) 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 *NotifyNotifySend) 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 *NotifyNotifySend) SetTo(v []string) {
o.To = v
}
func (o NotifyNotifySend) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o NotifyNotifySend) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Body) {
toSerialize["body"] = o.Body
}
if !IsNil(o.Channel) {
toSerialize["channel"] = o.Channel
}
if !IsNil(o.Event) {
toSerialize["event"] = o.Event
}
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.To) {
toSerialize["to"] = o.To
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *NotifyNotifySend) UnmarshalJSON(data []byte) (err error) {
varNotifyNotifySend := _NotifyNotifySend{}
err = json.Unmarshal(data, &varNotifyNotifySend)
if err != nil {
return err
}
*o = NotifyNotifySend(varNotifyNotifySend)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "body")
delete(additionalProperties, "channel")
delete(additionalProperties, "event")
delete(additionalProperties, "provider")
delete(additionalProperties, "subject")
delete(additionalProperties, "sync")
delete(additionalProperties, "template_id")
delete(additionalProperties, "template_vars")
delete(additionalProperties, "to")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableNotifyNotifySend struct {
value *NotifyNotifySend
isSet bool
}
func (v NullableNotifyNotifySend) Get() *NotifyNotifySend {
return v.value
}
func (v *NullableNotifyNotifySend) Set(val *NotifyNotifySend) {
v.value = val
v.isSet = true
}
func (v NullableNotifyNotifySend) IsSet() bool {
return v.isSet
}
func (v *NullableNotifyNotifySend) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableNotifyNotifySend(val *NotifyNotifySend) *NullableNotifyNotifySend {
return &NullableNotifyNotifySend{value: val, isSet: true}
}
func (v NullableNotifyNotifySend) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableNotifyNotifySend) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}