Files
stack/releases/sdks/go/pkg/models/shared/v2migrationinfo.go

83 lines
1.6 KiB
Go

// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
package shared
import (
"encoding/json"
"fmt"
"github.com/formancehq/formance-sdk-go/v2/pkg/utils"
"time"
)
type V2MigrationInfoState string
const (
V2MigrationInfoStateToDo V2MigrationInfoState = "TO DO"
V2MigrationInfoStateDone V2MigrationInfoState = "DONE"
)
func (e V2MigrationInfoState) ToPointer() *V2MigrationInfoState {
return &e
}
func (e *V2MigrationInfoState) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "TO DO":
fallthrough
case "DONE":
*e = V2MigrationInfoState(v)
return nil
default:
return fmt.Errorf("invalid value for V2MigrationInfoState: %v", v)
}
}
type V2MigrationInfo struct {
Date *time.Time `json:"date,omitempty"`
Name *string `json:"name,omitempty"`
State *V2MigrationInfoState `json:"state,omitempty"`
Version *int64 `json:"version,omitempty"`
}
func (v V2MigrationInfo) MarshalJSON() ([]byte, error) {
return utils.MarshalJSON(v, "", false)
}
func (v *V2MigrationInfo) UnmarshalJSON(data []byte) error {
if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil {
return err
}
return nil
}
func (o *V2MigrationInfo) GetDate() *time.Time {
if o == nil {
return nil
}
return o.Date
}
func (o *V2MigrationInfo) GetName() *string {
if o == nil {
return nil
}
return o.Name
}
func (o *V2MigrationInfo) GetState() *V2MigrationInfoState {
if o == nil {
return nil
}
return o.State
}
func (o *V2MigrationInfo) GetVersion() *int64 {
if o == nil {
return nil
}
return o.Version
}