-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
258 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
namespace ChargeHive\Php\Sdk\Generated\Endpoint; | ||
|
||
class ChargeSummaryRetrieve extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint | ||
{ | ||
protected $charge_id; | ||
/** | ||
* | ||
* | ||
* @param string $chargeId | ||
*/ | ||
public function __construct(string $chargeId) | ||
{ | ||
$this->charge_id = $chargeId; | ||
} | ||
use \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; | ||
public function getMethod() : string | ||
{ | ||
return 'GET'; | ||
} | ||
public function getUri() : string | ||
{ | ||
return str_replace(array('{charge_id}'), array($this->charge_id), '/v1/charge/{charge_id}/summary'); | ||
} | ||
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null) : array | ||
{ | ||
return array(array(), null); | ||
} | ||
public function getExtraHeaders() : array | ||
{ | ||
return array('Accept' => array('application/json')); | ||
} | ||
/** | ||
* {@inheritdoc} | ||
* | ||
* | ||
* @return null|\ChargeHive\Php\Sdk\Generated\Model\ChargehiveChargeSummaryRetrieveResponse|\ChargeHive\Php\Sdk\Generated\Model\RuntimeError | ||
*/ | ||
protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null) | ||
{ | ||
if (200 === $status) { | ||
return $serializer->deserialize($body, 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChargehiveChargeSummaryRetrieveResponse', 'json'); | ||
} | ||
return $serializer->deserialize($body, 'ChargeHive\\Php\\Sdk\\Generated\\Model\\RuntimeError', 'json'); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
generated/Model/ChargehiveChargeSummaryRetrieveResponse.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
namespace ChargeHive\Php\Sdk\Generated\Model; | ||
|
||
class ChargehiveChargeSummaryRetrieveResponse implements \JsonSerializable | ||
{ | ||
/** | ||
* | ||
* | ||
* @var ChtypeChargeSummary | ||
*/ | ||
protected $chargeSummary; | ||
/** | ||
* | ||
* | ||
* @return ChtypeChargeSummary | ||
*/ | ||
public function getChargeSummary() | ||
{ | ||
return $this->chargeSummary; | ||
} | ||
/** | ||
* | ||
* | ||
* @param ChtypeChargeSummary $chargeSummary | ||
* | ||
* @return self | ||
*/ | ||
public function setChargeSummary(ChtypeChargeSummary $chargeSummary) | ||
{ | ||
$this->chargeSummary = $chargeSummary; | ||
return $this; | ||
} | ||
public function jsonSerialize() | ||
{ | ||
return ['chargeSummary' => $this->chargeSummary]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
|
||
namespace ChargeHive\Php\Sdk\Generated\Model; | ||
|
||
class ChtypeChargeSummary implements \JsonSerializable | ||
{ | ||
/** | ||
* | ||
* | ||
* @var ChtypeAmount | ||
*/ | ||
protected $amount; | ||
/** | ||
* | ||
* | ||
* @var string | ||
*/ | ||
protected $status = 'STATUS_INVALID'; | ||
/** | ||
* | ||
* | ||
* @return ChtypeAmount | ||
*/ | ||
public function getAmount() | ||
{ | ||
return $this->amount; | ||
} | ||
/** | ||
* | ||
* | ||
* @param ChtypeAmount $amount | ||
* | ||
* @return self | ||
*/ | ||
public function setAmount(ChtypeAmount $amount) | ||
{ | ||
$this->amount = $amount; | ||
return $this; | ||
} | ||
/** | ||
* | ||
* | ||
* @return string | ||
*/ | ||
public function getStatus() | ||
{ | ||
return $this->status; | ||
} | ||
/** | ||
* | ||
* | ||
* @param string $status | ||
* | ||
* @return self | ||
*/ | ||
public function setStatus(string $status) | ||
{ | ||
$this->status = $status; | ||
return $this; | ||
} | ||
public function jsonSerialize() | ||
{ | ||
return ['amount' => $this->amount, 'status' => $this->status]; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
generated/Normalizer/ChargehiveChargeSummaryRetrieveResponseNormalizer.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
namespace ChargeHive\Php\Sdk\Generated\Normalizer; | ||
|
||
use Jane\JsonSchemaRuntime\Reference; | ||
use Symfony\Component\Serializer\Exception\InvalidArgumentException; | ||
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; | ||
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; | ||
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; | ||
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; | ||
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; | ||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; | ||
class ChargehiveChargeSummaryRetrieveResponseNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface | ||
{ | ||
use DenormalizerAwareTrait; | ||
use NormalizerAwareTrait; | ||
public function supportsDenormalization($data, $type, $format = null) | ||
{ | ||
return $type === 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChargehiveChargeSummaryRetrieveResponse'; | ||
} | ||
public function supportsNormalization($data, $format = null) | ||
{ | ||
return get_class($data) === 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChargehiveChargeSummaryRetrieveResponse'; | ||
} | ||
public function denormalize($data, $class, $format = null, array $context = array()) | ||
{ | ||
if (!is_object($data)) { | ||
throw new InvalidArgumentException(); | ||
} | ||
$object = new \ChargeHive\Php\Sdk\Generated\Model\ChargehiveChargeSummaryRetrieveResponse(); | ||
if (property_exists($data, 'chargeSummary')) { | ||
$object->setChargeSummary($this->denormalizer->denormalize($data->{'chargeSummary'}, 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChtypeChargeSummary', 'json', $context)); | ||
} | ||
return $object; | ||
} | ||
public function normalize($object, $format = null, array $context = array()) | ||
{ | ||
$data = new \stdClass(); | ||
if (null !== $object->getChargeSummary()) { | ||
$data->{'chargeSummary'} = $this->normalizer->normalize($object->getChargeSummary(), 'json', $context); | ||
} | ||
return $data; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
namespace ChargeHive\Php\Sdk\Generated\Normalizer; | ||
|
||
use Jane\JsonSchemaRuntime\Reference; | ||
use Symfony\Component\Serializer\Exception\InvalidArgumentException; | ||
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; | ||
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; | ||
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; | ||
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; | ||
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; | ||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; | ||
class ChtypeChargeSummaryNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface | ||
{ | ||
use DenormalizerAwareTrait; | ||
use NormalizerAwareTrait; | ||
public function supportsDenormalization($data, $type, $format = null) | ||
{ | ||
return $type === 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChtypeChargeSummary'; | ||
} | ||
public function supportsNormalization($data, $format = null) | ||
{ | ||
return get_class($data) === 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChtypeChargeSummary'; | ||
} | ||
public function denormalize($data, $class, $format = null, array $context = array()) | ||
{ | ||
if (!is_object($data)) { | ||
throw new InvalidArgumentException(); | ||
} | ||
$object = new \ChargeHive\Php\Sdk\Generated\Model\ChtypeChargeSummary(); | ||
if (property_exists($data, 'amount')) { | ||
$object->setAmount($this->denormalizer->denormalize($data->{'amount'}, 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChtypeAmount', 'json', $context)); | ||
} | ||
if (property_exists($data, 'status')) { | ||
$object->setStatus($data->{'status'}); | ||
} | ||
return $object; | ||
} | ||
public function normalize($object, $format = null, array $context = array()) | ||
{ | ||
$data = new \stdClass(); | ||
if (null !== $object->getAmount()) { | ||
$data->{'amount'} = $this->normalizer->normalize($object->getAmount(), 'json', $context); | ||
} | ||
if (null !== $object->getStatus()) { | ||
$data->{'status'} = $object->getStatus(); | ||
} | ||
return $data; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters