mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-06-15 19:38:50 -04:00
* refactor the jmap package to split it into several files as the
jmap.api.go file was becoming too unwieldy
* refactor the Groupware handler function response to be a Response
object, to be more future-proof and avoid adding more and more
return parameters while handling "no content" response as well
* more godoc for the JMAP model
* add Email creation, updating, deleting (Email/set,
EmailSubmission/set)
* add endpoints
- POST /accounts/{accountid}/messages
- PATCH|PUT /accounts/{accountid}/messages/{messageid}
- DELETE /accounts/{accountid}/messages/{messageid}
40 lines
1.0 KiB
Go
40 lines
1.0 KiB
Go
package groupware
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/opencloud-eu/opencloud/pkg/jmap"
|
|
)
|
|
|
|
// When the request succeeds.
|
|
// swagger:response VacationResponse200
|
|
type SwaggerVacationResponse200 struct {
|
|
// in: body
|
|
Body struct {
|
|
*jmap.VacationResponseGetResponse
|
|
}
|
|
}
|
|
|
|
// swagger:route GET /accounts/{account}/vacation vacation
|
|
// Get vacation notice information.
|
|
//
|
|
// A vacation response sends an automatic reply when a message is delivered to the mail store, informing the original
|
|
// sender that their message may not be read for some time.
|
|
//
|
|
// The VacationResponse object represents the state of vacation-response-related settings for an account.
|
|
//
|
|
// responses:
|
|
//
|
|
// 200: VacationResponse200
|
|
// 400: ErrorResponse400
|
|
// 500: ErrorResponse500
|
|
func (g Groupware) GetVacation(w http.ResponseWriter, r *http.Request) {
|
|
g.respond(w, r, func(req Request) Response {
|
|
res, err := g.jmap.GetVacationResponse(req.GetAccountId(), req.session, req.ctx, req.logger)
|
|
if err != nil {
|
|
return req.errorResponseFromJmap(err)
|
|
}
|
|
return response(res, res.State)
|
|
})
|
|
}
|