mirror of
https://github.com/hanzo-fi/stack.git
synced 2026-10-30 20:34:43 +00:00
72 lines
1.4 KiB
Go
72 lines
1.4 KiB
Go
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
|
|
package shared
|
|
|
|
import (
|
|
"github.com/formancehq/formance-sdk-go/v2/pkg/utils"
|
|
"math/big"
|
|
"time"
|
|
)
|
|
|
|
type V2Transaction struct {
|
|
ID *big.Int `json:"id"`
|
|
Metadata map[string]string `json:"metadata"`
|
|
Postings []V2Posting `json:"postings"`
|
|
Reference *string `json:"reference,omitempty"`
|
|
Reverted bool `json:"reverted"`
|
|
Timestamp time.Time `json:"timestamp"`
|
|
}
|
|
|
|
func (v V2Transaction) MarshalJSON() ([]byte, error) {
|
|
return utils.MarshalJSON(v, "", false)
|
|
}
|
|
|
|
func (v *V2Transaction) UnmarshalJSON(data []byte) error {
|
|
if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (o *V2Transaction) GetID() *big.Int {
|
|
if o == nil {
|
|
return big.NewInt(0)
|
|
}
|
|
return o.ID
|
|
}
|
|
|
|
func (o *V2Transaction) GetMetadata() map[string]string {
|
|
if o == nil {
|
|
return map[string]string{}
|
|
}
|
|
return o.Metadata
|
|
}
|
|
|
|
func (o *V2Transaction) GetPostings() []V2Posting {
|
|
if o == nil {
|
|
return []V2Posting{}
|
|
}
|
|
return o.Postings
|
|
}
|
|
|
|
func (o *V2Transaction) GetReference() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Reference
|
|
}
|
|
|
|
func (o *V2Transaction) GetReverted() bool {
|
|
if o == nil {
|
|
return false
|
|
}
|
|
return o.Reverted
|
|
}
|
|
|
|
func (o *V2Transaction) GetTimestamp() time.Time {
|
|
if o == nil {
|
|
return time.Time{}
|
|
}
|
|
return o.Timestamp
|
|
}
|