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

public extension LDP_NativeAssetSource {
  private typealias bridge = margelo.nitro.lunardatepicker.bridge.swift

  /**
   * Create a new instance of `LDP_NativeAssetSource`.
   */
  init(uri: String, width: Double?, height: Double?, scale: Double?) {
    self.init(std.string(uri), { () -> bridge.std__optional_double_ in
      if let __unwrappedValue = width {
        return bridge.create_std__optional_double_(__unwrappedValue)
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_double_ in
      if let __unwrappedValue = height {
        return bridge.create_std__optional_double_(__unwrappedValue)
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_double_ in
      if let __unwrappedValue = scale {
        return bridge.create_std__optional_double_(__unwrappedValue)
      } else {
        return .init()
      }
    }())
  }

  @inline(__always)
  var uri: String {
    return String(self.__uri)
  }
  
  @inline(__always)
  var width: Double? {
    return { () -> Double? in
      if bridge.has_value_std__optional_double_(self.__width) {
        let __unwrapped = bridge.get_std__optional_double_(self.__width)
        return __unwrapped
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var height: Double? {
    return { () -> Double? in
      if bridge.has_value_std__optional_double_(self.__height) {
        let __unwrapped = bridge.get_std__optional_double_(self.__height)
        return __unwrapped
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var scale: Double? {
    return { () -> Double? in
      if bridge.has_value_std__optional_double_(self.__scale) {
        let __unwrapped = bridge.get_std__optional_double_(self.__scale)
        return __unwrapped
      } else {
        return nil
      }
    }()
  }
}
