mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
269 lines
6.8 KiB
Go
269 lines
6.8 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 TelMessageInput type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &TelMessageInput{}
|
|
|
|
// TelMessageInput struct for TelMessageInput
|
|
type TelMessageInput struct {
|
|
// From is the number to send FROM, in E.164. It must be one this org holds and it must be sms-capable.
|
|
From *string `json:"from,omitempty"`
|
|
// Media are URLs to attach. A message with any is an MMS to the carrier — the distinction is the carrier's to make, not something the caller declares.
|
|
Media []string `json:"media,omitempty"`
|
|
// Text is the message body. It may be empty when Media carries the message.
|
|
Text *string `json:"text,omitempty"`
|
|
// To is the number to send to, in E.164.
|
|
To *string `json:"to,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _TelMessageInput TelMessageInput
|
|
|
|
// NewTelMessageInput instantiates a new TelMessageInput 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 NewTelMessageInput() *TelMessageInput {
|
|
this := TelMessageInput{}
|
|
return &this
|
|
}
|
|
|
|
// NewTelMessageInputWithDefaults instantiates a new TelMessageInput 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 NewTelMessageInputWithDefaults() *TelMessageInput {
|
|
this := TelMessageInput{}
|
|
return &this
|
|
}
|
|
|
|
// GetFrom returns the From field value if set, zero value otherwise.
|
|
func (o *TelMessageInput) 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 *TelMessageInput) 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 *TelMessageInput) 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 *TelMessageInput) SetFrom(v string) {
|
|
o.From = &v
|
|
}
|
|
|
|
// GetMedia returns the Media field value if set, zero value otherwise.
|
|
func (o *TelMessageInput) GetMedia() []string {
|
|
if o == nil || IsNil(o.Media) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.Media
|
|
}
|
|
|
|
// GetMediaOk returns a tuple with the Media field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TelMessageInput) GetMediaOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.Media) {
|
|
return nil, false
|
|
}
|
|
return o.Media, true
|
|
}
|
|
|
|
// HasMedia returns a boolean if a field has been set.
|
|
func (o *TelMessageInput) HasMedia() bool {
|
|
if o != nil && !IsNil(o.Media) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMedia gets a reference to the given []string and assigns it to the Media field.
|
|
func (o *TelMessageInput) SetMedia(v []string) {
|
|
o.Media = v
|
|
}
|
|
|
|
// GetText returns the Text field value if set, zero value otherwise.
|
|
func (o *TelMessageInput) 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 *TelMessageInput) 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 *TelMessageInput) 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 *TelMessageInput) SetText(v string) {
|
|
o.Text = &v
|
|
}
|
|
|
|
// GetTo returns the To field value if set, zero value otherwise.
|
|
func (o *TelMessageInput) 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 *TelMessageInput) 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 *TelMessageInput) 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 *TelMessageInput) SetTo(v string) {
|
|
o.To = &v
|
|
}
|
|
|
|
func (o TelMessageInput) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o TelMessageInput) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.From) {
|
|
toSerialize["from"] = o.From
|
|
}
|
|
if !IsNil(o.Media) {
|
|
toSerialize["media"] = o.Media
|
|
}
|
|
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 *TelMessageInput) UnmarshalJSON(data []byte) (err error) {
|
|
varTelMessageInput := _TelMessageInput{}
|
|
|
|
err = json.Unmarshal(data, &varTelMessageInput)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = TelMessageInput(varTelMessageInput)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "from")
|
|
delete(additionalProperties, "media")
|
|
delete(additionalProperties, "text")
|
|
delete(additionalProperties, "to")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableTelMessageInput struct {
|
|
value *TelMessageInput
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableTelMessageInput) Get() *TelMessageInput {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableTelMessageInput) Set(val *TelMessageInput) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableTelMessageInput) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableTelMessageInput) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableTelMessageInput(val *TelMessageInput) *NullableTelMessageInput {
|
|
return &NullableTelMessageInput{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableTelMessageInput) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableTelMessageInput) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|