added trust mode parameter to json-rpc mode

see #240
This commit is contained in:
Bernhard B
2022-05-08 20:23:54 +02:00
parent 25775a4c10
commit 798f897ad1
9 changed files with 314 additions and 4 deletions

View File

@@ -1439,6 +1439,16 @@ func (a *Api) AddDevice(c *gin.Context) {
c.Status(http.StatusNoContent)
}
// @Summary Set account specific settings.
// @Tags General
// @Description Set account specific settings.
// @Accept json
// @Produce json
// @Param number path string true "Registered Phone Number"
// @Success 204
// @Param data body TrustModeRequest true "Request"
// @Failure 400 {object} Error
// @Router /v1/configuration/{number}/settings [post]
func (a *Api) SetTrustMode(c *gin.Context) {
number := c.Param("number")
if number == "" {
@@ -1468,6 +1478,16 @@ func (a *Api) SetTrustMode(c *gin.Context) {
c.Status(http.StatusNoContent)
}
// @Summary List account specific settings.
// @Tags General
// @Description List account specific settings.
// @Accept json
// @Produce json
// @Param number path string true "Registered Phone Number"
// @Success 200
// @Param data body TrustModeResponse true "Request"
// @Failure 400 {object} Error
// @Router /v1/configuration/{number}/settings [get]
func (a *Api) GetTrustMode(c *gin.Context) {
number := c.Param("number")
if number == "" {