// StatusCode gets the status code from an error, defaulting to 500
772640
func StatusCode(err error) int {
	switch t := err.(type) {
	case util.HTTPError:
		return t.Code
	case *util.HTTPError:
		return t.Code
	case *oauth.Error:
		return t.Code
	default:
		return http.StatusInternalServerError
	}
}
565060
func (s *MessageResult) SetStatusCode(v int64) *MessageResult {
	s.StatusCode = &v
	return s
}
997145
func GetStatusCode(err error, default_code int) int {
	rv := errors.GetData(err, statusCode)
	sc, ok := rv.(int)
	if ok {
		return sc
	}
	return default_code
}
233281
func (o *AddOrderDefault) WithStatusCode(code int) *AddOrderDefault {
	o._statusCode = code
	return o
}
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)
}
319238
func (l *Limiter) GetStatusCode() int {
	l.RLock()
	defer l.RUnlock()
	return l.statusCode
}
285907
func (o *FindDefault) WithStatusCode(code int) *FindDefault {
	o._statusCode = code
	return o
}
579960
func (s *PutMethodResponseInput) SetStatusCode(v string) *PutMethodResponseInput {
	s.StatusCode = &v
	return s
}
805438
func CodeStatus(code codes.Code) int {
	if status, ok := codeToStatus[code]; ok {
		return status
	}
	return http.StatusInternalServerError
}
1372116
func (s *EndpointItemResponse) SetStatusCode(v int64) *EndpointItemResponse {
	s.StatusCode = &v
	return s
}
1139245
func errorStatus(err error) uint32 {
	if x, ok := err.(*Status); ok {
		return x.Code
	}

	switch {
	case os.IsNotExist(err):
		return StatusNoSuchFileOrDir
	case os.IsExist(err):
		return StatusFileExists
	case os.IsPermission(err):
		return StatusOperationNotPermitted
	}

	return StatusGenericError
}
977856
func (l *Limiter) SetStatusCode(statusCode int) *Limiter {
	l.Lock()
	l.statusCode = statusCode
	l.Unlock()

	return l
}
485586
func (o *GetIDDefault) WithStatusCode(code int) *GetIDDefault {
	o._statusCode = code
	return o
}
1259880
func (rb *ResponseBuffer) StatusCodeWriter(w http.ResponseWriter) http.ResponseWriter {
	return forcedStatusCodeWriter{w, rb}
}
956907
func (s *MetricDataResult) SetStatusCode(v string) *MetricDataResult {
	s.StatusCode = &v
	return s
}
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
}
810600
func (s *DeleteCollectionOutput) SetStatusCode(v int64) *DeleteCollectionOutput {
	s.StatusCode = &v
	return s
}