Files
sdk/model_network_network_list.go

155 lines
4.3 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 NetworkNetworkList type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &NetworkNetworkList{}
// NetworkNetworkList struct for NetworkNetworkList
type NetworkNetworkList struct {
// Networks holds the org's overlay network, or is empty when the org has no edge-routers on the fabric (no nodes → no network, never a fabricated one).
Networks []NetworkNetworkView `json:"networks,omitempty"`
AdditionalProperties map[string]interface{}
}
type _NetworkNetworkList NetworkNetworkList
// NewNetworkNetworkList instantiates a new NetworkNetworkList 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 NewNetworkNetworkList() *NetworkNetworkList {
this := NetworkNetworkList{}
return &this
}
// NewNetworkNetworkListWithDefaults instantiates a new NetworkNetworkList 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 NewNetworkNetworkListWithDefaults() *NetworkNetworkList {
this := NetworkNetworkList{}
return &this
}
// GetNetworks returns the Networks field value if set, zero value otherwise.
func (o *NetworkNetworkList) GetNetworks() []NetworkNetworkView {
if o == nil || IsNil(o.Networks) {
var ret []NetworkNetworkView
return ret
}
return o.Networks
}
// GetNetworksOk returns a tuple with the Networks field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NetworkNetworkList) GetNetworksOk() ([]NetworkNetworkView, bool) {
if o == nil || IsNil(o.Networks) {
return nil, false
}
return o.Networks, true
}
// HasNetworks returns a boolean if a field has been set.
func (o *NetworkNetworkList) HasNetworks() bool {
if o != nil && !IsNil(o.Networks) {
return true
}
return false
}
// SetNetworks gets a reference to the given []NetworkNetworkView and assigns it to the Networks field.
func (o *NetworkNetworkList) SetNetworks(v []NetworkNetworkView) {
o.Networks = v
}
func (o NetworkNetworkList) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o NetworkNetworkList) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Networks) {
toSerialize["networks"] = o.Networks
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *NetworkNetworkList) UnmarshalJSON(data []byte) (err error) {
varNetworkNetworkList := _NetworkNetworkList{}
err = json.Unmarshal(data, &varNetworkNetworkList)
if err != nil {
return err
}
*o = NetworkNetworkList(varNetworkNetworkList)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "networks")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableNetworkNetworkList struct {
value *NetworkNetworkList
isSet bool
}
func (v NullableNetworkNetworkList) Get() *NetworkNetworkList {
return v.value
}
func (v *NullableNetworkNetworkList) Set(val *NetworkNetworkList) {
v.value = val
v.isSet = true
}
func (v NullableNetworkNetworkList) IsSet() bool {
return v.isSet
}
func (v *NullableNetworkNetworkList) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableNetworkNetworkList(val *NetworkNetworkList) *NullableNetworkNetworkList {
return &NullableNetworkNetworkList{value: val, isSet: true}
}
func (v NullableNetworkNetworkList) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableNetworkNetworkList) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}