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 13, 2024
1 parent e073226 commit b2cb235
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 261 deletions.
39 changes: 0 additions & 39 deletions src/Generated/V2/Schemas/App/SystemSoftwareVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Mittwald\ApiClient\Generated\V2\Schemas\App;

use DateTime;
use InvalidArgumentException;
use JsonSchema\Validator;

Expand All @@ -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',
],
Expand Down Expand Up @@ -65,8 +60,6 @@ class SystemSoftwareVersion
'type' => 'object',
];

private ?DateTime $expiryDate = null;

private string $externalVersion;

private string $id;
Expand All @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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'};
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
}
}
}
5 changes: 5 additions & 0 deletions src/Generated/V2/Schemas/Conversation/Department.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
32 changes: 30 additions & 2 deletions src/Generated/V2/Schemas/Mailmigration/Mailbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ class Mailbox
'name' => [
'type' => 'string',
],
'passwordHash' => [
'type' => 'string',
],
'quotaInBytes' => [
'type' => 'integer',
],
Expand All @@ -39,6 +42,7 @@ class Mailbox
],
'required' => [
'name',
'passwordHash',
'quotaInBytes',
'mailsystem',
],
Expand All @@ -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;
}

Expand All @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}
Expand All @@ -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();
Expand Down
38 changes: 0 additions & 38 deletions src/Generated/V2/Schemas/Mailmigration/MigrationFinalizeJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,13 @@ 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',
],
],
'type' => 'object',
];

private ?MigrationFinalizeJobDisableLegacyEntities $disableLegacyEntities = null;

private ?MigrationFinalizeJobProjectSetting $projectSettingMigrations = null;

/**
Expand All @@ -45,15 +40,6 @@ public function __construct()
{
}

/**
* @return
* MigrationFinalizeJobDisableLegacyEntities|null
*/
public function getDisableLegacyEntities(): ?MigrationFinalizeJobDisableLegacyEntities
{
return $this->disableLegacyEntities ?? null;
}

/**
* @return
* MigrationFinalizeJobProjectSetting|null
Expand All @@ -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;
Expand Down Expand Up @@ -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;
}
Expand All @@ -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();
}
Expand Down
Loading

0 comments on commit b2cb235

Please sign in to comment.