1
0

Automated commit message

This commit is contained in:
PayPalServerSDKs
2024-09-04 15:55:32 +00:00
parent c9cb1ad04a
commit f6cd8b4d4f
732 changed files with 73611 additions and 1 deletions

45
src/Http/ApiResponse.php Normal file
View File

@@ -0,0 +1,45 @@
<?php
declare(strict_types=1);
/*
* PayPalRESTAPIsLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
namespace PayPalRESTAPIsLib\Http;
use Core\Types\Sdk\CoreApiResponse;
/**
* Holds the result of an API call.
*/
class ApiResponse extends CoreApiResponse
{
/**
* Create a new instance of this class with the given context and result.
*
* @param mixed $decodedBody Decoded response body
* @param mixed $result Deserialized result from the response
* @param HttpContext $context Http context
*/
public static function createFromContext($decodedBody, $result, HttpContext $context): self
{
$request = $context->getRequest();
$statusCode = $context->getResponse()->getStatusCode();
$reasonPhrase = null; // TODO
$headers = $context->getResponse()->getHeaders();
$body = $context->getResponse()->getRawBody();
return new self($request, $statusCode, $reasonPhrase, $headers, $result, $body);
}
/**
* Returns the original request that resulted in this response.
*/
public function getRequest(): HttpRequest
{
return $this->request;
}
}