Files
sdk/model_tel_call.go

345 lines
8.3 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 TelCall type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TelCall{}
// TelCall struct for TelCall
type TelCall struct {
// Agent names the Hanzo assistant handling the call. Set means the call was answered by that assistant rather than connected to a person.
Agent *string `json:"agent,omitempty"`
// From is the calling number in E.164. It must be one this org holds: a carrier refuses an origination from a number nobody proved they own.
From *string `json:"from,omitempty"`
// ID is the carrier's handle for the call — what a hangup or a lookup names.
Id *string `json:"id,omitempty"`
// Org is the tenant the call was placed for or received by.
Org *string `json:"org,omitempty"`
// Status is where the call is: \"queued\", \"ringing\", \"answered\", \"completed\" or \"failed\". Only the last two are terminal.
Status *string `json:"status,omitempty"`
// To is the called number in E.164.
To *string `json:"to,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TelCall TelCall
// NewTelCall instantiates a new TelCall 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 NewTelCall() *TelCall {
this := TelCall{}
return &this
}
// NewTelCallWithDefaults instantiates a new TelCall 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 NewTelCallWithDefaults() *TelCall {
this := TelCall{}
return &this
}
// GetAgent returns the Agent field value if set, zero value otherwise.
func (o *TelCall) 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 *TelCall) 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 *TelCall) 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 *TelCall) SetAgent(v string) {
o.Agent = &v
}
// GetFrom returns the From field value if set, zero value otherwise.
func (o *TelCall) 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 *TelCall) 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 *TelCall) 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 *TelCall) SetFrom(v string) {
o.From = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *TelCall) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TelCall) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *TelCall) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *TelCall) SetId(v string) {
o.Id = &v
}
// GetOrg returns the Org field value if set, zero value otherwise.
func (o *TelCall) GetOrg() string {
if o == nil || IsNil(o.Org) {
var ret string
return ret
}
return *o.Org
}
// GetOrgOk returns a tuple with the Org field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TelCall) GetOrgOk() (*string, bool) {
if o == nil || IsNil(o.Org) {
return nil, false
}
return o.Org, true
}
// HasOrg returns a boolean if a field has been set.
func (o *TelCall) HasOrg() bool {
if o != nil && !IsNil(o.Org) {
return true
}
return false
}
// SetOrg gets a reference to the given string and assigns it to the Org field.
func (o *TelCall) SetOrg(v string) {
o.Org = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *TelCall) GetStatus() string {
if o == nil || IsNil(o.Status) {
var ret string
return ret
}
return *o.Status
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TelCall) GetStatusOk() (*string, bool) {
if o == nil || IsNil(o.Status) {
return nil, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *TelCall) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *TelCall) SetStatus(v string) {
o.Status = &v
}
// GetTo returns the To field value if set, zero value otherwise.
func (o *TelCall) 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 *TelCall) 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 *TelCall) 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 *TelCall) SetTo(v string) {
o.To = &v
}
func (o TelCall) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TelCall) 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.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Org) {
toSerialize["org"] = o.Org
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.To) {
toSerialize["to"] = o.To
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TelCall) UnmarshalJSON(data []byte) (err error) {
varTelCall := _TelCall{}
err = json.Unmarshal(data, &varTelCall)
if err != nil {
return err
}
*o = TelCall(varTelCall)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "agent")
delete(additionalProperties, "from")
delete(additionalProperties, "id")
delete(additionalProperties, "org")
delete(additionalProperties, "status")
delete(additionalProperties, "to")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTelCall struct {
value *TelCall
isSet bool
}
func (v NullableTelCall) Get() *TelCall {
return v.value
}
func (v *NullableTelCall) Set(val *TelCall) {
v.value = val
v.isSet = true
}
func (v NullableTelCall) IsSet() bool {
return v.isSet
}
func (v *NullableTelCall) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTelCall(val *TelCall) *NullableTelCall {
return &NullableTelCall{value: val, isSet: true}
}
func (v NullableTelCall) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTelCall) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}