Files
sdk/model_captured.go

266 lines
6.4 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 Captured type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Captured{}
// Captured struct for Captured
type Captured struct {
// Answered is the label the caller was answered: the org's capability's when one answered, else Kai's own.
Answered *string `json:"answered,omitempty"`
Key *string `json:"key,omitempty"`
Labels []string `json:"labels,omitempty"`
Type *string `json:"type,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Captured Captured
// NewCaptured instantiates a new Captured 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 NewCaptured() *Captured {
this := Captured{}
return &this
}
// NewCapturedWithDefaults instantiates a new Captured 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 NewCapturedWithDefaults() *Captured {
this := Captured{}
return &this
}
// GetAnswered returns the Answered field value if set, zero value otherwise.
func (o *Captured) GetAnswered() string {
if o == nil || IsNil(o.Answered) {
var ret string
return ret
}
return *o.Answered
}
// GetAnsweredOk returns a tuple with the Answered field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Captured) GetAnsweredOk() (*string, bool) {
if o == nil || IsNil(o.Answered) {
return nil, false
}
return o.Answered, true
}
// HasAnswered returns a boolean if a field has been set.
func (o *Captured) HasAnswered() bool {
if o != nil && !IsNil(o.Answered) {
return true
}
return false
}
// SetAnswered gets a reference to the given string and assigns it to the Answered field.
func (o *Captured) SetAnswered(v string) {
o.Answered = &v
}
// GetKey returns the Key field value if set, zero value otherwise.
func (o *Captured) GetKey() string {
if o == nil || IsNil(o.Key) {
var ret string
return ret
}
return *o.Key
}
// GetKeyOk returns a tuple with the Key field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Captured) GetKeyOk() (*string, bool) {
if o == nil || IsNil(o.Key) {
return nil, false
}
return o.Key, true
}
// HasKey returns a boolean if a field has been set.
func (o *Captured) HasKey() bool {
if o != nil && !IsNil(o.Key) {
return true
}
return false
}
// SetKey gets a reference to the given string and assigns it to the Key field.
func (o *Captured) SetKey(v string) {
o.Key = &v
}
// GetLabels returns the Labels field value if set, zero value otherwise.
func (o *Captured) GetLabels() []string {
if o == nil || IsNil(o.Labels) {
var ret []string
return ret
}
return o.Labels
}
// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Captured) GetLabelsOk() ([]string, bool) {
if o == nil || IsNil(o.Labels) {
return nil, false
}
return o.Labels, true
}
// HasLabels returns a boolean if a field has been set.
func (o *Captured) HasLabels() bool {
if o != nil && !IsNil(o.Labels) {
return true
}
return false
}
// SetLabels gets a reference to the given []string and assigns it to the Labels field.
func (o *Captured) SetLabels(v []string) {
o.Labels = v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *Captured) 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 *Captured) 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 *Captured) 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 *Captured) SetType(v string) {
o.Type = &v
}
func (o Captured) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Captured) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Answered) {
toSerialize["answered"] = o.Answered
}
if !IsNil(o.Key) {
toSerialize["key"] = o.Key
}
if !IsNil(o.Labels) {
toSerialize["labels"] = o.Labels
}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Captured) UnmarshalJSON(data []byte) (err error) {
varCaptured := _Captured{}
err = json.Unmarshal(data, &varCaptured)
if err != nil {
return err
}
*o = Captured(varCaptured)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "answered")
delete(additionalProperties, "key")
delete(additionalProperties, "labels")
delete(additionalProperties, "type")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableCaptured struct {
value *Captured
isSet bool
}
func (v NullableCaptured) Get() *Captured {
return v.value
}
func (v *NullableCaptured) Set(val *Captured) {
v.value = val
v.isSet = true
}
func (v NullableCaptured) IsSet() bool {
return v.isSet
}
func (v *NullableCaptured) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCaptured(val *Captured) *NullableCaptured {
return &NullableCaptured{value: val, isSet: true}
}
func (v NullableCaptured) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCaptured) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}