<?php

namespace NoahVet\Reef\Jane\Endpoint;

class GetABCD extends \NoahVet\Reef\Jane\Runtime\Client\BaseEndpoint implements \NoahVet\Reef\Jane\Runtime\Client\Endpoint
{
    use \NoahVet\Reef\Jane\Runtime\Client\EndpointTrait;

    protected $a;

    protected $b;

    protected $c;

    protected $d;

    /**
     * Get ABCD.
     *
     * @param string $a the dynamic name
     * @param string $b the dynamic name
     * @param string $c the dynamic name
     * @param string $d the dynamic name
     */
    public function __construct(string $a, string $b, string $c, string $d)
    {
        $this->a = $a;
        $this->b = $b;
        $this->c = $c;
        $this->d = $d;
    }

    public function getMethod(): string
    {
        return 'GET';
    }

    public function getUri(): string
    {
        return \str_replace(['{a}', '{b}', '{c}', '{d}'], [$this->a, $this->b, $this->c, $this->d], '/assets/{a}/{b}/{c}/{d}');
    }

    public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array
    {
        return [[], null];
    }

    public function getAuthenticationScopes(): array
    {
        return ['BearerAuth'];
    }

    /**
     * @return null
     *
     * @throws \NoahVet\Reef\Jane\Exception\GetABCDBadRequestException
     * @throws \NoahVet\Reef\Jane\Exception\GetABCDNotFoundException
     * @throws \NoahVet\Reef\Jane\Exception\UnexpectedStatusCodeException
     */
    protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
    {
        $status = $response->getStatusCode();
        $body = (string) $response->getBody();
        if (200 === $status) {
            return null;
        }
        if (400 === $status) {
            throw new \NoahVet\Reef\Jane\Exception\GetABCDBadRequestException($response);
        }
        if (404 === $status) {
            throw new \NoahVet\Reef\Jane\Exception\GetABCDNotFoundException($response);
        }
        throw new \NoahVet\Reef\Jane\Exception\UnexpectedStatusCodeException($status, $body);
    }
}
