-
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
11 changed files
with
362 additions
and
2 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 MethodRefresh extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\Psr7HttplugEndpoint | ||
{ | ||
protected $token; | ||
/** | ||
* | ||
* | ||
* @param string $token | ||
* @param \ChargeHive\Php\Sdk\Generated\Model\ChargehiveMethodRefreshRequest $body | ||
*/ | ||
public function __construct(string $token, \ChargeHive\Php\Sdk\Generated\Model\ChargehiveMethodRefreshRequest $body) | ||
{ | ||
$this->token = $token; | ||
$this->body = $body; | ||
} | ||
use \Jane\OpenApiRuntime\Client\Psr7HttplugEndpointTrait; | ||
public function getMethod() : string | ||
{ | ||
return 'PUT'; | ||
} | ||
public function getUri() : string | ||
{ | ||
return str_replace(array('{token}'), array($this->token), '/v1/method/{token}/refresh'); | ||
} | ||
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\ChargehiveMethodRefreshResponse|\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\\ChargehiveMethodRefreshResponse', '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
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 ChargehiveMethodRefreshRequest implements \JsonSerializable | ||
{ | ||
/** | ||
* | ||
* | ||
* @var string | ||
*/ | ||
protected $token; | ||
/** | ||
* | ||
* | ||
* @var string | ||
*/ | ||
protected $connectorId; | ||
/** | ||
* | ||
* | ||
* @return string | ||
*/ | ||
public function getToken() | ||
{ | ||
return $this->token; | ||
} | ||
/** | ||
* | ||
* | ||
* @param string $token | ||
* | ||
* @return self | ||
*/ | ||
public function setToken(string $token) | ||
{ | ||
$this->token = $token; | ||
return $this; | ||
} | ||
/** | ||
* | ||
* | ||
* @return string | ||
*/ | ||
public function getConnectorId() | ||
{ | ||
return $this->connectorId; | ||
} | ||
/** | ||
* | ||
* | ||
* @param string $connectorId | ||
* | ||
* @return self | ||
*/ | ||
public function setConnectorId(string $connectorId) | ||
{ | ||
$this->connectorId = $connectorId; | ||
return $this; | ||
} | ||
public function jsonSerialize() | ||
{ | ||
return ['token' => $this->token, 'connectorId' => $this->connectorId]; | ||
} | ||
} |
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 ChargehiveMethodRefreshResponse implements \JsonSerializable | ||
{ | ||
/** | ||
* | ||
* | ||
* @var bool | ||
*/ | ||
protected $success; | ||
/** | ||
* | ||
* | ||
* @var string | ||
*/ | ||
protected $errMessage; | ||
/** | ||
* | ||
* | ||
* @return bool | ||
*/ | ||
public function getSuccess() | ||
{ | ||
return $this->success; | ||
} | ||
/** | ||
* | ||
* | ||
* @param bool $success | ||
* | ||
* @return self | ||
*/ | ||
public function setSuccess(bool $success) | ||
{ | ||
$this->success = $success; | ||
return $this; | ||
} | ||
/** | ||
* | ||
* | ||
* @return string | ||
*/ | ||
public function getErrMessage() | ||
{ | ||
return $this->errMessage; | ||
} | ||
/** | ||
* | ||
* | ||
* @param string $errMessage | ||
* | ||
* @return self | ||
*/ | ||
public function setErrMessage(string $errMessage) | ||
{ | ||
$this->errMessage = $errMessage; | ||
return $this; | ||
} | ||
public function jsonSerialize() | ||
{ | ||
return ['success' => $this->success, 'errMessage' => $this->errMessage]; | ||
} | ||
} |
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
50 changes: 50 additions & 0 deletions
50
generated/Normalizer/ChargehiveMethodRefreshRequestNormalizer.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,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 ChargehiveMethodRefreshRequestNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface | ||
{ | ||
use DenormalizerAwareTrait; | ||
use NormalizerAwareTrait; | ||
public function supportsDenormalization($data, $type, $format = null) | ||
{ | ||
return $type === 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChargehiveMethodRefreshRequest'; | ||
} | ||
public function supportsNormalization($data, $format = null) | ||
{ | ||
return get_class($data) === 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChargehiveMethodRefreshRequest'; | ||
} | ||
public function denormalize($data, $class, $format = null, array $context = array()) | ||
{ | ||
if (!is_object($data)) { | ||
throw new InvalidArgumentException(); | ||
} | ||
$object = new \ChargeHive\Php\Sdk\Generated\Model\ChargehiveMethodRefreshRequest(); | ||
if (property_exists($data, 'token')) { | ||
$object->setToken($data->{'token'}); | ||
} | ||
if (property_exists($data, 'connector_id')) { | ||
$object->setConnectorId($data->{'connector_id'}); | ||
} | ||
return $object; | ||
} | ||
public function normalize($object, $format = null, array $context = array()) | ||
{ | ||
$data = new \stdClass(); | ||
if (null !== $object->getToken()) { | ||
$data->{'token'} = $object->getToken(); | ||
} | ||
if (null !== $object->getConnectorId()) { | ||
$data->{'connector_id'} = $object->getConnectorId(); | ||
} | ||
return $data; | ||
} | ||
} |
Oops, something went wrong.