Joli\Jane\OpenApi\Tests\Expected\Resource\DefaultResource::getAnotherThing PHP Method

getAnotherThing() public method

public getAnotherThing ( array $parameters = [], string $fetch = self::FETCH_OBJECT ) : Psr\Http\Message\ResponseInterface | Thing
$parameters array List of parameters
$fetch string Fetch mode (object or response)
return Psr\Http\Message\ResponseInterface | Joli\Jane\OpenApi\Tests\Expected\Model\Thing
    public function getAnotherThing($parameters = [], $fetch = self::FETCH_OBJECT)
    {
        $queryParam = new QueryParam();
        $url = '/another-things';
        $url = $url . ('?' . $queryParam->buildQueryString($parameters));
        $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters));
        $body = $queryParam->buildFormDataString($parameters);
        $request = $this->messageFactory->createRequest('GET', $url, $headers, $body);
        $promise = $this->httpClient->sendAsyncRequest($request);
        if (self::FETCH_PROMISE === $fetch) {
            return $promise;
        }
        $response = $promise->wait();
        if (self::FETCH_OBJECT == $fetch) {
            if ('200' == $response->getStatusCode()) {
                return $this->serializer->deserialize((string) $response->getBody(), 'Joli\\Jane\\OpenApi\\Tests\\Expected\\Model\\Thing', 'json');
            }
        }
        return $response;
    }