WrappedResponse

@objc(SFMCSdkWrappedResponse)
public class WrappedResponse : NSObject

This class is a network response wrapper

  • Tag: WrappedResponse
  • Response data

    Declaration

    Swift

    @objc
    public let data: Data?
  • Network Response to an HTTP URL load

    Declaration

    Swift

    @objc
    public let response: HTTPURLResponse?
  • Generic error (optional)

    Declaration

    Swift

    @objc
    public let error: Error?
  • Success status based on the response status code (200-299 is considered a successful call)

    Declaration

    Swift

    @objc
    public var isSuccess: Bool { get }
  • Autorization status based on the response status code (401 is unautorized)

    Declaration

    Swift

    @objc
    public var isUnauthorized: Bool { get }
  • Time left on the execution timespan of the request

    Declaration

    Swift

    @objc
    public var timeToExecute: Int64 { get }
  • Declaration

    Swift

    @objc
    public init(
      data: Data? = nil,
      response: URLResponse? = nil,
      error: Error? = nil,
      startTimeMillis: Int64 = Int64(Date().timeIntervalSince1970 * 1000),
      endTimeMillis: Int64 = Int64(Date().timeIntervalSince1970 * 1000)
    )