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

import NitroModules

/**
 * Represents an instance of `MailFetchMessageOptions`, backed by a C++ struct.
 */
public typealias MailFetchMessageOptions = margelo.nitro.mailengine.MailFetchMessageOptions

public extension MailFetchMessageOptions {
  private typealias bridge = margelo.nitro.mailengine.bridge.swift

  /**
   * Create a new instance of `MailFetchMessageOptions`.
   */
  init(includeAttachments: Bool?, maxAttachmentBytes: Double?, markSeen: Bool?) {
    self.init({ () -> bridge.std__optional_bool_ in
      if let __unwrappedValue = includeAttachments {
        return bridge.create_std__optional_bool_(__unwrappedValue)
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_double_ in
      if let __unwrappedValue = maxAttachmentBytes {
        return bridge.create_std__optional_double_(__unwrappedValue)
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_bool_ in
      if let __unwrappedValue = markSeen {
        return bridge.create_std__optional_bool_(__unwrappedValue)
      } else {
        return .init()
      }
    }())
  }

  @inline(__always)
  var includeAttachments: Bool? {
    return { () -> Bool? in
      if bridge.has_value_std__optional_bool_(self.__includeAttachments) {
        let __unwrapped = bridge.get_std__optional_bool_(self.__includeAttachments)
        return __unwrapped
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var maxAttachmentBytes: Double? {
    return { () -> Double? in
      if bridge.has_value_std__optional_double_(self.__maxAttachmentBytes) {
        let __unwrapped = bridge.get_std__optional_double_(self.__maxAttachmentBytes)
        return __unwrapped
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var markSeen: Bool? {
    return { () -> Bool? in
      if bridge.has_value_std__optional_bool_(self.__markSeen) {
        let __unwrapped = bridge.get_std__optional_bool_(self.__markSeen)
        return __unwrapped
      } else {
        return nil
      }
    }()
  }
}
