You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
786 B
Go

package mobilizon
import (
"time"
)
type DateTime struct {
time.Time
}
func (t DateTime) MarshalJSON() ([]byte, error) {
return []byte("\"" + t.Format(time.RFC3339) + "\""), nil
}
func (e Event) AsInput() *EventInput {
return &EventInput{
Event: e,
PhysicalAddress: AddressInput{
Address: e.PhysicalAddress,
},
Picture: MediaInput{
Media: MediaInputObj{
File: Upload("pic"),
Name: e.Picture.Name,
},
},
}
}
type EventInput struct {
Event
Picture MediaInput
PhysicalAddress AddressInput
}
type AddressInput struct {
Address
}
type MediaInput struct {
Media MediaInputObj
// MediaId ID // NOTE: this breaks things
}
type MediaInputObj struct {
File Upload
Name String
Alt String
ActorID ID
}
type Upload string