public static ResponseStatus getResponseStatus(RestServiceErrorCode restServiceErrorCode) {
    switch (restServiceErrorCode) {
      case RequestTooLarge:
        return RequestTooLarge;
      case Conflict:
        return Conflict;
      case Deleted:
        return Gone;
      case NotFound:
        return NotFound;
      case BadRequest:
      case InvalidArgs:
      case InvalidAccount:
      case InvalidContainer:
      case InvalidRequestState:
      case MalformedRequest:
      case MissingArgs:
      case UnsupportedHttpMethod:
      case UnsupportedEncoding:
        return BadRequest;
      case ResourceDirty:
      case AccessDenied:
        return Forbidden;
      case Unauthorized:
        return Unauthorized;
      case NotAllowed:
        return MethodNotAllowed;
      case ResourceScanInProgress:
        return ProxyAuthenticationRequired;
      case RangeNotSatisfiable:
        return RangeNotSatisfiable;
      case ServiceUnavailable:
        return ServiceUnavailable;
      case TooManyRequests:
        return TooManyRequests;
      case InsufficientCapacity:
        return InsufficientCapacity;
      case PreconditionFailed:
        return PreconditionFailed;
      case IdConverterServiceError:
      case InternalServerError:
      case RequestChannelClosed:
      case RequestResponseQueuingFailure:
      case UnsupportedRestMethod:
      default:
        return InternalServerError;
    }
  }
Gets the ResponseStatus that corresponds to the {@code restServiceErrorCode}.
@param restServiceErrorCode the input {@link RestServiceErrorCode}.
@return the ResponseStatus that the {@code restServiceErrorCode} belongs to.
ambry-api/src/main/java/com/github/ambry/rest/ResponseStatus.java