{{>partial_header}}
package {{packageName}}

{{#operations}}
import (
	"github.com/go-macaron/binding"

	"github.com/grafana/grafana/pkg/api/routing"
	"github.com/grafana/grafana/pkg/api/response"
	"github.com/grafana/grafana/pkg/models"
	apimodels "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
	"github.com/grafana/grafana/pkg/services/ngalert/metrics"
	"github.com/grafana/grafana/pkg/middleware"
)

type {{classname}}Service interface { {{#operation}}
	{{nickname}}(*models.ReqContext{{#bodyParams}}, apimodels.{{dataType}}{{/bodyParams}}) response.Response{{/operation}}
}

func (api *API) Register{{classname}}Endpoints(srv {{classname}}Service, m *metrics.Metrics) {
	api.RouteRegister.Group("", func(group routing.RouteRegister){ {{#operations}}{{#operation}}
	group.{{httpMethod}}(
		toMacaronPath("{{{path}}}"){{#bodyParams}},
		binding.Bind(apimodels.{{dataType}}{}){{/bodyParams}},
		metrics.Instrument(
			http.Method{{httpMethod}},
			"{{{path}}}",
			srv.{{nickname}},
			m,
		),
  ){{/operation}}{{/operations}}
	}, middleware.ReqSignedIn)
}{{#operation}}
{{/operation}}{{/operations}}
