Files
sdk/model_node_node_view.go

383 lines
10 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 NodeNodeView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &NodeNodeView{}
// NodeNodeView struct for NodeNodeView
type NodeNodeView struct {
// Caps is the capability list the node reported. It is a self-report, useful to SHOW and never load-bearing: what a node may actually be asked to do is decided at the socket by the deployment's allowlist.
Caps []string `json:"caps,omitempty"`
// Commands is the command list the node reported. Same standing as Caps: a self-report, checked again at the socket before anything runs.
Commands []string `json:"commands,omitempty"`
// ConnectedAt is when this node's socket was established, RFC3339 UTC.
ConnectedAt *string `json:"connectedAt,omitempty"`
// DisplayName is the human name the node reported for itself.
DisplayName *string `json:"displayName,omitempty"`
// ID is the node's own identifier within the org — the value POST /v1/node/{id}/invoke addresses it by.
Id *string `json:"id,omitempty"`
// Platform is the operating system and architecture the node reported.
Platform *string `json:"platform,omitempty"`
// Version is the node agent's own version string.
Version *string `json:"version,omitempty"`
AdditionalProperties map[string]interface{}
}
type _NodeNodeView NodeNodeView
// NewNodeNodeView instantiates a new NodeNodeView 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 NewNodeNodeView() *NodeNodeView {
this := NodeNodeView{}
return &this
}
// NewNodeNodeViewWithDefaults instantiates a new NodeNodeView 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 NewNodeNodeViewWithDefaults() *NodeNodeView {
this := NodeNodeView{}
return &this
}
// GetCaps returns the Caps field value if set, zero value otherwise.
func (o *NodeNodeView) GetCaps() []string {
if o == nil || IsNil(o.Caps) {
var ret []string
return ret
}
return o.Caps
}
// GetCapsOk returns a tuple with the Caps field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NodeNodeView) GetCapsOk() ([]string, bool) {
if o == nil || IsNil(o.Caps) {
return nil, false
}
return o.Caps, true
}
// HasCaps returns a boolean if a field has been set.
func (o *NodeNodeView) HasCaps() bool {
if o != nil && !IsNil(o.Caps) {
return true
}
return false
}
// SetCaps gets a reference to the given []string and assigns it to the Caps field.
func (o *NodeNodeView) SetCaps(v []string) {
o.Caps = v
}
// GetCommands returns the Commands field value if set, zero value otherwise.
func (o *NodeNodeView) GetCommands() []string {
if o == nil || IsNil(o.Commands) {
var ret []string
return ret
}
return o.Commands
}
// GetCommandsOk returns a tuple with the Commands field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NodeNodeView) GetCommandsOk() ([]string, bool) {
if o == nil || IsNil(o.Commands) {
return nil, false
}
return o.Commands, true
}
// HasCommands returns a boolean if a field has been set.
func (o *NodeNodeView) HasCommands() bool {
if o != nil && !IsNil(o.Commands) {
return true
}
return false
}
// SetCommands gets a reference to the given []string and assigns it to the Commands field.
func (o *NodeNodeView) SetCommands(v []string) {
o.Commands = v
}
// GetConnectedAt returns the ConnectedAt field value if set, zero value otherwise.
func (o *NodeNodeView) GetConnectedAt() string {
if o == nil || IsNil(o.ConnectedAt) {
var ret string
return ret
}
return *o.ConnectedAt
}
// GetConnectedAtOk returns a tuple with the ConnectedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NodeNodeView) GetConnectedAtOk() (*string, bool) {
if o == nil || IsNil(o.ConnectedAt) {
return nil, false
}
return o.ConnectedAt, true
}
// HasConnectedAt returns a boolean if a field has been set.
func (o *NodeNodeView) HasConnectedAt() bool {
if o != nil && !IsNil(o.ConnectedAt) {
return true
}
return false
}
// SetConnectedAt gets a reference to the given string and assigns it to the ConnectedAt field.
func (o *NodeNodeView) SetConnectedAt(v string) {
o.ConnectedAt = &v
}
// GetDisplayName returns the DisplayName field value if set, zero value otherwise.
func (o *NodeNodeView) GetDisplayName() string {
if o == nil || IsNil(o.DisplayName) {
var ret string
return ret
}
return *o.DisplayName
}
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NodeNodeView) GetDisplayNameOk() (*string, bool) {
if o == nil || IsNil(o.DisplayName) {
return nil, false
}
return o.DisplayName, true
}
// HasDisplayName returns a boolean if a field has been set.
func (o *NodeNodeView) HasDisplayName() bool {
if o != nil && !IsNil(o.DisplayName) {
return true
}
return false
}
// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field.
func (o *NodeNodeView) SetDisplayName(v string) {
o.DisplayName = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *NodeNodeView) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NodeNodeView) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *NodeNodeView) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *NodeNodeView) SetId(v string) {
o.Id = &v
}
// GetPlatform returns the Platform field value if set, zero value otherwise.
func (o *NodeNodeView) GetPlatform() string {
if o == nil || IsNil(o.Platform) {
var ret string
return ret
}
return *o.Platform
}
// GetPlatformOk returns a tuple with the Platform field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NodeNodeView) GetPlatformOk() (*string, bool) {
if o == nil || IsNil(o.Platform) {
return nil, false
}
return o.Platform, true
}
// HasPlatform returns a boolean if a field has been set.
func (o *NodeNodeView) HasPlatform() bool {
if o != nil && !IsNil(o.Platform) {
return true
}
return false
}
// SetPlatform gets a reference to the given string and assigns it to the Platform field.
func (o *NodeNodeView) SetPlatform(v string) {
o.Platform = &v
}
// GetVersion returns the Version field value if set, zero value otherwise.
func (o *NodeNodeView) GetVersion() string {
if o == nil || IsNil(o.Version) {
var ret string
return ret
}
return *o.Version
}
// GetVersionOk returns a tuple with the Version field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NodeNodeView) GetVersionOk() (*string, bool) {
if o == nil || IsNil(o.Version) {
return nil, false
}
return o.Version, true
}
// HasVersion returns a boolean if a field has been set.
func (o *NodeNodeView) HasVersion() bool {
if o != nil && !IsNil(o.Version) {
return true
}
return false
}
// SetVersion gets a reference to the given string and assigns it to the Version field.
func (o *NodeNodeView) SetVersion(v string) {
o.Version = &v
}
func (o NodeNodeView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o NodeNodeView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Caps) {
toSerialize["caps"] = o.Caps
}
if !IsNil(o.Commands) {
toSerialize["commands"] = o.Commands
}
if !IsNil(o.ConnectedAt) {
toSerialize["connectedAt"] = o.ConnectedAt
}
if !IsNil(o.DisplayName) {
toSerialize["displayName"] = o.DisplayName
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Platform) {
toSerialize["platform"] = o.Platform
}
if !IsNil(o.Version) {
toSerialize["version"] = o.Version
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *NodeNodeView) UnmarshalJSON(data []byte) (err error) {
varNodeNodeView := _NodeNodeView{}
err = json.Unmarshal(data, &varNodeNodeView)
if err != nil {
return err
}
*o = NodeNodeView(varNodeNodeView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "caps")
delete(additionalProperties, "commands")
delete(additionalProperties, "connectedAt")
delete(additionalProperties, "displayName")
delete(additionalProperties, "id")
delete(additionalProperties, "platform")
delete(additionalProperties, "version")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableNodeNodeView struct {
value *NodeNodeView
isSet bool
}
func (v NullableNodeNodeView) Get() *NodeNodeView {
return v.value
}
func (v *NullableNodeNodeView) Set(val *NodeNodeView) {
v.value = val
v.isSet = true
}
func (v NullableNodeNodeView) IsSet() bool {
return v.isSet
}
func (v *NullableNodeNodeView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableNodeNodeView(val *NodeNodeView) *NullableNodeNodeView {
return &NullableNodeNodeView{value: val, isSet: true}
}
func (v NullableNodeNodeView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableNodeNodeView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}