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

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

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

  @inline(__always)
  var notification: NativeNotification {
    return self.__notification
  }
  
  @inline(__always)
  var actionIdentifier: String {
    return String(self.__actionIdentifier)
  }
  
  @inline(__always)
  var userText: String? {
    return { () -> String? in
      if bridge.has_value_std__optional_std__string_(self.__userText) {
        let __unwrapped = bridge.get_std__optional_std__string_(self.__userText)
        return String(__unwrapped)
      } else {
        return nil
      }
    }()
  }
}
