Skip to content

Commit

Permalink
Feature: setLabels on charge create and modify requests (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
fobilow authored Jul 2, 2021
1 parent 491b05f commit 54b6fa1
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 2 deletions.
29 changes: 28 additions & 1 deletion generated/Model/ChargehiveChargeCreateRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ class ChargehiveChargeCreateRequest implements \JsonSerializable
* @var ChtypeChargeMeta
*/
protected $chargeMeta;
/**
*
*
* @var ChargehivechtypeLabel[]
*/
protected $labels;
/**
*
*
Expand Down Expand Up @@ -193,8 +199,29 @@ public function setChargeMeta(ChtypeChargeMeta $chargeMeta)
$this->chargeMeta = $chargeMeta;
return $this;
}
/**
*
*
* @return ChargehivechtypeLabel[]
*/
public function getLabels()
{
return $this->labels;
}
/**
*
*
* @param ChargehivechtypeLabel[] $labels
*
* @return self
*/
public function setLabels(array $labels)
{
$this->labels = $labels;
return $this;
}
public function jsonSerialize()
{
return ['merchantReference' => $this->merchantReference, 'amount' => $this->amount, 'paymentMethodIds' => $this->paymentMethodIds, 'expiryTime' => $this->expiryTime, 'contractType' => $this->contractType, 'environment' => $this->environment, 'chargeMeta' => $this->chargeMeta];
return ['merchantReference' => $this->merchantReference, 'amount' => $this->amount, 'paymentMethodIds' => $this->paymentMethodIds, 'expiryTime' => $this->expiryTime, 'contractType' => $this->contractType, 'environment' => $this->environment, 'chargeMeta' => $this->chargeMeta, 'labels' => $this->labels];
}
}
29 changes: 28 additions & 1 deletion generated/Model/ChargehiveChargeModifyRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ class ChargehiveChargeModifyRequest implements \JsonSerializable
* @var string
*/
protected $chargeMetaType = 'CHARGE_META_TYPE_INVALID';
/**
*
*
* @var ChargehivechtypeLabel[]
*/
protected $labels;
/**
*
*
Expand Down Expand Up @@ -166,8 +172,29 @@ public function setChargeMetaType(string $chargeMetaType)
$this->chargeMetaType = $chargeMetaType;
return $this;
}
/**
*
*
* @return ChargehivechtypeLabel[]
*/
public function getLabels()
{
return $this->labels;
}
/**
*
*
* @param ChargehivechtypeLabel[] $labels
*
* @return self
*/
public function setLabels(array $labels)
{
$this->labels = $labels;
return $this;
}
public function jsonSerialize()
{
return ['chargeId' => $this->chargeId, 'amount' => $this->amount, 'paymentMethodIds' => $this->paymentMethodIds, 'expiryTime' => $this->expiryTime, 'chargeMeta' => $this->chargeMeta, 'chargeMetaType' => $this->chargeMetaType];
return ['chargeId' => $this->chargeId, 'amount' => $this->amount, 'paymentMethodIds' => $this->paymentMethodIds, 'expiryTime' => $this->expiryTime, 'chargeMeta' => $this->chargeMeta, 'chargeMetaType' => $this->chargeMetaType, 'labels' => $this->labels];
}
}
14 changes: 14 additions & 0 deletions generated/Normalizer/ChargehiveChargeCreateRequestNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ public function denormalize($data, $class, $format = null, array $context = arra
if (property_exists($data, 'charge_meta')) {
$object->setChargeMeta($this->denormalizer->denormalize($data->{'charge_meta'}, 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChtypeChargeMeta', 'json', $context));
}
if (property_exists($data, 'labels')) {
$values_1 = array();
foreach ($data->{'labels'} as $value_1) {
$values_1[] = $this->denormalizer->denormalize($value_1, 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChargehivechtypeLabel', 'json', $context);
}
$object->setLabels($values_1);
}
return $object;
}
public function normalize($object, $format = null, array $context = array())
Expand Down Expand Up @@ -83,6 +90,13 @@ public function normalize($object, $format = null, array $context = array())
if (null !== $object->getChargeMeta()) {
$data->{'charge_meta'} = $this->normalizer->normalize($object->getChargeMeta(), 'json', $context);
}
if (null !== $object->getLabels()) {
$values_1 = array();
foreach ($object->getLabels() as $value_1) {
$values_1[] = $this->normalizer->normalize($value_1, 'json', $context);
}
$data->{'labels'} = $values_1;
}
return $data;
}
}
14 changes: 14 additions & 0 deletions generated/Normalizer/ChargehiveChargeModifyRequestNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ public function denormalize($data, $class, $format = null, array $context = arra
if (property_exists($data, 'charge_meta_type')) {
$object->setChargeMetaType($data->{'charge_meta_type'});
}
if (property_exists($data, 'labels')) {
$values_1 = array();
foreach ($data->{'labels'} as $value_1) {
$values_1[] = $this->denormalizer->denormalize($value_1, 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChargehivechtypeLabel', 'json', $context);
}
$object->setLabels($values_1);
}
return $object;
}
public function normalize($object, $format = null, array $context = array())
Expand Down Expand Up @@ -77,6 +84,13 @@ public function normalize($object, $format = null, array $context = array())
if (null !== $object->getChargeMetaType()) {
$data->{'charge_meta_type'} = $object->getChargeMetaType();
}
if (null !== $object->getLabels()) {
$values_1 = array();
foreach ($object->getLabels() as $value_1) {
$values_1[] = $this->normalizer->normalize($value_1, 'json', $context);
}
$data->{'labels'} = $values_1;
}
return $data;
}
}

0 comments on commit 54b6fa1

Please sign in to comment.