Files
sdk/model_explorer_indexer_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 ExplorerIndexerView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ExplorerIndexerView{}
// ExplorerIndexerView struct for ExplorerIndexerView
type ExplorerIndexerView struct {
// Chain is the chain this indexer indexes, as the indexer names it.
Chain *string `json:"chain,omitempty"`
// Height is the latest INDEXED block height, as a decimal string. Absent when nothing has been indexed yet.
Height *string `json:"height,omitempty"`
// ID identifies the indexer: its chain name, else its chain id, else the brand.
Id *string `json:"id,omitempty"`
// Lag is how far behind the chain HEAD this indexer is. The indexer REST does not expose the head, so it is always absent rather than a fabricated zero.
Lag *string `json:"lag,omitempty"`
// Network is the deployment's network tier: mainnet, testnet or devnet.
Network *string `json:"network,omitempty"`
// Status is \"degraded\" when /health explicitly reports unhealthy, else \"active\".
Status *string `json:"status,omitempty"`
// UpdatedAt is the latest indexed block's timestamp, RFC 3339 UTC.
UpdatedAt *string `json:"updatedAt,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ExplorerIndexerView ExplorerIndexerView
// NewExplorerIndexerView instantiates a new ExplorerIndexerView 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 NewExplorerIndexerView() *ExplorerIndexerView {
this := ExplorerIndexerView{}
return &this
}
// NewExplorerIndexerViewWithDefaults instantiates a new ExplorerIndexerView 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 NewExplorerIndexerViewWithDefaults() *ExplorerIndexerView {
this := ExplorerIndexerView{}
return &this
}
// GetChain returns the Chain field value if set, zero value otherwise.
func (o *ExplorerIndexerView) GetChain() string {
if o == nil || IsNil(o.Chain) {
var ret string
return ret
}
return *o.Chain
}
// GetChainOk returns a tuple with the Chain field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ExplorerIndexerView) GetChainOk() (*string, bool) {
if o == nil || IsNil(o.Chain) {
return nil, false
}
return o.Chain, true
}
// HasChain returns a boolean if a field has been set.
func (o *ExplorerIndexerView) HasChain() bool {
if o != nil && !IsNil(o.Chain) {
return true
}
return false
}
// SetChain gets a reference to the given string and assigns it to the Chain field.
func (o *ExplorerIndexerView) SetChain(v string) {
o.Chain = &v
}
// GetHeight returns the Height field value if set, zero value otherwise.
func (o *ExplorerIndexerView) GetHeight() string {
if o == nil || IsNil(o.Height) {
var ret string
return ret
}
return *o.Height
}
// GetHeightOk returns a tuple with the Height field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ExplorerIndexerView) GetHeightOk() (*string, bool) {
if o == nil || IsNil(o.Height) {
return nil, false
}
return o.Height, true
}
// HasHeight returns a boolean if a field has been set.
func (o *ExplorerIndexerView) HasHeight() bool {
if o != nil && !IsNil(o.Height) {
return true
}
return false
}
// SetHeight gets a reference to the given string and assigns it to the Height field.
func (o *ExplorerIndexerView) SetHeight(v string) {
o.Height = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *ExplorerIndexerView) 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 *ExplorerIndexerView) 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 *ExplorerIndexerView) 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 *ExplorerIndexerView) SetId(v string) {
o.Id = &v
}
// GetLag returns the Lag field value if set, zero value otherwise.
func (o *ExplorerIndexerView) GetLag() string {
if o == nil || IsNil(o.Lag) {
var ret string
return ret
}
return *o.Lag
}
// GetLagOk returns a tuple with the Lag field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ExplorerIndexerView) GetLagOk() (*string, bool) {
if o == nil || IsNil(o.Lag) {
return nil, false
}
return o.Lag, true
}
// HasLag returns a boolean if a field has been set.
func (o *ExplorerIndexerView) HasLag() bool {
if o != nil && !IsNil(o.Lag) {
return true
}
return false
}
// SetLag gets a reference to the given string and assigns it to the Lag field.
func (o *ExplorerIndexerView) SetLag(v string) {
o.Lag = &v
}
// GetNetwork returns the Network field value if set, zero value otherwise.
func (o *ExplorerIndexerView) 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 *ExplorerIndexerView) 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 *ExplorerIndexerView) 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 *ExplorerIndexerView) SetNetwork(v string) {
o.Network = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *ExplorerIndexerView) GetStatus() string {
if o == nil || IsNil(o.Status) {
var ret string
return ret
}
return *o.Status
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ExplorerIndexerView) GetStatusOk() (*string, bool) {
if o == nil || IsNil(o.Status) {
return nil, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *ExplorerIndexerView) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *ExplorerIndexerView) SetStatus(v string) {
o.Status = &v
}
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
func (o *ExplorerIndexerView) GetUpdatedAt() string {
if o == nil || IsNil(o.UpdatedAt) {
var ret string
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 *ExplorerIndexerView) GetUpdatedAtOk() (*string, 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 *ExplorerIndexerView) HasUpdatedAt() bool {
if o != nil && !IsNil(o.UpdatedAt) {
return true
}
return false
}
// SetUpdatedAt gets a reference to the given string and assigns it to the UpdatedAt field.
func (o *ExplorerIndexerView) SetUpdatedAt(v string) {
o.UpdatedAt = &v
}
func (o ExplorerIndexerView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ExplorerIndexerView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Chain) {
toSerialize["chain"] = o.Chain
}
if !IsNil(o.Height) {
toSerialize["height"] = o.Height
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Lag) {
toSerialize["lag"] = o.Lag
}
if !IsNil(o.Network) {
toSerialize["network"] = o.Network
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.UpdatedAt) {
toSerialize["updatedAt"] = o.UpdatedAt
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ExplorerIndexerView) UnmarshalJSON(data []byte) (err error) {
varExplorerIndexerView := _ExplorerIndexerView{}
err = json.Unmarshal(data, &varExplorerIndexerView)
if err != nil {
return err
}
*o = ExplorerIndexerView(varExplorerIndexerView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "chain")
delete(additionalProperties, "height")
delete(additionalProperties, "id")
delete(additionalProperties, "lag")
delete(additionalProperties, "network")
delete(additionalProperties, "status")
delete(additionalProperties, "updatedAt")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableExplorerIndexerView struct {
value *ExplorerIndexerView
isSet bool
}
func (v NullableExplorerIndexerView) Get() *ExplorerIndexerView {
return v.value
}
func (v *NullableExplorerIndexerView) Set(val *ExplorerIndexerView) {
v.value = val
v.isSet = true
}
func (v NullableExplorerIndexerView) IsSet() bool {
return v.isSet
}
func (v *NullableExplorerIndexerView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableExplorerIndexerView(val *ExplorerIndexerView) *NullableExplorerIndexerView {
return &NullableExplorerIndexerView{value: val, isSet: true}
}
func (v NullableExplorerIndexerView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableExplorerIndexerView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}