hetzner-dns-api/generated/Endpoint/ExportZoneFile.php

61 lines
2.1 KiB
PHP
Raw Normal View History

2023-01-05 12:55:52 +01:00
<?php
namespace DigiComp\HetznerDnsApi\Endpoint;
class ExportZoneFile extends \DigiComp\HetznerDnsApi\Runtime\Client\BaseEndpoint implements \DigiComp\HetznerDnsApi\Runtime\Client\Endpoint
{
protected $ZoneID;
/**
* Export a zone file.
*
* @param string $zoneID ID of zone to be exported
*/
public function __construct(string $zoneID)
{
$this->ZoneID = $zoneID;
}
use \DigiComp\HetznerDnsApi\Runtime\Client\EndpointTrait;
public function getMethod() : string
{
return 'GET';
}
public function getUri() : string
{
return str_replace(array('{ZoneID}'), array($this->ZoneID), '/zones/{ZoneID}/export');
}
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null) : array
{
return array(array(), null);
}
/**
* {@inheritdoc}
*
* @throws \DigiComp\HetznerDnsApi\Exception\ExportZoneFileUnauthorizedException
* @throws \DigiComp\HetznerDnsApi\Exception\ExportZoneFileForbiddenException
* @throws \DigiComp\HetznerDnsApi\Exception\ExportZoneFileNotFoundException
* @throws \DigiComp\HetznerDnsApi\Exception\ExportZoneFileUnprocessableEntityException
*
* @return null
*/
protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
{
if (200 === $status) {
}
if (401 === $status) {
throw new \DigiComp\HetznerDnsApi\Exception\ExportZoneFileUnauthorizedException();
}
if (403 === $status) {
throw new \DigiComp\HetznerDnsApi\Exception\ExportZoneFileForbiddenException();
}
if (404 === $status) {
throw new \DigiComp\HetznerDnsApi\Exception\ExportZoneFileNotFoundException();
}
if (422 === $status) {
throw new \DigiComp\HetznerDnsApi\Exception\ExportZoneFileUnprocessableEntityException();
}
}
public function getAuthenticationScopes() : array
{
return array('Auth-API-Token');
}
}