Files
sdk/model_tel_buy_input.go

155 lines
3.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 TelBuyInput type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TelBuyInput{}
// TelBuyInput struct for TelBuyInput
type TelBuyInput struct {
// E164 is the number to buy, in E.164 (a leading + and digits), exactly as the search returned it. This is the number itself, not the id from a search result.
E164 *string `json:"e164,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TelBuyInput TelBuyInput
// NewTelBuyInput instantiates a new TelBuyInput 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 NewTelBuyInput() *TelBuyInput {
this := TelBuyInput{}
return &this
}
// NewTelBuyInputWithDefaults instantiates a new TelBuyInput 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 NewTelBuyInputWithDefaults() *TelBuyInput {
this := TelBuyInput{}
return &this
}
// GetE164 returns the E164 field value if set, zero value otherwise.
func (o *TelBuyInput) 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 *TelBuyInput) 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 *TelBuyInput) 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 *TelBuyInput) SetE164(v string) {
o.E164 = &v
}
func (o TelBuyInput) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TelBuyInput) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.E164) {
toSerialize["e164"] = o.E164
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TelBuyInput) UnmarshalJSON(data []byte) (err error) {
varTelBuyInput := _TelBuyInput{}
err = json.Unmarshal(data, &varTelBuyInput)
if err != nil {
return err
}
*o = TelBuyInput(varTelBuyInput)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "e164")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTelBuyInput struct {
value *TelBuyInput
isSet bool
}
func (v NullableTelBuyInput) Get() *TelBuyInput {
return v.value
}
func (v *NullableTelBuyInput) Set(val *TelBuyInput) {
v.value = val
v.isSet = true
}
func (v NullableTelBuyInput) IsSet() bool {
return v.isSet
}
func (v *NullableTelBuyInput) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTelBuyInput(val *TelBuyInput) *NullableTelBuyInput {
return &NullableTelBuyInput{value: val, isSet: true}
}
func (v NullableTelBuyInput) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTelBuyInput) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}