@param \DnsUpdater\Value\Record[] $records
@param string $domain
@param string $name
@param string $type

@return \DnsUpdater\Value\Record|null
557839
private function findRecord(array $records, string $domain, string $name, string $type): ?Record
    {
        foreach ($records as $record) {
            if (
                $domain === $record->getDomain() &&
                $name === $record->getName() &&
                $type === $record->getType()
            ) {
                return $record;
            }
        }

        return null;
    }
188437
def _update_record(self, identifier, rtype=None, name=None, content=None):
        
        if self.protocol == 'rpc':
            return self.rpc_helper.update_record(identifier, rtype, name, content)

        data = {}
        if rtype:
            data['rrset_type'] = rtype
        if name:
            data['rrset_name'] = self._relative_name(name)
        if content:
            if isinstance(content, (list, tuple, set)):
                data['rrset_values'] = list(content)
            else:
                data['rrset_values'] = [content]
        if rtype is not None:
            # replace the records of a specific rtype
            url = '/domains/{0}/records/{1}/{2}'.format(self.domain_id,
                                                        identifier or self._relative_name(
                                                            name),
                                                        rtype)
            self._put(url, data)
        else:
            # replace all records with a matching name
            url = '/domains/{0}/records/{1}'.format(self.domain_id,
                                                    identifier or self._relative_name(name))
            self._put(url, {'items': [data]})
        LOGGER.debug('update_record: %s', True)
        return True
447027
def query_dns(cls, domains, records):
        
        results = {k: set() for k in records}
        for record in records:
            for domain in domains:
                try:
                    answers = cls.resolver.query(domain, record)
                    for answer in answers:
                        # Add value to record type
                        results.get(record).add(answer)
                except (resolver.NoAnswer, resolver.NXDOMAIN, resolver.NoNameservers):
                    # Type of record doesn't fit domain or no answer from ns
                    continue

        return {k: v for k, v in results.items() if v}
1015193
def records(cls, fqdn, sort_by=None, text=False):
        """"""
        meta = cls.get_fqdn_info(fqdn)
        url = meta['domain_records_href']
        kwargs = {}
        if text:
            kwargs = {'headers': {'Accept': 'text/plain'}}
        return cls.json_get(cls.get_sort_url(url, sort_by), **kwargs)
1270039
@Trace(dispatcher = true)
	public List<Record> listAll(Long domainId) throws GloboDnsException {
		NewRelic.setTransactionName(null, "/globodns/listRecords");
		if (domainId == null) {
			throw new GloboDnsException("Domain id cannot be null");
		}
		
		GloboDnsRoot<Record> globoDnsRoot = this.get("/domains/" + domainId + "/records.json", true);
		if (globoDnsRoot == null) {
			throw new GloboDnsException("Invalid response");
		}
		return globoDnsRoot.getObjectList();
	}
973779
public function addDNSRecord($domain, $rec, $type, $val, $priority)
    {
        $this->send('v-add-dns-record', $this->userName, $domain, $rec, $type, $val, $priority);
    }
521557
public static function findFirstByNameType( $name, $type, $config = [] ) {

		return self::queryByNameType( $name, $type, $config )->one();
	}
799617
def records(self, domain, params=None):
        ''' 
        '''
        params = update_params(params, {'domain': domain})
        return self.request('/v1/dns/records', params, 'GET')
553913
public function bindValue($name, $value, $type = null)
    {
        return $this->stmt->bindValue($name, $value, $type);
    }
181392
public function changeDNSDomainRecord($domain, $recordId, $val, $priority)
    {
        return $this->send('v-change-dns-record', $this->userName, $domain, $recordId, $val,
            $priority);
    }
375892
def search_records(self, domain, record_type, name=None, data=None):
        
        search_params = []
        if name:
            search_params.append("name=%s" % name)
        if data:
            search_params.append("data=%s" % data)
        query_string = "&".join(search_params)
        dom_id = utils.get_id(domain)
        uri = "/domains/%s/records?type=%s" % (dom_id, record_type)
        if query_string:
            uri = "%s&%s" % (uri, query_string)
        resp, body = self._retry_get(uri)
        records = body.get("records", [])
        self._reset_paging("record", body)
        rec_paging = self._paging.get("record", {})
        while rec_paging.get("next_uri"):
            resp, body = self._retry_get(rec_paging.get("next_uri"))
            self._reset_paging("record", body)
            records.extend(body.get("records", []))
        for record in records:
            record["domain_id"] = dom_id
        return [CloudDNSRecord(self, record, loaded=False)
                for record in records if record]
708502
def _update_records(self, records, data):
        
        data = {k: v for k, v in data.items() if v}
        records = [dict(record, **data) for record in records]
        return self._apicall(
            'updateDnsRecords',
            domainname=self.domain,
            dnsrecordset={'dnsrecords': records},
        ).get('dnsrecords', [])
986543
def CreateRecord(record_type, host, results):
        
        record_class = dns_tag_lookup[record_type]
        record = etree.Element("a")
        record.set("host", host)
        for params in results:
            result = etree.Element("result")
            for k,v in params.iteritems():
                result.set(k, v)
            record.append(result)

        return record_class(record)
855968
public static function triggerOnValidation(string $name, array $record): self
    {
        $exception = new static('Record validation failed');
        $exception->name = $name;
        $exception->record = $record;

        return $exception;
    }
517771
def loadRecord(self, domain, rtype, callback=None, errback=None):
        
        rec = Record(self, domain, rtype)
        return rec.load(callback=callback, errback=errback)
750815
protected function _addRecipient($type, $address, $name = null)
    {
        $classes = $this->_classes;
        $headers = $this->headers();
        if (!isset($headers[$type])) {
            $addresses = $classes['addresses'];
            $headers[$type] = new $addresses();
        }
        $class = $classes['address'];
        $value = new $class($address, $name);
        $headers[$type][] = $value;
        return $value;
    }
787946
public function requestField(string $type, string $name): void
    {
        $this->fields[$type][] = $name;
        $this->updateUriQuery();
    }