BoxModel

public protocol BoxModel

Defines Box SDK model behavior

  • Raw data from the API that populates the model

    Declaration

    Swift

    var rawData: [String : Any] { get }
  • init(json:) Default implementation

    Initializer.

    Throws

    Decoding error

    Default Implementation

    “Deserialization” is just initialization the model with the original JSON. Initializer.

    Throws

    Decoding error

    Declaration

    Swift

    init(json: [String : Any]) throws

    Parameters

    json

    JSON in a dictionary form

  • Initializer.

    Throws

    Decoding error

    Declaration

    Swift

    init(json: Data) throws

    Parameters

    json

    JSON data

  • json() Default implementation

    Gets JSON string for a Box model object.

    Default Implementation

    Gets JSON string for a Box model object.

    Declaration

    Swift

    func json() -> String

    Return Value

    JSON string

  • toJSONString() Extension method

    Gets JSON string for a Box model object.

    Declaration

    Swift

    func toJSONString() -> String

    Return Value

    JSON string