76 lines
1.5 KiB
Go
76 lines
1.5 KiB
Go
package main
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
type dynamicObjectRequest struct {
|
|
Fields map[string]any
|
|
}
|
|
|
|
func (r *dynamicObjectRequest) UnmarshalJSON(data []byte) error {
|
|
var payload map[string]any
|
|
if err := json.Unmarshal(data, &payload); err != nil {
|
|
return err
|
|
}
|
|
r.Fields = payload
|
|
return nil
|
|
}
|
|
|
|
func (r dynamicObjectRequest) Doc() Doc {
|
|
if r.Fields == nil {
|
|
return Doc{}
|
|
}
|
|
return Doc(r.Fields)
|
|
}
|
|
|
|
type formUpsertRequest struct {
|
|
dynamicObjectRequest
|
|
}
|
|
|
|
type liveCourseUpsertRequest struct {
|
|
dynamicObjectRequest
|
|
}
|
|
|
|
type liveCourseCohortUpsertRequest struct {
|
|
dynamicObjectRequest
|
|
}
|
|
|
|
type liveCourseSessionUpsertRequest struct {
|
|
dynamicObjectRequest
|
|
}
|
|
|
|
type liveCourseEnrollmentUpsertRequest struct {
|
|
dynamicObjectRequest
|
|
}
|
|
|
|
type liveCourseAttendanceUpsertRequest struct {
|
|
dynamicObjectRequest
|
|
}
|
|
|
|
type publicFormResponse struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
Description string `json:"description,omitempty"`
|
|
Schema any `json:"schema"`
|
|
}
|
|
|
|
type publicFormSubmissionCreateResponse struct {
|
|
ID string `json:"id"`
|
|
FormID string `json:"formId"`
|
|
SubmittedAt int64 `json:"submittedAt"`
|
|
}
|
|
|
|
type learnerLiveCourseJoinResponse struct {
|
|
Allowed bool `json:"allowed"`
|
|
CourseID string `json:"courseId"`
|
|
SessionID string `json:"sessionId"`
|
|
JoinURL string `json:"joinUrl"`
|
|
}
|
|
|
|
type billingWebhookResponse struct {
|
|
Status string `json:"status"`
|
|
EventID string `json:"eventId"`
|
|
Message string `json:"message"`
|
|
}
|