final class RecordResource (View source)

The JSON shape of a record on /api/v2. The list endpoints report the fully qualified name, the single-record endpoints the name relative to the zone; both are contract and neither may drift without the other being reviewed.

Methods

static array
item(array $row, int $zoneId, string $zoneName, callable $formatId)

A single record as GET, POST and PUT /zones/{id}/records emit it: the name relative to the zone, the zone id second. A row without an id (the readback after a write failed) reports null.

static array
listItem(array $row, callable $formatId)

A record as the listing emits it: fully qualified name, no zone id.

static array
rrsetMember(array $row)

A member of an RRSet: the per-record values without name, type or ttl.

static string
stripTxtQuotes(string $content, string $type)

V2 quotes single-string TXT content on the way in and unquotes it on the way out; a multi-string value keeps its quoting so the parts stay distinct.

Details

static array item(array $row, int $zoneId, string $zoneName, callable $formatId)

A single record as GET, POST and PUT /zones/{id}/records emit it: the name relative to the zone, the zone id second. A row without an id (the readback after a write failed) reports null.

Parameters

array $row
int $zoneId
string $zoneName
callable $formatId

Return Value

array

static array listItem(array $row, callable $formatId)

A record as the listing emits it: fully qualified name, no zone id.

Parameters

array $row
callable $formatId

Return Value

array

static array rrsetMember(array $row)

A member of an RRSet: the per-record values without name, type or ttl.

Parameters

array $row

Return Value

array

static string stripTxtQuotes(string $content, string $type)

V2 quotes single-string TXT content on the way in and unquotes it on the way out; a multi-string value keeps its quoting so the parts stay distinct.

Parameters

string $content
string $type

Return Value

string