mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
307 lines
8.6 KiB
Go
307 lines
8.6 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 ValidatorChallengeView type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &ValidatorChallengeView{}
|
|
|
|
// ValidatorChallengeView struct for ValidatorChallengeView
|
|
type ValidatorChallengeView struct {
|
|
// ExpiresAt is when the nonce stops being redeemable, as a Unix timestamp.
|
|
ExpiresAt *int64 `json:"expiresAt,omitempty"`
|
|
// Message is the EXACT text to personal_sign. It is reconstructed server-side from the validated org, the slot and the nonce at redemption, so signing anything else cannot claim the slot.
|
|
Message *string `json:"message,omitempty"`
|
|
// Nonce is the single-use, org-bound challenge value to send back with the signature.
|
|
Nonce *string `json:"nonce,omitempty"`
|
|
// TokenID is the slot the challenge was issued for.
|
|
TokenId *int32 `json:"tokenId,omitempty"`
|
|
// TTLSeconds is the challenge lifetime in seconds.
|
|
TtlSeconds *int64 `json:"ttlSeconds,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _ValidatorChallengeView ValidatorChallengeView
|
|
|
|
// NewValidatorChallengeView instantiates a new ValidatorChallengeView 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 NewValidatorChallengeView() *ValidatorChallengeView {
|
|
this := ValidatorChallengeView{}
|
|
return &this
|
|
}
|
|
|
|
// NewValidatorChallengeViewWithDefaults instantiates a new ValidatorChallengeView 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 NewValidatorChallengeViewWithDefaults() *ValidatorChallengeView {
|
|
this := ValidatorChallengeView{}
|
|
return &this
|
|
}
|
|
|
|
// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise.
|
|
func (o *ValidatorChallengeView) GetExpiresAt() int64 {
|
|
if o == nil || IsNil(o.ExpiresAt) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.ExpiresAt
|
|
}
|
|
|
|
// GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ValidatorChallengeView) GetExpiresAtOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.ExpiresAt) {
|
|
return nil, false
|
|
}
|
|
return o.ExpiresAt, true
|
|
}
|
|
|
|
// HasExpiresAt returns a boolean if a field has been set.
|
|
func (o *ValidatorChallengeView) HasExpiresAt() bool {
|
|
if o != nil && !IsNil(o.ExpiresAt) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetExpiresAt gets a reference to the given int64 and assigns it to the ExpiresAt field.
|
|
func (o *ValidatorChallengeView) SetExpiresAt(v int64) {
|
|
o.ExpiresAt = &v
|
|
}
|
|
|
|
// GetMessage returns the Message field value if set, zero value otherwise.
|
|
func (o *ValidatorChallengeView) GetMessage() string {
|
|
if o == nil || IsNil(o.Message) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Message
|
|
}
|
|
|
|
// GetMessageOk returns a tuple with the Message field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ValidatorChallengeView) GetMessageOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Message) {
|
|
return nil, false
|
|
}
|
|
return o.Message, true
|
|
}
|
|
|
|
// HasMessage returns a boolean if a field has been set.
|
|
func (o *ValidatorChallengeView) HasMessage() bool {
|
|
if o != nil && !IsNil(o.Message) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMessage gets a reference to the given string and assigns it to the Message field.
|
|
func (o *ValidatorChallengeView) SetMessage(v string) {
|
|
o.Message = &v
|
|
}
|
|
|
|
// GetNonce returns the Nonce field value if set, zero value otherwise.
|
|
func (o *ValidatorChallengeView) GetNonce() string {
|
|
if o == nil || IsNil(o.Nonce) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Nonce
|
|
}
|
|
|
|
// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ValidatorChallengeView) GetNonceOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Nonce) {
|
|
return nil, false
|
|
}
|
|
return o.Nonce, true
|
|
}
|
|
|
|
// HasNonce returns a boolean if a field has been set.
|
|
func (o *ValidatorChallengeView) HasNonce() bool {
|
|
if o != nil && !IsNil(o.Nonce) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetNonce gets a reference to the given string and assigns it to the Nonce field.
|
|
func (o *ValidatorChallengeView) SetNonce(v string) {
|
|
o.Nonce = &v
|
|
}
|
|
|
|
// GetTokenId returns the TokenId field value if set, zero value otherwise.
|
|
func (o *ValidatorChallengeView) 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 *ValidatorChallengeView) 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 *ValidatorChallengeView) 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 *ValidatorChallengeView) SetTokenId(v int32) {
|
|
o.TokenId = &v
|
|
}
|
|
|
|
// GetTtlSeconds returns the TtlSeconds field value if set, zero value otherwise.
|
|
func (o *ValidatorChallengeView) GetTtlSeconds() int64 {
|
|
if o == nil || IsNil(o.TtlSeconds) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.TtlSeconds
|
|
}
|
|
|
|
// GetTtlSecondsOk returns a tuple with the TtlSeconds field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ValidatorChallengeView) GetTtlSecondsOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.TtlSeconds) {
|
|
return nil, false
|
|
}
|
|
return o.TtlSeconds, true
|
|
}
|
|
|
|
// HasTtlSeconds returns a boolean if a field has been set.
|
|
func (o *ValidatorChallengeView) HasTtlSeconds() bool {
|
|
if o != nil && !IsNil(o.TtlSeconds) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTtlSeconds gets a reference to the given int64 and assigns it to the TtlSeconds field.
|
|
func (o *ValidatorChallengeView) SetTtlSeconds(v int64) {
|
|
o.TtlSeconds = &v
|
|
}
|
|
|
|
func (o ValidatorChallengeView) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o ValidatorChallengeView) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.ExpiresAt) {
|
|
toSerialize["expiresAt"] = o.ExpiresAt
|
|
}
|
|
if !IsNil(o.Message) {
|
|
toSerialize["message"] = o.Message
|
|
}
|
|
if !IsNil(o.Nonce) {
|
|
toSerialize["nonce"] = o.Nonce
|
|
}
|
|
if !IsNil(o.TokenId) {
|
|
toSerialize["tokenId"] = o.TokenId
|
|
}
|
|
if !IsNil(o.TtlSeconds) {
|
|
toSerialize["ttlSeconds"] = o.TtlSeconds
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *ValidatorChallengeView) UnmarshalJSON(data []byte) (err error) {
|
|
varValidatorChallengeView := _ValidatorChallengeView{}
|
|
|
|
err = json.Unmarshal(data, &varValidatorChallengeView)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = ValidatorChallengeView(varValidatorChallengeView)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "expiresAt")
|
|
delete(additionalProperties, "message")
|
|
delete(additionalProperties, "nonce")
|
|
delete(additionalProperties, "tokenId")
|
|
delete(additionalProperties, "ttlSeconds")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableValidatorChallengeView struct {
|
|
value *ValidatorChallengeView
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableValidatorChallengeView) Get() *ValidatorChallengeView {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableValidatorChallengeView) Set(val *ValidatorChallengeView) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableValidatorChallengeView) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableValidatorChallengeView) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableValidatorChallengeView(val *ValidatorChallengeView) *NullableValidatorChallengeView {
|
|
return &NullableValidatorChallengeView{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableValidatorChallengeView) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableValidatorChallengeView) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|