Skip to content

Commit

Permalink
Revert unmerged changes from current master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Shaw committed Jan 21, 2020
1 parent e92e930 commit ff6313e
Showing 1 changed file with 4 additions and 35 deletions.
39 changes: 4 additions & 35 deletions src/DDoSX/RecordClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ class RecordClient extends BaseClient
];

/**
* Get paginated response of records
*
* @param int $page
* @param int $perPage
* @param int $page
* @param int $perPage
* @param array $filters
* @return int|\UKFast\SDK\Page
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function getPage($page = 1, $perPage = 20, $filters = [])
{
$filters = $this->friendlyToApi($filters, $this->requestMap);

$page = $this->paginatedRequest('v1/records', $page, $perPage, $filters);
$page->serializeWith(function ($item) {
return new Record($this->apiToFriendly($item, $this->requestMap));
Expand All @@ -41,37 +41,6 @@ public function getPage($page = 1, $perPage = 20, $filters = [])
}

/**
* Get singular records by its Id
*
* @param $domainName
* @param $recordId
* @return Record
*/
public function getById($domainName, $recordId)
{
$response = $this->request("GET", 'v1/domains/' . $domainName . '/records/' . $recordId);
$body = $this->decodeJson($response->getBody()->getContents());

return new Record($this->apiToFriendly($body, $this->requestMap));
}

/**
* Delete a record
*
* @param Record $record
* @return bool
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function destroy(Record $record)
{
$response = $this->delete("v1/domains/".$record->domain_name."/records/".$record->id);

return $response->getStatusCode() == 204;
}

/**
* Get paginated response of records associated with a domain name
*
* @param $domainName
* @param int $page
* @param int $perPage
Expand Down

0 comments on commit ff6313e

Please sign in to comment.