// RetryItemStatusCodes sets an array of status codes that indicate that a bulk
// response line item should be retried.
182721
func (s *BulkProcessorService) RetryItemStatusCodes(retryItemStatusCodes ...int) *BulkProcessorService {
	s.retryItemStatusCodes = retryItemStatusCodes
	return s
}
644729
func (s *UpdateMethodResponseInput) SetStatusCode(v string) *UpdateMethodResponseInput {
	s.StatusCode = &v
	return s
}
868306
func (s *PhaseContext) SetStatusCode(v string) *PhaseContext {
	s.StatusCode = &v
	return s
}
325355
func (r *URIBuilder) StatusCode(code int) *URIBuilder {
	r.cacheStatuscode = code
	return r
}
282320
func statusCode(code int) string {
	if code >= 100 {
		switch {
		case code < 200:
			return statusCodeWithTable(code-100, statusCode100[:])
		case code < 300:
			return statusCodeWithTable(code-200, statusCode200[:])
		case code < 400:
			return statusCodeWithTable(code-300, statusCode300[:])
		case code < 500:
			return statusCodeWithTable(code-400, statusCode400[:])
		case code < 600:
			return statusCodeWithTable(code-500, statusCode500[:])
		}
	}
	return strconv.Itoa(code)
}
425268
func (e *Error) StatusCode() int {
	code, ok := errorTypeToStatusCodeMap[e.Type]
	if !ok || code == 0 {
		return 500
	}

	return code
}
474978
func (s *GetObjectOutput) SetStatusCode(v int64) *GetObjectOutput {
	s.StatusCode = &v
	return s
}
117468
func isCodeRetryable(statusCode int) bool {
	if _, ok := retryableStatusCodes[statusCode]; ok {
		return true
	}

	return false
}
81077
func (s *InvokeOutput) SetStatusCode(v int64) *InvokeOutput {
	s.StatusCode = &v
	return s
}
1233592
func GetStatusCode(err error) (code int, ok bool) {
	e, ok := err.(arangoError)
	if !ok || e.statusCode == 0 {
		return 0, false
	}
	return e.statusCode, true
}
262426
func (r *httpVPackResponseElement) StatusCode() int {
	if r.statusCode == nil {
		statusCode := 200
		// Look for "error" field
		if errorFieldSlice, _ := r.slice.Get("error"); !errorFieldSlice.IsNone() {
			if hasError, err := errorFieldSlice.GetBool(); err == nil && hasError {
				// We have an error, look for code field
				statusCode = 500
				if codeFieldSlice, _ := r.slice.Get("code"); !codeFieldSlice.IsNone() {
					if code, err := codeFieldSlice.GetInt(); err == nil {
						statusCode = int(code)
					}
				}
			}
		}
		r.statusCode = &statusCode
	}
	return *r.statusCode
}
1238961
func checkRetry(c *etcd.Cluster, numReqs int, last http.Response, err error) error {
	if numReqs > retryCycles*len(c.Machines) {
		return fmt.Errorf("Tried and failed %d cluster connections: %s", retryCycles, err)
	}

	switch last.StatusCode {
	case 0:
		return nil
	case 500:
		time.Sleep(retrySleep)
		return nil
	case 200:
		return nil
	default:
		return fmt.Errorf("Unhandled HTTP Error: %s %d", last.Status, last.StatusCode)
	}
}
1316738
func HTTPStatusFromCode(code codes.Code) int {
	switch code {
	case codes.OK:
		return http.StatusOK
	case codes.Canceled:
		return http.StatusRequestTimeout
	case codes.Unknown:
		return http.StatusInternalServerError
	case codes.InvalidArgument:
		return http.StatusBadRequest
	case codes.DeadlineExceeded:
		return http.StatusGatewayTimeout
	case codes.NotFound:
		return http.StatusNotFound
	case codes.AlreadyExists:
		return http.StatusConflict
	case codes.PermissionDenied:
		return http.StatusForbidden
	case codes.Unauthenticated:
		return http.StatusUnauthorized
	case codes.ResourceExhausted:
		return http.StatusTooManyRequests
	case codes.FailedPrecondition:
		return http.StatusPreconditionFailed
	case codes.Aborted:
		return http.StatusConflict
	case codes.OutOfRange:
		return http.StatusBadRequest
	case codes.Unimplemented:
		return http.StatusNotImplemented
	case codes.Internal:
		return http.StatusInternalServerError
	case codes.Unavailable:
		return http.StatusServiceUnavailable
	case codes.DataLoss:
		return http.StatusInternalServerError
	}

	grpclog.Infof("Unknown gRPC error code: %v", code)
	return http.StatusInternalServerError
}
539566
func (s *DocumentationPartLocation) SetStatusCode(v string) *DocumentationPartLocation {
	s.StatusCode = &v
	return s
}
431983
func (m *RoundTripMetrics) GetStatusCodesCounts() map[int]int64 {
	sc := make(map[int]int64)
	for k, v := range m.statusCodes {
		if v.Count() != 0 {
			sc[k] = v.Count()
		}
	}
	return sc
}
1142481
func (o *GetTaskDetailsDefault) WithStatusCode(code int) *GetTaskDetailsDefault {
	o._statusCode = code
	return o
}
387510
func (r *Response) StatusCode() int {
	if r.statusCode <= 0 {
		r.statusCode = 200
	}
	return r.statusCode
}