protected function checkParameters(array $parameters)
    {
        if (!array_key_exists('record_type', $parameters)) {
            throw new \InvalidArgumentException('You need to provide the record_type.');
        }

        if (!in_array($parameters['record_type'], array('A', 'CNAME', 'NS', 'TXT', 'MX', 'SRV'))) {
            throw new \InvalidArgumentException('The record_type can only be A, CNAME, NS, TXT, MX or SRV');
        }

        if (!array_key_exists('data', $parameters) || !is_string($parameters['data'])) {
            throw new \InvalidArgumentException('You need to provide the data value of the record.');
        }

        if (in_array($parameters['record_type'], array('A', 'CNAME', 'TXT', 'SRV'))) {
            if (!array_key_exists('name', $parameters) || !is_string($parameters['name'])) {
                throw new \InvalidArgumentException('You need to provide the name string if the record_type is A, CNAME, TXT or SRV.');
            }
        }

        if (in_array($parameters['record_type'], array('SRV', 'MX'))) {
            if (!array_key_exists('priority', $parameters) || !is_int($parameters['priority'])) {
                throw new \InvalidArgumentException('You need to provide the priority integer if the record_type is SRV or MX.');
            }
        }

        if ('SRV' === $parameters['record_type']) {
            if (!array_key_exists('port', $parameters) || !is_int($parameters['port'])) {
                throw new \InvalidArgumentException('You need to provide the port integer if the record_type is SRV.');
            }
        }

        if ('SRV' === $parameters['record_type']) {
            if (!array_key_exists('weight', $parameters) || !is_int($parameters['weight'])) {
                throw new \InvalidArgumentException('You need to provide the weight integer if the record_type is SRV.');
            }
        }
    }