From b2cb235b21f232672384958389baf5aa811030e7 Mon Sep 17 00:00:00 2001 From: mittwald-machine Date: Sat, 13 Apr 2024 00:09:28 +0000 Subject: [PATCH] Update generated client --- .../V2/Schemas/App/SystemSoftwareVersion.php | 39 ---- .../V2/Schemas/Conversation/Department.php | 5 + .../V2/Schemas/Mailmigration/Mailbox.php | 32 ++- .../Mailmigration/MigrationFinalizeJob.php | 38 ---- ...rationFinalizeJobDisableLegacyEntities.php | 182 ------------------ 5 files changed, 35 insertions(+), 261 deletions(-) delete mode 100644 src/Generated/V2/Schemas/Mailmigration/MigrationFinalizeJobDisableLegacyEntities.php diff --git a/src/Generated/V2/Schemas/App/SystemSoftwareVersion.php b/src/Generated/V2/Schemas/App/SystemSoftwareVersion.php index da5aee97..9405ffd8 100644 --- a/src/Generated/V2/Schemas/App/SystemSoftwareVersion.php +++ b/src/Generated/V2/Schemas/App/SystemSoftwareVersion.php @@ -4,7 +4,6 @@ namespace Mittwald\ApiClient\Generated\V2\Schemas\App; -use DateTime; use InvalidArgumentException; use JsonSchema\Validator; @@ -27,10 +26,6 @@ class SystemSoftwareVersion private static array $schema = [ 'description' => 'A SystemSoftwareVersion is an officially supported version of a SystemSoftware, containing the necessary and recommended configuration und dependencies.', 'properties' => [ - 'expiryDate' => [ - 'format' => 'date-time', - 'type' => 'string', - ], 'externalVersion' => [ 'type' => 'string', ], @@ -65,8 +60,6 @@ class SystemSoftwareVersion 'type' => 'object', ]; - private ?DateTime $expiryDate = null; - private string $externalVersion; private string $id; @@ -92,11 +85,6 @@ public function __construct(string $externalVersion, string $id, string $interna $this->internalVersion = $internalVersion; } - public function getExpiryDate(): ?DateTime - { - return $this->expiryDate ?? null; - } - public function getExternalVersion(): string { return $this->externalVersion; @@ -134,22 +122,6 @@ public function getUserInputs(): ?array return $this->userInputs ?? null; } - public function withExpiryDate(DateTime $expiryDate): self - { - $clone = clone $this; - $clone->expiryDate = $expiryDate; - - return $clone; - } - - public function withoutExpiryDate(): self - { - $clone = clone $this; - unset($clone->expiryDate); - - return $clone; - } - public function withExternalVersion(string $externalVersion): self { $validator = new Validator(); @@ -267,10 +239,6 @@ public static function buildFromInput(array|object $input, bool $validate = true static::validateInput($input); } - $expiryDate = null; - if (isset($input->{'expiryDate'})) { - $expiryDate = new DateTime($input->{'expiryDate'}); - } $externalVersion = $input->{'externalVersion'}; $id = $input->{'id'}; $internalVersion = $input->{'internalVersion'}; @@ -288,7 +256,6 @@ public static function buildFromInput(array|object $input, bool $validate = true } $obj = new self($externalVersion, $id, $internalVersion); - $obj->expiryDate = $expiryDate; $obj->recommended = $recommended; $obj->systemSoftwareDependencies = $systemSoftwareDependencies; $obj->userInputs = $userInputs; @@ -303,9 +270,6 @@ public static function buildFromInput(array|object $input, bool $validate = true public function toJson(): array { $output = []; - if (isset($this->expiryDate)) { - $output['expiryDate'] = ($this->expiryDate)->format(DateTime::ATOM); - } $output['externalVersion'] = $this->externalVersion; $output['id'] = $this->id; $output['internalVersion'] = $this->internalVersion; @@ -348,8 +312,5 @@ public static function validateInput(array|object $input, bool $return = false): public function __clone() { - if (isset($this->expiryDate)) { - $this->expiryDate = clone $this->expiryDate; - } } } diff --git a/src/Generated/V2/Schemas/Conversation/Department.php b/src/Generated/V2/Schemas/Conversation/Department.php index 39143e31..dec8fe31 100644 --- a/src/Generated/V2/Schemas/Conversation/Department.php +++ b/src/Generated/V2/Schemas/Conversation/Department.php @@ -8,9 +8,14 @@ enum Department: string { case development = 'development'; case mail = 'mail'; + case infra = 'infra'; + case marketing = 'marketing'; + case network = 'network'; + case dataCenter = 'dataCenter'; case accounting = 'accounting'; case customerService = 'customerService'; case cloudHosting = 'cloudHosting'; case software = 'software'; case generic = 'generic'; + case security = 'security'; } diff --git a/src/Generated/V2/Schemas/Mailmigration/Mailbox.php b/src/Generated/V2/Schemas/Mailmigration/Mailbox.php index ff3f9965..9b90643f 100644 --- a/src/Generated/V2/Schemas/Mailmigration/Mailbox.php +++ b/src/Generated/V2/Schemas/Mailmigration/Mailbox.php @@ -30,6 +30,9 @@ class Mailbox 'name' => [ 'type' => 'string', ], + 'passwordHash' => [ + 'type' => 'string', + ], 'quotaInBytes' => [ 'type' => 'integer', ], @@ -39,6 +42,7 @@ class Mailbox ], 'required' => [ 'name', + 'passwordHash', 'quotaInBytes', 'mailsystem', ], @@ -49,14 +53,17 @@ class Mailbox private string $name; + private string $passwordHash; + private int $quotaInBytes; private ?SpamProtection $spamProtection = null; - public function __construct(MailSystemSettings $mailsystem, string $name, int $quotaInBytes) + public function __construct(MailSystemSettings $mailsystem, string $name, string $passwordHash, int $quotaInBytes) { $this->mailsystem = $mailsystem; $this->name = $name; + $this->passwordHash = $passwordHash; $this->quotaInBytes = $quotaInBytes; } @@ -74,6 +81,11 @@ public function getName(): string return $this->name; } + public function getPasswordHash(): string + { + return $this->passwordHash; + } + public function getQuotaInBytes(): int { return $this->quotaInBytes; @@ -110,6 +122,20 @@ public function withName(string $name): self return $clone; } + public function withPasswordHash(string $passwordHash): self + { + $validator = new Validator(); + $validator->validate($passwordHash, static::$schema['properties']['passwordHash']); + if (!$validator->isValid()) { + throw new InvalidArgumentException($validator->getErrors()[0]['message']); + } + + $clone = clone $this; + $clone->passwordHash = $passwordHash; + + return $clone; + } + public function withQuotaInBytes(int $quotaInBytes): self { $validator = new Validator(); @@ -157,13 +183,14 @@ public static function buildFromInput(array|object $input, bool $validate = true $mailsystem = MailSystemSettings::buildFromInput($input->{'mailsystem'}, validate: $validate); $name = $input->{'name'}; + $passwordHash = $input->{'passwordHash'}; $quotaInBytes = (int)($input->{'quotaInBytes'}); $spamProtection = null; if (isset($input->{'spamProtection'})) { $spamProtection = SpamProtection::buildFromInput($input->{'spamProtection'}, validate: $validate); } - $obj = new self($mailsystem, $name, $quotaInBytes); + $obj = new self($mailsystem, $name, $passwordHash, $quotaInBytes); $obj->spamProtection = $spamProtection; return $obj; } @@ -178,6 +205,7 @@ public function toJson(): array $output = []; $output['mailsystem'] = $this->mailsystem->toJson(); $output['name'] = $this->name; + $output['passwordHash'] = $this->passwordHash; $output['quotaInBytes'] = $this->quotaInBytes; if (isset($this->spamProtection)) { $output['spamProtection'] = $this->spamProtection->toJson(); diff --git a/src/Generated/V2/Schemas/Mailmigration/MigrationFinalizeJob.php b/src/Generated/V2/Schemas/Mailmigration/MigrationFinalizeJob.php index d9b06fb7..ac17a849 100644 --- a/src/Generated/V2/Schemas/Mailmigration/MigrationFinalizeJob.php +++ b/src/Generated/V2/Schemas/Mailmigration/MigrationFinalizeJob.php @@ -24,9 +24,6 @@ class MigrationFinalizeJob */ private static array $schema = [ 'properties' => [ - 'disableLegacyEntities' => [ - '$ref' => '#/components/schemas/de.mittwald.v1.mailmigration.MigrationFinalizeJobDisableLegacyEntities', - ], 'projectSettingMigrations' => [ '$ref' => '#/components/schemas/de.mittwald.v1.mailmigration.MigrationFinalizeJobProjectSetting', ], @@ -34,8 +31,6 @@ class MigrationFinalizeJob 'type' => 'object', ]; - private ?MigrationFinalizeJobDisableLegacyEntities $disableLegacyEntities = null; - private ?MigrationFinalizeJobProjectSetting $projectSettingMigrations = null; /** @@ -45,15 +40,6 @@ public function __construct() { } - /** - * @return - * MigrationFinalizeJobDisableLegacyEntities|null - */ - public function getDisableLegacyEntities(): ?MigrationFinalizeJobDisableLegacyEntities - { - return $this->disableLegacyEntities ?? null; - } - /** * @return * MigrationFinalizeJobProjectSetting|null @@ -63,22 +49,6 @@ public function getProjectSettingMigrations(): ?MigrationFinalizeJobProjectSetti return $this->projectSettingMigrations ?? null; } - public function withDisableLegacyEntities(MigrationFinalizeJobDisableLegacyEntities $disableLegacyEntities): self - { - $clone = clone $this; - $clone->disableLegacyEntities = $disableLegacyEntities; - - return $clone; - } - - public function withoutDisableLegacyEntities(): self - { - $clone = clone $this; - unset($clone->disableLegacyEntities); - - return $clone; - } - public function withProjectSettingMigrations(MigrationFinalizeJobProjectSetting $projectSettingMigrations): self { $clone = clone $this; @@ -110,17 +80,12 @@ public static function buildFromInput(array|object $input, bool $validate = true static::validateInput($input); } - $disableLegacyEntities = null; - if (isset($input->{'disableLegacyEntities'})) { - $disableLegacyEntities = MigrationFinalizeJobDisableLegacyEntities::buildFromInput($input->{'disableLegacyEntities'}, validate: $validate); - } $projectSettingMigrations = null; if (isset($input->{'projectSettingMigrations'})) { $projectSettingMigrations = MigrationFinalizeJobProjectSetting::buildFromInput($input->{'projectSettingMigrations'}, validate: $validate); } $obj = new self(); - $obj->disableLegacyEntities = $disableLegacyEntities; $obj->projectSettingMigrations = $projectSettingMigrations; return $obj; } @@ -133,9 +98,6 @@ public static function buildFromInput(array|object $input, bool $validate = true public function toJson(): array { $output = []; - if (isset($this->disableLegacyEntities)) { - $output['disableLegacyEntities'] = $this->disableLegacyEntities->toJson(); - } if (isset($this->projectSettingMigrations)) { $output['projectSettingMigrations'] = $this->projectSettingMigrations->toJson(); } diff --git a/src/Generated/V2/Schemas/Mailmigration/MigrationFinalizeJobDisableLegacyEntities.php b/src/Generated/V2/Schemas/Mailmigration/MigrationFinalizeJobDisableLegacyEntities.php deleted file mode 100644 index 95f4e7f2..00000000 --- a/src/Generated/V2/Schemas/Mailmigration/MigrationFinalizeJobDisableLegacyEntities.php +++ /dev/null @@ -1,182 +0,0 @@ - [ - 'addresses' => [ - 'items' => [ - 'type' => 'string', - ], - 'type' => 'array', - ], - 'mailboxNames' => [ - 'items' => [ - 'type' => 'string', - ], - 'type' => 'array', - ], - ], - 'required' => [ - 'mailboxNames', - 'addresses', - ], - 'type' => 'object', - ]; - - /** - * @var string[] - */ - private array $addresses; - - /** - * @var string[] - */ - private array $mailboxNames; - - /** - * @param string[] $addresses - * @param string[] $mailboxNames - */ - public function __construct(array $addresses, array $mailboxNames) - { - $this->addresses = $addresses; - $this->mailboxNames = $mailboxNames; - } - - /** - * @return string[] - */ - public function getAddresses(): array - { - return $this->addresses; - } - - /** - * @return string[] - */ - public function getMailboxNames(): array - { - return $this->mailboxNames; - } - - /** - * @param string[] $addresses - */ - public function withAddresses(array $addresses): self - { - $validator = new Validator(); - $validator->validate($addresses, static::$schema['properties']['addresses']); - if (!$validator->isValid()) { - throw new InvalidArgumentException($validator->getErrors()[0]['message']); - } - - $clone = clone $this; - $clone->addresses = $addresses; - - return $clone; - } - - /** - * @param string[] $mailboxNames - */ - public function withMailboxNames(array $mailboxNames): self - { - $validator = new Validator(); - $validator->validate($mailboxNames, static::$schema['properties']['mailboxNames']); - if (!$validator->isValid()) { - throw new InvalidArgumentException($validator->getErrors()[0]['message']); - } - - $clone = clone $this; - $clone->mailboxNames = $mailboxNames; - - return $clone; - } - - /** - * Builds a new instance from an input array - * - * @param array|object $input Input data - * @param bool $validate Set this to false to skip validation; use at own risk - * @return MigrationFinalizeJobDisableLegacyEntities Created instance - * @throws InvalidArgumentException - */ - public static function buildFromInput(array|object $input, bool $validate = true): MigrationFinalizeJobDisableLegacyEntities - { - $input = is_array($input) ? Validator::arrayToObjectRecursive($input) : $input; - if ($validate) { - static::validateInput($input); - } - - $addresses = $input->{'addresses'}; - $mailboxNames = $input->{'mailboxNames'}; - - $obj = new self($addresses, $mailboxNames); - - return $obj; - } - - /** - * Converts this object back to a simple array that can be JSON-serialized - * - * @return array Converted array - */ - public function toJson(): array - { - $output = []; - $output['addresses'] = $this->addresses; - $output['mailboxNames'] = $this->mailboxNames; - - return $output; - } - - /** - * Validates an input array - * - * @param array|object $input Input data - * @param bool $return Return instead of throwing errors - * @return bool Validation result - * @throws InvalidArgumentException - */ - public static function validateInput(array|object $input, bool $return = false): bool - { - $validator = new \Mittwald\ApiClient\Validator\Validator(); - $input = is_array($input) ? Validator::arrayToObjectRecursive($input) : $input; - $validator->validate($input, static::$schema); - - if (!$validator->isValid() && !$return) { - $errors = array_map(function (array $e): string { - return $e["property"] . ": " . $e["message"]; - }, $validator->getErrors()); - throw new InvalidArgumentException(join(", ", $errors)); - } - - return $validator->isValid(); - } - - public function __clone() - { - } -}