Files
sdk/model_licensing_device_signals.go

420 lines
11 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 LicensingDeviceSignals type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &LicensingDeviceSignals{}
// LicensingDeviceSignals struct for LicensingDeviceSignals
type LicensingDeviceSignals struct {
Arch *string `json:"arch,omitempty"`
// CPUID is a CPU/board identifier string.
Cpuid *string `json:"cpuid,omitempty"`
// DiskSerial of the boot/root volume.
DiskSerial *string `json:"disk_serial,omitempty"`
// Hostname is a weak signal, used only as a tiebreaker.
Hostname *string `json:"hostname,omitempty"`
// InstallID is a per-install random the agent persists locally on first run.
InstallId *string `json:"install_id,omitempty"`
// MachineID is a stable per-host id (e.g. /etc/machine-id, IOPlatformUUID, MachineGuid). Strongest single signal where present.
MachineId *string `json:"machine_id,omitempty"`
// MAC addresses of stable interfaces (order-insensitive; we sort).
Macs []string `json:"macs,omitempty"`
// OS / Arch coarse platform tags.
Os *string `json:"os,omitempty"`
AdditionalProperties map[string]interface{}
}
type _LicensingDeviceSignals LicensingDeviceSignals
// NewLicensingDeviceSignals instantiates a new LicensingDeviceSignals 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 NewLicensingDeviceSignals() *LicensingDeviceSignals {
this := LicensingDeviceSignals{}
return &this
}
// NewLicensingDeviceSignalsWithDefaults instantiates a new LicensingDeviceSignals 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 NewLicensingDeviceSignalsWithDefaults() *LicensingDeviceSignals {
this := LicensingDeviceSignals{}
return &this
}
// GetArch returns the Arch field value if set, zero value otherwise.
func (o *LicensingDeviceSignals) GetArch() string {
if o == nil || IsNil(o.Arch) {
var ret string
return ret
}
return *o.Arch
}
// GetArchOk returns a tuple with the Arch field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LicensingDeviceSignals) GetArchOk() (*string, bool) {
if o == nil || IsNil(o.Arch) {
return nil, false
}
return o.Arch, true
}
// HasArch returns a boolean if a field has been set.
func (o *LicensingDeviceSignals) HasArch() bool {
if o != nil && !IsNil(o.Arch) {
return true
}
return false
}
// SetArch gets a reference to the given string and assigns it to the Arch field.
func (o *LicensingDeviceSignals) SetArch(v string) {
o.Arch = &v
}
// GetCpuid returns the Cpuid field value if set, zero value otherwise.
func (o *LicensingDeviceSignals) GetCpuid() string {
if o == nil || IsNil(o.Cpuid) {
var ret string
return ret
}
return *o.Cpuid
}
// GetCpuidOk returns a tuple with the Cpuid field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LicensingDeviceSignals) GetCpuidOk() (*string, bool) {
if o == nil || IsNil(o.Cpuid) {
return nil, false
}
return o.Cpuid, true
}
// HasCpuid returns a boolean if a field has been set.
func (o *LicensingDeviceSignals) HasCpuid() bool {
if o != nil && !IsNil(o.Cpuid) {
return true
}
return false
}
// SetCpuid gets a reference to the given string and assigns it to the Cpuid field.
func (o *LicensingDeviceSignals) SetCpuid(v string) {
o.Cpuid = &v
}
// GetDiskSerial returns the DiskSerial field value if set, zero value otherwise.
func (o *LicensingDeviceSignals) GetDiskSerial() string {
if o == nil || IsNil(o.DiskSerial) {
var ret string
return ret
}
return *o.DiskSerial
}
// GetDiskSerialOk returns a tuple with the DiskSerial field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LicensingDeviceSignals) GetDiskSerialOk() (*string, bool) {
if o == nil || IsNil(o.DiskSerial) {
return nil, false
}
return o.DiskSerial, true
}
// HasDiskSerial returns a boolean if a field has been set.
func (o *LicensingDeviceSignals) HasDiskSerial() bool {
if o != nil && !IsNil(o.DiskSerial) {
return true
}
return false
}
// SetDiskSerial gets a reference to the given string and assigns it to the DiskSerial field.
func (o *LicensingDeviceSignals) SetDiskSerial(v string) {
o.DiskSerial = &v
}
// GetHostname returns the Hostname field value if set, zero value otherwise.
func (o *LicensingDeviceSignals) GetHostname() string {
if o == nil || IsNil(o.Hostname) {
var ret string
return ret
}
return *o.Hostname
}
// GetHostnameOk returns a tuple with the Hostname field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LicensingDeviceSignals) GetHostnameOk() (*string, bool) {
if o == nil || IsNil(o.Hostname) {
return nil, false
}
return o.Hostname, true
}
// HasHostname returns a boolean if a field has been set.
func (o *LicensingDeviceSignals) HasHostname() bool {
if o != nil && !IsNil(o.Hostname) {
return true
}
return false
}
// SetHostname gets a reference to the given string and assigns it to the Hostname field.
func (o *LicensingDeviceSignals) SetHostname(v string) {
o.Hostname = &v
}
// GetInstallId returns the InstallId field value if set, zero value otherwise.
func (o *LicensingDeviceSignals) GetInstallId() string {
if o == nil || IsNil(o.InstallId) {
var ret string
return ret
}
return *o.InstallId
}
// GetInstallIdOk returns a tuple with the InstallId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LicensingDeviceSignals) GetInstallIdOk() (*string, bool) {
if o == nil || IsNil(o.InstallId) {
return nil, false
}
return o.InstallId, true
}
// HasInstallId returns a boolean if a field has been set.
func (o *LicensingDeviceSignals) HasInstallId() bool {
if o != nil && !IsNil(o.InstallId) {
return true
}
return false
}
// SetInstallId gets a reference to the given string and assigns it to the InstallId field.
func (o *LicensingDeviceSignals) SetInstallId(v string) {
o.InstallId = &v
}
// GetMachineId returns the MachineId field value if set, zero value otherwise.
func (o *LicensingDeviceSignals) GetMachineId() string {
if o == nil || IsNil(o.MachineId) {
var ret string
return ret
}
return *o.MachineId
}
// GetMachineIdOk returns a tuple with the MachineId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LicensingDeviceSignals) GetMachineIdOk() (*string, bool) {
if o == nil || IsNil(o.MachineId) {
return nil, false
}
return o.MachineId, true
}
// HasMachineId returns a boolean if a field has been set.
func (o *LicensingDeviceSignals) HasMachineId() bool {
if o != nil && !IsNil(o.MachineId) {
return true
}
return false
}
// SetMachineId gets a reference to the given string and assigns it to the MachineId field.
func (o *LicensingDeviceSignals) SetMachineId(v string) {
o.MachineId = &v
}
// GetMacs returns the Macs field value if set, zero value otherwise.
func (o *LicensingDeviceSignals) GetMacs() []string {
if o == nil || IsNil(o.Macs) {
var ret []string
return ret
}
return o.Macs
}
// GetMacsOk returns a tuple with the Macs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LicensingDeviceSignals) GetMacsOk() ([]string, bool) {
if o == nil || IsNil(o.Macs) {
return nil, false
}
return o.Macs, true
}
// HasMacs returns a boolean if a field has been set.
func (o *LicensingDeviceSignals) HasMacs() bool {
if o != nil && !IsNil(o.Macs) {
return true
}
return false
}
// SetMacs gets a reference to the given []string and assigns it to the Macs field.
func (o *LicensingDeviceSignals) SetMacs(v []string) {
o.Macs = v
}
// GetOs returns the Os field value if set, zero value otherwise.
func (o *LicensingDeviceSignals) 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 *LicensingDeviceSignals) 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 *LicensingDeviceSignals) 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 *LicensingDeviceSignals) SetOs(v string) {
o.Os = &v
}
func (o LicensingDeviceSignals) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o LicensingDeviceSignals) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Arch) {
toSerialize["arch"] = o.Arch
}
if !IsNil(o.Cpuid) {
toSerialize["cpuid"] = o.Cpuid
}
if !IsNil(o.DiskSerial) {
toSerialize["disk_serial"] = o.DiskSerial
}
if !IsNil(o.Hostname) {
toSerialize["hostname"] = o.Hostname
}
if !IsNil(o.InstallId) {
toSerialize["install_id"] = o.InstallId
}
if !IsNil(o.MachineId) {
toSerialize["machine_id"] = o.MachineId
}
if !IsNil(o.Macs) {
toSerialize["macs"] = o.Macs
}
if !IsNil(o.Os) {
toSerialize["os"] = o.Os
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *LicensingDeviceSignals) UnmarshalJSON(data []byte) (err error) {
varLicensingDeviceSignals := _LicensingDeviceSignals{}
err = json.Unmarshal(data, &varLicensingDeviceSignals)
if err != nil {
return err
}
*o = LicensingDeviceSignals(varLicensingDeviceSignals)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "arch")
delete(additionalProperties, "cpuid")
delete(additionalProperties, "disk_serial")
delete(additionalProperties, "hostname")
delete(additionalProperties, "install_id")
delete(additionalProperties, "machine_id")
delete(additionalProperties, "macs")
delete(additionalProperties, "os")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableLicensingDeviceSignals struct {
value *LicensingDeviceSignals
isSet bool
}
func (v NullableLicensingDeviceSignals) Get() *LicensingDeviceSignals {
return v.value
}
func (v *NullableLicensingDeviceSignals) Set(val *LicensingDeviceSignals) {
v.value = val
v.isSet = true
}
func (v NullableLicensingDeviceSignals) IsSet() bool {
return v.isSet
}
func (v *NullableLicensingDeviceSignals) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableLicensingDeviceSignals(val *LicensingDeviceSignals) *NullableLicensingDeviceSignals {
return &NullableLicensingDeviceSignals{value: val, isSet: true}
}
func (v NullableLicensingDeviceSignals) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableLicensingDeviceSignals) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}