toDeliveryStatus method

DeliveryStatus toDeliveryStatus()

Implementation

DeliveryStatus toDeliveryStatus() {
  switch (this) {
    case 'SUCCESSFUL':
      return DeliveryStatus.successful;
    case 'THROTTLED':
      return DeliveryStatus.throttled;
    case 'TEMPORARY_FAILURE':
      return DeliveryStatus.temporaryFailure;
    case 'PERMANENT_FAILURE':
      return DeliveryStatus.permanentFailure;
    case 'UNKNOWN_FAILURE':
      return DeliveryStatus.unknownFailure;
    case 'OPT_OUT':
      return DeliveryStatus.optOut;
    case 'DUPLICATE':
      return DeliveryStatus.duplicate;
  }
  throw Exception('$this is not known in enum DeliveryStatus');
}