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

import NitroModules

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

public extension NitroVerifyPurchaseWithIapkitProps {
  private typealias bridge = margelo.nitro.iap.bridge.swift

  /**
   * Create a new instance of `NitroVerifyPurchaseWithIapkitProps`.
   */
  init(apiKey: String?, apple: NitroVerifyPurchaseWithIapkitAppleProps?, google: NitroVerifyPurchaseWithIapkitGoogleProps?) {
    self.init({ () -> bridge.std__optional_std__string_ in
      if let __unwrappedValue = apiKey {
        return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_NitroVerifyPurchaseWithIapkitAppleProps_ in
      if let __unwrappedValue = apple {
        return bridge.create_std__optional_NitroVerifyPurchaseWithIapkitAppleProps_(__unwrappedValue)
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_NitroVerifyPurchaseWithIapkitGoogleProps_ in
      if let __unwrappedValue = google {
        return bridge.create_std__optional_NitroVerifyPurchaseWithIapkitGoogleProps_(__unwrappedValue)
      } else {
        return .init()
      }
    }())
  }

  var apiKey: String? {
    @inline(__always)
    get {
      return { () -> String? in
        if bridge.has_value_std__optional_std__string_(self.__apiKey) {
          let __unwrapped = bridge.get_std__optional_std__string_(self.__apiKey)
          return String(__unwrapped)
        } else {
          return nil
        }
      }()
    }
    @inline(__always)
    set {
      self.__apiKey = { () -> bridge.std__optional_std__string_ in
        if let __unwrappedValue = newValue {
          return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
        } else {
          return .init()
        }
      }()
    }
  }
  
  var apple: NitroVerifyPurchaseWithIapkitAppleProps? {
    @inline(__always)
    get {
      return self.__apple.value
    }
    @inline(__always)
    set {
      self.__apple = { () -> bridge.std__optional_NitroVerifyPurchaseWithIapkitAppleProps_ in
        if let __unwrappedValue = newValue {
          return bridge.create_std__optional_NitroVerifyPurchaseWithIapkitAppleProps_(__unwrappedValue)
        } else {
          return .init()
        }
      }()
    }
  }
  
  var google: NitroVerifyPurchaseWithIapkitGoogleProps? {
    @inline(__always)
    get {
      return self.__google.value
    }
    @inline(__always)
    set {
      self.__google = { () -> bridge.std__optional_NitroVerifyPurchaseWithIapkitGoogleProps_ in
        if let __unwrappedValue = newValue {
          return bridge.create_std__optional_NitroVerifyPurchaseWithIapkitGoogleProps_(__unwrappedValue)
        } else {
          return .init()
        }
      }()
    }
  }
}
