Skip to content

Commit

Permalink
export
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterjan.eilers committed Aug 28, 2024
1 parent 5621a8d commit 0b22177
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/Api/BrandsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ public function list(
return BrandCollection::fromArray($response->json());
}

public function export(
string $customer,
array $parameters = []
): array {
$query = $parameters;
$query['export'] = 'true';
$response = $this->client->get("/v2/customers/{$customer}/brands", $query);
return $response->json()['entities'];
}

/**
* @see https://dm.realtimeregister.com/docs/api/brands/create
*
Expand Down
7 changes: 7 additions & 0 deletions src/Api/DomainsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ public function list(
return DomainDetailsCollection::fromArray($response->json());
}

public function export(array $parameters = []): array {
$query = $parameters;
$query['export'] = 'true';
$response = $this->client->get('v2/domains', $query);
return $response->json()['entities'];
}

/* @see https://dm.realtimeregister.com/docs/api/domains/check */
public function check(string $domainName, ?string $languageCode = null): DomainAvailability
{
Expand Down
7 changes: 7 additions & 0 deletions src/Api/ProvidersApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ public function list(
return ProviderCollection::fromArray($response->json());
}

public function export(array $parameters = []): array {
$query = $parameters;
$query['export'] = 'true';
$response = $this->client->get('v2/providers', $query);
return $response->json()['entities'];
}

/* @see https://dm.realtimeregister.com/docs/api/providers/downtime/get */
public function getDowntime(int $id): Downtime
{
Expand Down
2 changes: 1 addition & 1 deletion src/Domain/AbstractCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public static function fromArray(array $json)
}

// Instantiate pagination object
if (array_key_exists('pagination', $json) && $json['pagination']['limit']) {
if (array_key_exists('pagination', $json)) {
$pagination = Pagination::fromArray($json['pagination']);
} else {
$pagination = Pagination::fromArray([
Expand Down

0 comments on commit 0b22177

Please sign in to comment.