Files
sdk/model_link_link_list.go

193 lines
5.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 LinkLinkList type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &LinkLinkList{}
// LinkLinkList struct for LinkLinkList
type LinkLinkList struct {
// Devices is the same rows folded per machine — the cross-machine \"AI Providers / Accounts\" view.
Devices []LinkDeviceView `json:"devices,omitempty"`
// Links is every link the caller registered, newest first. Revoked links are INCLUDED rather than dropped, because a logged-out account keeps its usage history and audit trail.
Links []LinkLinkView `json:"links,omitempty"`
AdditionalProperties map[string]interface{}
}
type _LinkLinkList LinkLinkList
// NewLinkLinkList instantiates a new LinkLinkList 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 NewLinkLinkList() *LinkLinkList {
this := LinkLinkList{}
return &this
}
// NewLinkLinkListWithDefaults instantiates a new LinkLinkList 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 NewLinkLinkListWithDefaults() *LinkLinkList {
this := LinkLinkList{}
return &this
}
// GetDevices returns the Devices field value if set, zero value otherwise.
func (o *LinkLinkList) GetDevices() []LinkDeviceView {
if o == nil || IsNil(o.Devices) {
var ret []LinkDeviceView
return ret
}
return o.Devices
}
// GetDevicesOk returns a tuple with the Devices field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkLinkList) GetDevicesOk() ([]LinkDeviceView, bool) {
if o == nil || IsNil(o.Devices) {
return nil, false
}
return o.Devices, true
}
// HasDevices returns a boolean if a field has been set.
func (o *LinkLinkList) HasDevices() bool {
if o != nil && !IsNil(o.Devices) {
return true
}
return false
}
// SetDevices gets a reference to the given []LinkDeviceView and assigns it to the Devices field.
func (o *LinkLinkList) SetDevices(v []LinkDeviceView) {
o.Devices = v
}
// GetLinks returns the Links field value if set, zero value otherwise.
func (o *LinkLinkList) GetLinks() []LinkLinkView {
if o == nil || IsNil(o.Links) {
var ret []LinkLinkView
return ret
}
return o.Links
}
// GetLinksOk returns a tuple with the Links field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkLinkList) GetLinksOk() ([]LinkLinkView, bool) {
if o == nil || IsNil(o.Links) {
return nil, false
}
return o.Links, true
}
// HasLinks returns a boolean if a field has been set.
func (o *LinkLinkList) HasLinks() bool {
if o != nil && !IsNil(o.Links) {
return true
}
return false
}
// SetLinks gets a reference to the given []LinkLinkView and assigns it to the Links field.
func (o *LinkLinkList) SetLinks(v []LinkLinkView) {
o.Links = v
}
func (o LinkLinkList) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o LinkLinkList) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Devices) {
toSerialize["devices"] = o.Devices
}
if !IsNil(o.Links) {
toSerialize["links"] = o.Links
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *LinkLinkList) UnmarshalJSON(data []byte) (err error) {
varLinkLinkList := _LinkLinkList{}
err = json.Unmarshal(data, &varLinkLinkList)
if err != nil {
return err
}
*o = LinkLinkList(varLinkLinkList)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "devices")
delete(additionalProperties, "links")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableLinkLinkList struct {
value *LinkLinkList
isSet bool
}
func (v NullableLinkLinkList) Get() *LinkLinkList {
return v.value
}
func (v *NullableLinkLinkList) Set(val *LinkLinkList) {
v.value = val
v.isSet = true
}
func (v NullableLinkLinkList) IsSet() bool {
return v.isSet
}
func (v *NullableLinkLinkList) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableLinkLinkList(val *LinkLinkList) *NullableLinkLinkList {
return &NullableLinkLinkList{value: val, isSet: true}
}
func (v NullableLinkLinkList) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableLinkLinkList) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}