Skip to content

Commit 52cbdb5

Browse files
feat: add invoiceType field to ContributorListIncomingInvoices response
- Introduced `invoiceType` as a new property in the `ContributorListIncomingInvoicesOKResponse` and `ContributorListIncomingInvoicesOKResponseBodyItem` classes. - Defined possible values for `invoiceType`: 'REGULAR', 'CORRECTION', 'REISSUE', 'CANCELLATION'. - Updated methods to handle the new `invoiceType` property, including getters and with/without mutators.
1 parent 086dc43 commit 52cbdb5

File tree

3 files changed

+62
-1
lines changed

3 files changed

+62
-1
lines changed

src/Generated/V2/Clients/Marketplace/ContributorListIncomingInvoices/ContributorListIncomingInvoicesOKResponse.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ class ContributorListIncomingInvoicesOKResponse implements ResponseContainer
5151
'example' => 'RG1234567',
5252
'type' => 'string',
5353
],
54+
'invoiceType' => [
55+
'enum' => [
56+
'REGULAR',
57+
'CORRECTION',
58+
'REISSUE',
59+
'CANCELLATION',
60+
],
61+
'type' => 'string',
62+
],
5463
'pdfId' => [
5564
'format' => 'uuid',
5665
'type' => 'string',

src/Generated/V2/Clients/Marketplace/ContributorListIncomingInvoices/ContributorListIncomingInvoicesOKResponseBodyItem.php

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,15 @@ class ContributorListIncomingInvoicesOKResponseBodyItem
4444
'example' => 'RG1234567',
4545
'type' => 'string',
4646
],
47+
'invoiceType' => [
48+
'enum' => [
49+
'REGULAR',
50+
'CORRECTION',
51+
'REISSUE',
52+
'CANCELLATION',
53+
],
54+
'type' => 'string',
55+
],
4756
'pdfId' => [
4857
'format' => 'uuid',
4958
'type' => 'string',
@@ -90,6 +99,8 @@ class ContributorListIncomingInvoicesOKResponseBodyItem
9099

91100
private string $invoiceNumber;
92101

102+
private ?ContributorListIncomingInvoicesOKResponseBodyItemInvoiceType $invoiceType = null;
103+
93104
private string $pdfId;
94105

95106
private Recipient $recipient;
@@ -148,6 +159,11 @@ public function getInvoiceNumber(): string
148159
return $this->invoiceNumber;
149160
}
150161

162+
public function getInvoiceType(): ?ContributorListIncomingInvoicesOKResponseBodyItemInvoiceType
163+
{
164+
return $this->invoiceType ?? null;
165+
}
166+
151167
public function getPdfId(): string
152168
{
153169
return $this->pdfId;
@@ -260,6 +276,22 @@ public function withInvoiceNumber(string $invoiceNumber): self
260276
return $clone;
261277
}
262278

279+
public function withInvoiceType(ContributorListIncomingInvoicesOKResponseBodyItemInvoiceType $invoiceType): self
280+
{
281+
$clone = clone $this;
282+
$clone->invoiceType = $invoiceType;
283+
284+
return $clone;
285+
}
286+
287+
public function withoutInvoiceType(): self
288+
{
289+
$clone = clone $this;
290+
unset($clone->invoiceType);
291+
292+
return $clone;
293+
}
294+
263295
public function withPdfId(string $pdfId): self
264296
{
265297
$validator = new Validator();
@@ -332,13 +364,17 @@ public static function buildFromInput(array|object $input, bool $validate = true
332364
$date = new DateTime($input->{'date'});
333365
$id = $input->{'id'};
334366
$invoiceNumber = $input->{'invoiceNumber'};
367+
$invoiceType = null;
368+
if (isset($input->{'invoiceType'})) {
369+
$invoiceType = ContributorListIncomingInvoicesOKResponseBodyItemInvoiceType::from($input->{'invoiceType'});
370+
}
335371
$pdfId = $input->{'pdfId'};
336372
$recipient = Recipient::buildFromInput($input->{'recipient'}, validate: $validate);
337373
$totalGross = str_contains((string)($input->{'totalGross'}), '.') ? (float)($input->{'totalGross'}) : (int)($input->{'totalGross'});
338374
$totalNet = str_contains((string)($input->{'totalNet'}), '.') ? (float)($input->{'totalNet'}) : (int)($input->{'totalNet'});
339375

340376
$obj = new self($currency, $customerId, $customerName, $customerNumber, $date, $id, $invoiceNumber, $pdfId, $recipient, $totalGross, $totalNet);
341-
377+
$obj->invoiceType = $invoiceType;
342378
return $obj;
343379
}
344380

@@ -357,6 +393,9 @@ public function toJson(): array
357393
$output['date'] = ($this->date)->format(DateTime::ATOM);
358394
$output['id'] = $this->id;
359395
$output['invoiceNumber'] = $this->invoiceNumber;
396+
if (isset($this->invoiceType)) {
397+
$output['invoiceType'] = ($this->invoiceType)->value;
398+
}
360399
$output['pdfId'] = $this->pdfId;
361400
$output['recipient'] = $this->recipient->toJson();
362401
$output['totalGross'] = $this->totalGross;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Mittwald\ApiClient\Generated\V2\Clients\Marketplace\ContributorListIncomingInvoices;
6+
7+
enum ContributorListIncomingInvoicesOKResponseBodyItemInvoiceType: string
8+
{
9+
case REGULAR = 'REGULAR';
10+
case CORRECTION = 'CORRECTION';
11+
case REISSUE = 'REISSUE';
12+
case CANCELLATION = 'CANCELLATION';
13+
}

0 commit comments

Comments
 (0)