/* Check and return Redfish resource of the given Redpath. */
EFI_STATUS RedfishCheckIfRedpathExist(IN REDFISH_SERVICE RedfishService, IN CHAR8 *Redpath, IN REDFISH_RESPONSE *Response OPTIONAL)
/* Check and return Redfish resource of the given Redpath. */
EFI_STATUS RedfishCheckIfRedpathExist(IN REDFISH_SERVICE RedfishService, IN CHAR8 *Redpath, IN REDFISH_RESPONSE *Response OPTIONAL)
{
  EFI_STATUS        Status;
  REDFISH_RESPONSE  TempResponse;
  if (Redpath == NULL) {
    return EFI_INVALID_PARAMETER;
  }
  Status = RedfishGetByService (RedfishService, Redpath, &TempResponse);
  if (EFI_ERROR (Status)) {
    return Status;
  }
  if (Response == NULL) {
    RedfishFreeResponse (
      TempResponse.StatusCode,
      TempResponse.HeaderCount,
      TempResponse.Headers,
      TempResponse.Payload
      );
  } else {
    CopyMem ((VOID *)Response, (VOID *)&TempResponse, sizeof (REDFISH_RESPONSE));
  }
  return EFI_SUCCESS;
}