public static function batchDryRun($json)
    {
        $fields = Deserialize::_fromJson($json);

        $result = new Api\MtBatchDryRunResult();
        $result->setNumberOfRecipients($fields->number_of_recipients);
        $result->setNumberOfMessages($fields->number_of_messages);

        if (isset($fields->per_recipient)) {
            $result->setPerRecipient(
                array_map(
                    function ($s) {
                        $pr = new Api\DryRunPerRecipient();
                        $pr->setRecipient($s->recipient);
                        $pr->setNumberOfParts($s->number_of_parts);
                        $pr->setBody($s->body);
                        $pr->setEncoding($s->encoding);
                        return $pr;
                    },
                    $fields->per_recipient
                )
            );
        }

        return $result;
    }