///
/// CalendarRecurrenceFrequency.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 `CalendarRecurrenceFrequency`, backed by a C++ enum.
 */
public typealias CalendarRecurrenceFrequency = margelo.nitro.one.CalendarRecurrenceFrequency

public extension CalendarRecurrenceFrequency {
  /**
   * Get a CalendarRecurrenceFrequency for the given String value, or
   * return `nil` if the given value was invalid/unknown.
   */
  init?(fromString string: String) {
    switch string {
      case "daily":
        self = .daily
      case "weekly":
        self = .weekly
      case "monthly":
        self = .monthly
      case "yearly":
        self = .yearly
      default:
        return nil
    }
  }

  /**
   * Get the String value this CalendarRecurrenceFrequency represents.
   */
  var stringValue: String {
    switch self {
      case .daily:
        return "daily"
      case .weekly:
        return "weekly"
      case .monthly:
        return "monthly"
      case .yearly:
        return "yearly"
    }
  }
}
