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

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

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

  @inline(__always)
  var title: String {
    return String(self.__title)
  }

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

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

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