Files
sdk/model_link_device_view.go

345 lines
9.1 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 LinkDeviceView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &LinkDeviceView{}
// LinkDeviceView struct for LinkDeviceView
type LinkDeviceView struct {
// Accounts is every account the caller has signed in on this machine.
Accounts []LinkLinkView `json:"accounts,omitempty"`
// ActiveSessions is how many agent sessions the caller currently has running on this machine; 0 where the agent plane is not mounted.
ActiveSessions *int64 `json:"activeSessions,omitempty"`
// Host is the machine's hostname label, from its most-recently-seen account.
Host *string `json:"host,omitempty"`
// LastSeen is when any account on this machine last reported, RFC 3339 UTC.
LastSeen *string `json:"lastSeen,omitempty"`
// Machine is the stable machine identifier.
Machine *string `json:"machine,omitempty"`
// OS is the machine's operating system label.
Os *string `json:"os,omitempty"`
AdditionalProperties map[string]interface{}
}
type _LinkDeviceView LinkDeviceView
// NewLinkDeviceView instantiates a new LinkDeviceView 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 NewLinkDeviceView() *LinkDeviceView {
this := LinkDeviceView{}
return &this
}
// NewLinkDeviceViewWithDefaults instantiates a new LinkDeviceView 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 NewLinkDeviceViewWithDefaults() *LinkDeviceView {
this := LinkDeviceView{}
return &this
}
// GetAccounts returns the Accounts field value if set, zero value otherwise.
func (o *LinkDeviceView) GetAccounts() []LinkLinkView {
if o == nil || IsNil(o.Accounts) {
var ret []LinkLinkView
return ret
}
return o.Accounts
}
// GetAccountsOk returns a tuple with the Accounts field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkDeviceView) GetAccountsOk() ([]LinkLinkView, bool) {
if o == nil || IsNil(o.Accounts) {
return nil, false
}
return o.Accounts, true
}
// HasAccounts returns a boolean if a field has been set.
func (o *LinkDeviceView) HasAccounts() bool {
if o != nil && !IsNil(o.Accounts) {
return true
}
return false
}
// SetAccounts gets a reference to the given []LinkLinkView and assigns it to the Accounts field.
func (o *LinkDeviceView) SetAccounts(v []LinkLinkView) {
o.Accounts = v
}
// GetActiveSessions returns the ActiveSessions field value if set, zero value otherwise.
func (o *LinkDeviceView) GetActiveSessions() int64 {
if o == nil || IsNil(o.ActiveSessions) {
var ret int64
return ret
}
return *o.ActiveSessions
}
// GetActiveSessionsOk returns a tuple with the ActiveSessions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkDeviceView) GetActiveSessionsOk() (*int64, bool) {
if o == nil || IsNil(o.ActiveSessions) {
return nil, false
}
return o.ActiveSessions, true
}
// HasActiveSessions returns a boolean if a field has been set.
func (o *LinkDeviceView) HasActiveSessions() bool {
if o != nil && !IsNil(o.ActiveSessions) {
return true
}
return false
}
// SetActiveSessions gets a reference to the given int64 and assigns it to the ActiveSessions field.
func (o *LinkDeviceView) SetActiveSessions(v int64) {
o.ActiveSessions = &v
}
// GetHost returns the Host field value if set, zero value otherwise.
func (o *LinkDeviceView) GetHost() string {
if o == nil || IsNil(o.Host) {
var ret string
return ret
}
return *o.Host
}
// GetHostOk returns a tuple with the Host field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkDeviceView) GetHostOk() (*string, bool) {
if o == nil || IsNil(o.Host) {
return nil, false
}
return o.Host, true
}
// HasHost returns a boolean if a field has been set.
func (o *LinkDeviceView) HasHost() bool {
if o != nil && !IsNil(o.Host) {
return true
}
return false
}
// SetHost gets a reference to the given string and assigns it to the Host field.
func (o *LinkDeviceView) SetHost(v string) {
o.Host = &v
}
// GetLastSeen returns the LastSeen field value if set, zero value otherwise.
func (o *LinkDeviceView) GetLastSeen() string {
if o == nil || IsNil(o.LastSeen) {
var ret string
return ret
}
return *o.LastSeen
}
// GetLastSeenOk returns a tuple with the LastSeen field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkDeviceView) GetLastSeenOk() (*string, bool) {
if o == nil || IsNil(o.LastSeen) {
return nil, false
}
return o.LastSeen, true
}
// HasLastSeen returns a boolean if a field has been set.
func (o *LinkDeviceView) HasLastSeen() bool {
if o != nil && !IsNil(o.LastSeen) {
return true
}
return false
}
// SetLastSeen gets a reference to the given string and assigns it to the LastSeen field.
func (o *LinkDeviceView) SetLastSeen(v string) {
o.LastSeen = &v
}
// GetMachine returns the Machine field value if set, zero value otherwise.
func (o *LinkDeviceView) GetMachine() string {
if o == nil || IsNil(o.Machine) {
var ret string
return ret
}
return *o.Machine
}
// GetMachineOk returns a tuple with the Machine field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkDeviceView) GetMachineOk() (*string, bool) {
if o == nil || IsNil(o.Machine) {
return nil, false
}
return o.Machine, true
}
// HasMachine returns a boolean if a field has been set.
func (o *LinkDeviceView) HasMachine() bool {
if o != nil && !IsNil(o.Machine) {
return true
}
return false
}
// SetMachine gets a reference to the given string and assigns it to the Machine field.
func (o *LinkDeviceView) SetMachine(v string) {
o.Machine = &v
}
// GetOs returns the Os field value if set, zero value otherwise.
func (o *LinkDeviceView) GetOs() string {
if o == nil || IsNil(o.Os) {
var ret string
return ret
}
return *o.Os
}
// GetOsOk returns a tuple with the Os field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkDeviceView) GetOsOk() (*string, bool) {
if o == nil || IsNil(o.Os) {
return nil, false
}
return o.Os, true
}
// HasOs returns a boolean if a field has been set.
func (o *LinkDeviceView) HasOs() bool {
if o != nil && !IsNil(o.Os) {
return true
}
return false
}
// SetOs gets a reference to the given string and assigns it to the Os field.
func (o *LinkDeviceView) SetOs(v string) {
o.Os = &v
}
func (o LinkDeviceView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o LinkDeviceView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Accounts) {
toSerialize["accounts"] = o.Accounts
}
if !IsNil(o.ActiveSessions) {
toSerialize["activeSessions"] = o.ActiveSessions
}
if !IsNil(o.Host) {
toSerialize["host"] = o.Host
}
if !IsNil(o.LastSeen) {
toSerialize["lastSeen"] = o.LastSeen
}
if !IsNil(o.Machine) {
toSerialize["machine"] = o.Machine
}
if !IsNil(o.Os) {
toSerialize["os"] = o.Os
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *LinkDeviceView) UnmarshalJSON(data []byte) (err error) {
varLinkDeviceView := _LinkDeviceView{}
err = json.Unmarshal(data, &varLinkDeviceView)
if err != nil {
return err
}
*o = LinkDeviceView(varLinkDeviceView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "accounts")
delete(additionalProperties, "activeSessions")
delete(additionalProperties, "host")
delete(additionalProperties, "lastSeen")
delete(additionalProperties, "machine")
delete(additionalProperties, "os")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableLinkDeviceView struct {
value *LinkDeviceView
isSet bool
}
func (v NullableLinkDeviceView) Get() *LinkDeviceView {
return v.value
}
func (v *NullableLinkDeviceView) Set(val *LinkDeviceView) {
v.value = val
v.isSet = true
}
func (v NullableLinkDeviceView) IsSet() bool {
return v.isSet
}
func (v *NullableLinkDeviceView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableLinkDeviceView(val *LinkDeviceView) *NullableLinkDeviceView {
return &NullableLinkDeviceView{value: val, isSet: true}
}
func (v NullableLinkDeviceView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableLinkDeviceView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}