mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
307 lines
7.8 KiB
Go
307 lines
7.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 TelCallInput type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &TelCallInput{}
|
|
|
|
// TelCallInput struct for TelCallInput
|
|
type TelCallInput struct {
|
|
// Agent hands the answered call to a Hanzo assistant by name instead of connecting it to a person. Empty places an ordinary call.
|
|
Agent *string `json:"agent,omitempty"`
|
|
// From is the number to call FROM, in E.164. It must be one this org holds.
|
|
From *string `json:"from,omitempty"`
|
|
// Record is a per-call flag rather than a product. Where a recording lands and how long it is kept is the org's retention policy, not this call's.
|
|
Record *bool `json:"record,omitempty"`
|
|
// To is the number to call, in E.164.
|
|
To *string `json:"to,omitempty"`
|
|
// Webhook is a URL the carrier posts this call's events to as it progresses. Empty means the call's outcome is only visible by reading it back.
|
|
Webhook *string `json:"webhook,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _TelCallInput TelCallInput
|
|
|
|
// NewTelCallInput instantiates a new TelCallInput 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 NewTelCallInput() *TelCallInput {
|
|
this := TelCallInput{}
|
|
return &this
|
|
}
|
|
|
|
// NewTelCallInputWithDefaults instantiates a new TelCallInput 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 NewTelCallInputWithDefaults() *TelCallInput {
|
|
this := TelCallInput{}
|
|
return &this
|
|
}
|
|
|
|
// GetAgent returns the Agent field value if set, zero value otherwise.
|
|
func (o *TelCallInput) GetAgent() string {
|
|
if o == nil || IsNil(o.Agent) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Agent
|
|
}
|
|
|
|
// GetAgentOk returns a tuple with the Agent field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TelCallInput) GetAgentOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Agent) {
|
|
return nil, false
|
|
}
|
|
return o.Agent, true
|
|
}
|
|
|
|
// HasAgent returns a boolean if a field has been set.
|
|
func (o *TelCallInput) HasAgent() bool {
|
|
if o != nil && !IsNil(o.Agent) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAgent gets a reference to the given string and assigns it to the Agent field.
|
|
func (o *TelCallInput) SetAgent(v string) {
|
|
o.Agent = &v
|
|
}
|
|
|
|
// GetFrom returns the From field value if set, zero value otherwise.
|
|
func (o *TelCallInput) 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 *TelCallInput) 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 *TelCallInput) 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 *TelCallInput) SetFrom(v string) {
|
|
o.From = &v
|
|
}
|
|
|
|
// GetRecord returns the Record field value if set, zero value otherwise.
|
|
func (o *TelCallInput) GetRecord() bool {
|
|
if o == nil || IsNil(o.Record) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Record
|
|
}
|
|
|
|
// GetRecordOk returns a tuple with the Record field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TelCallInput) GetRecordOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Record) {
|
|
return nil, false
|
|
}
|
|
return o.Record, true
|
|
}
|
|
|
|
// HasRecord returns a boolean if a field has been set.
|
|
func (o *TelCallInput) HasRecord() bool {
|
|
if o != nil && !IsNil(o.Record) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRecord gets a reference to the given bool and assigns it to the Record field.
|
|
func (o *TelCallInput) SetRecord(v bool) {
|
|
o.Record = &v
|
|
}
|
|
|
|
// GetTo returns the To field value if set, zero value otherwise.
|
|
func (o *TelCallInput) 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 *TelCallInput) 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 *TelCallInput) 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 *TelCallInput) SetTo(v string) {
|
|
o.To = &v
|
|
}
|
|
|
|
// GetWebhook returns the Webhook field value if set, zero value otherwise.
|
|
func (o *TelCallInput) GetWebhook() string {
|
|
if o == nil || IsNil(o.Webhook) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Webhook
|
|
}
|
|
|
|
// GetWebhookOk returns a tuple with the Webhook field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TelCallInput) GetWebhookOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Webhook) {
|
|
return nil, false
|
|
}
|
|
return o.Webhook, true
|
|
}
|
|
|
|
// HasWebhook returns a boolean if a field has been set.
|
|
func (o *TelCallInput) HasWebhook() bool {
|
|
if o != nil && !IsNil(o.Webhook) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetWebhook gets a reference to the given string and assigns it to the Webhook field.
|
|
func (o *TelCallInput) SetWebhook(v string) {
|
|
o.Webhook = &v
|
|
}
|
|
|
|
func (o TelCallInput) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o TelCallInput) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Agent) {
|
|
toSerialize["agent"] = o.Agent
|
|
}
|
|
if !IsNil(o.From) {
|
|
toSerialize["from"] = o.From
|
|
}
|
|
if !IsNil(o.Record) {
|
|
toSerialize["record"] = o.Record
|
|
}
|
|
if !IsNil(o.To) {
|
|
toSerialize["to"] = o.To
|
|
}
|
|
if !IsNil(o.Webhook) {
|
|
toSerialize["webhook"] = o.Webhook
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *TelCallInput) UnmarshalJSON(data []byte) (err error) {
|
|
varTelCallInput := _TelCallInput{}
|
|
|
|
err = json.Unmarshal(data, &varTelCallInput)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = TelCallInput(varTelCallInput)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "agent")
|
|
delete(additionalProperties, "from")
|
|
delete(additionalProperties, "record")
|
|
delete(additionalProperties, "to")
|
|
delete(additionalProperties, "webhook")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableTelCallInput struct {
|
|
value *TelCallInput
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableTelCallInput) Get() *TelCallInput {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableTelCallInput) Set(val *TelCallInput) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableTelCallInput) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableTelCallInput) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableTelCallInput(val *TelCallInput) *NullableTelCallInput {
|
|
return &NullableTelCallInput{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableTelCallInput) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableTelCallInput) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|