body = $requestBody; $this->queryParameters = $queryParameters; $this->accept = $accept; } public function getMethod(): string { return 'POST'; } public function getUri(): string { return '/plugins/create'; } public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { if (\is_string($this->body) || \is_resource($this->body) || $this->body instanceof \Psr\Http\Message\StreamInterface) { return [['Content-Type' => ['application/x-tar']], $this->body]; } return [[], null]; } public function getExtraHeaders(): array { if (empty($this->accept)) { return ['Accept' => ['application/json', 'text/plain']]; } return $this->accept; } protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver { $optionsResolver = parent::getQueryOptionsResolver(); $optionsResolver->setDefined(['name']); $optionsResolver->setRequired(['name']); $optionsResolver->setDefaults([]); $optionsResolver->addAllowedTypes('name', ['string']); return $optionsResolver; } /** * @throws \Docker\API\Exception\PluginCreateInternalServerErrorException * * @return null */ protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) { $status = $response->getStatusCode(); $body = (string) $response->getBody(); if (204 === $status) { } if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) { throw new \Docker\API\Exception\PluginCreateInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response); } } public function getAuthenticationScopes(): array { return []; } }