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

public extension MessageAttachment {
  private typealias bridge = margelo.nitro.one.bridge.swift

  /**
   * Create a new instance of `MessageAttachment`.
   */
  init(attachmentURL: String, attachmentAlternateFilename: String?) {
    self.init(std.string(attachmentURL), { () -> bridge.std__optional_std__string_ in
      if let __unwrappedValue = attachmentAlternateFilename {
        return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
      } else {
        return .init()
      }
    }())
  }

  @inline(__always)
  var attachmentURL: String {
    return String(self.__attachmentURL)
  }
  
  @inline(__always)
  var attachmentAlternateFilename: String? {
    return { () -> String? in
      if bridge.has_value_std__optional_std__string_(self.__attachmentAlternateFilename) {
        let __unwrapped = bridge.get_std__optional_std__string_(self.__attachmentAlternateFilename)
        return String(__unwrapped)
      } else {
        return nil
      }
    }()
  }
}
