Files
sdk/model_agent_target_list.go

155 lines
4.0 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 AgentTargetList type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AgentTargetList{}
// AgentTargetList struct for AgentTargetList
type AgentTargetList struct {
// Targets is every target registered to the caller's org; in a held org, the caller's own.
Targets []AgentTargetView `json:"targets,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AgentTargetList AgentTargetList
// NewAgentTargetList instantiates a new AgentTargetList 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 NewAgentTargetList() *AgentTargetList {
this := AgentTargetList{}
return &this
}
// NewAgentTargetListWithDefaults instantiates a new AgentTargetList 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 NewAgentTargetListWithDefaults() *AgentTargetList {
this := AgentTargetList{}
return &this
}
// GetTargets returns the Targets field value if set, zero value otherwise.
func (o *AgentTargetList) GetTargets() []AgentTargetView {
if o == nil || IsNil(o.Targets) {
var ret []AgentTargetView
return ret
}
return o.Targets
}
// GetTargetsOk returns a tuple with the Targets field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentTargetList) GetTargetsOk() ([]AgentTargetView, bool) {
if o == nil || IsNil(o.Targets) {
return nil, false
}
return o.Targets, true
}
// HasTargets returns a boolean if a field has been set.
func (o *AgentTargetList) HasTargets() bool {
if o != nil && !IsNil(o.Targets) {
return true
}
return false
}
// SetTargets gets a reference to the given []AgentTargetView and assigns it to the Targets field.
func (o *AgentTargetList) SetTargets(v []AgentTargetView) {
o.Targets = v
}
func (o AgentTargetList) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AgentTargetList) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Targets) {
toSerialize["targets"] = o.Targets
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AgentTargetList) UnmarshalJSON(data []byte) (err error) {
varAgentTargetList := _AgentTargetList{}
err = json.Unmarshal(data, &varAgentTargetList)
if err != nil {
return err
}
*o = AgentTargetList(varAgentTargetList)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "targets")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAgentTargetList struct {
value *AgentTargetList
isSet bool
}
func (v NullableAgentTargetList) Get() *AgentTargetList {
return v.value
}
func (v *NullableAgentTargetList) Set(val *AgentTargetList) {
v.value = val
v.isSet = true
}
func (v NullableAgentTargetList) IsSet() bool {
return v.isSet
}
func (v *NullableAgentTargetList) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAgentTargetList(val *AgentTargetList) *NullableAgentTargetList {
return &NullableAgentTargetList{value: val, isSet: true}
}
func (v NullableAgentTargetList) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAgentTargetList) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}