Skip to content

Commit 54b6fa1

Browse files
authored
Feature: setLabels on charge create and modify requests (#9)
1 parent 491b05f commit 54b6fa1

File tree

4 files changed

+84
-2
lines changed

4 files changed

+84
-2
lines changed

generated/Model/ChargehiveChargeCreateRequest.php

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ class ChargehiveChargeCreateRequest implements \JsonSerializable
4646
* @var ChtypeChargeMeta
4747
*/
4848
protected $chargeMeta;
49+
/**
50+
*
51+
*
52+
* @var ChargehivechtypeLabel[]
53+
*/
54+
protected $labels;
4955
/**
5056
*
5157
*
@@ -193,8 +199,29 @@ public function setChargeMeta(ChtypeChargeMeta $chargeMeta)
193199
$this->chargeMeta = $chargeMeta;
194200
return $this;
195201
}
202+
/**
203+
*
204+
*
205+
* @return ChargehivechtypeLabel[]
206+
*/
207+
public function getLabels()
208+
{
209+
return $this->labels;
210+
}
211+
/**
212+
*
213+
*
214+
* @param ChargehivechtypeLabel[] $labels
215+
*
216+
* @return self
217+
*/
218+
public function setLabels(array $labels)
219+
{
220+
$this->labels = $labels;
221+
return $this;
222+
}
196223
public function jsonSerialize()
197224
{
198-
return ['merchantReference' => $this->merchantReference, 'amount' => $this->amount, 'paymentMethodIds' => $this->paymentMethodIds, 'expiryTime' => $this->expiryTime, 'contractType' => $this->contractType, 'environment' => $this->environment, 'chargeMeta' => $this->chargeMeta];
225+
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];
199226
}
200227
}

generated/Model/ChargehiveChargeModifyRequest.php

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ class ChargehiveChargeModifyRequest implements \JsonSerializable
4040
* @var string
4141
*/
4242
protected $chargeMetaType = 'CHARGE_META_TYPE_INVALID';
43+
/**
44+
*
45+
*
46+
* @var ChargehivechtypeLabel[]
47+
*/
48+
protected $labels;
4349
/**
4450
*
4551
*
@@ -166,8 +172,29 @@ public function setChargeMetaType(string $chargeMetaType)
166172
$this->chargeMetaType = $chargeMetaType;
167173
return $this;
168174
}
175+
/**
176+
*
177+
*
178+
* @return ChargehivechtypeLabel[]
179+
*/
180+
public function getLabels()
181+
{
182+
return $this->labels;
183+
}
184+
/**
185+
*
186+
*
187+
* @param ChargehivechtypeLabel[] $labels
188+
*
189+
* @return self
190+
*/
191+
public function setLabels(array $labels)
192+
{
193+
$this->labels = $labels;
194+
return $this;
195+
}
169196
public function jsonSerialize()
170197
{
171-
return ['chargeId' => $this->chargeId, 'amount' => $this->amount, 'paymentMethodIds' => $this->paymentMethodIds, 'expiryTime' => $this->expiryTime, 'chargeMeta' => $this->chargeMeta, 'chargeMetaType' => $this->chargeMetaType];
198+
return ['chargeId' => $this->chargeId, 'amount' => $this->amount, 'paymentMethodIds' => $this->paymentMethodIds, 'expiryTime' => $this->expiryTime, 'chargeMeta' => $this->chargeMeta, 'chargeMetaType' => $this->chargeMetaType, 'labels' => $this->labels];
172199
}
173200
}

generated/Normalizer/ChargehiveChargeCreateRequestNormalizer.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ public function denormalize($data, $class, $format = null, array $context = arra
5353
if (property_exists($data, 'charge_meta')) {
5454
$object->setChargeMeta($this->denormalizer->denormalize($data->{'charge_meta'}, 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChtypeChargeMeta', 'json', $context));
5555
}
56+
if (property_exists($data, 'labels')) {
57+
$values_1 = array();
58+
foreach ($data->{'labels'} as $value_1) {
59+
$values_1[] = $this->denormalizer->denormalize($value_1, 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChargehivechtypeLabel', 'json', $context);
60+
}
61+
$object->setLabels($values_1);
62+
}
5663
return $object;
5764
}
5865
public function normalize($object, $format = null, array $context = array())
@@ -83,6 +90,13 @@ public function normalize($object, $format = null, array $context = array())
8390
if (null !== $object->getChargeMeta()) {
8491
$data->{'charge_meta'} = $this->normalizer->normalize($object->getChargeMeta(), 'json', $context);
8592
}
93+
if (null !== $object->getLabels()) {
94+
$values_1 = array();
95+
foreach ($object->getLabels() as $value_1) {
96+
$values_1[] = $this->normalizer->normalize($value_1, 'json', $context);
97+
}
98+
$data->{'labels'} = $values_1;
99+
}
86100
return $data;
87101
}
88102
}

generated/Normalizer/ChargehiveChargeModifyRequestNormalizer.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ public function denormalize($data, $class, $format = null, array $context = arra
5050
if (property_exists($data, 'charge_meta_type')) {
5151
$object->setChargeMetaType($data->{'charge_meta_type'});
5252
}
53+
if (property_exists($data, 'labels')) {
54+
$values_1 = array();
55+
foreach ($data->{'labels'} as $value_1) {
56+
$values_1[] = $this->denormalizer->denormalize($value_1, 'ChargeHive\\Php\\Sdk\\Generated\\Model\\ChargehivechtypeLabel', 'json', $context);
57+
}
58+
$object->setLabels($values_1);
59+
}
5360
return $object;
5461
}
5562
public function normalize($object, $format = null, array $context = array())
@@ -77,6 +84,13 @@ public function normalize($object, $format = null, array $context = array())
7784
if (null !== $object->getChargeMetaType()) {
7885
$data->{'charge_meta_type'} = $object->getChargeMetaType();
7986
}
87+
if (null !== $object->getLabels()) {
88+
$values_1 = array();
89+
foreach ($object->getLabels() as $value_1) {
90+
$values_1[] = $this->normalizer->normalize($value_1, 'json', $context);
91+
}
92+
$data->{'labels'} = $values_1;
93+
}
8094
return $data;
8195
}
8296
}

0 commit comments

Comments
 (0)