///
/// MailComposeResult.swift
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///

/**
 * Represents the JS union `MailComposeResult`, backed by a C++ enum.
 */
public typealias MailComposeResult = margelo.nitro.one.MailComposeResult

public extension MailComposeResult {
  /**
   * Get a MailComposeResult for the given String value, or
   * return `nil` if the given value was invalid/unknown.
   */
  init?(fromString string: String) {
    switch string {
      case "failed":
        self = .failed
      case "cancelled":
        self = .cancelled
      case "saved":
        self = .saved
      case "sent":
        self = .sent
      default:
        return nil
    }
  }

  /**
   * Get the String value this MailComposeResult represents.
   */
  var stringValue: String {
    switch self {
      case .failed:
        return "failed"
      case .cancelled:
        return "cancelled"
      case .saved:
        return "saved"
      case .sent:
        return "sent"
    }
  }
}
