mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
307 lines
7.7 KiB
Go
307 lines
7.7 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 WalletSafeTxIn type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &WalletSafeTxIn{}
|
|
|
|
// WalletSafeTxIn struct for WalletSafeTxIn
|
|
type WalletSafeTxIn struct {
|
|
// ChainID is the EVM chain the Safe transaction is bound to. 0 uses the wallet's own chain, or the Hanzo L1 (36963) when it is chain-agnostic.
|
|
ChainId *int64 `json:"chainId,omitempty"`
|
|
// Data is the call data, hex-encoded.
|
|
Data *string `json:"data,omitempty"`
|
|
// Nonce is the Safe's transaction nonce.
|
|
Nonce *int64 `json:"nonce,omitempty"`
|
|
// To is the transaction's target address.
|
|
To *string `json:"to,omitempty"`
|
|
// Value is the native-token amount to send, as a decimal string in wei.
|
|
Value *string `json:"value,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _WalletSafeTxIn WalletSafeTxIn
|
|
|
|
// NewWalletSafeTxIn instantiates a new WalletSafeTxIn 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 NewWalletSafeTxIn() *WalletSafeTxIn {
|
|
this := WalletSafeTxIn{}
|
|
return &this
|
|
}
|
|
|
|
// NewWalletSafeTxInWithDefaults instantiates a new WalletSafeTxIn 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 NewWalletSafeTxInWithDefaults() *WalletSafeTxIn {
|
|
this := WalletSafeTxIn{}
|
|
return &this
|
|
}
|
|
|
|
// GetChainId returns the ChainId field value if set, zero value otherwise.
|
|
func (o *WalletSafeTxIn) GetChainId() int64 {
|
|
if o == nil || IsNil(o.ChainId) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.ChainId
|
|
}
|
|
|
|
// GetChainIdOk returns a tuple with the ChainId field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WalletSafeTxIn) GetChainIdOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.ChainId) {
|
|
return nil, false
|
|
}
|
|
return o.ChainId, true
|
|
}
|
|
|
|
// HasChainId returns a boolean if a field has been set.
|
|
func (o *WalletSafeTxIn) HasChainId() bool {
|
|
if o != nil && !IsNil(o.ChainId) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetChainId gets a reference to the given int64 and assigns it to the ChainId field.
|
|
func (o *WalletSafeTxIn) SetChainId(v int64) {
|
|
o.ChainId = &v
|
|
}
|
|
|
|
// GetData returns the Data field value if set, zero value otherwise.
|
|
func (o *WalletSafeTxIn) GetData() string {
|
|
if o == nil || IsNil(o.Data) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Data
|
|
}
|
|
|
|
// GetDataOk returns a tuple with the Data field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WalletSafeTxIn) GetDataOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Data) {
|
|
return nil, false
|
|
}
|
|
return o.Data, true
|
|
}
|
|
|
|
// HasData returns a boolean if a field has been set.
|
|
func (o *WalletSafeTxIn) HasData() bool {
|
|
if o != nil && !IsNil(o.Data) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetData gets a reference to the given string and assigns it to the Data field.
|
|
func (o *WalletSafeTxIn) SetData(v string) {
|
|
o.Data = &v
|
|
}
|
|
|
|
// GetNonce returns the Nonce field value if set, zero value otherwise.
|
|
func (o *WalletSafeTxIn) GetNonce() int64 {
|
|
if o == nil || IsNil(o.Nonce) {
|
|
var ret int64
|
|
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 *WalletSafeTxIn) GetNonceOk() (*int64, 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 *WalletSafeTxIn) HasNonce() bool {
|
|
if o != nil && !IsNil(o.Nonce) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetNonce gets a reference to the given int64 and assigns it to the Nonce field.
|
|
func (o *WalletSafeTxIn) SetNonce(v int64) {
|
|
o.Nonce = &v
|
|
}
|
|
|
|
// GetTo returns the To field value if set, zero value otherwise.
|
|
func (o *WalletSafeTxIn) GetTo() string {
|
|
if o == nil || IsNil(o.To) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.To
|
|
}
|
|
|
|
// GetToOk returns a tuple with the To field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WalletSafeTxIn) GetToOk() (*string, bool) {
|
|
if o == nil || IsNil(o.To) {
|
|
return nil, false
|
|
}
|
|
return o.To, true
|
|
}
|
|
|
|
// HasTo returns a boolean if a field has been set.
|
|
func (o *WalletSafeTxIn) HasTo() bool {
|
|
if o != nil && !IsNil(o.To) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTo gets a reference to the given string and assigns it to the To field.
|
|
func (o *WalletSafeTxIn) SetTo(v string) {
|
|
o.To = &v
|
|
}
|
|
|
|
// GetValue returns the Value field value if set, zero value otherwise.
|
|
func (o *WalletSafeTxIn) GetValue() string {
|
|
if o == nil || IsNil(o.Value) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Value
|
|
}
|
|
|
|
// GetValueOk returns a tuple with the Value field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WalletSafeTxIn) GetValueOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Value) {
|
|
return nil, false
|
|
}
|
|
return o.Value, true
|
|
}
|
|
|
|
// HasValue returns a boolean if a field has been set.
|
|
func (o *WalletSafeTxIn) HasValue() bool {
|
|
if o != nil && !IsNil(o.Value) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetValue gets a reference to the given string and assigns it to the Value field.
|
|
func (o *WalletSafeTxIn) SetValue(v string) {
|
|
o.Value = &v
|
|
}
|
|
|
|
func (o WalletSafeTxIn) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o WalletSafeTxIn) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.ChainId) {
|
|
toSerialize["chainId"] = o.ChainId
|
|
}
|
|
if !IsNil(o.Data) {
|
|
toSerialize["data"] = o.Data
|
|
}
|
|
if !IsNil(o.Nonce) {
|
|
toSerialize["nonce"] = o.Nonce
|
|
}
|
|
if !IsNil(o.To) {
|
|
toSerialize["to"] = o.To
|
|
}
|
|
if !IsNil(o.Value) {
|
|
toSerialize["value"] = o.Value
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *WalletSafeTxIn) UnmarshalJSON(data []byte) (err error) {
|
|
varWalletSafeTxIn := _WalletSafeTxIn{}
|
|
|
|
err = json.Unmarshal(data, &varWalletSafeTxIn)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = WalletSafeTxIn(varWalletSafeTxIn)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "chainId")
|
|
delete(additionalProperties, "data")
|
|
delete(additionalProperties, "nonce")
|
|
delete(additionalProperties, "to")
|
|
delete(additionalProperties, "value")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableWalletSafeTxIn struct {
|
|
value *WalletSafeTxIn
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableWalletSafeTxIn) Get() *WalletSafeTxIn {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableWalletSafeTxIn) Set(val *WalletSafeTxIn) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableWalletSafeTxIn) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableWalletSafeTxIn) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableWalletSafeTxIn(val *WalletSafeTxIn) *NullableWalletSafeTxIn {
|
|
return &NullableWalletSafeTxIn{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableWalletSafeTxIn) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableWalletSafeTxIn) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|