197 lines
5.1 KiB
Go
197 lines
5.1 KiB
Go
/*
|
|
Garage Administration API v0+garage-v0.8.0
|
|
|
|
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
|
|
|
|
API version: v0.8.0
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package garage
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
// NodeNetworkInfo struct for NodeNetworkInfo
|
|
type NodeNetworkInfo struct {
|
|
Addr string `json:"addr"`
|
|
IsUp bool `json:"is_up"`
|
|
LastSeenSecsAgo NullableInt32 `json:"last_seen_secs_ago"`
|
|
Hostname string `json:"hostname"`
|
|
}
|
|
|
|
// NewNodeNetworkInfo instantiates a new NodeNetworkInfo 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 NewNodeNetworkInfo(addr string, isUp bool, lastSeenSecsAgo NullableInt32, hostname string) *NodeNetworkInfo {
|
|
this := NodeNetworkInfo{}
|
|
this.Addr = addr
|
|
this.IsUp = isUp
|
|
this.LastSeenSecsAgo = lastSeenSecsAgo
|
|
this.Hostname = hostname
|
|
return &this
|
|
}
|
|
|
|
// NewNodeNetworkInfoWithDefaults instantiates a new NodeNetworkInfo 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 NewNodeNetworkInfoWithDefaults() *NodeNetworkInfo {
|
|
this := NodeNetworkInfo{}
|
|
return &this
|
|
}
|
|
|
|
// GetAddr returns the Addr field value
|
|
func (o *NodeNetworkInfo) GetAddr() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.Addr
|
|
}
|
|
|
|
// GetAddrOk returns a tuple with the Addr field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *NodeNetworkInfo) GetAddrOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Addr, true
|
|
}
|
|
|
|
// SetAddr sets field value
|
|
func (o *NodeNetworkInfo) SetAddr(v string) {
|
|
o.Addr = v
|
|
}
|
|
|
|
// GetIsUp returns the IsUp field value
|
|
func (o *NodeNetworkInfo) GetIsUp() bool {
|
|
if o == nil {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
|
|
return o.IsUp
|
|
}
|
|
|
|
// GetIsUpOk returns a tuple with the IsUp field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *NodeNetworkInfo) GetIsUpOk() (*bool, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.IsUp, true
|
|
}
|
|
|
|
// SetIsUp sets field value
|
|
func (o *NodeNetworkInfo) SetIsUp(v bool) {
|
|
o.IsUp = v
|
|
}
|
|
|
|
// GetLastSeenSecsAgo returns the LastSeenSecsAgo field value
|
|
// If the value is explicit nil, the zero value for int32 will be returned
|
|
func (o *NodeNetworkInfo) GetLastSeenSecsAgo() int32 {
|
|
if o == nil || o.LastSeenSecsAgo.Get() == nil {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
|
|
return *o.LastSeenSecsAgo.Get()
|
|
}
|
|
|
|
// GetLastSeenSecsAgoOk returns a tuple with the LastSeenSecsAgo field value
|
|
// and a boolean to check if the value has been set.
|
|
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
|
func (o *NodeNetworkInfo) GetLastSeenSecsAgoOk() (*int32, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return o.LastSeenSecsAgo.Get(), o.LastSeenSecsAgo.IsSet()
|
|
}
|
|
|
|
// SetLastSeenSecsAgo sets field value
|
|
func (o *NodeNetworkInfo) SetLastSeenSecsAgo(v int32) {
|
|
o.LastSeenSecsAgo.Set(&v)
|
|
}
|
|
|
|
// GetHostname returns the Hostname field value
|
|
func (o *NodeNetworkInfo) GetHostname() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.Hostname
|
|
}
|
|
|
|
// GetHostnameOk returns a tuple with the Hostname field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *NodeNetworkInfo) GetHostnameOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Hostname, true
|
|
}
|
|
|
|
// SetHostname sets field value
|
|
func (o *NodeNetworkInfo) SetHostname(v string) {
|
|
o.Hostname = v
|
|
}
|
|
|
|
func (o NodeNetworkInfo) MarshalJSON() ([]byte, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if true {
|
|
toSerialize["addr"] = o.Addr
|
|
}
|
|
if true {
|
|
toSerialize["is_up"] = o.IsUp
|
|
}
|
|
if true {
|
|
toSerialize["last_seen_secs_ago"] = o.LastSeenSecsAgo.Get()
|
|
}
|
|
if true {
|
|
toSerialize["hostname"] = o.Hostname
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
type NullableNodeNetworkInfo struct {
|
|
value *NodeNetworkInfo
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableNodeNetworkInfo) Get() *NodeNetworkInfo {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableNodeNetworkInfo) Set(val *NodeNetworkInfo) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableNodeNetworkInfo) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableNodeNetworkInfo) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableNodeNetworkInfo(val *NodeNetworkInfo) *NullableNodeNetworkInfo {
|
|
return &NullableNodeNetworkInfo{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableNodeNetworkInfo) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableNodeNetworkInfo) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|
|
|
|
|