Files
sdk/model_wallet_wallet.go

573 lines
17 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 WalletWallet type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &WalletWallet{}
// WalletWallet struct for WalletWallet
type WalletWallet struct {
// AccountID names the WalletAccount grouping. Required when creating a wallet and it must be an account of the caller's own org; empty in a lookup means no narrowing by account.
AccountId *string `json:"accountId,omitempty"`
// Address is the on-chain address. For kms/mpc/treasury it is the EOA a signature from this wallet recovers to; for safe it is the CREATE2 address of the Safe CONTRACT, which holds no key — its approvals recover to the MPC owner instead. Rotating a kms wallet mints a new key and therefore a NEW address, and funds and approvals at the old one do not follow; mpc, treasury and safe addresses are invariant under rotation.
Address *string `json:"address,omitempty"`
// Agent narrows within the org to one agent. Empty means the dimension is unused — the wallet belongs to the org (or project) at large.
Agent *string `json:"agent,omitempty"`
// Chain is the EVM chain the wallet is bound to, CAIP-2 \"eip155:<n>\" or a bare decimal chain id. Empty is chain-agnostic: the ring signs an unbound digest, and a Safe falls back to the Hanzo L1 (36963) because a Safe and its EIP-712 domain must be chain-bound.
Chain *string `json:"chain,omitempty"`
// CreatedAt is when the wallet was provisioned, Unix seconds. Listings order by it, newest first.
CreatedAt *int64 `json:"createdAt,omitempty"`
// Custody is the backend holding the signing material, fixed at creation: \"kms\" (a secp256k1 key sealed under KMS and opened in-process), \"mpc\" or \"treasury\" (an m-of-n threshold key on the deployed ring, which differ by governance and not by signing mechanics), or \"safe\" (a Safe contract owned by an MPC key). A kind the deployment has not wired refuses with 503 rather than fabricating a signature.
Custody *string `json:"custody,omitempty"`
// FinanceAccount is the finance ledger account bound to this wallet — the lookup that turns a ledger account back into an on-chain signer. Absent is the normal state and means unbound; the column is NULL until something binds it.
FinanceAccount *string `json:"financeAccount,omitempty"`
// ID is the wallet id, minted by the server as \"wal_\" + 24 hex. It is the last segment of the key ref, and it is the LEDGER SUBJECT an x402 payment into this wallet credits — so it names money as well as key material.
Id *string `json:"id,omitempty"`
// Name is the display label given at creation. It addresses nothing: the key ref is derived from the scope and the id, so renaming moves no material.
Name *string `json:"name,omitempty"`
// Org is the tenant. It is the hard isolation boundary, always present and never crossed, stamped from the validated principal rather than read from a request. It is also the first segment of the key ref, which is what stops another tenant from addressing this material.
Org *string `json:"org,omitempty"`
// Project narrows within the org to one project. On a wallet it is the caller's ambient X-Project-Id at creation and never a body field, so key material cannot be addressed under a scope no minter validated; the DEFAULT project collapses to empty, which is what keeps an org's default-scope wallet on the un-suffixed ref. Empty means the dimension is unused.
Project *string `json:"project,omitempty"`
// Tier is the wallet tier the ring keys its TierPolicy on: hot, warm, cold, gas, bridge, contract_admin, validator, quarantine or disaster_recovery. It defaults to hot and is refused at the boundary if it is none of the nine.
Tier *string `json:"tier,omitempty"`
AdditionalProperties map[string]interface{}
}
type _WalletWallet WalletWallet
// NewWalletWallet instantiates a new WalletWallet 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 NewWalletWallet() *WalletWallet {
this := WalletWallet{}
return &this
}
// NewWalletWalletWithDefaults instantiates a new WalletWallet 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 NewWalletWalletWithDefaults() *WalletWallet {
this := WalletWallet{}
return &this
}
// GetAccountId returns the AccountId field value if set, zero value otherwise.
func (o *WalletWallet) GetAccountId() string {
if o == nil || IsNil(o.AccountId) {
var ret string
return ret
}
return *o.AccountId
}
// GetAccountIdOk returns a tuple with the AccountId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WalletWallet) GetAccountIdOk() (*string, bool) {
if o == nil || IsNil(o.AccountId) {
return nil, false
}
return o.AccountId, true
}
// HasAccountId returns a boolean if a field has been set.
func (o *WalletWallet) HasAccountId() bool {
if o != nil && !IsNil(o.AccountId) {
return true
}
return false
}
// SetAccountId gets a reference to the given string and assigns it to the AccountId field.
func (o *WalletWallet) SetAccountId(v string) {
o.AccountId = &v
}
// GetAddress returns the Address field value if set, zero value otherwise.
func (o *WalletWallet) GetAddress() string {
if o == nil || IsNil(o.Address) {
var ret string
return ret
}
return *o.Address
}
// GetAddressOk returns a tuple with the Address field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WalletWallet) GetAddressOk() (*string, bool) {
if o == nil || IsNil(o.Address) {
return nil, false
}
return o.Address, true
}
// HasAddress returns a boolean if a field has been set.
func (o *WalletWallet) HasAddress() bool {
if o != nil && !IsNil(o.Address) {
return true
}
return false
}
// SetAddress gets a reference to the given string and assigns it to the Address field.
func (o *WalletWallet) SetAddress(v string) {
o.Address = &v
}
// GetAgent returns the Agent field value if set, zero value otherwise.
func (o *WalletWallet) GetAgent() string {
if o == nil || IsNil(o.Agent) {
var ret string
return ret
}
return *o.Agent
}
// GetAgentOk returns a tuple with the Agent field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WalletWallet) GetAgentOk() (*string, bool) {
if o == nil || IsNil(o.Agent) {
return nil, false
}
return o.Agent, true
}
// HasAgent returns a boolean if a field has been set.
func (o *WalletWallet) HasAgent() bool {
if o != nil && !IsNil(o.Agent) {
return true
}
return false
}
// SetAgent gets a reference to the given string and assigns it to the Agent field.
func (o *WalletWallet) SetAgent(v string) {
o.Agent = &v
}
// GetChain returns the Chain field value if set, zero value otherwise.
func (o *WalletWallet) 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 *WalletWallet) 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 *WalletWallet) 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 *WalletWallet) SetChain(v string) {
o.Chain = &v
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *WalletWallet) 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 *WalletWallet) 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 *WalletWallet) 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 *WalletWallet) SetCreatedAt(v int64) {
o.CreatedAt = &v
}
// GetCustody returns the Custody field value if set, zero value otherwise.
func (o *WalletWallet) GetCustody() string {
if o == nil || IsNil(o.Custody) {
var ret string
return ret
}
return *o.Custody
}
// GetCustodyOk returns a tuple with the Custody field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WalletWallet) GetCustodyOk() (*string, bool) {
if o == nil || IsNil(o.Custody) {
return nil, false
}
return o.Custody, true
}
// HasCustody returns a boolean if a field has been set.
func (o *WalletWallet) HasCustody() bool {
if o != nil && !IsNil(o.Custody) {
return true
}
return false
}
// SetCustody gets a reference to the given string and assigns it to the Custody field.
func (o *WalletWallet) SetCustody(v string) {
o.Custody = &v
}
// GetFinanceAccount returns the FinanceAccount field value if set, zero value otherwise.
func (o *WalletWallet) GetFinanceAccount() string {
if o == nil || IsNil(o.FinanceAccount) {
var ret string
return ret
}
return *o.FinanceAccount
}
// GetFinanceAccountOk returns a tuple with the FinanceAccount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WalletWallet) GetFinanceAccountOk() (*string, bool) {
if o == nil || IsNil(o.FinanceAccount) {
return nil, false
}
return o.FinanceAccount, true
}
// HasFinanceAccount returns a boolean if a field has been set.
func (o *WalletWallet) HasFinanceAccount() bool {
if o != nil && !IsNil(o.FinanceAccount) {
return true
}
return false
}
// SetFinanceAccount gets a reference to the given string and assigns it to the FinanceAccount field.
func (o *WalletWallet) SetFinanceAccount(v string) {
o.FinanceAccount = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *WalletWallet) 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 *WalletWallet) 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 *WalletWallet) 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 *WalletWallet) SetId(v string) {
o.Id = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *WalletWallet) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WalletWallet) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *WalletWallet) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *WalletWallet) SetName(v string) {
o.Name = &v
}
// GetOrg returns the Org field value if set, zero value otherwise.
func (o *WalletWallet) GetOrg() string {
if o == nil || IsNil(o.Org) {
var ret string
return ret
}
return *o.Org
}
// GetOrgOk returns a tuple with the Org field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WalletWallet) GetOrgOk() (*string, bool) {
if o == nil || IsNil(o.Org) {
return nil, false
}
return o.Org, true
}
// HasOrg returns a boolean if a field has been set.
func (o *WalletWallet) HasOrg() bool {
if o != nil && !IsNil(o.Org) {
return true
}
return false
}
// SetOrg gets a reference to the given string and assigns it to the Org field.
func (o *WalletWallet) SetOrg(v string) {
o.Org = &v
}
// GetProject returns the Project field value if set, zero value otherwise.
func (o *WalletWallet) GetProject() string {
if o == nil || IsNil(o.Project) {
var ret string
return ret
}
return *o.Project
}
// GetProjectOk returns a tuple with the Project field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WalletWallet) GetProjectOk() (*string, bool) {
if o == nil || IsNil(o.Project) {
return nil, false
}
return o.Project, true
}
// HasProject returns a boolean if a field has been set.
func (o *WalletWallet) HasProject() bool {
if o != nil && !IsNil(o.Project) {
return true
}
return false
}
// SetProject gets a reference to the given string and assigns it to the Project field.
func (o *WalletWallet) SetProject(v string) {
o.Project = &v
}
// GetTier returns the Tier field value if set, zero value otherwise.
func (o *WalletWallet) GetTier() string {
if o == nil || IsNil(o.Tier) {
var ret string
return ret
}
return *o.Tier
}
// GetTierOk returns a tuple with the Tier field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WalletWallet) GetTierOk() (*string, bool) {
if o == nil || IsNil(o.Tier) {
return nil, false
}
return o.Tier, true
}
// HasTier returns a boolean if a field has been set.
func (o *WalletWallet) HasTier() bool {
if o != nil && !IsNil(o.Tier) {
return true
}
return false
}
// SetTier gets a reference to the given string and assigns it to the Tier field.
func (o *WalletWallet) SetTier(v string) {
o.Tier = &v
}
func (o WalletWallet) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o WalletWallet) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.AccountId) {
toSerialize["accountId"] = o.AccountId
}
if !IsNil(o.Address) {
toSerialize["address"] = o.Address
}
if !IsNil(o.Agent) {
toSerialize["agent"] = o.Agent
}
if !IsNil(o.Chain) {
toSerialize["chain"] = o.Chain
}
if !IsNil(o.CreatedAt) {
toSerialize["createdAt"] = o.CreatedAt
}
if !IsNil(o.Custody) {
toSerialize["custody"] = o.Custody
}
if !IsNil(o.FinanceAccount) {
toSerialize["financeAccount"] = o.FinanceAccount
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Org) {
toSerialize["org"] = o.Org
}
if !IsNil(o.Project) {
toSerialize["project"] = o.Project
}
if !IsNil(o.Tier) {
toSerialize["tier"] = o.Tier
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *WalletWallet) UnmarshalJSON(data []byte) (err error) {
varWalletWallet := _WalletWallet{}
err = json.Unmarshal(data, &varWalletWallet)
if err != nil {
return err
}
*o = WalletWallet(varWalletWallet)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "accountId")
delete(additionalProperties, "address")
delete(additionalProperties, "agent")
delete(additionalProperties, "chain")
delete(additionalProperties, "createdAt")
delete(additionalProperties, "custody")
delete(additionalProperties, "financeAccount")
delete(additionalProperties, "id")
delete(additionalProperties, "name")
delete(additionalProperties, "org")
delete(additionalProperties, "project")
delete(additionalProperties, "tier")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableWalletWallet struct {
value *WalletWallet
isSet bool
}
func (v NullableWalletWallet) Get() *WalletWallet {
return v.value
}
func (v *NullableWalletWallet) Set(val *WalletWallet) {
v.value = val
v.isSet = true
}
func (v NullableWalletWallet) IsSet() bool {
return v.isSet
}
func (v *NullableWalletWallet) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableWalletWallet(val *WalletWallet) *NullableWalletWallet {
return &NullableWalletWallet{value: val, isSet: true}
}
func (v NullableWalletWallet) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableWalletWallet) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}