// AlreadyRevoked returns a ProblemDetails with a AlreadyRevokedProblem and a 400 Bad
// Request status code.
5274
func AlreadyRevoked(detail string, a ...interface{}) *ProblemDetails {
	return &ProblemDetails{
		Type:       AlreadyRevokedProblem,
		Detail:     fmt.Sprintf(detail, a...),
		HTTPStatus: http.StatusBadRequest,
	}
}
336004
func (ri *RetryableInvoker) Invoke(invocation Invocation) (interface{}, error) {
	attemptNum := 0
	var lastErr error

	for {
		attemptNum++
		if attemptNum > 1 {
			logger.Debugf("Retry attempt #%d on error [%s]", attemptNum, lastErr)
		}

		retval, err := invocation()
		if err == nil {
			if attemptNum > 1 {
				logger.Debugf("Success on attempt #%d after error [%s]", attemptNum, lastErr)
			}
			return retval, nil
		}

		logger.Debugf("Failed with err [%s] on attempt #%d. Checking if retry is warranted...", err, attemptNum)
		if !ri.resolveRetry(err) {
			if lastErr != nil && lastErr.Error() != err.Error() {
				logger.Debugf("... retry for err [%s] is NOT warranted after %d attempt(s). Previous error [%s]", err, attemptNum, lastErr)
			} else {
				logger.Debugf("... retry for err [%s] is NOT warranted after %d attempt(s).", err, attemptNum)
			}
			return nil, err
		}
		logger.Debugf("... retry for err [%s] is warranted", err)
		lastErr = err
	}
}
884350
func (s *Service) TeamInvitationRevoke(ctx context.Context, teamIdentity string, teamInvitationIdentity string) (*TeamInvitation, error) {
	var teamInvitation TeamInvitation
	return &teamInvitation, s.Delete(ctx, &teamInvitation, fmt.Sprintf("/teams/%v/invitations/%v", teamIdentity, teamInvitationIdentity))
}
1070042
func (h *Recovery) ServeHTTPContext(ctx context.Context, w http.ResponseWriter, r *http.Request) (err error) {
	ctx = reporter.WithReporter(ctx, h.Reporter)

	// Add the request to the context.
	ctx = errors.WithRequest(ctx, r)

	// Add the request id
	ctx = errors.WithInfo(ctx, "request_id", httpx.RequestID(ctx))

	defer func() {
		if e := errors.Recover(ctx, recover()); e != nil {
			w.WriteHeader(http.StatusInternalServerError)
			err = e
			reporter.Report(ctx, err)
			return
		}
	}()

	err = h.handler.ServeHTTPContext(ctx, w, r)

	return
}
147770
func (p *PassthruChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {
	function, args := stub.GetFunctionAndParameters()
	return p.iq(stub, function, args)
}
411317
func (service *BaseService) AddInvokeHandler(handler ...InvokeHandler) Service {
	service.handlerManager.AddInvokeHandler(handler...)
	return service
}
580692
func (_m *ClientInterface) GetEvaluatedService(serviceID string, instanceID int) (*service.Service, string, string, error) {
	ret := _m.Called(serviceID, instanceID)

	var r0 *service.Service
	if rf, ok := ret.Get(0).(func(string, int) *service.Service); ok {
		r0 = rf(serviceID, instanceID)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*service.Service)
		}
	}

	var r1 string
	if rf, ok := ret.Get(1).(func(string, int) string); ok {
		r1 = rf(serviceID, instanceID)
	} else {
		r1 = ret.Get(1).(string)
	}

	var r2 string
	if rf, ok := ret.Get(1).(func(string, int) string); ok {
		r2 = rf(serviceID, instanceID)
	} else {
		r2 = ret.Get(1).(string)
	}

	var r3 error
	if rf, ok := ret.Get(2).(func(string, int) error); ok {
		r3 = rf(serviceID, instanceID)
	} else {
		r3 = ret.Error(2)
	}

	return r0, r1, r2, r3
}
951828
func Invoke(ctx context.Context, call APICall, opts ...CallOption) error {
	var settings CallSettings
	for _, opt := range opts {
		opt.Resolve(&settings)
	}
	return invoke(ctx, call, settings, Sleep)
}
4761
func (s *uniterResolver) nextOpConflicted(
	localState resolver.LocalState,
	remoteState remotestate.Snapshot,
	opFactory operation.Factory,
) (operation.Operation, error) {
	if remoteState.ResolvedMode != params.ResolvedNone {
		if err := s.config.ClearResolved(); err != nil {
			return nil, errors.Trace(err)
		}
		return opFactory.NewResolvedUpgrade(localState.CharmURL)
	}
	if remoteState.ForceCharmUpgrade && charmModified(localState, remoteState) {
		return opFactory.NewRevertUpgrade(remoteState.CharmURL)
	}
	return nil, resolver.ErrWaiting
}
1174261
func RequestRejoinParamSetup(maxTimeN, maxCountN int) storage.MACCommandBlock {
	return storage.MACCommandBlock{
		CID: lorawan.RejoinParamSetupReq,
		MACCommands: []lorawan.MACCommand{
			{
				CID: lorawan.RejoinParamSetupReq,
				Payload: &lorawan.RejoinParamSetupReqPayload{
					MaxTimeN:  uint8(maxTimeN),
					MaxCountN: uint8(maxCountN),
				},
			},
		},
	}
}
453395
func Invoke(ctx context.Context, call APICall, opts ...CallOption) error {
	return v2.Invoke(ctx, call, opts...)
}
1032620
func (h *Handler) Invoke(
	ctx context.Context,
	payload []byte,
) (resp []byte, err error) {
	if len(h.finalizer) > 0 {
		defer func() {
			for _, f := range h.finalizer {
				f(ctx, resp, err)
			}
		}()
	}

	for _, f := range h.before {
		ctx = f(ctx, payload)
	}

	request, err := h.dec(ctx, payload)
	if err != nil {
		h.errorHandler.Handle(ctx, err)
		return h.errorEncoder(ctx, err)
	}

	response, err := h.e(ctx, request)
	if err != nil {
		h.errorHandler.Handle(ctx, err)
		return h.errorEncoder(ctx, err)
	}

	for _, f := range h.after {
		ctx = f(ctx, response)
	}

	if resp, err = h.enc(ctx, response); err != nil {
		h.errorHandler.Handle(ctx, err)
		return h.errorEncoder(ctx, err)
	}

	return resp, err
}
956169
func RecordLongRunning(req *http.Request, requestInfo *request.RequestInfo, component string, fn func()) {
	if requestInfo == nil {
		requestInfo = &request.RequestInfo{Verb: req.Method, Path: req.URL.Path}
	}
	var g prometheus.Gauge
	scope := CleanScope(requestInfo)
	reportedVerb := cleanVerb(strings.ToUpper(requestInfo.Verb), req)
	if requestInfo.IsResourceRequest {
		g = longRunningRequestGauge.WithLabelValues(reportedVerb, requestInfo.APIGroup, requestInfo.APIVersion, requestInfo.Resource, requestInfo.Subresource, scope, component)
	} else {
		g = longRunningRequestGauge.WithLabelValues(reportedVerb, "", "", "", requestInfo.Path, scope, component)
	}
	g.Inc()
	defer g.Dec()
	fn()
}
1012474
func (r *IsRevokedCertRPC) IsRevokedCert(c context.Context, req *admin.IsRevokedCertRequest) (*admin.IsRevokedCertResponse, error) {
	sn := big.Int{}
	if _, ok := sn.SetString(req.Sn, 0); !ok {
		return nil, status.Errorf(codes.InvalidArgument, "can't parse 'sn'")
	}

	checker, err := GetCertChecker(c, req.Ca)
	if err != nil {
		if details, ok := err.(Error); ok && details.Reason == NoSuchCA {
			return nil, status.Errorf(codes.NotFound, "no such CA: %q", req.Ca)
		}
		return nil, status.Errorf(codes.Internal, "failed to check %q CRL - %s", req.Ca, err)
	}

	revoked, err := checker.CRL.IsRevokedSN(c, &sn)
	if err != nil {
		return nil, status.Errorf(codes.Internal, "failed to check %q CRL - %s", req.Ca, err)
	}

	return &admin.IsRevokedCertResponse{Revoked: revoked}, nil
}
1298178
func NewRevokeDeviceSessionBatchArg(RevokeDevices []*RevokeDeviceSessionArg) *RevokeDeviceSessionBatchArg {
	s := new(RevokeDeviceSessionBatchArg)
	s.RevokeDevices = RevokeDevices
	return s
}
1264755
func opcodeReserved(op *parsedOpcode, vm *Engine) error {
	str := fmt.Sprintf("attempt to execute reserved opcode %s",
		op.opcode.name)
	return scriptError(ErrReservedOpcode, str)
}
1008193
func (client *BaseClient) Invoke(
	name string,
	args []reflect.Value,
	settings *InvokeSettings) (results []reflect.Value, err error) {
	context := client.GetClientContext(settings)
	results, err = client.handlerManager.invokeHandler(name, args, context)
	if results == nil && len(context.ResultTypes) > 0 {
		n := len(context.ResultTypes)
		results = make([]reflect.Value, n)
		for i := 0; i < n; i++ {
			results[i] = reflect.New(context.ResultTypes[i]).Elem()
		}
	}
	client.contextPool.Put(context)
	return
}