ObjectDeserializer

public enum ObjectDeserializer

Provides methods for deserialization JSON data to custom objects

  • Deserializes Data? object to the type that conforms to BoxModel and returns a Result of this type if success or BoxSDKError on failure.

    Declaration

    Swift

    public static func deserialize<ReturnType>(data: Data?) -> Result<ReturnType, BoxSDKError> where ReturnType : BoxModel

    Parameters

    data

    Binary data to deserialize

    Return Value

    Returns an object if success otherwise error

  • Deserializes BoxResponse object to the type that conforms to Decodable and returns a Result of this type if success or BoxSDKError on failure.

    Declaration

    Swift

    public static func deserialize<ReturnType>(response: BoxResponse) -> Result<ReturnType, BoxSDKError> where ReturnType : Decodable

    Parameters

    response

    The BoxResponse object which body will be deserialize

    Return Value

    Returns an object if success otherwise error