// Code generated by protoc-gen-grpc-api-gateway. DO NOT EDIT.
// source: ark/v1/admin.proto

/*
Package arkv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.
*/
package arkv1

import (
	"context"
	"io"
	"net/http"

	"github.com/meshapi/grpc-api-gateway/gateway"
	"github.com/meshapi/grpc-api-gateway/protoconvert"
	"github.com/meshapi/grpc-api-gateway/trie"
	"google.golang.org/grpc"
	"google.golang.org/grpc/grpclog"
	"google.golang.org/protobuf/proto"
)

func request_AdminService_GetScheduledSweep_0(ctx context.Context, marshaler gateway.Marshaler, mux *gateway.ServeMux, client AdminServiceClient, req *http.Request, pathParams gateway.Params) (proto.Message, gateway.ServerMetadata, error) {
	var protoReq GetScheduledSweepRequest
	var metadata gateway.ServerMetadata

	msg, err := client.GetScheduledSweep(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}

func request_AdminService_GetRoundDetails_0(ctx context.Context, marshaler gateway.Marshaler, mux *gateway.ServeMux, client AdminServiceClient, req *http.Request, pathParams gateway.Params) (proto.Message, gateway.ServerMetadata, error) {
	var protoReq GetRoundDetailsRequest
	var metadata gateway.ServerMetadata

	var (
		val string
		err error
		_   = err
	)

	val = pathParams.ByName("round_id")
	if val == "" {
		return nil, metadata, gateway.ErrPathParameterMissing{Name: "round_id"}
	}

	protoReq.RoundId, err = protoconvert.String(val)
	if err != nil {
		return nil, metadata, gateway.ErrPathParameterTypeMismatch{Err: err, Name: "round_id"}
	}

	msg, err := client.GetRoundDetails(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}

var (
	query_params_AdminService_GetRounds_0 = gateway.QueryParameterParseOptions{
		Filter: trie.New(),
	}
)

func request_AdminService_GetRounds_0(ctx context.Context, marshaler gateway.Marshaler, mux *gateway.ServeMux, client AdminServiceClient, req *http.Request, pathParams gateway.Params) (proto.Message, gateway.ServerMetadata, error) {
	var protoReq GetRoundsRequest
	var metadata gateway.ServerMetadata

	if err := req.ParseForm(); err != nil {
		return nil, metadata, gateway.ErrInvalidQueryParameters{Err: err}
	}
	if err := mux.PopulateQueryParameters(&protoReq, req.Form, query_params_AdminService_GetRounds_0); err != nil {
		return nil, metadata, gateway.ErrInvalidQueryParameters{Err: err}
	}

	msg, err := client.GetRounds(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}

func request_AdminService_CreateNote_0(ctx context.Context, marshaler gateway.Marshaler, mux *gateway.ServeMux, client AdminServiceClient, req *http.Request, pathParams gateway.Params) (proto.Message, gateway.ServerMetadata, error) {
	var protoReq CreateNoteRequest
	var metadata gateway.ServerMetadata

	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF {
		return nil, metadata, gateway.ErrMarshal{Err: err, Inbound: true}
	}

	msg, err := client.CreateNote(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}

func request_AdminService_GetScheduledSessionConfig_0(ctx context.Context, marshaler gateway.Marshaler, mux *gateway.ServeMux, client AdminServiceClient, req *http.Request, pathParams gateway.Params) (proto.Message, gateway.ServerMetadata, error) {
	var protoReq GetScheduledSessionConfigRequest
	var metadata gateway.ServerMetadata

	msg, err := client.GetScheduledSessionConfig(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}

func request_AdminService_UpdateScheduledSessionConfig_0(ctx context.Context, marshaler gateway.Marshaler, mux *gateway.ServeMux, client AdminServiceClient, req *http.Request, pathParams gateway.Params) (proto.Message, gateway.ServerMetadata, error) {
	var protoReq UpdateScheduledSessionConfigRequest
	var metadata gateway.ServerMetadata

	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF {
		return nil, metadata, gateway.ErrMarshal{Err: err, Inbound: true}
	}

	msg, err := client.UpdateScheduledSessionConfig(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}

var (
	query_params_AdminService_ListIntents_0 = gateway.QueryParameterParseOptions{
		Filter: trie.New(),
	}
)

func request_AdminService_ListIntents_0(ctx context.Context, marshaler gateway.Marshaler, mux *gateway.ServeMux, client AdminServiceClient, req *http.Request, pathParams gateway.Params) (proto.Message, gateway.ServerMetadata, error) {
	var protoReq ListIntentsRequest
	var metadata gateway.ServerMetadata

	if err := req.ParseForm(); err != nil {
		return nil, metadata, gateway.ErrInvalidQueryParameters{Err: err}
	}
	if err := mux.PopulateQueryParameters(&protoReq, req.Form, query_params_AdminService_ListIntents_0); err != nil {
		return nil, metadata, gateway.ErrInvalidQueryParameters{Err: err}
	}

	msg, err := client.ListIntents(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}

func request_AdminService_DeleteIntents_0(ctx context.Context, marshaler gateway.Marshaler, mux *gateway.ServeMux, client AdminServiceClient, req *http.Request, pathParams gateway.Params) (proto.Message, gateway.ServerMetadata, error) {
	var protoReq DeleteIntentsRequest
	var metadata gateway.ServerMetadata

	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF {
		return nil, metadata, gateway.ErrMarshal{Err: err, Inbound: true}
	}

	msg, err := client.DeleteIntents(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}

func request_AdminService_GetConvictions_0(ctx context.Context, marshaler gateway.Marshaler, mux *gateway.ServeMux, client AdminServiceClient, req *http.Request, pathParams gateway.Params) (proto.Message, gateway.ServerMetadata, error) {
	var protoReq GetConvictionsRequest
	var metadata gateway.ServerMetadata

	var (
		val string
		err error
		_   = err
	)

	val = pathParams.ByName("ids")
	if val == "" {
		return nil, metadata, gateway.ErrPathParameterMissing{Name: "ids"}
	}

	protoReq.Ids, err = protoconvert.StringSlice(val, ",")
	if err != nil {
		return nil, metadata, gateway.ErrPathParameterTypeMismatch{Err: err, Name: "ids"}
	}

	msg, err := client.GetConvictions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}

var (
	query_params_AdminService_GetConvictionsInRange_0 = gateway.QueryParameterParseOptions{
		Filter: trie.New(),
	}
)

func request_AdminService_GetConvictionsInRange_0(ctx context.Context, marshaler gateway.Marshaler, mux *gateway.ServeMux, client AdminServiceClient, req *http.Request, pathParams gateway.Params) (proto.Message, gateway.ServerMetadata, error) {
	var protoReq GetConvictionsInRangeRequest
	var metadata gateway.ServerMetadata

	if err := req.ParseForm(); err != nil {
		return nil, metadata, gateway.ErrInvalidQueryParameters{Err: err}
	}
	if err := mux.PopulateQueryParameters(&protoReq, req.Form, query_params_AdminService_GetConvictionsInRange_0); err != nil {
		return nil, metadata, gateway.ErrInvalidQueryParameters{Err: err}
	}

	msg, err := client.GetConvictionsInRange(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}

func request_AdminService_GetConvictionsByRound_0(ctx context.Context, marshaler gateway.Marshaler, mux *gateway.ServeMux, client AdminServiceClient, req *http.Request, pathParams gateway.Params) (proto.Message, gateway.ServerMetadata, error) {
	var protoReq GetConvictionsByRoundRequest
	var metadata gateway.ServerMetadata

	var (
		val string
		err error
		_   = err
	)

	val = pathParams.ByName("round_id")
	if val == "" {
		return nil, metadata, gateway.ErrPathParameterMissing{Name: "round_id"}
	}

	protoReq.RoundId, err = protoconvert.String(val)
	if err != nil {
		return nil, metadata, gateway.ErrPathParameterTypeMismatch{Err: err, Name: "round_id"}
	}

	msg, err := client.GetConvictionsByRound(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}

func request_AdminService_GetActiveScriptConvictions_0(ctx context.Context, marshaler gateway.Marshaler, mux *gateway.ServeMux, client AdminServiceClient, req *http.Request, pathParams gateway.Params) (proto.Message, gateway.ServerMetadata, error) {
	var protoReq GetActiveScriptConvictionsRequest
	var metadata gateway.ServerMetadata

	var (
		val string
		err error
		_   = err
	)

	val = pathParams.ByName("script")
	if val == "" {
		return nil, metadata, gateway.ErrPathParameterMissing{Name: "script"}
	}

	protoReq.Script, err = protoconvert.String(val)
	if err != nil {
		return nil, metadata, gateway.ErrPathParameterTypeMismatch{Err: err, Name: "script"}
	}

	msg, err := client.GetActiveScriptConvictions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}

func request_AdminService_PardonConviction_0(ctx context.Context, marshaler gateway.Marshaler, mux *gateway.ServeMux, client AdminServiceClient, req *http.Request, pathParams gateway.Params) (proto.Message, gateway.ServerMetadata, error) {
	var protoReq PardonConvictionRequest
	var metadata gateway.ServerMetadata

	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF {
		return nil, metadata, gateway.ErrMarshal{Err: err, Inbound: true}
	}

	var (
		val string
		err error
		_   = err
	)

	val = pathParams.ByName("id")
	if val == "" {
		return nil, metadata, gateway.ErrPathParameterMissing{Name: "id"}
	}

	protoReq.Id, err = protoconvert.String(val)
	if err != nil {
		return nil, metadata, gateway.ErrPathParameterTypeMismatch{Err: err, Name: "id"}
	}

	msg, err := client.PardonConviction(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}

func request_AdminService_BanScript_0(ctx context.Context, marshaler gateway.Marshaler, mux *gateway.ServeMux, client AdminServiceClient, req *http.Request, pathParams gateway.Params) (proto.Message, gateway.ServerMetadata, error) {
	var protoReq BanScriptRequest
	var metadata gateway.ServerMetadata

	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF {
		return nil, metadata, gateway.ErrMarshal{Err: err, Inbound: true}
	}

	msg, err := client.BanScript(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}

func request_AdminService_RevokeAuth_0(ctx context.Context, marshaler gateway.Marshaler, mux *gateway.ServeMux, client AdminServiceClient, req *http.Request, pathParams gateway.Params) (proto.Message, gateway.ServerMetadata, error) {
	var protoReq RevokeAuthRequest
	var metadata gateway.ServerMetadata

	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF {
		return nil, metadata, gateway.ErrMarshal{Err: err, Inbound: true}
	}

	msg, err := client.RevokeAuth(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}

// RegisterAdminServiceHandlerFromEndpoint is same as RegisterAdminServiceHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAdminServiceHandlerFromEndpoint(ctx context.Context, mux *gateway.ServeMux, endpoint string, opts []grpc.DialOption) error {
	conn, err := grpc.DialContext(ctx, endpoint, opts...)
	if err != nil {
		return err
	}
	defer func() {
		if err != nil {
			if cerr := conn.Close(); cerr != nil {
				grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
			}
			return
		}
		go func() {
			<-ctx.Done()
			if cerr := conn.Close(); cerr != nil {
				grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
			}
		}()
	}()

	RegisterAdminServiceHandler(ctx, mux, conn)
	return nil
}

// RegisterAdminServiceHandler registers the http handlers for service AdminService to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterAdminServiceHandler(ctx context.Context, mux *gateway.ServeMux, conn *grpc.ClientConn) {
	RegisterAdminServiceHandlerClient(ctx, mux, NewAdminServiceClient(conn))
}

// RegisterAdminServiceHandlerClient registers the http handlers for service AdminService
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AdminServiceClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AdminServiceClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "AdminServiceClient" to call the correct interceptors.
func RegisterAdminServiceHandlerClient(ctx context.Context, mux *gateway.ServeMux, client AdminServiceClient) {

	mux.HandleWithParams("GET", "/v1/admin/sweeps", func(w http.ResponseWriter, req *http.Request, pathParams gateway.Params) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
		inboundMarshaler, outboundMarshaler := mux.MarshalerForRequest(req)
		var err error
		var annotatedContext context.Context
		annotatedContext, err = gateway.AnnotateContext(ctx, mux, req, "/ark.v1.AdminService/GetScheduledSweep", gateway.WithHTTPPathPattern("/v1/admin/sweeps"))
		if err != nil {
			mux.HTTPError(ctx, outboundMarshaler, w, req, err)
			return
		}

		resp, md, err := request_AdminService_GetScheduledSweep_0(annotatedContext, inboundMarshaler, mux, client, req, pathParams)
		annotatedContext = gateway.NewServerMetadataContext(annotatedContext, md)
		if err != nil {
			mux.HTTPError(annotatedContext, outboundMarshaler, w, req, err)
			return
		}

		mux.ForwardResponseMessage(annotatedContext, outboundMarshaler, w, req, resp)
	})

	mux.HandleWithParams("GET", "/v1/admin/round/:round_id", func(w http.ResponseWriter, req *http.Request, pathParams gateway.Params) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
		inboundMarshaler, outboundMarshaler := mux.MarshalerForRequest(req)
		var err error
		var annotatedContext context.Context
		annotatedContext, err = gateway.AnnotateContext(ctx, mux, req, "/ark.v1.AdminService/GetRoundDetails", gateway.WithHTTPPathPattern("/v1/admin/round/{round_id}"))
		if err != nil {
			mux.HTTPError(ctx, outboundMarshaler, w, req, err)
			return
		}

		resp, md, err := request_AdminService_GetRoundDetails_0(annotatedContext, inboundMarshaler, mux, client, req, pathParams)
		annotatedContext = gateway.NewServerMetadataContext(annotatedContext, md)
		if err != nil {
			mux.HTTPError(annotatedContext, outboundMarshaler, w, req, err)
			return
		}

		mux.ForwardResponseMessage(annotatedContext, outboundMarshaler, w, req, resp)
	})

	mux.HandleWithParams("GET", "/v1/admin/rounds", func(w http.ResponseWriter, req *http.Request, pathParams gateway.Params) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
		inboundMarshaler, outboundMarshaler := mux.MarshalerForRequest(req)
		var err error
		var annotatedContext context.Context
		annotatedContext, err = gateway.AnnotateContext(ctx, mux, req, "/ark.v1.AdminService/GetRounds", gateway.WithHTTPPathPattern("/v1/admin/rounds"))
		if err != nil {
			mux.HTTPError(ctx, outboundMarshaler, w, req, err)
			return
		}

		resp, md, err := request_AdminService_GetRounds_0(annotatedContext, inboundMarshaler, mux, client, req, pathParams)
		annotatedContext = gateway.NewServerMetadataContext(annotatedContext, md)
		if err != nil {
			mux.HTTPError(annotatedContext, outboundMarshaler, w, req, err)
			return
		}

		mux.ForwardResponseMessage(annotatedContext, outboundMarshaler, w, req, resp)
	})

	mux.HandleWithParams("POST", "/v1/admin/note", func(w http.ResponseWriter, req *http.Request, pathParams gateway.Params) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
		inboundMarshaler, outboundMarshaler := mux.MarshalerForRequest(req)
		var err error
		var annotatedContext context.Context
		annotatedContext, err = gateway.AnnotateContext(ctx, mux, req, "/ark.v1.AdminService/CreateNote", gateway.WithHTTPPathPattern("/v1/admin/note"))
		if err != nil {
			mux.HTTPError(ctx, outboundMarshaler, w, req, err)
			return
		}

		resp, md, err := request_AdminService_CreateNote_0(annotatedContext, inboundMarshaler, mux, client, req, pathParams)
		annotatedContext = gateway.NewServerMetadataContext(annotatedContext, md)
		if err != nil {
			mux.HTTPError(annotatedContext, outboundMarshaler, w, req, err)
			return
		}

		mux.ForwardResponseMessage(annotatedContext, outboundMarshaler, w, req, resp)
	})

	mux.HandleWithParams("GET", "/v1/admin/scheduledSession", func(w http.ResponseWriter, req *http.Request, pathParams gateway.Params) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
		inboundMarshaler, outboundMarshaler := mux.MarshalerForRequest(req)
		var err error
		var annotatedContext context.Context
		annotatedContext, err = gateway.AnnotateContext(ctx, mux, req, "/ark.v1.AdminService/GetScheduledSessionConfig", gateway.WithHTTPPathPattern("/v1/admin/scheduledSession"))
		if err != nil {
			mux.HTTPError(ctx, outboundMarshaler, w, req, err)
			return
		}

		resp, md, err := request_AdminService_GetScheduledSessionConfig_0(annotatedContext, inboundMarshaler, mux, client, req, pathParams)
		annotatedContext = gateway.NewServerMetadataContext(annotatedContext, md)
		if err != nil {
			mux.HTTPError(annotatedContext, outboundMarshaler, w, req, err)
			return
		}

		mux.ForwardResponseMessage(annotatedContext, outboundMarshaler, w, req, resp)
	})

	mux.HandleWithParams("POST", "/v1/admin/scheduledSession", func(w http.ResponseWriter, req *http.Request, pathParams gateway.Params) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
		inboundMarshaler, outboundMarshaler := mux.MarshalerForRequest(req)
		var err error
		var annotatedContext context.Context
		annotatedContext, err = gateway.AnnotateContext(ctx, mux, req, "/ark.v1.AdminService/UpdateScheduledSessionConfig", gateway.WithHTTPPathPattern("/v1/admin/scheduledSession"))
		if err != nil {
			mux.HTTPError(ctx, outboundMarshaler, w, req, err)
			return
		}

		resp, md, err := request_AdminService_UpdateScheduledSessionConfig_0(annotatedContext, inboundMarshaler, mux, client, req, pathParams)
		annotatedContext = gateway.NewServerMetadataContext(annotatedContext, md)
		if err != nil {
			mux.HTTPError(annotatedContext, outboundMarshaler, w, req, err)
			return
		}

		mux.ForwardResponseMessage(annotatedContext, outboundMarshaler, w, req, resp)
	})

	mux.HandleWithParams("GET", "/v1/admin/intents", func(w http.ResponseWriter, req *http.Request, pathParams gateway.Params) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
		inboundMarshaler, outboundMarshaler := mux.MarshalerForRequest(req)
		var err error
		var annotatedContext context.Context
		annotatedContext, err = gateway.AnnotateContext(ctx, mux, req, "/ark.v1.AdminService/ListIntents", gateway.WithHTTPPathPattern("/v1/admin/intents"))
		if err != nil {
			mux.HTTPError(ctx, outboundMarshaler, w, req, err)
			return
		}

		resp, md, err := request_AdminService_ListIntents_0(annotatedContext, inboundMarshaler, mux, client, req, pathParams)
		annotatedContext = gateway.NewServerMetadataContext(annotatedContext, md)
		if err != nil {
			mux.HTTPError(annotatedContext, outboundMarshaler, w, req, err)
			return
		}

		mux.ForwardResponseMessage(annotatedContext, outboundMarshaler, w, req, resp)
	})

	mux.HandleWithParams("POST", "/v1/admin/intents/delete", func(w http.ResponseWriter, req *http.Request, pathParams gateway.Params) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
		inboundMarshaler, outboundMarshaler := mux.MarshalerForRequest(req)
		var err error
		var annotatedContext context.Context
		annotatedContext, err = gateway.AnnotateContext(ctx, mux, req, "/ark.v1.AdminService/DeleteIntents", gateway.WithHTTPPathPattern("/v1/admin/intents/delete"))
		if err != nil {
			mux.HTTPError(ctx, outboundMarshaler, w, req, err)
			return
		}

		resp, md, err := request_AdminService_DeleteIntents_0(annotatedContext, inboundMarshaler, mux, client, req, pathParams)
		annotatedContext = gateway.NewServerMetadataContext(annotatedContext, md)
		if err != nil {
			mux.HTTPError(annotatedContext, outboundMarshaler, w, req, err)
			return
		}

		mux.ForwardResponseMessage(annotatedContext, outboundMarshaler, w, req, resp)
	})

	mux.HandleWithParams("GET", "/v1/admin/convictions/:ids", func(w http.ResponseWriter, req *http.Request, pathParams gateway.Params) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
		inboundMarshaler, outboundMarshaler := mux.MarshalerForRequest(req)
		var err error
		var annotatedContext context.Context
		annotatedContext, err = gateway.AnnotateContext(ctx, mux, req, "/ark.v1.AdminService/GetConvictions", gateway.WithHTTPPathPattern("/v1/admin/convictions/{ids}"))
		if err != nil {
			mux.HTTPError(ctx, outboundMarshaler, w, req, err)
			return
		}

		resp, md, err := request_AdminService_GetConvictions_0(annotatedContext, inboundMarshaler, mux, client, req, pathParams)
		annotatedContext = gateway.NewServerMetadataContext(annotatedContext, md)
		if err != nil {
			mux.HTTPError(annotatedContext, outboundMarshaler, w, req, err)
			return
		}

		mux.ForwardResponseMessage(annotatedContext, outboundMarshaler, w, req, resp)
	})

	mux.HandleWithParams("GET", "/v1/admin/convictionsInRange", func(w http.ResponseWriter, req *http.Request, pathParams gateway.Params) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
		inboundMarshaler, outboundMarshaler := mux.MarshalerForRequest(req)
		var err error
		var annotatedContext context.Context
		annotatedContext, err = gateway.AnnotateContext(ctx, mux, req, "/ark.v1.AdminService/GetConvictionsInRange", gateway.WithHTTPPathPattern("/v1/admin/convictionsInRange"))
		if err != nil {
			mux.HTTPError(ctx, outboundMarshaler, w, req, err)
			return
		}

		resp, md, err := request_AdminService_GetConvictionsInRange_0(annotatedContext, inboundMarshaler, mux, client, req, pathParams)
		annotatedContext = gateway.NewServerMetadataContext(annotatedContext, md)
		if err != nil {
			mux.HTTPError(annotatedContext, outboundMarshaler, w, req, err)
			return
		}

		mux.ForwardResponseMessage(annotatedContext, outboundMarshaler, w, req, resp)
	})

	mux.HandleWithParams("GET", "/v1/admin/convictionsByRound/:round_id", func(w http.ResponseWriter, req *http.Request, pathParams gateway.Params) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
		inboundMarshaler, outboundMarshaler := mux.MarshalerForRequest(req)
		var err error
		var annotatedContext context.Context
		annotatedContext, err = gateway.AnnotateContext(ctx, mux, req, "/ark.v1.AdminService/GetConvictionsByRound", gateway.WithHTTPPathPattern("/v1/admin/convictionsByRound/{round_id}"))
		if err != nil {
			mux.HTTPError(ctx, outboundMarshaler, w, req, err)
			return
		}

		resp, md, err := request_AdminService_GetConvictionsByRound_0(annotatedContext, inboundMarshaler, mux, client, req, pathParams)
		annotatedContext = gateway.NewServerMetadataContext(annotatedContext, md)
		if err != nil {
			mux.HTTPError(annotatedContext, outboundMarshaler, w, req, err)
			return
		}

		mux.ForwardResponseMessage(annotatedContext, outboundMarshaler, w, req, resp)
	})

	mux.HandleWithParams("GET", "/v1/admin/convictionsByScript/:script", func(w http.ResponseWriter, req *http.Request, pathParams gateway.Params) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
		inboundMarshaler, outboundMarshaler := mux.MarshalerForRequest(req)
		var err error
		var annotatedContext context.Context
		annotatedContext, err = gateway.AnnotateContext(ctx, mux, req, "/ark.v1.AdminService/GetActiveScriptConvictions", gateway.WithHTTPPathPattern("/v1/admin/convictionsByScript/{script}"))
		if err != nil {
			mux.HTTPError(ctx, outboundMarshaler, w, req, err)
			return
		}

		resp, md, err := request_AdminService_GetActiveScriptConvictions_0(annotatedContext, inboundMarshaler, mux, client, req, pathParams)
		annotatedContext = gateway.NewServerMetadataContext(annotatedContext, md)
		if err != nil {
			mux.HTTPError(annotatedContext, outboundMarshaler, w, req, err)
			return
		}

		mux.ForwardResponseMessage(annotatedContext, outboundMarshaler, w, req, resp)
	})

	mux.HandleWithParams("POST", "/v1/admin/convictions/:id/pardon", func(w http.ResponseWriter, req *http.Request, pathParams gateway.Params) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
		inboundMarshaler, outboundMarshaler := mux.MarshalerForRequest(req)
		var err error
		var annotatedContext context.Context
		annotatedContext, err = gateway.AnnotateContext(ctx, mux, req, "/ark.v1.AdminService/PardonConviction", gateway.WithHTTPPathPattern("/v1/admin/convictions/{id}/pardon"))
		if err != nil {
			mux.HTTPError(ctx, outboundMarshaler, w, req, err)
			return
		}

		resp, md, err := request_AdminService_PardonConviction_0(annotatedContext, inboundMarshaler, mux, client, req, pathParams)
		annotatedContext = gateway.NewServerMetadataContext(annotatedContext, md)
		if err != nil {
			mux.HTTPError(annotatedContext, outboundMarshaler, w, req, err)
			return
		}

		mux.ForwardResponseMessage(annotatedContext, outboundMarshaler, w, req, resp)
	})

	mux.HandleWithParams("POST", "/v1/admin/conviction/ban", func(w http.ResponseWriter, req *http.Request, pathParams gateway.Params) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
		inboundMarshaler, outboundMarshaler := mux.MarshalerForRequest(req)
		var err error
		var annotatedContext context.Context
		annotatedContext, err = gateway.AnnotateContext(ctx, mux, req, "/ark.v1.AdminService/BanScript", gateway.WithHTTPPathPattern("/v1/admin/conviction/ban"))
		if err != nil {
			mux.HTTPError(ctx, outboundMarshaler, w, req, err)
			return
		}

		resp, md, err := request_AdminService_BanScript_0(annotatedContext, inboundMarshaler, mux, client, req, pathParams)
		annotatedContext = gateway.NewServerMetadataContext(annotatedContext, md)
		if err != nil {
			mux.HTTPError(annotatedContext, outboundMarshaler, w, req, err)
			return
		}

		mux.ForwardResponseMessage(annotatedContext, outboundMarshaler, w, req, resp)
	})

	mux.HandleWithParams("POST", "/v1/admin/auth/revoke", func(w http.ResponseWriter, req *http.Request, pathParams gateway.Params) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
		inboundMarshaler, outboundMarshaler := mux.MarshalerForRequest(req)
		var err error
		var annotatedContext context.Context
		annotatedContext, err = gateway.AnnotateContext(ctx, mux, req, "/ark.v1.AdminService/RevokeAuth", gateway.WithHTTPPathPattern("/v1/admin/auth/revoke"))
		if err != nil {
			mux.HTTPError(ctx, outboundMarshaler, w, req, err)
			return
		}

		resp, md, err := request_AdminService_RevokeAuth_0(annotatedContext, inboundMarshaler, mux, client, req, pathParams)
		annotatedContext = gateway.NewServerMetadataContext(annotatedContext, md)
		if err != nil {
			mux.HTTPError(annotatedContext, outboundMarshaler, w, req, err)
			return
		}

		mux.ForwardResponseMessage(annotatedContext, outboundMarshaler, w, req, resp)
	})

}
