Instantiate a new PositionSide from a dict (generally from loading a
        JSON response). The data used to instantiate the PositionSide is a
        shallow copy of the dict passed in, with any complex child types
        instantiated appropriately.

def from_dict(data, ctx):
        """
        Instantiate a new PositionSide from a dict (generally from loading a
        JSON response). The data used to instantiate the PositionSide is a
        shallow copy of the dict passed in, with any complex child types
        instantiated appropriately.
        """

        data = data.copy()

        if data.get('units') is not None:
            data['units'] = ctx.convert_decimal_number(
                data.get('units')
            )

        if data.get('averagePrice') is not None:
            data['averagePrice'] = ctx.convert_decimal_number(
                data.get('averagePrice')
            )


        if data.get('pl') is not None:
            data['pl'] = ctx.convert_decimal_number(
                data.get('pl')
            )

        if data.get('unrealizedPL') is not None:
            data['unrealizedPL'] = ctx.convert_decimal_number(
                data.get('unrealizedPL')
            )

        if data.get('resettablePL') is not None:
            data['resettablePL'] = ctx.convert_decimal_number(
                data.get('resettablePL')
            )

        if data.get('financing') is not None:
            data['financing'] = ctx.convert_decimal_number(
                data.get('financing')
            )

        if data.get('guaranteedExecutionFees') is not None:
            data['guaranteedExecutionFees'] = ctx.convert_decimal_number(
                data.get('guaranteedExecutionFees')
            )

        return PositionSide(**data)