Skip to content

Commit

Permalink
Update generated client
Browse files Browse the repository at this point in the history
  • Loading branch information
mittwald-machine committed Apr 26, 2024
1 parent 55f6fca commit 08dbc71
Showing 1 changed file with 66 additions and 10 deletions.
76 changes: 66 additions & 10 deletions src/Generated/V2/Schemas/Contract/ContractItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -114,7 +119,6 @@ class ContractItem
],
'required' => [
'itemId',
'orderDate',
'isActivated',
'contractPeriod',
'articles',
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -169,7 +178,7 @@ class ContractItem
*/
private ?DateTime $nextPossibleUpgradeDate = null;

private DateTime $orderDate;
private ?DateTime $orderDate = null;

private ?string $orderId = null;

Expand All @@ -185,15 +194,14 @@ 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;
$this->description = $description;
$this->isActivated = $isActivated;
$this->isBaseItem = $isBaseItem;
$this->itemId = $itemId;
$this->orderDate = $orderDate;
$this->totalPrice = $totalPrice;
}

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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'});
Expand Down Expand Up @@ -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'};
Expand All @@ -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;
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
}
}

0 comments on commit 08dbc71

Please sign in to comment.