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

import NitroModules

/// See ``HybridUrlRequestSpec``
public protocol HybridUrlRequestSpec_protocol: HybridObject {
  // Properties
  

  // Methods
  func start() throws -> Void
  func followRedirect() throws -> Void
  func read() throws -> Void
  func cancel() throws -> Void
  func isDone() throws -> Bool
}

public extension HybridUrlRequestSpec_protocol {
  /// Default implementation of ``HybridObject.toString``
  func toString() -> String {
    return "[HybridObject UrlRequest]"
  }
}

/// See ``HybridUrlRequestSpec``
open class HybridUrlRequestSpec_base {
  private weak var cxxWrapper: HybridUrlRequestSpec_cxx? = nil
  public init() { }
  public func getCxxWrapper() -> HybridUrlRequestSpec_cxx {
  #if DEBUG
    guard self is any HybridUrlRequestSpec else {
      fatalError("`self` is not a `HybridUrlRequestSpec`! Did you accidentally inherit from `HybridUrlRequestSpec_base` instead of `HybridUrlRequestSpec`?")
    }
  #endif
    if let cxxWrapper = self.cxxWrapper {
      return cxxWrapper
    } else {
      let cxxWrapper = HybridUrlRequestSpec_cxx(self as! any HybridUrlRequestSpec)
      self.cxxWrapper = cxxWrapper
      return cxxWrapper
    }
  }
}

/**
 * A Swift base-protocol representing the UrlRequest HybridObject.
 * Implement this protocol to create Swift-based instances of UrlRequest.
 * ```swift
 * class HybridUrlRequest : HybridUrlRequestSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridUrlRequestSpec = HybridUrlRequestSpec_protocol & HybridUrlRequestSpec_base
