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

public extension AdvertisingDataTypes {
  private typealias bridge = margelo.nitro.munimbluetooth.bridge.swift

  /**
   * Create a new instance of `AdvertisingDataTypes`.
   */
  init(flags: Double?, incompleteServiceUUIDs16: [String]?, completeServiceUUIDs16: [String]?, incompleteServiceUUIDs32: [String]?, completeServiceUUIDs32: [String]?, incompleteServiceUUIDs128: [String]?, completeServiceUUIDs128: [String]?, shortenedLocalName: String?, completeLocalName: String?, txPowerLevel: Double?, serviceSolicitationUUIDs16: [String]?, serviceSolicitationUUIDs128: [String]?, serviceData16: [ServiceDataEntry]?, serviceData32: [ServiceDataEntry]?, serviceData128: [ServiceDataEntry]?, appearance: Double?, serviceSolicitationUUIDs32: [String]?, manufacturerData: String?) {
    self.init({ () -> bridge.std__optional_double_ in
      if let __unwrappedValue = flags {
        return bridge.create_std__optional_double_(__unwrappedValue)
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_std__vector_std__string__ in
      if let __unwrappedValue = incompleteServiceUUIDs16 {
        return bridge.create_std__optional_std__vector_std__string__({ () -> bridge.std__vector_std__string_ in
          var __vector = bridge.create_std__vector_std__string_(__unwrappedValue.count)
          for __item in __unwrappedValue {
            __vector.push_back(std.string(__item))
          }
          return __vector
        }())
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_std__vector_std__string__ in
      if let __unwrappedValue = completeServiceUUIDs16 {
        return bridge.create_std__optional_std__vector_std__string__({ () -> bridge.std__vector_std__string_ in
          var __vector = bridge.create_std__vector_std__string_(__unwrappedValue.count)
          for __item in __unwrappedValue {
            __vector.push_back(std.string(__item))
          }
          return __vector
        }())
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_std__vector_std__string__ in
      if let __unwrappedValue = incompleteServiceUUIDs32 {
        return bridge.create_std__optional_std__vector_std__string__({ () -> bridge.std__vector_std__string_ in
          var __vector = bridge.create_std__vector_std__string_(__unwrappedValue.count)
          for __item in __unwrappedValue {
            __vector.push_back(std.string(__item))
          }
          return __vector
        }())
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_std__vector_std__string__ in
      if let __unwrappedValue = completeServiceUUIDs32 {
        return bridge.create_std__optional_std__vector_std__string__({ () -> bridge.std__vector_std__string_ in
          var __vector = bridge.create_std__vector_std__string_(__unwrappedValue.count)
          for __item in __unwrappedValue {
            __vector.push_back(std.string(__item))
          }
          return __vector
        }())
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_std__vector_std__string__ in
      if let __unwrappedValue = incompleteServiceUUIDs128 {
        return bridge.create_std__optional_std__vector_std__string__({ () -> bridge.std__vector_std__string_ in
          var __vector = bridge.create_std__vector_std__string_(__unwrappedValue.count)
          for __item in __unwrappedValue {
            __vector.push_back(std.string(__item))
          }
          return __vector
        }())
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_std__vector_std__string__ in
      if let __unwrappedValue = completeServiceUUIDs128 {
        return bridge.create_std__optional_std__vector_std__string__({ () -> bridge.std__vector_std__string_ in
          var __vector = bridge.create_std__vector_std__string_(__unwrappedValue.count)
          for __item in __unwrappedValue {
            __vector.push_back(std.string(__item))
          }
          return __vector
        }())
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_std__string_ in
      if let __unwrappedValue = shortenedLocalName {
        return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_std__string_ in
      if let __unwrappedValue = completeLocalName {
        return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_double_ in
      if let __unwrappedValue = txPowerLevel {
        return bridge.create_std__optional_double_(__unwrappedValue)
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_std__vector_std__string__ in
      if let __unwrappedValue = serviceSolicitationUUIDs16 {
        return bridge.create_std__optional_std__vector_std__string__({ () -> bridge.std__vector_std__string_ in
          var __vector = bridge.create_std__vector_std__string_(__unwrappedValue.count)
          for __item in __unwrappedValue {
            __vector.push_back(std.string(__item))
          }
          return __vector
        }())
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_std__vector_std__string__ in
      if let __unwrappedValue = serviceSolicitationUUIDs128 {
        return bridge.create_std__optional_std__vector_std__string__({ () -> bridge.std__vector_std__string_ in
          var __vector = bridge.create_std__vector_std__string_(__unwrappedValue.count)
          for __item in __unwrappedValue {
            __vector.push_back(std.string(__item))
          }
          return __vector
        }())
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_std__vector_ServiceDataEntry__ in
      if let __unwrappedValue = serviceData16 {
        return bridge.create_std__optional_std__vector_ServiceDataEntry__({ () -> bridge.std__vector_ServiceDataEntry_ in
          var __vector = bridge.create_std__vector_ServiceDataEntry_(__unwrappedValue.count)
          for __item in __unwrappedValue {
            __vector.push_back(__item)
          }
          return __vector
        }())
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_std__vector_ServiceDataEntry__ in
      if let __unwrappedValue = serviceData32 {
        return bridge.create_std__optional_std__vector_ServiceDataEntry__({ () -> bridge.std__vector_ServiceDataEntry_ in
          var __vector = bridge.create_std__vector_ServiceDataEntry_(__unwrappedValue.count)
          for __item in __unwrappedValue {
            __vector.push_back(__item)
          }
          return __vector
        }())
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_std__vector_ServiceDataEntry__ in
      if let __unwrappedValue = serviceData128 {
        return bridge.create_std__optional_std__vector_ServiceDataEntry__({ () -> bridge.std__vector_ServiceDataEntry_ in
          var __vector = bridge.create_std__vector_ServiceDataEntry_(__unwrappedValue.count)
          for __item in __unwrappedValue {
            __vector.push_back(__item)
          }
          return __vector
        }())
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_double_ in
      if let __unwrappedValue = appearance {
        return bridge.create_std__optional_double_(__unwrappedValue)
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_std__vector_std__string__ in
      if let __unwrappedValue = serviceSolicitationUUIDs32 {
        return bridge.create_std__optional_std__vector_std__string__({ () -> bridge.std__vector_std__string_ in
          var __vector = bridge.create_std__vector_std__string_(__unwrappedValue.count)
          for __item in __unwrappedValue {
            __vector.push_back(std.string(__item))
          }
          return __vector
        }())
      } else {
        return .init()
      }
    }(), { () -> bridge.std__optional_std__string_ in
      if let __unwrappedValue = manufacturerData {
        return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
      } else {
        return .init()
      }
    }())
  }

  @inline(__always)
  var flags: Double? {
    return { () -> Double? in
      if bridge.has_value_std__optional_double_(self.__flags) {
        let __unwrapped = bridge.get_std__optional_double_(self.__flags)
        return __unwrapped
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var incompleteServiceUUIDs16: [String]? {
    return { () -> [String]? in
      if bridge.has_value_std__optional_std__vector_std__string__(self.__incompleteServiceUUIDs16) {
        let __unwrapped = bridge.get_std__optional_std__vector_std__string__(self.__incompleteServiceUUIDs16)
        return __unwrapped.map({ __item in String(__item) })
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var completeServiceUUIDs16: [String]? {
    return { () -> [String]? in
      if bridge.has_value_std__optional_std__vector_std__string__(self.__completeServiceUUIDs16) {
        let __unwrapped = bridge.get_std__optional_std__vector_std__string__(self.__completeServiceUUIDs16)
        return __unwrapped.map({ __item in String(__item) })
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var incompleteServiceUUIDs32: [String]? {
    return { () -> [String]? in
      if bridge.has_value_std__optional_std__vector_std__string__(self.__incompleteServiceUUIDs32) {
        let __unwrapped = bridge.get_std__optional_std__vector_std__string__(self.__incompleteServiceUUIDs32)
        return __unwrapped.map({ __item in String(__item) })
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var completeServiceUUIDs32: [String]? {
    return { () -> [String]? in
      if bridge.has_value_std__optional_std__vector_std__string__(self.__completeServiceUUIDs32) {
        let __unwrapped = bridge.get_std__optional_std__vector_std__string__(self.__completeServiceUUIDs32)
        return __unwrapped.map({ __item in String(__item) })
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var incompleteServiceUUIDs128: [String]? {
    return { () -> [String]? in
      if bridge.has_value_std__optional_std__vector_std__string__(self.__incompleteServiceUUIDs128) {
        let __unwrapped = bridge.get_std__optional_std__vector_std__string__(self.__incompleteServiceUUIDs128)
        return __unwrapped.map({ __item in String(__item) })
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var completeServiceUUIDs128: [String]? {
    return { () -> [String]? in
      if bridge.has_value_std__optional_std__vector_std__string__(self.__completeServiceUUIDs128) {
        let __unwrapped = bridge.get_std__optional_std__vector_std__string__(self.__completeServiceUUIDs128)
        return __unwrapped.map({ __item in String(__item) })
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var shortenedLocalName: String? {
    return { () -> String? in
      if bridge.has_value_std__optional_std__string_(self.__shortenedLocalName) {
        let __unwrapped = bridge.get_std__optional_std__string_(self.__shortenedLocalName)
        return String(__unwrapped)
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var completeLocalName: String? {
    return { () -> String? in
      if bridge.has_value_std__optional_std__string_(self.__completeLocalName) {
        let __unwrapped = bridge.get_std__optional_std__string_(self.__completeLocalName)
        return String(__unwrapped)
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var txPowerLevel: Double? {
    return { () -> Double? in
      if bridge.has_value_std__optional_double_(self.__txPowerLevel) {
        let __unwrapped = bridge.get_std__optional_double_(self.__txPowerLevel)
        return __unwrapped
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var serviceSolicitationUUIDs16: [String]? {
    return { () -> [String]? in
      if bridge.has_value_std__optional_std__vector_std__string__(self.__serviceSolicitationUUIDs16) {
        let __unwrapped = bridge.get_std__optional_std__vector_std__string__(self.__serviceSolicitationUUIDs16)
        return __unwrapped.map({ __item in String(__item) })
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var serviceSolicitationUUIDs128: [String]? {
    return { () -> [String]? in
      if bridge.has_value_std__optional_std__vector_std__string__(self.__serviceSolicitationUUIDs128) {
        let __unwrapped = bridge.get_std__optional_std__vector_std__string__(self.__serviceSolicitationUUIDs128)
        return __unwrapped.map({ __item in String(__item) })
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var serviceData16: [ServiceDataEntry]? {
    return { () -> [ServiceDataEntry]? in
      if bridge.has_value_std__optional_std__vector_ServiceDataEntry__(self.__serviceData16) {
        let __unwrapped = bridge.get_std__optional_std__vector_ServiceDataEntry__(self.__serviceData16)
        return __unwrapped.map({ __item in __item })
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var serviceData32: [ServiceDataEntry]? {
    return { () -> [ServiceDataEntry]? in
      if bridge.has_value_std__optional_std__vector_ServiceDataEntry__(self.__serviceData32) {
        let __unwrapped = bridge.get_std__optional_std__vector_ServiceDataEntry__(self.__serviceData32)
        return __unwrapped.map({ __item in __item })
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var serviceData128: [ServiceDataEntry]? {
    return { () -> [ServiceDataEntry]? in
      if bridge.has_value_std__optional_std__vector_ServiceDataEntry__(self.__serviceData128) {
        let __unwrapped = bridge.get_std__optional_std__vector_ServiceDataEntry__(self.__serviceData128)
        return __unwrapped.map({ __item in __item })
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var appearance: Double? {
    return { () -> Double? in
      if bridge.has_value_std__optional_double_(self.__appearance) {
        let __unwrapped = bridge.get_std__optional_double_(self.__appearance)
        return __unwrapped
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var serviceSolicitationUUIDs32: [String]? {
    return { () -> [String]? in
      if bridge.has_value_std__optional_std__vector_std__string__(self.__serviceSolicitationUUIDs32) {
        let __unwrapped = bridge.get_std__optional_std__vector_std__string__(self.__serviceSolicitationUUIDs32)
        return __unwrapped.map({ __item in String(__item) })
      } else {
        return nil
      }
    }()
  }
  
  @inline(__always)
  var manufacturerData: String? {
    return { () -> String? in
      if bridge.has_value_std__optional_std__string_(self.__manufacturerData) {
        let __unwrapped = bridge.get_std__optional_std__string_(self.__manufacturerData)
        return String(__unwrapped)
      } else {
        return nil
      }
    }()
  }
}
