Files
sdk/model_tel_number.go

421 lines
11 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 TelNumber type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TelNumber{}
// TelNumber struct for TelNumber
type TelNumber struct {
// Capable is what the number can carry: any of \"voice\", \"sms\", \"mms\", \"fax\". A number missing \"sms\" cannot send one no matter what this platform does.
Capable []string `json:"capable,omitempty"`
// Country is the ISO 3166-1 alpha-2 code the number is issued under. Numbering is national, so this is what makes a search answerable at all.
Country *string `json:"country,omitempty"`
// Currency is the ISO 4217 code Monthly is denominated in. Without it the number beside it means nothing, so the two are always read together.
Currency *string `json:"currency,omitempty"`
// E164 is the number in E.164: a leading + and digits only, no spaces or dashes. That is what a carrier accepts and what a search result must be bought by.
E164 *string `json:"e164,omitempty"`
// ID is the carrier's handle for the number, and the id every route here addresses it by. It is not the number itself — see E164.
Id *string `json:"id,omitempty"`
// Monthly is the recurring rental in the MINOR unit of Currency (cents for USD), exactly as the carrier quoted it. It is a price, not a charge: nothing is billed by this field.
Monthly *int64 `json:"monthly,omitempty"`
// Org is the tenant holding the number. A search result carries none — nobody holds it yet — which is how an available number is told from a held one.
Org *string `json:"org,omitempty"`
// Type is what kind of number it is: \"local\", \"national\", \"tollfree\" or \"mobile\". It decides both price and what a carrier will let it originate.
Type *string `json:"type,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TelNumber TelNumber
// NewTelNumber instantiates a new TelNumber 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 NewTelNumber() *TelNumber {
this := TelNumber{}
return &this
}
// NewTelNumberWithDefaults instantiates a new TelNumber 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 NewTelNumberWithDefaults() *TelNumber {
this := TelNumber{}
return &this
}
// GetCapable returns the Capable field value if set, zero value otherwise.
func (o *TelNumber) GetCapable() []string {
if o == nil || IsNil(o.Capable) {
var ret []string
return ret
}
return o.Capable
}
// GetCapableOk returns a tuple with the Capable field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TelNumber) GetCapableOk() ([]string, bool) {
if o == nil || IsNil(o.Capable) {
return nil, false
}
return o.Capable, true
}
// HasCapable returns a boolean if a field has been set.
func (o *TelNumber) HasCapable() bool {
if o != nil && !IsNil(o.Capable) {
return true
}
return false
}
// SetCapable gets a reference to the given []string and assigns it to the Capable field.
func (o *TelNumber) SetCapable(v []string) {
o.Capable = v
}
// GetCountry returns the Country field value if set, zero value otherwise.
func (o *TelNumber) GetCountry() string {
if o == nil || IsNil(o.Country) {
var ret string
return ret
}
return *o.Country
}
// GetCountryOk returns a tuple with the Country field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TelNumber) GetCountryOk() (*string, bool) {
if o == nil || IsNil(o.Country) {
return nil, false
}
return o.Country, true
}
// HasCountry returns a boolean if a field has been set.
func (o *TelNumber) HasCountry() bool {
if o != nil && !IsNil(o.Country) {
return true
}
return false
}
// SetCountry gets a reference to the given string and assigns it to the Country field.
func (o *TelNumber) SetCountry(v string) {
o.Country = &v
}
// GetCurrency returns the Currency field value if set, zero value otherwise.
func (o *TelNumber) GetCurrency() string {
if o == nil || IsNil(o.Currency) {
var ret string
return ret
}
return *o.Currency
}
// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TelNumber) GetCurrencyOk() (*string, bool) {
if o == nil || IsNil(o.Currency) {
return nil, false
}
return o.Currency, true
}
// HasCurrency returns a boolean if a field has been set.
func (o *TelNumber) HasCurrency() bool {
if o != nil && !IsNil(o.Currency) {
return true
}
return false
}
// SetCurrency gets a reference to the given string and assigns it to the Currency field.
func (o *TelNumber) SetCurrency(v string) {
o.Currency = &v
}
// GetE164 returns the E164 field value if set, zero value otherwise.
func (o *TelNumber) GetE164() string {
if o == nil || IsNil(o.E164) {
var ret string
return ret
}
return *o.E164
}
// GetE164Ok returns a tuple with the E164 field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TelNumber) GetE164Ok() (*string, bool) {
if o == nil || IsNil(o.E164) {
return nil, false
}
return o.E164, true
}
// HasE164 returns a boolean if a field has been set.
func (o *TelNumber) HasE164() bool {
if o != nil && !IsNil(o.E164) {
return true
}
return false
}
// SetE164 gets a reference to the given string and assigns it to the E164 field.
func (o *TelNumber) SetE164(v string) {
o.E164 = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *TelNumber) 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 *TelNumber) 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 *TelNumber) 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 *TelNumber) SetId(v string) {
o.Id = &v
}
// GetMonthly returns the Monthly field value if set, zero value otherwise.
func (o *TelNumber) GetMonthly() int64 {
if o == nil || IsNil(o.Monthly) {
var ret int64
return ret
}
return *o.Monthly
}
// GetMonthlyOk returns a tuple with the Monthly field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TelNumber) GetMonthlyOk() (*int64, bool) {
if o == nil || IsNil(o.Monthly) {
return nil, false
}
return o.Monthly, true
}
// HasMonthly returns a boolean if a field has been set.
func (o *TelNumber) HasMonthly() bool {
if o != nil && !IsNil(o.Monthly) {
return true
}
return false
}
// SetMonthly gets a reference to the given int64 and assigns it to the Monthly field.
func (o *TelNumber) SetMonthly(v int64) {
o.Monthly = &v
}
// GetOrg returns the Org field value if set, zero value otherwise.
func (o *TelNumber) 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 *TelNumber) 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 *TelNumber) 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 *TelNumber) SetOrg(v string) {
o.Org = &v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *TelNumber) GetType() string {
if o == nil || IsNil(o.Type) {
var ret string
return ret
}
return *o.Type
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TelNumber) GetTypeOk() (*string, bool) {
if o == nil || IsNil(o.Type) {
return nil, false
}
return o.Type, true
}
// HasType returns a boolean if a field has been set.
func (o *TelNumber) HasType() bool {
if o != nil && !IsNil(o.Type) {
return true
}
return false
}
// SetType gets a reference to the given string and assigns it to the Type field.
func (o *TelNumber) SetType(v string) {
o.Type = &v
}
func (o TelNumber) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TelNumber) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Capable) {
toSerialize["capable"] = o.Capable
}
if !IsNil(o.Country) {
toSerialize["country"] = o.Country
}
if !IsNil(o.Currency) {
toSerialize["currency"] = o.Currency
}
if !IsNil(o.E164) {
toSerialize["e164"] = o.E164
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Monthly) {
toSerialize["monthly"] = o.Monthly
}
if !IsNil(o.Org) {
toSerialize["org"] = o.Org
}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TelNumber) UnmarshalJSON(data []byte) (err error) {
varTelNumber := _TelNumber{}
err = json.Unmarshal(data, &varTelNumber)
if err != nil {
return err
}
*o = TelNumber(varTelNumber)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "capable")
delete(additionalProperties, "country")
delete(additionalProperties, "currency")
delete(additionalProperties, "e164")
delete(additionalProperties, "id")
delete(additionalProperties, "monthly")
delete(additionalProperties, "org")
delete(additionalProperties, "type")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTelNumber struct {
value *TelNumber
isSet bool
}
func (v NullableTelNumber) Get() *TelNumber {
return v.value
}
func (v *NullableTelNumber) Set(val *TelNumber) {
v.value = val
v.isSet = true
}
func (v NullableTelNumber) IsSet() bool {
return v.isSet
}
func (v *NullableTelNumber) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTelNumber(val *TelNumber) *NullableTelNumber {
return &NullableTelNumber{value: val, isSet: true}
}
func (v NullableTelNumber) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTelNumber) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}