/* 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 TransactionOutputModel type satisfies the MappedNullable interface at compile time var _ MappedNullable = &TransactionOutputModel{} // TransactionOutputModel struct for TransactionOutputModel type TransactionOutputModel struct { Amount *int32 `json:"amount,omitempty"` GlobalIndex *int32 `json:"global_index,omitempty"` IsSpent *bool `json:"is_spent,omitempty"` MinimumSigs *int32 `json:"minimum_sigs,omitempty"` PubKeys []string `json:"pub_keys,omitempty"` AdditionalProperties map[string]interface{} } type _TransactionOutputModel TransactionOutputModel // NewTransactionOutputModel instantiates a new TransactionOutputModel 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 NewTransactionOutputModel() *TransactionOutputModel { this := TransactionOutputModel{} return &this } // NewTransactionOutputModelWithDefaults instantiates a new TransactionOutputModel 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 NewTransactionOutputModelWithDefaults() *TransactionOutputModel { this := TransactionOutputModel{} return &this } // GetAmount returns the Amount field value if set, zero value otherwise. func (o *TransactionOutputModel) 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 *TransactionOutputModel) 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 *TransactionOutputModel) 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 *TransactionOutputModel) SetAmount(v int32) { o.Amount = &v } // GetGlobalIndex returns the GlobalIndex field value if set, zero value otherwise. func (o *TransactionOutputModel) GetGlobalIndex() int32 { if o == nil || IsNil(o.GlobalIndex) { var ret int32 return ret } return *o.GlobalIndex } // GetGlobalIndexOk returns a tuple with the GlobalIndex field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TransactionOutputModel) GetGlobalIndexOk() (*int32, bool) { if o == nil || IsNil(o.GlobalIndex) { return nil, false } return o.GlobalIndex, true } // HasGlobalIndex returns a boolean if a field has been set. func (o *TransactionOutputModel) HasGlobalIndex() bool { if o != nil && !IsNil(o.GlobalIndex) { return true } return false } // SetGlobalIndex gets a reference to the given int32 and assigns it to the GlobalIndex field. func (o *TransactionOutputModel) SetGlobalIndex(v int32) { o.GlobalIndex = &v } // GetIsSpent returns the IsSpent field value if set, zero value otherwise. func (o *TransactionOutputModel) GetIsSpent() bool { if o == nil || IsNil(o.IsSpent) { var ret bool return ret } return *o.IsSpent } // GetIsSpentOk returns a tuple with the IsSpent field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TransactionOutputModel) GetIsSpentOk() (*bool, bool) { if o == nil || IsNil(o.IsSpent) { return nil, false } return o.IsSpent, true } // HasIsSpent returns a boolean if a field has been set. func (o *TransactionOutputModel) HasIsSpent() bool { if o != nil && !IsNil(o.IsSpent) { return true } return false } // SetIsSpent gets a reference to the given bool and assigns it to the IsSpent field. func (o *TransactionOutputModel) SetIsSpent(v bool) { o.IsSpent = &v } // GetMinimumSigs returns the MinimumSigs field value if set, zero value otherwise. func (o *TransactionOutputModel) GetMinimumSigs() int32 { if o == nil || IsNil(o.MinimumSigs) { var ret int32 return ret } return *o.MinimumSigs } // GetMinimumSigsOk returns a tuple with the MinimumSigs field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TransactionOutputModel) GetMinimumSigsOk() (*int32, bool) { if o == nil || IsNil(o.MinimumSigs) { return nil, false } return o.MinimumSigs, true } // HasMinimumSigs returns a boolean if a field has been set. func (o *TransactionOutputModel) HasMinimumSigs() bool { if o != nil && !IsNil(o.MinimumSigs) { return true } return false } // SetMinimumSigs gets a reference to the given int32 and assigns it to the MinimumSigs field. func (o *TransactionOutputModel) SetMinimumSigs(v int32) { o.MinimumSigs = &v } // GetPubKeys returns the PubKeys field value if set, zero value otherwise. func (o *TransactionOutputModel) GetPubKeys() []string { if o == nil || IsNil(o.PubKeys) { var ret []string return ret } return o.PubKeys } // GetPubKeysOk returns a tuple with the PubKeys field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TransactionOutputModel) GetPubKeysOk() ([]string, bool) { if o == nil || IsNil(o.PubKeys) { return nil, false } return o.PubKeys, true } // HasPubKeys returns a boolean if a field has been set. func (o *TransactionOutputModel) HasPubKeys() bool { if o != nil && !IsNil(o.PubKeys) { return true } return false } // SetPubKeys gets a reference to the given []string and assigns it to the PubKeys field. func (o *TransactionOutputModel) SetPubKeys(v []string) { o.PubKeys = v } func (o TransactionOutputModel) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o TransactionOutputModel) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if !IsNil(o.Amount) { toSerialize["amount"] = o.Amount } if !IsNil(o.GlobalIndex) { toSerialize["global_index"] = o.GlobalIndex } if !IsNil(o.IsSpent) { toSerialize["is_spent"] = o.IsSpent } if !IsNil(o.MinimumSigs) { toSerialize["minimum_sigs"] = o.MinimumSigs } if !IsNil(o.PubKeys) { toSerialize["pub_keys"] = o.PubKeys } for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *TransactionOutputModel) UnmarshalJSON(data []byte) (err error) { varTransactionOutputModel := _TransactionOutputModel{} err = json.Unmarshal(data, &varTransactionOutputModel) if err != nil { return err } *o = TransactionOutputModel(varTransactionOutputModel) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "amount") delete(additionalProperties, "global_index") delete(additionalProperties, "is_spent") delete(additionalProperties, "minimum_sigs") delete(additionalProperties, "pub_keys") o.AdditionalProperties = additionalProperties } return err } type NullableTransactionOutputModel struct { value *TransactionOutputModel isSet bool } func (v NullableTransactionOutputModel) Get() *TransactionOutputModel { return v.value } func (v *NullableTransactionOutputModel) Set(val *TransactionOutputModel) { v.value = val v.isSet = true } func (v NullableTransactionOutputModel) IsSet() bool { return v.isSet } func (v *NullableTransactionOutputModel) Unset() { v.value = nil v.isSet = false } func NewNullableTransactionOutputModel(val *TransactionOutputModel) *NullableTransactionOutputModel { return &NullableTransactionOutputModel{value: val, isSet: true} } func (v NullableTransactionOutputModel) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableTransactionOutputModel) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }