From 08dbc71bce46f947034b0855532077d6627df10c Mon Sep 17 00:00:00 2001 From: mittwald-machine Date: Fri, 26 Apr 2024 00:09:39 +0000 Subject: [PATCH] Update generated client --- .../V2/Schemas/Contract/ContractItem.php | 76 ++++++++++++++++--- 1 file changed, 66 insertions(+), 10 deletions(-) diff --git a/src/Generated/V2/Schemas/Contract/ContractItem.php b/src/Generated/V2/Schemas/Contract/ContractItem.php index 203456b1..223425fa 100644 --- a/src/Generated/V2/Schemas/Contract/ContractItem.php +++ b/src/Generated/V2/Schemas/Contract/ContractItem.php @@ -55,6 +55,11 @@ class ContractItem 'format' => 'uuid', 'type' => 'string', ], + 'invoiceStop' => [ + 'description' => 'If this attribute is set, the contract item will currently only be invoiced until this date.', + 'format' => 'date-time', + 'type' => 'string', + ], 'invoicingPeriod' => [ 'example' => 1, 'type' => 'number', @@ -114,7 +119,6 @@ class ContractItem ], 'required' => [ 'itemId', - 'orderDate', 'isActivated', 'contractPeriod', 'articles', @@ -142,6 +146,11 @@ class ContractItem private ?string $groupByProjectId = null; + /** + * If this attribute is set, the contract item will currently only be invoiced until this date. + */ + private ?DateTime $invoiceStop = null; + private int|float|null $invoicingPeriod = null; private bool $isActivated; @@ -169,7 +178,7 @@ class ContractItem */ private ?DateTime $nextPossibleUpgradeDate = null; - private DateTime $orderDate; + private ?DateTime $orderDate = null; private ?string $orderId = null; @@ -185,7 +194,7 @@ class ContractItem * @param Article[] $articles * @param int|float $contractPeriod */ - public function __construct(array $articles, int|float $contractPeriod, string $description, bool $isActivated, bool $isBaseItem, string $itemId, DateTime $orderDate, Price $totalPrice) + public function __construct(array $articles, int|float $contractPeriod, string $description, bool $isActivated, bool $isBaseItem, string $itemId, Price $totalPrice) { $this->articles = $articles; $this->contractPeriod = $contractPeriod; @@ -193,7 +202,6 @@ public function __construct(array $articles, int|float $contractPeriod, string $ $this->isActivated = $isActivated; $this->isBaseItem = $isBaseItem; $this->itemId = $itemId; - $this->orderDate = $orderDate; $this->totalPrice = $totalPrice; } @@ -239,6 +247,11 @@ public function getGroupByProjectId(): ?string return $this->groupByProjectId ?? null; } + public function getInvoiceStop(): ?DateTime + { + return $this->invoiceStop ?? null; + } + public function getInvoicingPeriod(): int|float|null { return $this->invoicingPeriod; @@ -284,9 +297,9 @@ public function getNextPossibleUpgradeDate(): ?DateTime return $this->nextPossibleUpgradeDate ?? null; } - public function getOrderDate(): DateTime + public function getOrderDate(): ?DateTime { - return $this->orderDate; + return $this->orderDate ?? null; } public function getOrderId(): ?string @@ -435,6 +448,22 @@ public function withoutGroupByProjectId(): self return $clone; } + public function withInvoiceStop(DateTime $invoiceStop): self + { + $clone = clone $this; + $clone->invoiceStop = $invoiceStop; + + return $clone; + } + + public function withoutInvoiceStop(): self + { + $clone = clone $this; + unset($clone->invoiceStop); + + return $clone; + } + /** * @param int|float $invoicingPeriod */ @@ -602,6 +631,14 @@ public function withOrderDate(DateTime $orderDate): self return $clone; } + public function withoutOrderDate(): self + { + $clone = clone $this; + unset($clone->orderDate); + + return $clone; + } + public function withOrderId(string $orderId): self { $validator = new Validator(); @@ -720,6 +757,10 @@ public static function buildFromInput(array|object $input, bool $validate = true if (isset($input->{'groupByProjectId'})) { $groupByProjectId = $input->{'groupByProjectId'}; } + $invoiceStop = null; + if (isset($input->{'invoiceStop'})) { + $invoiceStop = new DateTime($input->{'invoiceStop'}); + } $invoicingPeriod = null; if (isset($input->{'invoicingPeriod'})) { $invoicingPeriod = str_contains((string)($input->{'invoicingPeriod'}), '.') ? (float)($input->{'invoicingPeriod'}) : (int)($input->{'invoicingPeriod'}); @@ -747,7 +788,10 @@ public static function buildFromInput(array|object $input, bool $validate = true if (isset($input->{'nextPossibleUpgradeDate'})) { $nextPossibleUpgradeDate = new DateTime($input->{'nextPossibleUpgradeDate'}); } - $orderDate = new DateTime($input->{'orderDate'}); + $orderDate = null; + if (isset($input->{'orderDate'})) { + $orderDate = new DateTime($input->{'orderDate'}); + } $orderId = null; if (isset($input->{'orderId'})) { $orderId = $input->{'orderId'}; @@ -766,17 +810,19 @@ public static function buildFromInput(array|object $input, bool $validate = true } $totalPrice = Price::buildFromInput($input->{'totalPrice'}, validate: $validate); - $obj = new self($articles, $contractPeriod, $description, $isActivated, $isBaseItem, $itemId, $orderDate, $totalPrice); + $obj = new self($articles, $contractPeriod, $description, $isActivated, $isBaseItem, $itemId, $totalPrice); $obj->activationDate = $activationDate; $obj->aggregateReference = $aggregateReference; $obj->freeTrialDays = $freeTrialDays; $obj->groupByProjectId = $groupByProjectId; + $obj->invoiceStop = $invoiceStop; $obj->invoicingPeriod = $invoicingPeriod; $obj->isInFreeTrial = $isInFreeTrial; $obj->isInclusive = $isInclusive; $obj->nextPossibleDowngradeDate = $nextPossibleDowngradeDate; $obj->nextPossibleTerminationDate = $nextPossibleTerminationDate; $obj->nextPossibleUpgradeDate = $nextPossibleUpgradeDate; + $obj->orderDate = $orderDate; $obj->orderId = $orderId; $obj->replacedByItem = $replacedByItem; $obj->tariffChange = $tariffChange; @@ -807,6 +853,9 @@ public function toJson(): array if (isset($this->groupByProjectId)) { $output['groupByProjectId'] = $this->groupByProjectId; } + if (isset($this->invoiceStop)) { + $output['invoiceStop'] = ($this->invoiceStop)->format(DateTime::ATOM); + } if (isset($this->invoicingPeriod)) { $output['invoicingPeriod'] = $this->invoicingPeriod; } @@ -828,7 +877,9 @@ public function toJson(): array if (isset($this->nextPossibleUpgradeDate)) { $output['nextPossibleUpgradeDate'] = ($this->nextPossibleUpgradeDate)->format(DateTime::ATOM); } - $output['orderDate'] = ($this->orderDate)->format(DateTime::ATOM); + if (isset($this->orderDate)) { + $output['orderDate'] = ($this->orderDate)->format(DateTime::ATOM); + } if (isset($this->orderId)) { $output['orderId'] = $this->orderId; } @@ -875,6 +926,9 @@ public function __clone() if (isset($this->activationDate)) { $this->activationDate = clone $this->activationDate; } + if (isset($this->invoiceStop)) { + $this->invoiceStop = clone $this->invoiceStop; + } if (isset($this->nextPossibleDowngradeDate)) { $this->nextPossibleDowngradeDate = clone $this->nextPossibleDowngradeDate; } @@ -884,6 +938,8 @@ public function __clone() if (isset($this->nextPossibleUpgradeDate)) { $this->nextPossibleUpgradeDate = clone $this->nextPossibleUpgradeDate; } - $this->orderDate = clone $this->orderDate; + if (isset($this->orderDate)) { + $this->orderDate = clone $this->orderDate; + } } }