mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
573 lines
16 KiB
Go
573 lines
16 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 ValidatorSlotView type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &ValidatorSlotView{}
|
|
|
|
// ValidatorSlotView struct for ValidatorSlotView
|
|
type ValidatorSlotView struct {
|
|
// BLSPubkey is the node's BLS public key, hex.
|
|
BlsPubkey *string `json:"blsPubkey,omitempty"`
|
|
// CRName is the LuxNetwork custom resource that materializes the node.
|
|
CrName *string `json:"crName,omitempty"`
|
|
// CreatedAt is when the slot was first claimed, as a Unix timestamp.
|
|
CreatedAt *int64 `json:"createdAt,omitempty"`
|
|
// Namespace is the Kubernetes namespace the node's CR lives in.
|
|
Namespace *string `json:"namespace,omitempty"`
|
|
// Network is the luxd network slug the node joins.
|
|
Network *string `json:"network,omitempty"`
|
|
// NodeID is the luxd node id derived from the sealed staking identity. It is stable across re-claims of the same slot.
|
|
NodeID *string `json:"nodeID,omitempty"`
|
|
// NodeStatus is the provisioning state of the node: \"node_created\" once the CR is applied, \"node_pending\" when no cluster is reachable (the slot is still claimed and the keys are still sealed).
|
|
NodeStatus *string `json:"nodeStatus,omitempty"`
|
|
// Registration is the queued owner-gated registration, absent until one exists.
|
|
Registration *ValidatorRegistrationView `json:"registration,omitempty"`
|
|
// Slot is the validator slot number — the same value as tokenId, under the name the portal reads.
|
|
Slot *int32 `json:"slot,omitempty"`
|
|
// TokenID is the GenesisNFT token id that IS this slot.
|
|
TokenId *int32 `json:"tokenId,omitempty"`
|
|
// UpdatedAt is when the slot last changed, as a Unix timestamp.
|
|
UpdatedAt *int64 `json:"updatedAt,omitempty"`
|
|
// Wallet is the lowercase Ethereum address that proved ownership of the NFT.
|
|
Wallet *string `json:"wallet,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _ValidatorSlotView ValidatorSlotView
|
|
|
|
// NewValidatorSlotView instantiates a new ValidatorSlotView 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 NewValidatorSlotView() *ValidatorSlotView {
|
|
this := ValidatorSlotView{}
|
|
return &this
|
|
}
|
|
|
|
// NewValidatorSlotViewWithDefaults instantiates a new ValidatorSlotView 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 NewValidatorSlotViewWithDefaults() *ValidatorSlotView {
|
|
this := ValidatorSlotView{}
|
|
return &this
|
|
}
|
|
|
|
// GetBlsPubkey returns the BlsPubkey field value if set, zero value otherwise.
|
|
func (o *ValidatorSlotView) GetBlsPubkey() string {
|
|
if o == nil || IsNil(o.BlsPubkey) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.BlsPubkey
|
|
}
|
|
|
|
// GetBlsPubkeyOk returns a tuple with the BlsPubkey field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ValidatorSlotView) GetBlsPubkeyOk() (*string, bool) {
|
|
if o == nil || IsNil(o.BlsPubkey) {
|
|
return nil, false
|
|
}
|
|
return o.BlsPubkey, true
|
|
}
|
|
|
|
// HasBlsPubkey returns a boolean if a field has been set.
|
|
func (o *ValidatorSlotView) HasBlsPubkey() bool {
|
|
if o != nil && !IsNil(o.BlsPubkey) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetBlsPubkey gets a reference to the given string and assigns it to the BlsPubkey field.
|
|
func (o *ValidatorSlotView) SetBlsPubkey(v string) {
|
|
o.BlsPubkey = &v
|
|
}
|
|
|
|
// GetCrName returns the CrName field value if set, zero value otherwise.
|
|
func (o *ValidatorSlotView) GetCrName() string {
|
|
if o == nil || IsNil(o.CrName) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.CrName
|
|
}
|
|
|
|
// GetCrNameOk returns a tuple with the CrName field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ValidatorSlotView) GetCrNameOk() (*string, bool) {
|
|
if o == nil || IsNil(o.CrName) {
|
|
return nil, false
|
|
}
|
|
return o.CrName, true
|
|
}
|
|
|
|
// HasCrName returns a boolean if a field has been set.
|
|
func (o *ValidatorSlotView) HasCrName() bool {
|
|
if o != nil && !IsNil(o.CrName) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCrName gets a reference to the given string and assigns it to the CrName field.
|
|
func (o *ValidatorSlotView) SetCrName(v string) {
|
|
o.CrName = &v
|
|
}
|
|
|
|
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
|
|
func (o *ValidatorSlotView) GetCreatedAt() int64 {
|
|
if o == nil || IsNil(o.CreatedAt) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.CreatedAt
|
|
}
|
|
|
|
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ValidatorSlotView) GetCreatedAtOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.CreatedAt) {
|
|
return nil, false
|
|
}
|
|
return o.CreatedAt, true
|
|
}
|
|
|
|
// HasCreatedAt returns a boolean if a field has been set.
|
|
func (o *ValidatorSlotView) HasCreatedAt() bool {
|
|
if o != nil && !IsNil(o.CreatedAt) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCreatedAt gets a reference to the given int64 and assigns it to the CreatedAt field.
|
|
func (o *ValidatorSlotView) SetCreatedAt(v int64) {
|
|
o.CreatedAt = &v
|
|
}
|
|
|
|
// GetNamespace returns the Namespace field value if set, zero value otherwise.
|
|
func (o *ValidatorSlotView) GetNamespace() string {
|
|
if o == nil || IsNil(o.Namespace) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Namespace
|
|
}
|
|
|
|
// GetNamespaceOk returns a tuple with the Namespace field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ValidatorSlotView) GetNamespaceOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Namespace) {
|
|
return nil, false
|
|
}
|
|
return o.Namespace, true
|
|
}
|
|
|
|
// HasNamespace returns a boolean if a field has been set.
|
|
func (o *ValidatorSlotView) HasNamespace() bool {
|
|
if o != nil && !IsNil(o.Namespace) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetNamespace gets a reference to the given string and assigns it to the Namespace field.
|
|
func (o *ValidatorSlotView) SetNamespace(v string) {
|
|
o.Namespace = &v
|
|
}
|
|
|
|
// GetNetwork returns the Network field value if set, zero value otherwise.
|
|
func (o *ValidatorSlotView) GetNetwork() string {
|
|
if o == nil || IsNil(o.Network) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Network
|
|
}
|
|
|
|
// GetNetworkOk returns a tuple with the Network field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ValidatorSlotView) GetNetworkOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Network) {
|
|
return nil, false
|
|
}
|
|
return o.Network, true
|
|
}
|
|
|
|
// HasNetwork returns a boolean if a field has been set.
|
|
func (o *ValidatorSlotView) HasNetwork() bool {
|
|
if o != nil && !IsNil(o.Network) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetNetwork gets a reference to the given string and assigns it to the Network field.
|
|
func (o *ValidatorSlotView) SetNetwork(v string) {
|
|
o.Network = &v
|
|
}
|
|
|
|
// GetNodeID returns the NodeID field value if set, zero value otherwise.
|
|
func (o *ValidatorSlotView) GetNodeID() string {
|
|
if o == nil || IsNil(o.NodeID) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.NodeID
|
|
}
|
|
|
|
// GetNodeIDOk returns a tuple with the NodeID field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ValidatorSlotView) GetNodeIDOk() (*string, bool) {
|
|
if o == nil || IsNil(o.NodeID) {
|
|
return nil, false
|
|
}
|
|
return o.NodeID, true
|
|
}
|
|
|
|
// HasNodeID returns a boolean if a field has been set.
|
|
func (o *ValidatorSlotView) HasNodeID() bool {
|
|
if o != nil && !IsNil(o.NodeID) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetNodeID gets a reference to the given string and assigns it to the NodeID field.
|
|
func (o *ValidatorSlotView) SetNodeID(v string) {
|
|
o.NodeID = &v
|
|
}
|
|
|
|
// GetNodeStatus returns the NodeStatus field value if set, zero value otherwise.
|
|
func (o *ValidatorSlotView) GetNodeStatus() string {
|
|
if o == nil || IsNil(o.NodeStatus) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.NodeStatus
|
|
}
|
|
|
|
// GetNodeStatusOk returns a tuple with the NodeStatus field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ValidatorSlotView) GetNodeStatusOk() (*string, bool) {
|
|
if o == nil || IsNil(o.NodeStatus) {
|
|
return nil, false
|
|
}
|
|
return o.NodeStatus, true
|
|
}
|
|
|
|
// HasNodeStatus returns a boolean if a field has been set.
|
|
func (o *ValidatorSlotView) HasNodeStatus() bool {
|
|
if o != nil && !IsNil(o.NodeStatus) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetNodeStatus gets a reference to the given string and assigns it to the NodeStatus field.
|
|
func (o *ValidatorSlotView) SetNodeStatus(v string) {
|
|
o.NodeStatus = &v
|
|
}
|
|
|
|
// GetRegistration returns the Registration field value if set, zero value otherwise.
|
|
func (o *ValidatorSlotView) GetRegistration() ValidatorRegistrationView {
|
|
if o == nil || IsNil(o.Registration) {
|
|
var ret ValidatorRegistrationView
|
|
return ret
|
|
}
|
|
return *o.Registration
|
|
}
|
|
|
|
// GetRegistrationOk returns a tuple with the Registration field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ValidatorSlotView) GetRegistrationOk() (*ValidatorRegistrationView, bool) {
|
|
if o == nil || IsNil(o.Registration) {
|
|
return nil, false
|
|
}
|
|
return o.Registration, true
|
|
}
|
|
|
|
// HasRegistration returns a boolean if a field has been set.
|
|
func (o *ValidatorSlotView) HasRegistration() bool {
|
|
if o != nil && !IsNil(o.Registration) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRegistration gets a reference to the given ValidatorRegistrationView and assigns it to the Registration field.
|
|
func (o *ValidatorSlotView) SetRegistration(v ValidatorRegistrationView) {
|
|
o.Registration = &v
|
|
}
|
|
|
|
// GetSlot returns the Slot field value if set, zero value otherwise.
|
|
func (o *ValidatorSlotView) GetSlot() int32 {
|
|
if o == nil || IsNil(o.Slot) {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.Slot
|
|
}
|
|
|
|
// GetSlotOk returns a tuple with the Slot field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ValidatorSlotView) GetSlotOk() (*int32, bool) {
|
|
if o == nil || IsNil(o.Slot) {
|
|
return nil, false
|
|
}
|
|
return o.Slot, true
|
|
}
|
|
|
|
// HasSlot returns a boolean if a field has been set.
|
|
func (o *ValidatorSlotView) HasSlot() bool {
|
|
if o != nil && !IsNil(o.Slot) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSlot gets a reference to the given int32 and assigns it to the Slot field.
|
|
func (o *ValidatorSlotView) SetSlot(v int32) {
|
|
o.Slot = &v
|
|
}
|
|
|
|
// GetTokenId returns the TokenId field value if set, zero value otherwise.
|
|
func (o *ValidatorSlotView) GetTokenId() int32 {
|
|
if o == nil || IsNil(o.TokenId) {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.TokenId
|
|
}
|
|
|
|
// GetTokenIdOk returns a tuple with the TokenId field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ValidatorSlotView) GetTokenIdOk() (*int32, bool) {
|
|
if o == nil || IsNil(o.TokenId) {
|
|
return nil, false
|
|
}
|
|
return o.TokenId, true
|
|
}
|
|
|
|
// HasTokenId returns a boolean if a field has been set.
|
|
func (o *ValidatorSlotView) HasTokenId() bool {
|
|
if o != nil && !IsNil(o.TokenId) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTokenId gets a reference to the given int32 and assigns it to the TokenId field.
|
|
func (o *ValidatorSlotView) SetTokenId(v int32) {
|
|
o.TokenId = &v
|
|
}
|
|
|
|
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
|
|
func (o *ValidatorSlotView) GetUpdatedAt() int64 {
|
|
if o == nil || IsNil(o.UpdatedAt) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.UpdatedAt
|
|
}
|
|
|
|
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ValidatorSlotView) GetUpdatedAtOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.UpdatedAt) {
|
|
return nil, false
|
|
}
|
|
return o.UpdatedAt, true
|
|
}
|
|
|
|
// HasUpdatedAt returns a boolean if a field has been set.
|
|
func (o *ValidatorSlotView) HasUpdatedAt() bool {
|
|
if o != nil && !IsNil(o.UpdatedAt) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUpdatedAt gets a reference to the given int64 and assigns it to the UpdatedAt field.
|
|
func (o *ValidatorSlotView) SetUpdatedAt(v int64) {
|
|
o.UpdatedAt = &v
|
|
}
|
|
|
|
// GetWallet returns the Wallet field value if set, zero value otherwise.
|
|
func (o *ValidatorSlotView) GetWallet() string {
|
|
if o == nil || IsNil(o.Wallet) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Wallet
|
|
}
|
|
|
|
// GetWalletOk returns a tuple with the Wallet field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ValidatorSlotView) GetWalletOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Wallet) {
|
|
return nil, false
|
|
}
|
|
return o.Wallet, true
|
|
}
|
|
|
|
// HasWallet returns a boolean if a field has been set.
|
|
func (o *ValidatorSlotView) HasWallet() bool {
|
|
if o != nil && !IsNil(o.Wallet) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetWallet gets a reference to the given string and assigns it to the Wallet field.
|
|
func (o *ValidatorSlotView) SetWallet(v string) {
|
|
o.Wallet = &v
|
|
}
|
|
|
|
func (o ValidatorSlotView) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o ValidatorSlotView) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.BlsPubkey) {
|
|
toSerialize["blsPubkey"] = o.BlsPubkey
|
|
}
|
|
if !IsNil(o.CrName) {
|
|
toSerialize["crName"] = o.CrName
|
|
}
|
|
if !IsNil(o.CreatedAt) {
|
|
toSerialize["createdAt"] = o.CreatedAt
|
|
}
|
|
if !IsNil(o.Namespace) {
|
|
toSerialize["namespace"] = o.Namespace
|
|
}
|
|
if !IsNil(o.Network) {
|
|
toSerialize["network"] = o.Network
|
|
}
|
|
if !IsNil(o.NodeID) {
|
|
toSerialize["nodeID"] = o.NodeID
|
|
}
|
|
if !IsNil(o.NodeStatus) {
|
|
toSerialize["nodeStatus"] = o.NodeStatus
|
|
}
|
|
if !IsNil(o.Registration) {
|
|
toSerialize["registration"] = o.Registration
|
|
}
|
|
if !IsNil(o.Slot) {
|
|
toSerialize["slot"] = o.Slot
|
|
}
|
|
if !IsNil(o.TokenId) {
|
|
toSerialize["tokenId"] = o.TokenId
|
|
}
|
|
if !IsNil(o.UpdatedAt) {
|
|
toSerialize["updatedAt"] = o.UpdatedAt
|
|
}
|
|
if !IsNil(o.Wallet) {
|
|
toSerialize["wallet"] = o.Wallet
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *ValidatorSlotView) UnmarshalJSON(data []byte) (err error) {
|
|
varValidatorSlotView := _ValidatorSlotView{}
|
|
|
|
err = json.Unmarshal(data, &varValidatorSlotView)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = ValidatorSlotView(varValidatorSlotView)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "blsPubkey")
|
|
delete(additionalProperties, "crName")
|
|
delete(additionalProperties, "createdAt")
|
|
delete(additionalProperties, "namespace")
|
|
delete(additionalProperties, "network")
|
|
delete(additionalProperties, "nodeID")
|
|
delete(additionalProperties, "nodeStatus")
|
|
delete(additionalProperties, "registration")
|
|
delete(additionalProperties, "slot")
|
|
delete(additionalProperties, "tokenId")
|
|
delete(additionalProperties, "updatedAt")
|
|
delete(additionalProperties, "wallet")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableValidatorSlotView struct {
|
|
value *ValidatorSlotView
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableValidatorSlotView) Get() *ValidatorSlotView {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableValidatorSlotView) Set(val *ValidatorSlotView) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableValidatorSlotView) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableValidatorSlotView) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableValidatorSlotView(val *ValidatorSlotView) *NullableValidatorSlotView {
|
|
return &NullableValidatorSlotView{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableValidatorSlotView) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableValidatorSlotView) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|