-
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.
* Generate * Comment * Update comment * Update comment * Put refresh back
- Loading branch information
Showing
8 changed files
with
229 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?php | ||
|
||
return [ | ||
'openapi-file' => 'https://api.chargehive.com/swagger.json', | ||
//'openapi-file' => 'http://localhost:9051/swagger.json', // To use locally | ||
'namespace' => 'ChargeHive\\Php\\Sdk\\Generated', | ||
'directory' => __DIR__ . '/generated', | ||
]; |
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,49 @@ | ||
<?php | ||
|
||
namespace ChargeHive\Php\Sdk\Generated\Endpoint; | ||
|
||
class MethodSuspend extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint | ||
{ | ||
protected $token; | ||
/** | ||
* | ||
* | ||
* @param string $token | ||
* @param \ChargeHive\Php\Sdk\Generated\Model\ChargehiveMethodSuspendRequest $body | ||
*/ | ||
public function __construct(string $token, \ChargeHive\Php\Sdk\Generated\Model\ChargehiveMethodSuspendRequest $body) | ||
{ | ||
$this->token = $token; | ||
$this->body = $body; | ||
} | ||
use \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; | ||
public function getMethod() : string | ||
{ | ||
return 'POST'; | ||
} | ||
public function getUri() : string | ||
{ | ||
return str_replace(array('{token}'), array($this->token), '/v1/method/{token}/suspend'); | ||
} | ||
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, \Http\Message\StreamFactory $streamFactory = null) : array | ||
{ | ||
return $this->getSerializedBody($serializer); | ||
} | ||
public function getExtraHeaders() : array | ||
{ | ||
return array('Accept' => array('application/json')); | ||
} | ||
/** | ||
* {@inheritdoc} | ||
* | ||
* | ||
* @return null|\ChargeHive\Php\Sdk\Generated\Model\ChargehiveMethodSuspendResponse|\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\\ChargehiveMethodSuspendResponse', 'json'); | ||
} | ||
return $serializer->deserialize($body, 'ChargeHive\\Php\\Sdk\\Generated\\Model\\RuntimeError', 'json'); | ||
} | ||
} |
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 ChargehiveMethodSuspendRequest implements \JsonSerializable | ||
{ | ||
/** | ||
* | ||
* | ||
* @var string | ||
*/ | ||
protected $token; | ||
/** | ||
* | ||
* | ||
* @return string | ||
*/ | ||
public function getToken() | ||
{ | ||
return $this->token; | ||
} | ||
/** | ||
* | ||
* | ||
* @param string $token | ||
* | ||
* @return self | ||
*/ | ||
public function setToken(string $token) | ||
{ | ||
$this->token = $token; | ||
return $this; | ||
} | ||
public function jsonSerialize() | ||
{ | ||
return ['token' => $this->token]; | ||
} | ||
} |
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 ChargehiveMethodSuspendResponse implements \JsonSerializable | ||
{ | ||
/** | ||
* | ||
* | ||
* @var bool | ||
*/ | ||
protected $success; | ||
/** | ||
* | ||
* | ||
* @return bool | ||
*/ | ||
public function getSuccess() | ||
{ | ||
return $this->success; | ||
} | ||
/** | ||
* | ||
* | ||
* @param bool $success | ||
* | ||
* @return self | ||
*/ | ||
public function setSuccess(bool $success) | ||
{ | ||
$this->success = $success; | ||
return $this; | ||
} | ||
public function jsonSerialize() | ||
{ | ||
return ['success' => $this->success]; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
generated/Normalizer/ChargehiveMethodSuspendRequestNormalizer.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 ChargehiveMethodSuspendRequestNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface | ||
{ | ||
use DenormalizerAwareTrait; | ||
use NormalizerAwareTrait; | ||
public function supportsDenormalization($data, $type, $format = null) | ||
{ | ||
return $type === 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChargehiveMethodSuspendRequest'; | ||
} | ||
public function supportsNormalization($data, $format = null) | ||
{ | ||
return get_class($data) === 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChargehiveMethodSuspendRequest'; | ||
} | ||
public function denormalize($data, $class, $format = null, array $context = array()) | ||
{ | ||
if (!is_object($data)) { | ||
throw new InvalidArgumentException(); | ||
} | ||
$object = new \ChargeHive\Php\Sdk\Generated\Model\ChargehiveMethodSuspendRequest(); | ||
if (property_exists($data, 'token')) { | ||
$object->setToken($data->{'token'}); | ||
} | ||
return $object; | ||
} | ||
public function normalize($object, $format = null, array $context = array()) | ||
{ | ||
$data = new \stdClass(); | ||
if (null !== $object->getToken()) { | ||
$data->{'token'} = $object->getToken(); | ||
} | ||
return $data; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
generated/Normalizer/ChargehiveMethodSuspendResponseNormalizer.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 ChargehiveMethodSuspendResponseNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface | ||
{ | ||
use DenormalizerAwareTrait; | ||
use NormalizerAwareTrait; | ||
public function supportsDenormalization($data, $type, $format = null) | ||
{ | ||
return $type === 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChargehiveMethodSuspendResponse'; | ||
} | ||
public function supportsNormalization($data, $format = null) | ||
{ | ||
return get_class($data) === 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChargehiveMethodSuspendResponse'; | ||
} | ||
public function denormalize($data, $class, $format = null, array $context = array()) | ||
{ | ||
if (!is_object($data)) { | ||
throw new InvalidArgumentException(); | ||
} | ||
$object = new \ChargeHive\Php\Sdk\Generated\Model\ChargehiveMethodSuspendResponse(); | ||
if (property_exists($data, 'success')) { | ||
$object->setSuccess($data->{'success'}); | ||
} | ||
return $object; | ||
} | ||
public function normalize($object, $format = null, array $context = array()) | ||
{ | ||
$data = new \stdClass(); | ||
if (null !== $object->getSuccess()) { | ||
$data->{'success'} = $object->getSuccess(); | ||
} | ||
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