2024-06-11 17:28:20 -04:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"codeberg.org/vlbeaudoin/voki/v3"
|
|
|
|
)
|
|
|
|
|
|
|
|
type APIResponse struct {
|
|
|
|
voki.MessageResponse
|
|
|
|
statusCode int
|
|
|
|
}
|
|
|
|
|
|
|
|
func (R APIResponse) StatusCode() int { return R.statusCode }
|
|
|
|
|
|
|
|
func (R *APIResponse) SetStatusCode(code int) error {
|
|
|
|
if code <= 0 {
|
|
|
|
return fmt.Errorf("Cannot set status code to %d", code)
|
|
|
|
}
|
|
|
|
R.statusCode = code
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type HealthGETResponse struct {
|
|
|
|
APIResponse
|
|
|
|
}
|
|
|
|
|
|
|
|
type MembreGETResponse struct {
|
|
|
|
APIResponse
|
|
|
|
Data MembreGETResponseData `json:"data"`
|
|
|
|
}
|
|
|
|
type MembreGETResponseData struct {
|
|
|
|
Membre Membre `json:"membre"`
|
|
|
|
}
|
|
|
|
|
2024-06-18 22:51:20 -04:00
|
|
|
type MembrePreferedNamePUTResponse struct {
|
|
|
|
APIResponse
|
|
|
|
}
|
|
|
|
|
2024-06-11 17:28:20 -04:00
|
|
|
type MembresGETResponse struct {
|
|
|
|
APIResponse
|
|
|
|
Data MembresGETResponseData `json:"data"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type MembresGETResponseData struct {
|
|
|
|
Membres []Membre `json:"membres"`
|
|
|
|
}
|
|
|
|
|
2024-06-20 18:51:38 -04:00
|
|
|
type MembreDisplayGETResponse struct {
|
|
|
|
APIResponse
|
|
|
|
Data MembreDisplayGETResponseData `json:"data"`
|
|
|
|
}
|
|
|
|
type MembreDisplayGETResponseData struct {
|
|
|
|
Membre MembreForDisplay `json:"membre_for_display"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type MembresDisplayGETResponse struct {
|
|
|
|
APIResponse
|
|
|
|
Data MembresDisplayGETResponseData `json:"data"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type MembresDisplayGETResponseData struct {
|
|
|
|
Membres []MembreForDisplay `json:"membres_for_display"`
|
|
|
|
}
|
|
|
|
|
2024-06-11 17:28:20 -04:00
|
|
|
type MembresPOSTResponse struct {
|
|
|
|
APIResponse
|
|
|
|
Data MembresPOSTResponseData `json:"data"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type MembresPOSTResponseData struct {
|
|
|
|
MembresInserted int64 `json:"membres_inserted"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type ProgrammesPOSTResponse struct {
|
|
|
|
APIResponse
|
|
|
|
Data ProgrammesPOSTResponseData `json:"data"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type ProgrammesPOSTResponseData struct {
|
|
|
|
ProgrammesInserted int64 `json:"programmes_inserted"`
|
|
|
|
}
|
2024-06-18 22:51:32 -04:00
|
|
|
|
|
|
|
type ProgrammesGETResponse struct {
|
|
|
|
APIResponse
|
|
|
|
Data ProgrammesGETResponseData `json:"data"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type ProgrammesGETResponseData struct {
|
|
|
|
Programmes []Programme `json:"programmes"`
|
|
|
|
}
|