-
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 * Put refresh back * Auto add files to git * Generate * New line * Regen after rebase
- Loading branch information
Showing
8 changed files
with
229 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,49 @@ | ||
<?php | ||
|
||
namespace ChargeHive\Php\Sdk\Generated\Endpoint; | ||
|
||
class MethodArchive extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint | ||
{ | ||
protected $token; | ||
/** | ||
* | ||
* | ||
* @param string $token | ||
* @param \ChargeHive\Php\Sdk\Generated\Model\ChargehiveMethodArchiveRequest $body | ||
*/ | ||
public function __construct(string $token, \ChargeHive\Php\Sdk\Generated\Model\ChargehiveMethodArchiveRequest $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}/archive'); | ||
} | ||
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\ChargehiveMethodArchiveResponse|\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\\ChargehiveMethodArchiveResponse', '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 ChargehiveMethodArchiveRequest 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 ChargehiveMethodArchiveResponse 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/ChargehiveMethodArchiveRequestNormalizer.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 ChargehiveMethodArchiveRequestNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface | ||
{ | ||
use DenormalizerAwareTrait; | ||
use NormalizerAwareTrait; | ||
public function supportsDenormalization($data, $type, $format = null) | ||
{ | ||
return $type === 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChargehiveMethodArchiveRequest'; | ||
} | ||
public function supportsNormalization($data, $format = null) | ||
{ | ||
return get_class($data) === 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChargehiveMethodArchiveRequest'; | ||
} | ||
public function denormalize($data, $class, $format = null, array $context = array()) | ||
{ | ||
if (!is_object($data)) { | ||
throw new InvalidArgumentException(); | ||
} | ||
$object = new \ChargeHive\Php\Sdk\Generated\Model\ChargehiveMethodArchiveRequest(); | ||
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/ChargehiveMethodArchiveResponseNormalizer.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 ChargehiveMethodArchiveResponseNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface | ||
{ | ||
use DenormalizerAwareTrait; | ||
use NormalizerAwareTrait; | ||
public function supportsDenormalization($data, $type, $format = null) | ||
{ | ||
return $type === 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChargehiveMethodArchiveResponse'; | ||
} | ||
public function supportsNormalization($data, $format = null) | ||
{ | ||
return get_class($data) === 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChargehiveMethodArchiveResponse'; | ||
} | ||
public function denormalize($data, $class, $format = null, array $context = array()) | ||
{ | ||
if (!is_object($data)) { | ||
throw new InvalidArgumentException(); | ||
} | ||
$object = new \ChargeHive\Php\Sdk\Generated\Model\ChargehiveMethodArchiveResponse(); | ||
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
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,3 +1,4 @@ | ||
#!/usr/bin/env bash | ||
rm -rf ./generated | ||
vendor/bin/jane-openapi generate | ||
git add ./generated/* |