1
0
Fork 0
forked from lthn/blockchain
blockchain/utils/sdk/client/go/model_transaction_input_model.go

304 lines
8.3 KiB
Go
Raw Permalink Normal View History

/*
Lethean Blockchain API
OpenAPI for Lethean Blockchain
API version: 6.0.1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package lthn
import (
"encoding/json"
)
// checks if the TransactionInputModel type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TransactionInputModel{}
// TransactionInputModel struct for TransactionInputModel
type TransactionInputModel struct {
Amount *int32 `json:"amount,omitempty"`
GlobalIndexes []int32 `json:"global_indexes,omitempty"`
HtlcOrigin *string `json:"htlc_origin,omitempty"`
KimageOrMsId *string `json:"kimage_or_ms_id,omitempty"`
MultisigCount *int32 `json:"multisig_count,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TransactionInputModel TransactionInputModel
// NewTransactionInputModel instantiates a new TransactionInputModel 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 NewTransactionInputModel() *TransactionInputModel {
this := TransactionInputModel{}
return &this
}
// NewTransactionInputModelWithDefaults instantiates a new TransactionInputModel 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 NewTransactionInputModelWithDefaults() *TransactionInputModel {
this := TransactionInputModel{}
return &this
}
// GetAmount returns the Amount field value if set, zero value otherwise.
func (o *TransactionInputModel) GetAmount() int32 {
if o == nil || IsNil(o.Amount) {
var ret int32
return ret
}
return *o.Amount
}
// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TransactionInputModel) GetAmountOk() (*int32, bool) {
if o == nil || IsNil(o.Amount) {
return nil, false
}
return o.Amount, true
}
// HasAmount returns a boolean if a field has been set.
func (o *TransactionInputModel) HasAmount() bool {
if o != nil && !IsNil(o.Amount) {
return true
}
return false
}
// SetAmount gets a reference to the given int32 and assigns it to the Amount field.
func (o *TransactionInputModel) SetAmount(v int32) {
o.Amount = &v
}
// GetGlobalIndexes returns the GlobalIndexes field value if set, zero value otherwise.
func (o *TransactionInputModel) GetGlobalIndexes() []int32 {
if o == nil || IsNil(o.GlobalIndexes) {
var ret []int32
return ret
}
return o.GlobalIndexes
}
// GetGlobalIndexesOk returns a tuple with the GlobalIndexes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TransactionInputModel) GetGlobalIndexesOk() ([]int32, bool) {
if o == nil || IsNil(o.GlobalIndexes) {
return nil, false
}
return o.GlobalIndexes, true
}
// HasGlobalIndexes returns a boolean if a field has been set.
func (o *TransactionInputModel) HasGlobalIndexes() bool {
if o != nil && !IsNil(o.GlobalIndexes) {
return true
}
return false
}
// SetGlobalIndexes gets a reference to the given []int32 and assigns it to the GlobalIndexes field.
func (o *TransactionInputModel) SetGlobalIndexes(v []int32) {
o.GlobalIndexes = v
}
// GetHtlcOrigin returns the HtlcOrigin field value if set, zero value otherwise.
func (o *TransactionInputModel) GetHtlcOrigin() string {
if o == nil || IsNil(o.HtlcOrigin) {
var ret string
return ret
}
return *o.HtlcOrigin
}
// GetHtlcOriginOk returns a tuple with the HtlcOrigin field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TransactionInputModel) GetHtlcOriginOk() (*string, bool) {
if o == nil || IsNil(o.HtlcOrigin) {
return nil, false
}
return o.HtlcOrigin, true
}
// HasHtlcOrigin returns a boolean if a field has been set.
func (o *TransactionInputModel) HasHtlcOrigin() bool {
if o != nil && !IsNil(o.HtlcOrigin) {
return true
}
return false
}
// SetHtlcOrigin gets a reference to the given string and assigns it to the HtlcOrigin field.
func (o *TransactionInputModel) SetHtlcOrigin(v string) {
o.HtlcOrigin = &v
}
// GetKimageOrMsId returns the KimageOrMsId field value if set, zero value otherwise.
func (o *TransactionInputModel) GetKimageOrMsId() string {
if o == nil || IsNil(o.KimageOrMsId) {
var ret string
return ret
}
return *o.KimageOrMsId
}
// GetKimageOrMsIdOk returns a tuple with the KimageOrMsId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TransactionInputModel) GetKimageOrMsIdOk() (*string, bool) {
if o == nil || IsNil(o.KimageOrMsId) {
return nil, false
}
return o.KimageOrMsId, true
}
// HasKimageOrMsId returns a boolean if a field has been set.
func (o *TransactionInputModel) HasKimageOrMsId() bool {
if o != nil && !IsNil(o.KimageOrMsId) {
return true
}
return false
}
// SetKimageOrMsId gets a reference to the given string and assigns it to the KimageOrMsId field.
func (o *TransactionInputModel) SetKimageOrMsId(v string) {
o.KimageOrMsId = &v
}
// GetMultisigCount returns the MultisigCount field value if set, zero value otherwise.
func (o *TransactionInputModel) GetMultisigCount() int32 {
if o == nil || IsNil(o.MultisigCount) {
var ret int32
return ret
}
return *o.MultisigCount
}
// GetMultisigCountOk returns a tuple with the MultisigCount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TransactionInputModel) GetMultisigCountOk() (*int32, bool) {
if o == nil || IsNil(o.MultisigCount) {
return nil, false
}
return o.MultisigCount, true
}
// HasMultisigCount returns a boolean if a field has been set.
func (o *TransactionInputModel) HasMultisigCount() bool {
if o != nil && !IsNil(o.MultisigCount) {
return true
}
return false
}
// SetMultisigCount gets a reference to the given int32 and assigns it to the MultisigCount field.
func (o *TransactionInputModel) SetMultisigCount(v int32) {
o.MultisigCount = &v
}
func (o TransactionInputModel) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TransactionInputModel) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Amount) {
toSerialize["amount"] = o.Amount
}
if !IsNil(o.GlobalIndexes) {
toSerialize["global_indexes"] = o.GlobalIndexes
}
if !IsNil(o.HtlcOrigin) {
toSerialize["htlc_origin"] = o.HtlcOrigin
}
if !IsNil(o.KimageOrMsId) {
toSerialize["kimage_or_ms_id"] = o.KimageOrMsId
}
if !IsNil(o.MultisigCount) {
toSerialize["multisig_count"] = o.MultisigCount
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TransactionInputModel) UnmarshalJSON(data []byte) (err error) {
varTransactionInputModel := _TransactionInputModel{}
err = json.Unmarshal(data, &varTransactionInputModel)
if err != nil {
return err
}
*o = TransactionInputModel(varTransactionInputModel)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "amount")
delete(additionalProperties, "global_indexes")
delete(additionalProperties, "htlc_origin")
delete(additionalProperties, "kimage_or_ms_id")
delete(additionalProperties, "multisig_count")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTransactionInputModel struct {
value *TransactionInputModel
isSet bool
}
func (v NullableTransactionInputModel) Get() *TransactionInputModel {
return v.value
}
func (v *NullableTransactionInputModel) Set(val *TransactionInputModel) {
v.value = val
v.isSet = true
}
func (v NullableTransactionInputModel) IsSet() bool {
return v.isSet
}
func (v *NullableTransactionInputModel) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTransactionInputModel(val *TransactionInputModel) *NullableTransactionInputModel {
return &NullableTransactionInputModel{value: val, isSet: true}
}
func (v NullableTransactionInputModel) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTransactionInputModel) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}