-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Auto Mation
committed
Jul 18, 2023
1 parent
24d574a
commit 9bd758b
Showing
40 changed files
with
3,330 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
lib/commercetools-history/src/Models/Change/AddInheritedAssociateChange.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* This file has been auto generated | ||
* Do not change it. | ||
*/ | ||
|
||
namespace Commercetools\History\Models\Change; | ||
|
||
use Commercetools\Base\JsonObject; | ||
use Commercetools\Base\DateTimeImmutableCollection; | ||
use Commercetools\History\Models\Common\InheritedAssociate; | ||
|
||
interface AddInheritedAssociateChange extends Change | ||
{ | ||
|
||
public const FIELD_NEXT_VALUE = 'nextValue'; | ||
|
||
/** | ||
|
||
* @return null|string | ||
*/ | ||
public function getChange(); | ||
|
||
/** | ||
|
||
* @return null|string | ||
*/ | ||
public function getType(); | ||
|
||
/** | ||
* <p>Value after the change.</p> | ||
* | ||
|
||
* @return null|InheritedAssociate | ||
*/ | ||
public function getNextValue(); | ||
|
||
/** | ||
* @param ?string $change | ||
*/ | ||
public function setChange(?string $change): void; | ||
|
||
/** | ||
* @param ?InheritedAssociate $nextValue | ||
*/ | ||
public function setNextValue(?InheritedAssociate $nextValue): void; | ||
} |
102 changes: 102 additions & 0 deletions
102
lib/commercetools-history/src/Models/Change/AddInheritedAssociateChangeBuilder.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* This file has been auto generated | ||
* Do not change it. | ||
*/ | ||
|
||
namespace Commercetools\History\Models\Change; | ||
|
||
use Commercetools\Base\Builder; | ||
use Commercetools\Base\DateTimeImmutableCollection; | ||
use Commercetools\Base\JsonObject; | ||
use Commercetools\Base\JsonObjectModel; | ||
use Commercetools\Base\MapperFactory; | ||
use stdClass; | ||
use Commercetools\History\Models\Common\InheritedAssociate; | ||
use Commercetools\History\Models\Common\InheritedAssociateBuilder; | ||
|
||
/** | ||
* @implements Builder<AddInheritedAssociateChange> | ||
*/ | ||
final class AddInheritedAssociateChangeBuilder implements Builder | ||
{ | ||
/** | ||
|
||
* @var ?string | ||
*/ | ||
private $change; | ||
|
||
/** | ||
|
||
* @var null|InheritedAssociate|InheritedAssociateBuilder | ||
*/ | ||
private $nextValue; | ||
|
||
/** | ||
|
||
* @return null|string | ||
*/ | ||
public function getChange() | ||
{ | ||
return $this->change; | ||
} | ||
|
||
/** | ||
* <p>Value after the change.</p> | ||
* | ||
|
||
* @return null|InheritedAssociate | ||
*/ | ||
public function getNextValue() | ||
{ | ||
return $this->nextValue instanceof InheritedAssociateBuilder ? $this->nextValue->build() : $this->nextValue; | ||
} | ||
|
||
/** | ||
* @param ?string $change | ||
* @return $this | ||
*/ | ||
public function withChange(?string $change) | ||
{ | ||
$this->change = $change; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @param ?InheritedAssociate $nextValue | ||
* @return $this | ||
*/ | ||
public function withNextValue(?InheritedAssociate $nextValue) | ||
{ | ||
$this->nextValue = $nextValue; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @deprecated use withNextValue() instead | ||
* @return $this | ||
*/ | ||
public function withNextValueBuilder(?InheritedAssociateBuilder $nextValue) | ||
{ | ||
$this->nextValue = $nextValue; | ||
|
||
return $this; | ||
} | ||
|
||
public function build(): AddInheritedAssociateChange | ||
{ | ||
return new AddInheritedAssociateChangeModel( | ||
$this->change, | ||
$this->nextValue instanceof InheritedAssociateBuilder ? $this->nextValue->build() : $this->nextValue | ||
); | ||
} | ||
|
||
public static function of(): AddInheritedAssociateChangeBuilder | ||
{ | ||
return new self(); | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
lib/commercetools-history/src/Models/Change/AddInheritedAssociateChangeCollection.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* This file has been auto generated | ||
* Do not change it. | ||
*/ | ||
|
||
namespace Commercetools\History\Models\Change; | ||
|
||
use Commercetools\History\Models\Change\ChangeCollection; | ||
use Commercetools\Exception\InvalidArgumentException; | ||
use stdClass; | ||
|
||
/** | ||
* @extends ChangeCollection<AddInheritedAssociateChange> | ||
* @method AddInheritedAssociateChange current() | ||
* @method AddInheritedAssociateChange end() | ||
* @method AddInheritedAssociateChange at($offset) | ||
*/ | ||
class AddInheritedAssociateChangeCollection extends ChangeCollection | ||
{ | ||
/** | ||
* @psalm-assert AddInheritedAssociateChange $value | ||
* @psalm-param AddInheritedAssociateChange|stdClass $value | ||
* @throws InvalidArgumentException | ||
* | ||
* @return AddInheritedAssociateChangeCollection | ||
*/ | ||
public function add($value) | ||
{ | ||
if (!$value instanceof AddInheritedAssociateChange) { | ||
throw new InvalidArgumentException(); | ||
} | ||
$this->store($value); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @psalm-return callable(int):?AddInheritedAssociateChange | ||
*/ | ||
protected function mapper() | ||
{ | ||
return function (?int $index): ?AddInheritedAssociateChange { | ||
$data = $this->get($index); | ||
if ($data instanceof stdClass) { | ||
/** @var AddInheritedAssociateChange $data */ | ||
$data = AddInheritedAssociateChangeModel::of($data); | ||
$this->set($data, $index); | ||
} | ||
|
||
return $data; | ||
}; | ||
} | ||
} |
134 changes: 134 additions & 0 deletions
134
lib/commercetools-history/src/Models/Change/AddInheritedAssociateChangeModel.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* This file has been auto generated | ||
* Do not change it. | ||
*/ | ||
|
||
namespace Commercetools\History\Models\Change; | ||
|
||
use Commercetools\Base\DateTimeImmutableCollection; | ||
use Commercetools\Base\JsonObject; | ||
use Commercetools\Base\JsonObjectModel; | ||
use Commercetools\Base\MapperFactory; | ||
use stdClass; | ||
use Commercetools\History\Models\Common\InheritedAssociate; | ||
use Commercetools\History\Models\Common\InheritedAssociateModel; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
final class AddInheritedAssociateChangeModel extends JsonObjectModel implements AddInheritedAssociateChange | ||
{ | ||
|
||
public const DISCRIMINATOR_VALUE = 'AddInheritedAssociateChange'; | ||
/** | ||
* | ||
* @var ?string | ||
*/ | ||
protected $type; | ||
|
||
/** | ||
* | ||
* @var ?string | ||
*/ | ||
protected $change; | ||
|
||
/** | ||
* | ||
* @var ?InheritedAssociate | ||
*/ | ||
protected $nextValue; | ||
|
||
|
||
/** | ||
* @psalm-suppress MissingParamType | ||
*/ | ||
public function __construct( | ||
?string $change = null, | ||
?InheritedAssociate $nextValue = null, | ||
?string $type = null | ||
) { | ||
$this->change = $change; | ||
$this->nextValue = $nextValue; | ||
$this->type = $type ?? self::DISCRIMINATOR_VALUE; | ||
} | ||
|
||
/** | ||
* | ||
* @return null|string | ||
*/ | ||
public function getType() | ||
{ | ||
if (is_null($this->type)) { | ||
/** @psalm-var ?string $data */ | ||
$data = $this->raw(self::FIELD_TYPE); | ||
if (is_null($data)) { | ||
return null; | ||
} | ||
$this->type = (string) $data; | ||
} | ||
|
||
return $this->type; | ||
} | ||
|
||
/** | ||
* | ||
* @return null|string | ||
*/ | ||
public function getChange() | ||
{ | ||
if (is_null($this->change)) { | ||
/** @psalm-var ?string $data */ | ||
$data = $this->raw(self::FIELD_CHANGE); | ||
if (is_null($data)) { | ||
return null; | ||
} | ||
$this->change = (string) $data; | ||
} | ||
|
||
return $this->change; | ||
} | ||
|
||
/** | ||
* <p>Value after the change.</p> | ||
* | ||
* | ||
* @return null|InheritedAssociate | ||
*/ | ||
public function getNextValue() | ||
{ | ||
if (is_null($this->nextValue)) { | ||
/** @psalm-var stdClass|array<string, mixed>|null $data */ | ||
$data = $this->raw(self::FIELD_NEXT_VALUE); | ||
if (is_null($data)) { | ||
return null; | ||
} | ||
|
||
$this->nextValue = InheritedAssociateModel::of($data); | ||
} | ||
|
||
return $this->nextValue; | ||
} | ||
|
||
|
||
/** | ||
* @param ?string $change | ||
*/ | ||
public function setChange(?string $change): void | ||
{ | ||
$this->change = $change; | ||
} | ||
|
||
/** | ||
* @param ?InheritedAssociate $nextValue | ||
*/ | ||
public function setNextValue(?InheritedAssociate $nextValue): void | ||
{ | ||
$this->nextValue = $nextValue; | ||
} | ||
|
||
|
||
|
||
} |
Oops, something went wrong.