From 3157b0d4520bb268a999701ea23c4af2c871f8e2 Mon Sep 17 00:00:00 2001 From: mittwald-machine Date: Sun, 17 Dec 2023 00:14:49 +0000 Subject: [PATCH] Update generated client --- .../AcceptCustomerInviteRequest.php | 34 +- .../AcceptCustomerInviteRequestBody.php | 4 +- .../DeclineCustomerInviteRequest.php | 34 +- .../DeleteCustomerInviteRequest.php | 34 +- .../DeleteCustomerMembershipRequest.php | 34 +- .../GetCustomerInviteRequest.php | 34 +- .../GetCustomerMembershipRequest.php | 34 +- .../ResendCustomerInviteMailRequest.php | 34 +- .../UpdateCustomerMembershipRequest.php | 34 +- .../UpdateCustomerMembershipRequestBody.php | 4 +- .../V2/Clients/Domain/DomainClient.php | 15 +- .../V2/Clients/Domain/DomainClientImpl.php | 32 +- .../Domain/ListDomains/ListDomainsRequest.php | 46 ++- ...tDomainsV2DeprecatedBadRequestResponse.php | 142 ++++++++ ...ListDomainsV2DeprecatedDefaultResponse.php | 142 ++++++++ .../ListDomainsV2DeprecatedOKResponse.php | 145 ++++++++ .../ListDomainsV2DeprecatedRequest.php | 332 ++++++++++++++++++ .../CreateFileNotAcceptableResponse.php | 142 ++++++++ .../CreateFileUnauthorizedResponse.php | 142 ++++++++ .../CreateFileUnprocessableEntityResponse.php | 142 ++++++++ .../V2/Clients/File/FileClientImpl.php | 26 ++ .../File/GetFile/GetFileForbiddenResponse.php | 142 ++++++++ .../GetFile/GetFileUnauthorizedResponse.php | 142 ++++++++ .../GetFileUnprocessableEntityResponse.php | 142 ++++++++ .../GetFileMetaBadRequestResponse.php | 142 ++++++++ .../GetFileMetaForbiddenResponse.php | 142 ++++++++ ...GetFileMetaInternalServerErrorResponse.php | 142 ++++++++ .../GetFileMetaUnauthorizedResponse.php | 142 ++++++++ ...GetFileMetaUnprocessableEntityResponse.php | 142 ++++++++ ...FileUploadTokenRulesBadRequestResponse.php | 142 ++++++++ ...tFileUploadTypeRulesBadRequestResponse.php | 142 ++++++++ .../AcceptProjectInviteRequest.php | 34 +- .../AcceptProjectInviteRequestBody.php | 4 +- .../CreateProjectInviteRequest.php | 2 +- .../CreateProjectInviteRequestBody.php | 2 +- .../DeclineProjectInviteRequest.php | 34 +- .../DeleteProjectInviteRequest.php | 34 +- .../DeleteProjectMembershipRequest.php | 34 +- .../GetProjectInviteRequest.php | 34 +- .../GetProjectMembershipRequest.php | 34 +- .../ResendProjectInviteMailRequest.php | 34 +- .../UpdateProjectMembershipRequest.php | 34 +- .../UpdateProjectMembershipRequestBody.php | 4 +- 43 files changed, 2992 insertions(+), 298 deletions(-) create mode 100644 src/Generated/V2/Clients/Domain/ListDomainsV2Deprecated/ListDomainsV2DeprecatedBadRequestResponse.php create mode 100644 src/Generated/V2/Clients/Domain/ListDomainsV2Deprecated/ListDomainsV2DeprecatedDefaultResponse.php create mode 100644 src/Generated/V2/Clients/Domain/ListDomainsV2Deprecated/ListDomainsV2DeprecatedOKResponse.php create mode 100644 src/Generated/V2/Clients/Domain/ListDomainsV2Deprecated/ListDomainsV2DeprecatedRequest.php create mode 100644 src/Generated/V2/Clients/File/CreateFile/CreateFileNotAcceptableResponse.php create mode 100644 src/Generated/V2/Clients/File/CreateFile/CreateFileUnauthorizedResponse.php create mode 100644 src/Generated/V2/Clients/File/CreateFile/CreateFileUnprocessableEntityResponse.php create mode 100644 src/Generated/V2/Clients/File/GetFile/GetFileForbiddenResponse.php create mode 100644 src/Generated/V2/Clients/File/GetFile/GetFileUnauthorizedResponse.php create mode 100644 src/Generated/V2/Clients/File/GetFile/GetFileUnprocessableEntityResponse.php create mode 100644 src/Generated/V2/Clients/File/GetFileMeta/GetFileMetaBadRequestResponse.php create mode 100644 src/Generated/V2/Clients/File/GetFileMeta/GetFileMetaForbiddenResponse.php create mode 100644 src/Generated/V2/Clients/File/GetFileMeta/GetFileMetaInternalServerErrorResponse.php create mode 100644 src/Generated/V2/Clients/File/GetFileMeta/GetFileMetaUnauthorizedResponse.php create mode 100644 src/Generated/V2/Clients/File/GetFileMeta/GetFileMetaUnprocessableEntityResponse.php create mode 100644 src/Generated/V2/Clients/File/GetFileUploadTokenRules/GetFileUploadTokenRulesBadRequestResponse.php create mode 100644 src/Generated/V2/Clients/File/GetFileUploadTypeRules/GetFileUploadTypeRulesBadRequestResponse.php diff --git a/src/Generated/V2/Clients/Customer/AcceptCustomerInvite/AcceptCustomerInviteRequest.php b/src/Generated/V2/Clients/Customer/AcceptCustomerInvite/AcceptCustomerInviteRequest.php index 3b50bdd8..989f308a 100644 --- a/src/Generated/V2/Clients/Customer/AcceptCustomerInvite/AcceptCustomerInviteRequest.php +++ b/src/Generated/V2/Clients/Customer/AcceptCustomerInvite/AcceptCustomerInviteRequest.php @@ -19,7 +19,7 @@ class AcceptCustomerInviteRequest private static array $schema = [ 'type' => 'object', 'properties' => [ - 'inviteId' => [ + 'customerInviteId' => [ 'format' => 'uuid', 'type' => 'string', ], @@ -34,7 +34,7 @@ class AcceptCustomerInviteRequest ], ], 'required' => [ - 'inviteId', + 'customerInviteId', 'body', ], ]; @@ -42,7 +42,7 @@ class AcceptCustomerInviteRequest /** * @var string */ - private string $inviteId; + private string $customerInviteId; /** * @var AcceptCustomerInviteRequestBody @@ -54,21 +54,21 @@ class AcceptCustomerInviteRequest ]; /** - * @param string $inviteId + * @param string $customerInviteId * @param AcceptCustomerInviteRequestBody $body */ - public function __construct(string $inviteId, AcceptCustomerInviteRequestBody $body) + public function __construct(string $customerInviteId, AcceptCustomerInviteRequestBody $body) { - $this->inviteId = $inviteId; + $this->customerInviteId = $customerInviteId; $this->body = $body; } /** * @return string */ - public function getInviteId(): string + public function getCustomerInviteId(): string { - return $this->inviteId; + return $this->customerInviteId; } /** @@ -80,19 +80,19 @@ public function getBody(): AcceptCustomerInviteRequestBody } /** - * @param string $inviteId + * @param string $customerInviteId * @return self */ - public function withInviteId(string $inviteId): self + public function withCustomerInviteId(string $customerInviteId): self { $validator = new Validator(); - $validator->validate($inviteId, static::$schema['properties']['inviteId']); + $validator->validate($customerInviteId, static::$schema['properties']['customerInviteId']); if (!$validator->isValid()) { throw new InvalidArgumentException($validator->getErrors()[0]['message']); } $clone = clone $this; - $clone->inviteId = $inviteId; + $clone->customerInviteId = $customerInviteId; return $clone; } @@ -124,10 +124,10 @@ public static function buildFromInput(array|object $input, bool $validate = true static::validateInput($input); } - $inviteId = $input->{'inviteId'}; + $customerInviteId = $input->{'customerInviteId'}; $body = AcceptCustomerInviteRequestBody::buildFromInput($input->{'body'}, validate: $validate); - $obj = new self($inviteId, $body); + $obj = new self($customerInviteId, $body); return $obj; } @@ -140,7 +140,7 @@ public static function buildFromInput(array|object $input, bool $validate = true public function toJson(): array { $output = []; - $output['inviteId'] = $this->inviteId; + $output['customerInviteId'] = $this->customerInviteId; $output['body'] = ($this->body)->toJson(); return $output; @@ -178,8 +178,8 @@ public function __clone() public function getUrl(): string { $mapped = $this->toJson(); - $inviteId = urlencode($mapped['inviteId']); - return '/v2/customer-invites/' . $inviteId . '/actions/accept'; + $customerInviteId = urlencode($mapped['customerInviteId']); + return '/v2/customer-invites/' . $customerInviteId . '/actions/accept'; } public function getQuery(): array diff --git a/src/Generated/V2/Clients/Customer/AcceptCustomerInvite/AcceptCustomerInviteRequestBody.php b/src/Generated/V2/Clients/Customer/AcceptCustomerInvite/AcceptCustomerInviteRequestBody.php index 6ebae0d0..544caf9e 100644 --- a/src/Generated/V2/Clients/Customer/AcceptCustomerInvite/AcceptCustomerInviteRequestBody.php +++ b/src/Generated/V2/Clients/Customer/AcceptCustomerInvite/AcceptCustomerInviteRequestBody.php @@ -152,8 +152,8 @@ public function __clone() public function getUrl(): string { $mapped = $this->toJson(); - $inviteId = urlencode($mapped['inviteId']); - return '/v2/customer-invites/' . $inviteId . '/actions/accept'; + $customerInviteId = urlencode($mapped['customerInviteId']); + return '/v2/customer-invites/' . $customerInviteId . '/actions/accept'; } public function getQuery(): array diff --git a/src/Generated/V2/Clients/Customer/DeclineCustomerInvite/DeclineCustomerInviteRequest.php b/src/Generated/V2/Clients/Customer/DeclineCustomerInvite/DeclineCustomerInviteRequest.php index 99063812..07b5f808 100644 --- a/src/Generated/V2/Clients/Customer/DeclineCustomerInvite/DeclineCustomerInviteRequest.php +++ b/src/Generated/V2/Clients/Customer/DeclineCustomerInvite/DeclineCustomerInviteRequest.php @@ -19,7 +19,7 @@ class DeclineCustomerInviteRequest private static array $schema = [ 'type' => 'object', 'properties' => [ - 'inviteId' => [ + 'customerInviteId' => [ 'format' => 'uuid', 'type' => 'string', ], @@ -28,7 +28,7 @@ class DeclineCustomerInviteRequest ], ], 'required' => [ - 'inviteId', + 'customerInviteId', 'body', ], ]; @@ -36,7 +36,7 @@ class DeclineCustomerInviteRequest /** * @var string */ - private string $inviteId; + private string $customerInviteId; /** * @var mixed @@ -48,21 +48,21 @@ class DeclineCustomerInviteRequest ]; /** - * @param string $inviteId + * @param string $customerInviteId * @param mixed $body */ - public function __construct(string $inviteId, $body) + public function __construct(string $customerInviteId, $body) { - $this->inviteId = $inviteId; + $this->customerInviteId = $customerInviteId; $this->body = $body; } /** * @return string */ - public function getInviteId(): string + public function getCustomerInviteId(): string { - return $this->inviteId; + return $this->customerInviteId; } /** @@ -74,19 +74,19 @@ public function getBody() } /** - * @param string $inviteId + * @param string $customerInviteId * @return self */ - public function withInviteId(string $inviteId): self + public function withCustomerInviteId(string $customerInviteId): self { $validator = new Validator(); - $validator->validate($inviteId, static::$schema['properties']['inviteId']); + $validator->validate($customerInviteId, static::$schema['properties']['customerInviteId']); if (!$validator->isValid()) { throw new InvalidArgumentException($validator->getErrors()[0]['message']); } $clone = clone $this; - $clone->inviteId = $inviteId; + $clone->customerInviteId = $customerInviteId; return $clone; } @@ -124,10 +124,10 @@ public static function buildFromInput(array|object $input, bool $validate = true static::validateInput($input); } - $inviteId = $input->{'inviteId'}; + $customerInviteId = $input->{'customerInviteId'}; $body = $input->{'body'}; - $obj = new self($inviteId, $body); + $obj = new self($customerInviteId, $body); return $obj; } @@ -140,7 +140,7 @@ public static function buildFromInput(array|object $input, bool $validate = true public function toJson(): array { $output = []; - $output['inviteId'] = $this->inviteId; + $output['customerInviteId'] = $this->customerInviteId; $output['body'] = $this->body; return $output; @@ -177,8 +177,8 @@ public function __clone() public function getUrl(): string { $mapped = $this->toJson(); - $inviteId = urlencode($mapped['inviteId']); - return '/v2/customer-invites/' . $inviteId . '/actions/decline'; + $customerInviteId = urlencode($mapped['customerInviteId']); + return '/v2/customer-invites/' . $customerInviteId . '/actions/decline'; } public function getQuery(): array diff --git a/src/Generated/V2/Clients/Customer/DeleteCustomerInvite/DeleteCustomerInviteRequest.php b/src/Generated/V2/Clients/Customer/DeleteCustomerInvite/DeleteCustomerInviteRequest.php index d2dd5662..ef3e8aa5 100644 --- a/src/Generated/V2/Clients/Customer/DeleteCustomerInvite/DeleteCustomerInviteRequest.php +++ b/src/Generated/V2/Clients/Customer/DeleteCustomerInvite/DeleteCustomerInviteRequest.php @@ -19,55 +19,55 @@ class DeleteCustomerInviteRequest private static array $schema = [ 'type' => 'object', 'properties' => [ - 'inviteId' => [ + 'customerInviteId' => [ 'format' => 'uuid', 'type' => 'string', ], ], 'required' => [ - 'inviteId', + 'customerInviteId', ], ]; /** * @var string */ - private string $inviteId; + private string $customerInviteId; private array $headers = [ ]; /** - * @param string $inviteId + * @param string $customerInviteId */ - public function __construct(string $inviteId) + public function __construct(string $customerInviteId) { - $this->inviteId = $inviteId; + $this->customerInviteId = $customerInviteId; } /** * @return string */ - public function getInviteId(): string + public function getCustomerInviteId(): string { - return $this->inviteId; + return $this->customerInviteId; } /** - * @param string $inviteId + * @param string $customerInviteId * @return self */ - public function withInviteId(string $inviteId): self + public function withCustomerInviteId(string $customerInviteId): self { $validator = new Validator(); - $validator->validate($inviteId, static::$schema['properties']['inviteId']); + $validator->validate($customerInviteId, static::$schema['properties']['customerInviteId']); if (!$validator->isValid()) { throw new InvalidArgumentException($validator->getErrors()[0]['message']); } $clone = clone $this; - $clone->inviteId = $inviteId; + $clone->customerInviteId = $customerInviteId; return $clone; } @@ -87,9 +87,9 @@ public static function buildFromInput(array|object $input, bool $validate = true static::validateInput($input); } - $inviteId = $input->{'inviteId'}; + $customerInviteId = $input->{'customerInviteId'}; - $obj = new self($inviteId); + $obj = new self($customerInviteId); return $obj; } @@ -102,7 +102,7 @@ public static function buildFromInput(array|object $input, bool $validate = true public function toJson(): array { $output = []; - $output['inviteId'] = $this->inviteId; + $output['customerInviteId'] = $this->customerInviteId; return $output; } @@ -138,8 +138,8 @@ public function __clone() public function getUrl(): string { $mapped = $this->toJson(); - $inviteId = urlencode($mapped['inviteId']); - return '/v2/customer-invites/' . $inviteId; + $customerInviteId = urlencode($mapped['customerInviteId']); + return '/v2/customer-invites/' . $customerInviteId; } public function getQuery(): array diff --git a/src/Generated/V2/Clients/Customer/DeleteCustomerMembership/DeleteCustomerMembershipRequest.php b/src/Generated/V2/Clients/Customer/DeleteCustomerMembership/DeleteCustomerMembershipRequest.php index 06b30d5a..d114525c 100644 --- a/src/Generated/V2/Clients/Customer/DeleteCustomerMembership/DeleteCustomerMembershipRequest.php +++ b/src/Generated/V2/Clients/Customer/DeleteCustomerMembership/DeleteCustomerMembershipRequest.php @@ -19,55 +19,55 @@ class DeleteCustomerMembershipRequest private static array $schema = [ 'type' => 'object', 'properties' => [ - 'membershipId' => [ + 'customerMembershipId' => [ 'format' => 'uuid', 'type' => 'string', ], ], 'required' => [ - 'membershipId', + 'customerMembershipId', ], ]; /** * @var string */ - private string $membershipId; + private string $customerMembershipId; private array $headers = [ ]; /** - * @param string $membershipId + * @param string $customerMembershipId */ - public function __construct(string $membershipId) + public function __construct(string $customerMembershipId) { - $this->membershipId = $membershipId; + $this->customerMembershipId = $customerMembershipId; } /** * @return string */ - public function getMembershipId(): string + public function getCustomerMembershipId(): string { - return $this->membershipId; + return $this->customerMembershipId; } /** - * @param string $membershipId + * @param string $customerMembershipId * @return self */ - public function withMembershipId(string $membershipId): self + public function withCustomerMembershipId(string $customerMembershipId): self { $validator = new Validator(); - $validator->validate($membershipId, static::$schema['properties']['membershipId']); + $validator->validate($customerMembershipId, static::$schema['properties']['customerMembershipId']); if (!$validator->isValid()) { throw new InvalidArgumentException($validator->getErrors()[0]['message']); } $clone = clone $this; - $clone->membershipId = $membershipId; + $clone->customerMembershipId = $customerMembershipId; return $clone; } @@ -87,9 +87,9 @@ public static function buildFromInput(array|object $input, bool $validate = true static::validateInput($input); } - $membershipId = $input->{'membershipId'}; + $customerMembershipId = $input->{'customerMembershipId'}; - $obj = new self($membershipId); + $obj = new self($customerMembershipId); return $obj; } @@ -102,7 +102,7 @@ public static function buildFromInput(array|object $input, bool $validate = true public function toJson(): array { $output = []; - $output['membershipId'] = $this->membershipId; + $output['customerMembershipId'] = $this->customerMembershipId; return $output; } @@ -138,8 +138,8 @@ public function __clone() public function getUrl(): string { $mapped = $this->toJson(); - $membershipId = urlencode($mapped['membershipId']); - return '/v2/customer-memberships/' . $membershipId; + $customerMembershipId = urlencode($mapped['customerMembershipId']); + return '/v2/customer-memberships/' . $customerMembershipId; } public function getQuery(): array diff --git a/src/Generated/V2/Clients/Customer/GetCustomerInvite/GetCustomerInviteRequest.php b/src/Generated/V2/Clients/Customer/GetCustomerInvite/GetCustomerInviteRequest.php index 5d54b4ee..cf11ef8e 100644 --- a/src/Generated/V2/Clients/Customer/GetCustomerInvite/GetCustomerInviteRequest.php +++ b/src/Generated/V2/Clients/Customer/GetCustomerInvite/GetCustomerInviteRequest.php @@ -19,54 +19,54 @@ class GetCustomerInviteRequest private static array $schema = [ 'type' => 'object', 'properties' => [ - 'inviteId' => [ + 'customerInviteId' => [ 'type' => 'string', ], ], 'required' => [ - 'inviteId', + 'customerInviteId', ], ]; /** * @var string */ - private string $inviteId; + private string $customerInviteId; private array $headers = [ ]; /** - * @param string $inviteId + * @param string $customerInviteId */ - public function __construct(string $inviteId) + public function __construct(string $customerInviteId) { - $this->inviteId = $inviteId; + $this->customerInviteId = $customerInviteId; } /** * @return string */ - public function getInviteId(): string + public function getCustomerInviteId(): string { - return $this->inviteId; + return $this->customerInviteId; } /** - * @param string $inviteId + * @param string $customerInviteId * @return self */ - public function withInviteId(string $inviteId): self + public function withCustomerInviteId(string $customerInviteId): self { $validator = new Validator(); - $validator->validate($inviteId, static::$schema['properties']['inviteId']); + $validator->validate($customerInviteId, static::$schema['properties']['customerInviteId']); if (!$validator->isValid()) { throw new InvalidArgumentException($validator->getErrors()[0]['message']); } $clone = clone $this; - $clone->inviteId = $inviteId; + $clone->customerInviteId = $customerInviteId; return $clone; } @@ -86,9 +86,9 @@ public static function buildFromInput(array|object $input, bool $validate = true static::validateInput($input); } - $inviteId = $input->{'inviteId'}; + $customerInviteId = $input->{'customerInviteId'}; - $obj = new self($inviteId); + $obj = new self($customerInviteId); return $obj; } @@ -101,7 +101,7 @@ public static function buildFromInput(array|object $input, bool $validate = true public function toJson(): array { $output = []; - $output['inviteId'] = $this->inviteId; + $output['customerInviteId'] = $this->customerInviteId; return $output; } @@ -137,8 +137,8 @@ public function __clone() public function getUrl(): string { $mapped = $this->toJson(); - $inviteId = urlencode($mapped['inviteId']); - return '/v2/customer-invites/' . $inviteId; + $customerInviteId = urlencode($mapped['customerInviteId']); + return '/v2/customer-invites/' . $customerInviteId; } public function getQuery(): array diff --git a/src/Generated/V2/Clients/Customer/GetCustomerMembership/GetCustomerMembershipRequest.php b/src/Generated/V2/Clients/Customer/GetCustomerMembership/GetCustomerMembershipRequest.php index d50736ad..df21284b 100644 --- a/src/Generated/V2/Clients/Customer/GetCustomerMembership/GetCustomerMembershipRequest.php +++ b/src/Generated/V2/Clients/Customer/GetCustomerMembership/GetCustomerMembershipRequest.php @@ -19,54 +19,54 @@ class GetCustomerMembershipRequest private static array $schema = [ 'type' => 'object', 'properties' => [ - 'membershipId' => [ + 'customerMembershipId' => [ 'type' => 'string', ], ], 'required' => [ - 'membershipId', + 'customerMembershipId', ], ]; /** * @var string */ - private string $membershipId; + private string $customerMembershipId; private array $headers = [ ]; /** - * @param string $membershipId + * @param string $customerMembershipId */ - public function __construct(string $membershipId) + public function __construct(string $customerMembershipId) { - $this->membershipId = $membershipId; + $this->customerMembershipId = $customerMembershipId; } /** * @return string */ - public function getMembershipId(): string + public function getCustomerMembershipId(): string { - return $this->membershipId; + return $this->customerMembershipId; } /** - * @param string $membershipId + * @param string $customerMembershipId * @return self */ - public function withMembershipId(string $membershipId): self + public function withCustomerMembershipId(string $customerMembershipId): self { $validator = new Validator(); - $validator->validate($membershipId, static::$schema['properties']['membershipId']); + $validator->validate($customerMembershipId, static::$schema['properties']['customerMembershipId']); if (!$validator->isValid()) { throw new InvalidArgumentException($validator->getErrors()[0]['message']); } $clone = clone $this; - $clone->membershipId = $membershipId; + $clone->customerMembershipId = $customerMembershipId; return $clone; } @@ -86,9 +86,9 @@ public static function buildFromInput(array|object $input, bool $validate = true static::validateInput($input); } - $membershipId = $input->{'membershipId'}; + $customerMembershipId = $input->{'customerMembershipId'}; - $obj = new self($membershipId); + $obj = new self($customerMembershipId); return $obj; } @@ -101,7 +101,7 @@ public static function buildFromInput(array|object $input, bool $validate = true public function toJson(): array { $output = []; - $output['membershipId'] = $this->membershipId; + $output['customerMembershipId'] = $this->customerMembershipId; return $output; } @@ -137,8 +137,8 @@ public function __clone() public function getUrl(): string { $mapped = $this->toJson(); - $membershipId = urlencode($mapped['membershipId']); - return '/v2/customer-memberships/' . $membershipId; + $customerMembershipId = urlencode($mapped['customerMembershipId']); + return '/v2/customer-memberships/' . $customerMembershipId; } public function getQuery(): array diff --git a/src/Generated/V2/Clients/Customer/ResendCustomerInviteMail/ResendCustomerInviteMailRequest.php b/src/Generated/V2/Clients/Customer/ResendCustomerInviteMail/ResendCustomerInviteMailRequest.php index 48f34ef9..54004f77 100644 --- a/src/Generated/V2/Clients/Customer/ResendCustomerInviteMail/ResendCustomerInviteMailRequest.php +++ b/src/Generated/V2/Clients/Customer/ResendCustomerInviteMail/ResendCustomerInviteMailRequest.php @@ -19,7 +19,7 @@ class ResendCustomerInviteMailRequest private static array $schema = [ 'type' => 'object', 'properties' => [ - 'inviteId' => [ + 'customerInviteId' => [ 'format' => 'uuid', 'type' => 'string', ], @@ -28,7 +28,7 @@ class ResendCustomerInviteMailRequest ], ], 'required' => [ - 'inviteId', + 'customerInviteId', 'body', ], ]; @@ -36,7 +36,7 @@ class ResendCustomerInviteMailRequest /** * @var string */ - private string $inviteId; + private string $customerInviteId; /** * @var mixed @@ -48,21 +48,21 @@ class ResendCustomerInviteMailRequest ]; /** - * @param string $inviteId + * @param string $customerInviteId * @param mixed $body */ - public function __construct(string $inviteId, $body) + public function __construct(string $customerInviteId, $body) { - $this->inviteId = $inviteId; + $this->customerInviteId = $customerInviteId; $this->body = $body; } /** * @return string */ - public function getInviteId(): string + public function getCustomerInviteId(): string { - return $this->inviteId; + return $this->customerInviteId; } /** @@ -74,19 +74,19 @@ public function getBody() } /** - * @param string $inviteId + * @param string $customerInviteId * @return self */ - public function withInviteId(string $inviteId): self + public function withCustomerInviteId(string $customerInviteId): self { $validator = new Validator(); - $validator->validate($inviteId, static::$schema['properties']['inviteId']); + $validator->validate($customerInviteId, static::$schema['properties']['customerInviteId']); if (!$validator->isValid()) { throw new InvalidArgumentException($validator->getErrors()[0]['message']); } $clone = clone $this; - $clone->inviteId = $inviteId; + $clone->customerInviteId = $customerInviteId; return $clone; } @@ -124,10 +124,10 @@ public static function buildFromInput(array|object $input, bool $validate = true static::validateInput($input); } - $inviteId = $input->{'inviteId'}; + $customerInviteId = $input->{'customerInviteId'}; $body = $input->{'body'}; - $obj = new self($inviteId, $body); + $obj = new self($customerInviteId, $body); return $obj; } @@ -140,7 +140,7 @@ public static function buildFromInput(array|object $input, bool $validate = true public function toJson(): array { $output = []; - $output['inviteId'] = $this->inviteId; + $output['customerInviteId'] = $this->customerInviteId; $output['body'] = $this->body; return $output; @@ -177,8 +177,8 @@ public function __clone() public function getUrl(): string { $mapped = $this->toJson(); - $inviteId = urlencode($mapped['inviteId']); - return '/v2/customer-invites/' . $inviteId . '/actions/resend'; + $customerInviteId = urlencode($mapped['customerInviteId']); + return '/v2/customer-invites/' . $customerInviteId . '/actions/resend'; } public function getQuery(): array diff --git a/src/Generated/V2/Clients/Customer/UpdateCustomerMembership/UpdateCustomerMembershipRequest.php b/src/Generated/V2/Clients/Customer/UpdateCustomerMembership/UpdateCustomerMembershipRequest.php index 8a600c34..de6a60e0 100644 --- a/src/Generated/V2/Clients/Customer/UpdateCustomerMembership/UpdateCustomerMembershipRequest.php +++ b/src/Generated/V2/Clients/Customer/UpdateCustomerMembership/UpdateCustomerMembershipRequest.php @@ -19,7 +19,7 @@ class UpdateCustomerMembershipRequest private static array $schema = [ 'type' => 'object', 'properties' => [ - 'membershipId' => [ + 'customerMembershipId' => [ 'format' => 'uuid', 'type' => 'string', ], @@ -41,7 +41,7 @@ class UpdateCustomerMembershipRequest ], ], 'required' => [ - 'membershipId', + 'customerMembershipId', 'body', ], ]; @@ -49,7 +49,7 @@ class UpdateCustomerMembershipRequest /** * @var string */ - private string $membershipId; + private string $customerMembershipId; /** * @var UpdateCustomerMembershipRequestBody @@ -61,21 +61,21 @@ class UpdateCustomerMembershipRequest ]; /** - * @param string $membershipId + * @param string $customerMembershipId * @param UpdateCustomerMembershipRequestBody $body */ - public function __construct(string $membershipId, UpdateCustomerMembershipRequestBody $body) + public function __construct(string $customerMembershipId, UpdateCustomerMembershipRequestBody $body) { - $this->membershipId = $membershipId; + $this->customerMembershipId = $customerMembershipId; $this->body = $body; } /** * @return string */ - public function getMembershipId(): string + public function getCustomerMembershipId(): string { - return $this->membershipId; + return $this->customerMembershipId; } /** @@ -87,19 +87,19 @@ public function getBody(): UpdateCustomerMembershipRequestBody } /** - * @param string $membershipId + * @param string $customerMembershipId * @return self */ - public function withMembershipId(string $membershipId): self + public function withCustomerMembershipId(string $customerMembershipId): self { $validator = new Validator(); - $validator->validate($membershipId, static::$schema['properties']['membershipId']); + $validator->validate($customerMembershipId, static::$schema['properties']['customerMembershipId']); if (!$validator->isValid()) { throw new InvalidArgumentException($validator->getErrors()[0]['message']); } $clone = clone $this; - $clone->membershipId = $membershipId; + $clone->customerMembershipId = $customerMembershipId; return $clone; } @@ -131,10 +131,10 @@ public static function buildFromInput(array|object $input, bool $validate = true static::validateInput($input); } - $membershipId = $input->{'membershipId'}; + $customerMembershipId = $input->{'customerMembershipId'}; $body = UpdateCustomerMembershipRequestBody::buildFromInput($input->{'body'}, validate: $validate); - $obj = new self($membershipId, $body); + $obj = new self($customerMembershipId, $body); return $obj; } @@ -147,7 +147,7 @@ public static function buildFromInput(array|object $input, bool $validate = true public function toJson(): array { $output = []; - $output['membershipId'] = $this->membershipId; + $output['customerMembershipId'] = $this->customerMembershipId; $output['body'] = ($this->body)->toJson(); return $output; @@ -185,8 +185,8 @@ public function __clone() public function getUrl(): string { $mapped = $this->toJson(); - $membershipId = urlencode($mapped['membershipId']); - return '/v2/customer-memberships/' . $membershipId; + $customerMembershipId = urlencode($mapped['customerMembershipId']); + return '/v2/customer-memberships/' . $customerMembershipId; } public function getQuery(): array diff --git a/src/Generated/V2/Clients/Customer/UpdateCustomerMembership/UpdateCustomerMembershipRequestBody.php b/src/Generated/V2/Clients/Customer/UpdateCustomerMembership/UpdateCustomerMembershipRequestBody.php index dc1a7e08..86546bf9 100644 --- a/src/Generated/V2/Clients/Customer/UpdateCustomerMembership/UpdateCustomerMembershipRequestBody.php +++ b/src/Generated/V2/Clients/Customer/UpdateCustomerMembership/UpdateCustomerMembershipRequestBody.php @@ -186,8 +186,8 @@ public function __clone() public function getUrl(): string { $mapped = $this->toJson(); - $membershipId = urlencode($mapped['membershipId']); - return '/v2/customer-memberships/' . $membershipId; + $customerMembershipId = urlencode($mapped['customerMembershipId']); + return '/v2/customer-memberships/' . $customerMembershipId; } public function getQuery(): array diff --git a/src/Generated/V2/Clients/Domain/DomainClient.php b/src/Generated/V2/Clients/Domain/DomainClient.php index 9874a960..b6982c9f 100644 --- a/src/Generated/V2/Clients/Domain/DomainClient.php +++ b/src/Generated/V2/Clients/Domain/DomainClient.php @@ -71,6 +71,8 @@ use Mittwald\ApiClient\Generated\V2\Clients\Domain\ListDomainOwnerships\ListDomainOwnershipsRequest; use Mittwald\ApiClient\Generated\V2\Clients\Domain\ListDomains\ListDomainsOKResponse; use Mittwald\ApiClient\Generated\V2\Clients\Domain\ListDomains\ListDomainsRequest; +use Mittwald\ApiClient\Generated\V2\Clients\Domain\ListDomainsV2Deprecated\ListDomainsV2DeprecatedOKResponse; +use Mittwald\ApiClient\Generated\V2\Clients\Domain\ListDomainsV2Deprecated\ListDomainsV2DeprecatedRequest; use Mittwald\ApiClient\Generated\V2\Clients\Domain\ListTldContactSchemas\ListTldContactSchemasOKResponse; use Mittwald\ApiClient\Generated\V2\Clients\Domain\ListTldContactSchemas\ListTldContactSchemasRequest; use Mittwald\ApiClient\Generated\V2\Clients\Domain\ListTlds\ListTldsOKResponse; @@ -431,7 +433,7 @@ public function getLatestScreenshot(GetLatestScreenshotRequest $request): GetLat */ public function listDomainOwnerships(ListDomainOwnershipsRequest $request): ListDomainOwnershipsOKResponse; /** - * List Domains belonging to a Project. + * List Domains * * @see https://developer.mittwald.de/reference/v2/#tag/Domain/operation/domain-list-domains * @throws GuzzleException @@ -440,6 +442,17 @@ public function listDomainOwnerships(ListDomainOwnershipsRequest $request): List * @return ListDomains\ListDomainsOKResponse OK */ public function listDomains(ListDomainsRequest $request): ListDomainsOKResponse; + /** + * List Domains belonging to a Project. + * + * @see https://developer.mittwald.de/reference/v2/#tag/Domain/operation/domain-list-domains-v2-deprecated + * @throws GuzzleException + * @throws UnexpectedResponseException + * @param ListDomainsV2Deprecated\ListDomainsV2DeprecatedRequest $request An object representing the request for this operation + * @deprecated + * @return ListDomainsV2Deprecated\ListDomainsV2DeprecatedOKResponse OK + */ + public function listDomainsV2Deprecated(ListDomainsV2DeprecatedRequest $request): ListDomainsV2DeprecatedOKResponse; /** * List the contact schemas for a TLD. * diff --git a/src/Generated/V2/Clients/Domain/DomainClientImpl.php b/src/Generated/V2/Clients/Domain/DomainClientImpl.php index 9376a3d6..2861b204 100644 --- a/src/Generated/V2/Clients/Domain/DomainClientImpl.php +++ b/src/Generated/V2/Clients/Domain/DomainClientImpl.php @@ -166,6 +166,10 @@ use Mittwald\ApiClient\Generated\V2\Clients\Domain\ListDomains\ListDomainsDefaultResponse; use Mittwald\ApiClient\Generated\V2\Clients\Domain\ListDomains\ListDomainsOKResponse; use Mittwald\ApiClient\Generated\V2\Clients\Domain\ListDomains\ListDomainsRequest; +use Mittwald\ApiClient\Generated\V2\Clients\Domain\ListDomainsV2Deprecated\ListDomainsV2DeprecatedBadRequestResponse; +use Mittwald\ApiClient\Generated\V2\Clients\Domain\ListDomainsV2Deprecated\ListDomainsV2DeprecatedDefaultResponse; +use Mittwald\ApiClient\Generated\V2\Clients\Domain\ListDomainsV2Deprecated\ListDomainsV2DeprecatedOKResponse; +use Mittwald\ApiClient\Generated\V2\Clients\Domain\ListDomainsV2Deprecated\ListDomainsV2DeprecatedRequest; use Mittwald\ApiClient\Generated\V2\Clients\Domain\ListTldContactSchemas\ListTldContactSchemasDefaultResponse; use Mittwald\ApiClient\Generated\V2\Clients\Domain\ListTldContactSchemas\ListTldContactSchemasOKResponse; use Mittwald\ApiClient\Generated\V2\Clients\Domain\ListTldContactSchemas\ListTldContactSchemasRequest; @@ -1035,7 +1039,7 @@ public function listDomainOwnerships(ListDomainOwnershipsRequest $request): List } /** - * List Domains belonging to a Project. + * List Domains * * @see https://developer.mittwald.de/reference/v2/#tag/Domain/operation/domain-list-domains * @throws GuzzleException @@ -1059,6 +1063,32 @@ public function listDomains(ListDomainsRequest $request): ListDomainsOKResponse }); } + /** + * List Domains belonging to a Project. + * + * @see https://developer.mittwald.de/reference/v2/#tag/Domain/operation/domain-list-domains-v2-deprecated + * @throws GuzzleException + * @throws UnexpectedResponseException + * @param ListDomainsV2Deprecated\ListDomainsV2DeprecatedRequest $request An object representing the request for this operation + * @deprecated + * @return ListDomainsV2Deprecated\ListDomainsV2DeprecatedOKResponse OK + */ + public function listDomainsV2Deprecated(ListDomainsV2DeprecatedRequest $request): ListDomainsV2DeprecatedOKResponse + { + $httpRequest = new Request(ListDomainsV2DeprecatedRequest::method, $request->getUrl()); + $httpResponse = $this->client->send($httpRequest, [ + 'query' => $request->getQuery(), + 'headers' => $request->getHeaders(), + ]); + if ($httpResponse->getStatusCode() === 200) { + return ListDomainsV2DeprecatedOKResponse::fromResponse($httpResponse); + } + throw new UnexpectedResponseException(match ($httpResponse->getStatusCode()) { + 400 => ListDomainsV2DeprecatedBadRequestResponse::fromResponse($httpResponse), + default => ListDomainsV2DeprecatedDefaultResponse::fromResponse($httpResponse), + }); + } + /** * List the contact schemas for a TLD. * diff --git a/src/Generated/V2/Clients/Domain/ListDomains/ListDomainsRequest.php b/src/Generated/V2/Clients/Domain/ListDomains/ListDomainsRequest.php index 7a1ea3c7..5896f170 100644 --- a/src/Generated/V2/Clients/Domain/ListDomains/ListDomainsRequest.php +++ b/src/Generated/V2/Clients/Domain/ListDomains/ListDomainsRequest.php @@ -36,14 +36,14 @@ class ListDomainsRequest ], ], 'required' => [ - 'projectId', + ], ]; /** - * @var string + * @var string|null */ - private string $projectId; + private ?string $projectId = null; /** * @var int|null @@ -65,19 +65,18 @@ class ListDomainsRequest ]; /** - * @param string $projectId + * */ - public function __construct(string $projectId) + public function __construct() { - $this->projectId = $projectId; } /** - * @return string + * @return string|null */ - public function getProjectId(): string + public function getProjectId(): ?string { - return $this->projectId; + return $this->projectId ?? null; } /** @@ -122,6 +121,17 @@ public function withProjectId(string $projectId): self return $clone; } + /** + * @return self + */ + public function withoutProjectId(): self + { + $clone = clone $this; + unset($clone->projectId); + + return $clone; + } + /** * @param int $page * @return self @@ -224,7 +234,10 @@ public static function buildFromInput(array|object $input, bool $validate = true static::validateInput($input); } - $projectId = $input->{'projectId'}; + $projectId = null; + if (isset($input->{'projectId'})) { + $projectId = $input->{'projectId'}; + } $page = null; if (isset($input->{'page'})) { $page = (int)($input->{'page'}); @@ -238,7 +251,8 @@ public static function buildFromInput(array|object $input, bool $validate = true $domainSearchName = $input->{'domainSearchName'}; } - $obj = new self($projectId); + $obj = new self(); + $obj->projectId = $projectId; $obj->page = $page; $obj->limit = $limit; $obj->domainSearchName = $domainSearchName; @@ -253,7 +267,9 @@ public static function buildFromInput(array|object $input, bool $validate = true public function toJson(): array { $output = []; - $output['projectId'] = $this->projectId; + if (isset($this->projectId)) { + $output['projectId'] = $this->projectId; + } if (isset($this->page)) { $output['page'] = $this->page; } @@ -298,14 +314,16 @@ public function __clone() public function getUrl(): string { $mapped = $this->toJson(); - $projectId = urlencode($mapped['projectId']); - return '/v2/projects/' . $projectId . '/domains'; + return '/v2/domains'; } public function getQuery(): array { $mapped = $this->toJson(); $query = []; + if (isset($mapped['projectId'])) { + $query['projectId'] = $mapped['projectId']; + } if (isset($mapped['page'])) { $query['page'] = $mapped['page']; } diff --git a/src/Generated/V2/Clients/Domain/ListDomainsV2Deprecated/ListDomainsV2DeprecatedBadRequestResponse.php b/src/Generated/V2/Clients/Domain/ListDomainsV2Deprecated/ListDomainsV2DeprecatedBadRequestResponse.php new file mode 100644 index 00000000..986e7f9a --- /dev/null +++ b/src/Generated/V2/Clients/Domain/ListDomainsV2Deprecated/ListDomainsV2DeprecatedBadRequestResponse.php @@ -0,0 +1,142 @@ + 'object', + 'required' => [ + 'body', + ], + 'properties' => [ + 'body' => [ + '$ref' => '#/components/schemas/de.mittwald.v1.commons.ValidationErrors', + ], + ], + ]; + + /** + * @var ValidationErrors + */ + private ValidationErrors $body; + + private ResponseInterface|null $httpResponse = null; + + /** + * @param ValidationErrors $body + */ + public function __construct(ValidationErrors $body) + { + $this->body = $body; + } + + /** + * @return ValidationErrors + */ + public function getBody(): ValidationErrors + { + return $this->body; + } + + /** + * @param ValidationErrors $body + * @return self + */ + public function withBody(ValidationErrors $body): self + { + $clone = clone $this; + $clone->body = $body; + + 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 ListDomainsV2DeprecatedBadRequestResponse Created instance + * @throws InvalidArgumentException + */ + public static function buildFromInput(array|object $input, bool $validate = true): ListDomainsV2DeprecatedBadRequestResponse + { + $input = is_array($input) ? Validator::arrayToObjectRecursive($input) : $input; + if ($validate) { + static::validateInput($input); + } + + $body = ValidationErrors::buildFromInput($input->{'body'}, validate: $validate); + + $obj = new self($body); + + 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['body'] = $this->body->toJson(); + + 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 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() + { + } + + public static function fromResponse(ResponseInterface $httpResponse): self + { + $parsedBody = json_decode($httpResponse->getBody()->getContents(), associative: true); + $response = static::buildFromInput(['body' => $parsedBody], validate: false); + $response->httpResponse = $httpResponse; + return $response; + } + + public function getResponse(): ResponseInterface|null + { + return $this->httpResponse; + } +} diff --git a/src/Generated/V2/Clients/Domain/ListDomainsV2Deprecated/ListDomainsV2DeprecatedDefaultResponse.php b/src/Generated/V2/Clients/Domain/ListDomainsV2Deprecated/ListDomainsV2DeprecatedDefaultResponse.php new file mode 100644 index 00000000..c767cbfb --- /dev/null +++ b/src/Generated/V2/Clients/Domain/ListDomainsV2Deprecated/ListDomainsV2DeprecatedDefaultResponse.php @@ -0,0 +1,142 @@ + 'object', + 'required' => [ + 'body', + ], + 'properties' => [ + 'body' => [ + '$ref' => '#/components/schemas/de.mittwald.v1.commons.Error', + ], + ], + ]; + + /** + * @var Error + */ + private Error $body; + + private ResponseInterface|null $httpResponse = null; + + /** + * @param Error $body + */ + public function __construct(Error $body) + { + $this->body = $body; + } + + /** + * @return Error + */ + public function getBody(): Error + { + return $this->body; + } + + /** + * @param Error $body + * @return self + */ + public function withBody(Error $body): self + { + $clone = clone $this; + $clone->body = $body; + + 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 ListDomainsV2DeprecatedDefaultResponse Created instance + * @throws InvalidArgumentException + */ + public static function buildFromInput(array|object $input, bool $validate = true): ListDomainsV2DeprecatedDefaultResponse + { + $input = is_array($input) ? Validator::arrayToObjectRecursive($input) : $input; + if ($validate) { + static::validateInput($input); + } + + $body = Error::buildFromInput($input->{'body'}, validate: $validate); + + $obj = new self($body); + + 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['body'] = $this->body->toJson(); + + 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 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() + { + } + + public static function fromResponse(ResponseInterface $httpResponse): self + { + $parsedBody = json_decode($httpResponse->getBody()->getContents(), associative: true); + $response = static::buildFromInput(['body' => $parsedBody], validate: false); + $response->httpResponse = $httpResponse; + return $response; + } + + public function getResponse(): ResponseInterface|null + { + return $this->httpResponse; + } +} diff --git a/src/Generated/V2/Clients/Domain/ListDomainsV2Deprecated/ListDomainsV2DeprecatedOKResponse.php b/src/Generated/V2/Clients/Domain/ListDomainsV2Deprecated/ListDomainsV2DeprecatedOKResponse.php new file mode 100644 index 00000000..713f638d --- /dev/null +++ b/src/Generated/V2/Clients/Domain/ListDomainsV2Deprecated/ListDomainsV2DeprecatedOKResponse.php @@ -0,0 +1,145 @@ + 'object', + 'required' => [ + 'body', + ], + 'properties' => [ + 'body' => [ + 'items' => [ + '$ref' => '#/components/schemas/de.mittwald.v1.domain.Domain', + ], + 'type' => 'array', + ], + ], + ]; + + /** + * @var Domain[] + */ + private array $body; + + private ResponseInterface|null $httpResponse = null; + + /** + * @param Domain[] $body + */ + public function __construct(array $body) + { + $this->body = $body; + } + + /** + * @return Domain[] + */ + public function getBody(): array + { + return $this->body; + } + + /** + * @param Domain[] $body + * @return self + */ + public function withBody(array $body): self + { + $clone = clone $this; + $clone->body = $body; + + 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 ListDomainsV2DeprecatedOKResponse Created instance + * @throws InvalidArgumentException + */ + public static function buildFromInput(array|object $input, bool $validate = true): ListDomainsV2DeprecatedOKResponse + { + $input = is_array($input) ? Validator::arrayToObjectRecursive($input) : $input; + if ($validate) { + static::validateInput($input); + } + + $body = array_map(fn (array|object $i): Domain => Domain::buildFromInput($i, validate: $validate), $input->{'body'}); + + $obj = new self($body); + + 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['body'] = array_map(fn (Domain $i): array => $i->toJson(), $this->body); + + 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 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() + { + } + + public static function fromResponse(ResponseInterface $httpResponse): self + { + $parsedBody = json_decode($httpResponse->getBody()->getContents(), associative: true); + $response = static::buildFromInput(['body' => $parsedBody], validate: false); + $response->httpResponse = $httpResponse; + return $response; + } + + public function getResponse(): ResponseInterface|null + { + return $this->httpResponse; + } +} diff --git a/src/Generated/V2/Clients/Domain/ListDomainsV2Deprecated/ListDomainsV2DeprecatedRequest.php b/src/Generated/V2/Clients/Domain/ListDomainsV2Deprecated/ListDomainsV2DeprecatedRequest.php new file mode 100644 index 00000000..f72cf1b1 --- /dev/null +++ b/src/Generated/V2/Clients/Domain/ListDomainsV2Deprecated/ListDomainsV2DeprecatedRequest.php @@ -0,0 +1,332 @@ + 'object', + 'properties' => [ + 'projectId' => [ + 'format' => 'uuid', + 'type' => 'string', + ], + 'page' => [ + 'minimum' => 1, + 'type' => 'integer', + ], + 'limit' => [ + 'minimum' => 1, + 'type' => 'integer', + ], + 'domainSearchName' => [ + 'type' => 'string', + ], + ], + 'required' => [ + 'projectId', + ], + ]; + + /** + * @var string + */ + private string $projectId; + + /** + * @var int|null + */ + private ?int $page = null; + + /** + * @var int|null + */ + private ?int $limit = null; + + /** + * @var string|null + */ + private ?string $domainSearchName = null; + + private array $headers = [ + + ]; + + /** + * @param string $projectId + */ + public function __construct(string $projectId) + { + $this->projectId = $projectId; + } + + /** + * @return string + */ + public function getProjectId(): string + { + return $this->projectId; + } + + /** + * @return int|null + */ + public function getPage(): ?int + { + return $this->page ?? null; + } + + /** + * @return int|null + */ + public function getLimit(): ?int + { + return $this->limit ?? null; + } + + /** + * @return string|null + */ + public function getDomainSearchName(): ?string + { + return $this->domainSearchName ?? null; + } + + /** + * @param string $projectId + * @return self + */ + public function withProjectId(string $projectId): self + { + $validator = new Validator(); + $validator->validate($projectId, static::$schema['properties']['projectId']); + if (!$validator->isValid()) { + throw new InvalidArgumentException($validator->getErrors()[0]['message']); + } + + $clone = clone $this; + $clone->projectId = $projectId; + + return $clone; + } + + /** + * @param int $page + * @return self + */ + public function withPage(int $page): self + { + $validator = new Validator(); + $validator->validate($page, static::$schema['properties']['page']); + if (!$validator->isValid()) { + throw new InvalidArgumentException($validator->getErrors()[0]['message']); + } + + $clone = clone $this; + $clone->page = $page; + + return $clone; + } + + /** + * @return self + */ + public function withoutPage(): self + { + $clone = clone $this; + unset($clone->page); + + return $clone; + } + + /** + * @param int $limit + * @return self + */ + public function withLimit(int $limit): self + { + $validator = new Validator(); + $validator->validate($limit, static::$schema['properties']['limit']); + if (!$validator->isValid()) { + throw new InvalidArgumentException($validator->getErrors()[0]['message']); + } + + $clone = clone $this; + $clone->limit = $limit; + + return $clone; + } + + /** + * @return self + */ + public function withoutLimit(): self + { + $clone = clone $this; + unset($clone->limit); + + return $clone; + } + + /** + * @param string $domainSearchName + * @return self + */ + public function withDomainSearchName(string $domainSearchName): self + { + $validator = new Validator(); + $validator->validate($domainSearchName, static::$schema['properties']['domainSearchName']); + if (!$validator->isValid()) { + throw new InvalidArgumentException($validator->getErrors()[0]['message']); + } + + $clone = clone $this; + $clone->domainSearchName = $domainSearchName; + + return $clone; + } + + /** + * @return self + */ + public function withoutDomainSearchName(): self + { + $clone = clone $this; + unset($clone->domainSearchName); + + 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 ListDomainsV2DeprecatedRequest Created instance + * @throws InvalidArgumentException + */ + public static function buildFromInput(array|object $input, bool $validate = true): ListDomainsV2DeprecatedRequest + { + $input = is_array($input) ? Validator::arrayToObjectRecursive($input) : $input; + if ($validate) { + static::validateInput($input); + } + + $projectId = $input->{'projectId'}; + $page = null; + if (isset($input->{'page'})) { + $page = (int)($input->{'page'}); + } + $limit = null; + if (isset($input->{'limit'})) { + $limit = (int)($input->{'limit'}); + } + $domainSearchName = null; + if (isset($input->{'domainSearchName'})) { + $domainSearchName = $input->{'domainSearchName'}; + } + + $obj = new self($projectId); + $obj->page = $page; + $obj->limit = $limit; + $obj->domainSearchName = $domainSearchName; + 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['projectId'] = $this->projectId; + if (isset($this->page)) { + $output['page'] = $this->page; + } + if (isset($this->limit)) { + $output['limit'] = $this->limit; + } + if (isset($this->domainSearchName)) { + $output['domainSearchName'] = $this->domainSearchName; + } + + 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 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() + { + } + + public function getUrl(): string + { + $mapped = $this->toJson(); + $projectId = urlencode($mapped['projectId']); + return '/v2/projects/' . $projectId . '/domains'; + } + + public function getQuery(): array + { + $mapped = $this->toJson(); + $query = []; + if (isset($mapped['page'])) { + $query['page'] = $mapped['page']; + } + if (isset($mapped['limit'])) { + $query['limit'] = $mapped['limit']; + } + if (isset($mapped['domainSearchName'])) { + $query['domainSearchName'] = $mapped['domainSearchName']; + } + return $query; + } + + public function getHeaders(): array + { + return $this->headers; + } + + public function withHeader(string $name, string|array $value): self + { + $clone = clone $this; + $clone->headers[$name] = $value; + return $clone; + } +} diff --git a/src/Generated/V2/Clients/File/CreateFile/CreateFileNotAcceptableResponse.php b/src/Generated/V2/Clients/File/CreateFile/CreateFileNotAcceptableResponse.php new file mode 100644 index 00000000..345fc87b --- /dev/null +++ b/src/Generated/V2/Clients/File/CreateFile/CreateFileNotAcceptableResponse.php @@ -0,0 +1,142 @@ + 'object', + 'required' => [ + 'body', + ], + 'properties' => [ + 'body' => [ + '$ref' => '#/components/schemas/de.mittwald.v1.commons.ValidationErrors', + ], + ], + ]; + + /** + * @var ValidationErrors + */ + private ValidationErrors $body; + + private ResponseInterface|null $httpResponse = null; + + /** + * @param ValidationErrors $body + */ + public function __construct(ValidationErrors $body) + { + $this->body = $body; + } + + /** + * @return ValidationErrors + */ + public function getBody(): ValidationErrors + { + return $this->body; + } + + /** + * @param ValidationErrors $body + * @return self + */ + public function withBody(ValidationErrors $body): self + { + $clone = clone $this; + $clone->body = $body; + + 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 CreateFileNotAcceptableResponse Created instance + * @throws InvalidArgumentException + */ + public static function buildFromInput(array|object $input, bool $validate = true): CreateFileNotAcceptableResponse + { + $input = is_array($input) ? Validator::arrayToObjectRecursive($input) : $input; + if ($validate) { + static::validateInput($input); + } + + $body = ValidationErrors::buildFromInput($input->{'body'}, validate: $validate); + + $obj = new self($body); + + 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['body'] = $this->body->toJson(); + + 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 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() + { + } + + public static function fromResponse(ResponseInterface $httpResponse): self + { + $parsedBody = json_decode($httpResponse->getBody()->getContents(), associative: true); + $response = static::buildFromInput(['body' => $parsedBody], validate: false); + $response->httpResponse = $httpResponse; + return $response; + } + + public function getResponse(): ResponseInterface|null + { + return $this->httpResponse; + } +} diff --git a/src/Generated/V2/Clients/File/CreateFile/CreateFileUnauthorizedResponse.php b/src/Generated/V2/Clients/File/CreateFile/CreateFileUnauthorizedResponse.php new file mode 100644 index 00000000..29f97e94 --- /dev/null +++ b/src/Generated/V2/Clients/File/CreateFile/CreateFileUnauthorizedResponse.php @@ -0,0 +1,142 @@ + 'object', + 'required' => [ + 'body', + ], + 'properties' => [ + 'body' => [ + '$ref' => '#/components/schemas/de.mittwald.v1.commons.Error', + ], + ], + ]; + + /** + * @var Error + */ + private Error $body; + + private ResponseInterface|null $httpResponse = null; + + /** + * @param Error $body + */ + public function __construct(Error $body) + { + $this->body = $body; + } + + /** + * @return Error + */ + public function getBody(): Error + { + return $this->body; + } + + /** + * @param Error $body + * @return self + */ + public function withBody(Error $body): self + { + $clone = clone $this; + $clone->body = $body; + + 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 CreateFileUnauthorizedResponse Created instance + * @throws InvalidArgumentException + */ + public static function buildFromInput(array|object $input, bool $validate = true): CreateFileUnauthorizedResponse + { + $input = is_array($input) ? Validator::arrayToObjectRecursive($input) : $input; + if ($validate) { + static::validateInput($input); + } + + $body = Error::buildFromInput($input->{'body'}, validate: $validate); + + $obj = new self($body); + + 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['body'] = $this->body->toJson(); + + 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 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() + { + } + + public static function fromResponse(ResponseInterface $httpResponse): self + { + $parsedBody = json_decode($httpResponse->getBody()->getContents(), associative: true); + $response = static::buildFromInput(['body' => $parsedBody], validate: false); + $response->httpResponse = $httpResponse; + return $response; + } + + public function getResponse(): ResponseInterface|null + { + return $this->httpResponse; + } +} diff --git a/src/Generated/V2/Clients/File/CreateFile/CreateFileUnprocessableEntityResponse.php b/src/Generated/V2/Clients/File/CreateFile/CreateFileUnprocessableEntityResponse.php new file mode 100644 index 00000000..3f9860c2 --- /dev/null +++ b/src/Generated/V2/Clients/File/CreateFile/CreateFileUnprocessableEntityResponse.php @@ -0,0 +1,142 @@ + 'object', + 'required' => [ + 'body', + ], + 'properties' => [ + 'body' => [ + '$ref' => '#/components/schemas/de.mittwald.v1.commons.ValidationErrors', + ], + ], + ]; + + /** + * @var ValidationErrors + */ + private ValidationErrors $body; + + private ResponseInterface|null $httpResponse = null; + + /** + * @param ValidationErrors $body + */ + public function __construct(ValidationErrors $body) + { + $this->body = $body; + } + + /** + * @return ValidationErrors + */ + public function getBody(): ValidationErrors + { + return $this->body; + } + + /** + * @param ValidationErrors $body + * @return self + */ + public function withBody(ValidationErrors $body): self + { + $clone = clone $this; + $clone->body = $body; + + 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 CreateFileUnprocessableEntityResponse Created instance + * @throws InvalidArgumentException + */ + public static function buildFromInput(array|object $input, bool $validate = true): CreateFileUnprocessableEntityResponse + { + $input = is_array($input) ? Validator::arrayToObjectRecursive($input) : $input; + if ($validate) { + static::validateInput($input); + } + + $body = ValidationErrors::buildFromInput($input->{'body'}, validate: $validate); + + $obj = new self($body); + + 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['body'] = $this->body->toJson(); + + 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 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() + { + } + + public static function fromResponse(ResponseInterface $httpResponse): self + { + $parsedBody = json_decode($httpResponse->getBody()->getContents(), associative: true); + $response = static::buildFromInput(['body' => $parsedBody], validate: false); + $response->httpResponse = $httpResponse; + return $response; + } + + public function getResponse(): ResponseInterface|null + { + return $this->httpResponse; + } +} diff --git a/src/Generated/V2/Clients/File/FileClientImpl.php b/src/Generated/V2/Clients/File/FileClientImpl.php index 27b7ae36..3e0e3ab8 100644 --- a/src/Generated/V2/Clients/File/FileClientImpl.php +++ b/src/Generated/V2/Clients/File/FileClientImpl.php @@ -11,7 +11,10 @@ use Mittwald\ApiClient\Generated\V2\Clients\File\CreateFile\CreateFileCreatedResponse; use Mittwald\ApiClient\Generated\V2\Clients\File\CreateFile\CreateFileDefaultResponse; use Mittwald\ApiClient\Generated\V2\Clients\File\CreateFile\CreateFileInternalServerErrorResponse; +use Mittwald\ApiClient\Generated\V2\Clients\File\CreateFile\CreateFileNotAcceptableResponse; use Mittwald\ApiClient\Generated\V2\Clients\File\CreateFile\CreateFileRequest; +use Mittwald\ApiClient\Generated\V2\Clients\File\CreateFile\CreateFileUnauthorizedResponse; +use Mittwald\ApiClient\Generated\V2\Clients\File\CreateFile\CreateFileUnprocessableEntityResponse; use Mittwald\ApiClient\Generated\V2\Clients\File\DeprecatedFileGetFileTokenRules\DeprecatedFileGetFileTokenRulesDefaultResponse; use Mittwald\ApiClient\Generated\V2\Clients\File\DeprecatedFileGetFileTokenRules\DeprecatedFileGetFileTokenRulesInternalServerErrorResponse; use Mittwald\ApiClient\Generated\V2\Clients\File\DeprecatedFileGetFileTokenRules\DeprecatedFileGetFileTokenRulesNotFoundResponse; @@ -24,18 +27,28 @@ use Mittwald\ApiClient\Generated\V2\Clients\File\DeprecatedFileGetFileTypeRules\DeprecatedFileGetFileTypeRulesRequest; use Mittwald\ApiClient\Generated\V2\Clients\File\GetFile\GetFileBadRequestResponse; use Mittwald\ApiClient\Generated\V2\Clients\File\GetFile\GetFileDefaultResponse; +use Mittwald\ApiClient\Generated\V2\Clients\File\GetFile\GetFileForbiddenResponse; use Mittwald\ApiClient\Generated\V2\Clients\File\GetFile\GetFileInternalServerErrorResponse; use Mittwald\ApiClient\Generated\V2\Clients\File\GetFile\GetFileNotFoundResponse; use Mittwald\ApiClient\Generated\V2\Clients\File\GetFile\GetFileRequest; +use Mittwald\ApiClient\Generated\V2\Clients\File\GetFile\GetFileUnauthorizedResponse; +use Mittwald\ApiClient\Generated\V2\Clients\File\GetFile\GetFileUnprocessableEntityResponse; +use Mittwald\ApiClient\Generated\V2\Clients\File\GetFileMeta\GetFileMetaBadRequestResponse; use Mittwald\ApiClient\Generated\V2\Clients\File\GetFileMeta\GetFileMetaDefaultResponse; +use Mittwald\ApiClient\Generated\V2\Clients\File\GetFileMeta\GetFileMetaForbiddenResponse; +use Mittwald\ApiClient\Generated\V2\Clients\File\GetFileMeta\GetFileMetaInternalServerErrorResponse; use Mittwald\ApiClient\Generated\V2\Clients\File\GetFileMeta\GetFileMetaNotFoundResponse; use Mittwald\ApiClient\Generated\V2\Clients\File\GetFileMeta\GetFileMetaOKResponse; use Mittwald\ApiClient\Generated\V2\Clients\File\GetFileMeta\GetFileMetaRequest; +use Mittwald\ApiClient\Generated\V2\Clients\File\GetFileMeta\GetFileMetaUnauthorizedResponse; +use Mittwald\ApiClient\Generated\V2\Clients\File\GetFileMeta\GetFileMetaUnprocessableEntityResponse; +use Mittwald\ApiClient\Generated\V2\Clients\File\GetFileUploadTokenRules\GetFileUploadTokenRulesBadRequestResponse; use Mittwald\ApiClient\Generated\V2\Clients\File\GetFileUploadTokenRules\GetFileUploadTokenRulesDefaultResponse; use Mittwald\ApiClient\Generated\V2\Clients\File\GetFileUploadTokenRules\GetFileUploadTokenRulesInternalServerErrorResponse; use Mittwald\ApiClient\Generated\V2\Clients\File\GetFileUploadTokenRules\GetFileUploadTokenRulesNotFoundResponse; use Mittwald\ApiClient\Generated\V2\Clients\File\GetFileUploadTokenRules\GetFileUploadTokenRulesOKResponse; use Mittwald\ApiClient\Generated\V2\Clients\File\GetFileUploadTokenRules\GetFileUploadTokenRulesRequest; +use Mittwald\ApiClient\Generated\V2\Clients\File\GetFileUploadTypeRules\GetFileUploadTypeRulesBadRequestResponse; use Mittwald\ApiClient\Generated\V2\Clients\File\GetFileUploadTypeRules\GetFileUploadTypeRulesDefaultResponse; use Mittwald\ApiClient\Generated\V2\Clients\File\GetFileUploadTypeRules\GetFileUploadTypeRulesInternalServerErrorResponse; use Mittwald\ApiClient\Generated\V2\Clients\File\GetFileUploadTypeRules\GetFileUploadTypeRulesNotFoundResponse; @@ -139,6 +152,9 @@ public function createFile(CreateFileRequest $request): CreateFileCreatedRespons } throw new UnexpectedResponseException(match ($httpResponse->getStatusCode()) { 400 => CreateFileBadRequestResponse::fromResponse($httpResponse), + 401 => CreateFileUnauthorizedResponse::fromResponse($httpResponse), + 406 => CreateFileNotAcceptableResponse::fromResponse($httpResponse), + 422 => CreateFileUnprocessableEntityResponse::fromResponse($httpResponse), 500 => CreateFileInternalServerErrorResponse::fromResponse($httpResponse), default => CreateFileDefaultResponse::fromResponse($httpResponse), }); @@ -165,7 +181,10 @@ public function getFile(GetFileRequest $request): StringResponse } throw new UnexpectedResponseException(match ($httpResponse->getStatusCode()) { 400 => GetFileBadRequestResponse::fromResponse($httpResponse), + 401 => GetFileUnauthorizedResponse::fromResponse($httpResponse), + 403 => GetFileForbiddenResponse::fromResponse($httpResponse), 404 => GetFileNotFoundResponse::fromResponse($httpResponse), + 422 => GetFileUnprocessableEntityResponse::fromResponse($httpResponse), 500 => GetFileInternalServerErrorResponse::fromResponse($httpResponse), default => GetFileDefaultResponse::fromResponse($httpResponse), }); @@ -191,7 +210,12 @@ public function getFileMeta(GetFileMetaRequest $request): GetFileMetaOKResponse return GetFileMetaOKResponse::fromResponse($httpResponse); } throw new UnexpectedResponseException(match ($httpResponse->getStatusCode()) { + 400 => GetFileMetaBadRequestResponse::fromResponse($httpResponse), + 401 => GetFileMetaUnauthorizedResponse::fromResponse($httpResponse), + 403 => GetFileMetaForbiddenResponse::fromResponse($httpResponse), 404 => GetFileMetaNotFoundResponse::fromResponse($httpResponse), + 422 => GetFileMetaUnprocessableEntityResponse::fromResponse($httpResponse), + 500 => GetFileMetaInternalServerErrorResponse::fromResponse($httpResponse), default => GetFileMetaDefaultResponse::fromResponse($httpResponse), }); } @@ -216,6 +240,7 @@ public function getFileUploadTokenRules(GetFileUploadTokenRulesRequest $request) return GetFileUploadTokenRulesOKResponse::fromResponse($httpResponse); } throw new UnexpectedResponseException(match ($httpResponse->getStatusCode()) { + 400 => GetFileUploadTokenRulesBadRequestResponse::fromResponse($httpResponse), 404 => GetFileUploadTokenRulesNotFoundResponse::fromResponse($httpResponse), 500 => GetFileUploadTokenRulesInternalServerErrorResponse::fromResponse($httpResponse), default => GetFileUploadTokenRulesDefaultResponse::fromResponse($httpResponse), @@ -242,6 +267,7 @@ public function getFileUploadTypeRules(GetFileUploadTypeRulesRequest $request): return GetFileUploadTypeRulesOKResponse::fromResponse($httpResponse); } throw new UnexpectedResponseException(match ($httpResponse->getStatusCode()) { + 400 => GetFileUploadTypeRulesBadRequestResponse::fromResponse($httpResponse), 404 => GetFileUploadTypeRulesNotFoundResponse::fromResponse($httpResponse), 500 => GetFileUploadTypeRulesInternalServerErrorResponse::fromResponse($httpResponse), default => GetFileUploadTypeRulesDefaultResponse::fromResponse($httpResponse), diff --git a/src/Generated/V2/Clients/File/GetFile/GetFileForbiddenResponse.php b/src/Generated/V2/Clients/File/GetFile/GetFileForbiddenResponse.php new file mode 100644 index 00000000..24db89a0 --- /dev/null +++ b/src/Generated/V2/Clients/File/GetFile/GetFileForbiddenResponse.php @@ -0,0 +1,142 @@ + 'object', + 'required' => [ + 'body', + ], + 'properties' => [ + 'body' => [ + '$ref' => '#/components/schemas/de.mittwald.v1.commons.Error', + ], + ], + ]; + + /** + * @var Error + */ + private Error $body; + + private ResponseInterface|null $httpResponse = null; + + /** + * @param Error $body + */ + public function __construct(Error $body) + { + $this->body = $body; + } + + /** + * @return Error + */ + public function getBody(): Error + { + return $this->body; + } + + /** + * @param Error $body + * @return self + */ + public function withBody(Error $body): self + { + $clone = clone $this; + $clone->body = $body; + + 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 GetFileForbiddenResponse Created instance + * @throws InvalidArgumentException + */ + public static function buildFromInput(array|object $input, bool $validate = true): GetFileForbiddenResponse + { + $input = is_array($input) ? Validator::arrayToObjectRecursive($input) : $input; + if ($validate) { + static::validateInput($input); + } + + $body = Error::buildFromInput($input->{'body'}, validate: $validate); + + $obj = new self($body); + + 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['body'] = $this->body->toJson(); + + 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 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() + { + } + + public static function fromResponse(ResponseInterface $httpResponse): self + { + $parsedBody = json_decode($httpResponse->getBody()->getContents(), associative: true); + $response = static::buildFromInput(['body' => $parsedBody], validate: false); + $response->httpResponse = $httpResponse; + return $response; + } + + public function getResponse(): ResponseInterface|null + { + return $this->httpResponse; + } +} diff --git a/src/Generated/V2/Clients/File/GetFile/GetFileUnauthorizedResponse.php b/src/Generated/V2/Clients/File/GetFile/GetFileUnauthorizedResponse.php new file mode 100644 index 00000000..6d7c54ef --- /dev/null +++ b/src/Generated/V2/Clients/File/GetFile/GetFileUnauthorizedResponse.php @@ -0,0 +1,142 @@ + 'object', + 'required' => [ + 'body', + ], + 'properties' => [ + 'body' => [ + '$ref' => '#/components/schemas/de.mittwald.v1.commons.Error', + ], + ], + ]; + + /** + * @var Error + */ + private Error $body; + + private ResponseInterface|null $httpResponse = null; + + /** + * @param Error $body + */ + public function __construct(Error $body) + { + $this->body = $body; + } + + /** + * @return Error + */ + public function getBody(): Error + { + return $this->body; + } + + /** + * @param Error $body + * @return self + */ + public function withBody(Error $body): self + { + $clone = clone $this; + $clone->body = $body; + + 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 GetFileUnauthorizedResponse Created instance + * @throws InvalidArgumentException + */ + public static function buildFromInput(array|object $input, bool $validate = true): GetFileUnauthorizedResponse + { + $input = is_array($input) ? Validator::arrayToObjectRecursive($input) : $input; + if ($validate) { + static::validateInput($input); + } + + $body = Error::buildFromInput($input->{'body'}, validate: $validate); + + $obj = new self($body); + + 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['body'] = $this->body->toJson(); + + 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 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() + { + } + + public static function fromResponse(ResponseInterface $httpResponse): self + { + $parsedBody = json_decode($httpResponse->getBody()->getContents(), associative: true); + $response = static::buildFromInput(['body' => $parsedBody], validate: false); + $response->httpResponse = $httpResponse; + return $response; + } + + public function getResponse(): ResponseInterface|null + { + return $this->httpResponse; + } +} diff --git a/src/Generated/V2/Clients/File/GetFile/GetFileUnprocessableEntityResponse.php b/src/Generated/V2/Clients/File/GetFile/GetFileUnprocessableEntityResponse.php new file mode 100644 index 00000000..e79d8b1c --- /dev/null +++ b/src/Generated/V2/Clients/File/GetFile/GetFileUnprocessableEntityResponse.php @@ -0,0 +1,142 @@ + 'object', + 'required' => [ + 'body', + ], + 'properties' => [ + 'body' => [ + '$ref' => '#/components/schemas/de.mittwald.v1.commons.ValidationErrors', + ], + ], + ]; + + /** + * @var ValidationErrors + */ + private ValidationErrors $body; + + private ResponseInterface|null $httpResponse = null; + + /** + * @param ValidationErrors $body + */ + public function __construct(ValidationErrors $body) + { + $this->body = $body; + } + + /** + * @return ValidationErrors + */ + public function getBody(): ValidationErrors + { + return $this->body; + } + + /** + * @param ValidationErrors $body + * @return self + */ + public function withBody(ValidationErrors $body): self + { + $clone = clone $this; + $clone->body = $body; + + 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 GetFileUnprocessableEntityResponse Created instance + * @throws InvalidArgumentException + */ + public static function buildFromInput(array|object $input, bool $validate = true): GetFileUnprocessableEntityResponse + { + $input = is_array($input) ? Validator::arrayToObjectRecursive($input) : $input; + if ($validate) { + static::validateInput($input); + } + + $body = ValidationErrors::buildFromInput($input->{'body'}, validate: $validate); + + $obj = new self($body); + + 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['body'] = $this->body->toJson(); + + 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 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() + { + } + + public static function fromResponse(ResponseInterface $httpResponse): self + { + $parsedBody = json_decode($httpResponse->getBody()->getContents(), associative: true); + $response = static::buildFromInput(['body' => $parsedBody], validate: false); + $response->httpResponse = $httpResponse; + return $response; + } + + public function getResponse(): ResponseInterface|null + { + return $this->httpResponse; + } +} diff --git a/src/Generated/V2/Clients/File/GetFileMeta/GetFileMetaBadRequestResponse.php b/src/Generated/V2/Clients/File/GetFileMeta/GetFileMetaBadRequestResponse.php new file mode 100644 index 00000000..6fb362b2 --- /dev/null +++ b/src/Generated/V2/Clients/File/GetFileMeta/GetFileMetaBadRequestResponse.php @@ -0,0 +1,142 @@ + 'object', + 'required' => [ + 'body', + ], + 'properties' => [ + 'body' => [ + '$ref' => '#/components/schemas/de.mittwald.v1.commons.ValidationErrors', + ], + ], + ]; + + /** + * @var ValidationErrors + */ + private ValidationErrors $body; + + private ResponseInterface|null $httpResponse = null; + + /** + * @param ValidationErrors $body + */ + public function __construct(ValidationErrors $body) + { + $this->body = $body; + } + + /** + * @return ValidationErrors + */ + public function getBody(): ValidationErrors + { + return $this->body; + } + + /** + * @param ValidationErrors $body + * @return self + */ + public function withBody(ValidationErrors $body): self + { + $clone = clone $this; + $clone->body = $body; + + 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 GetFileMetaBadRequestResponse Created instance + * @throws InvalidArgumentException + */ + public static function buildFromInput(array|object $input, bool $validate = true): GetFileMetaBadRequestResponse + { + $input = is_array($input) ? Validator::arrayToObjectRecursive($input) : $input; + if ($validate) { + static::validateInput($input); + } + + $body = ValidationErrors::buildFromInput($input->{'body'}, validate: $validate); + + $obj = new self($body); + + 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['body'] = $this->body->toJson(); + + 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 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() + { + } + + public static function fromResponse(ResponseInterface $httpResponse): self + { + $parsedBody = json_decode($httpResponse->getBody()->getContents(), associative: true); + $response = static::buildFromInput(['body' => $parsedBody], validate: false); + $response->httpResponse = $httpResponse; + return $response; + } + + public function getResponse(): ResponseInterface|null + { + return $this->httpResponse; + } +} diff --git a/src/Generated/V2/Clients/File/GetFileMeta/GetFileMetaForbiddenResponse.php b/src/Generated/V2/Clients/File/GetFileMeta/GetFileMetaForbiddenResponse.php new file mode 100644 index 00000000..16f898fc --- /dev/null +++ b/src/Generated/V2/Clients/File/GetFileMeta/GetFileMetaForbiddenResponse.php @@ -0,0 +1,142 @@ + 'object', + 'required' => [ + 'body', + ], + 'properties' => [ + 'body' => [ + '$ref' => '#/components/schemas/de.mittwald.v1.commons.Error', + ], + ], + ]; + + /** + * @var Error + */ + private Error $body; + + private ResponseInterface|null $httpResponse = null; + + /** + * @param Error $body + */ + public function __construct(Error $body) + { + $this->body = $body; + } + + /** + * @return Error + */ + public function getBody(): Error + { + return $this->body; + } + + /** + * @param Error $body + * @return self + */ + public function withBody(Error $body): self + { + $clone = clone $this; + $clone->body = $body; + + 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 GetFileMetaForbiddenResponse Created instance + * @throws InvalidArgumentException + */ + public static function buildFromInput(array|object $input, bool $validate = true): GetFileMetaForbiddenResponse + { + $input = is_array($input) ? Validator::arrayToObjectRecursive($input) : $input; + if ($validate) { + static::validateInput($input); + } + + $body = Error::buildFromInput($input->{'body'}, validate: $validate); + + $obj = new self($body); + + 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['body'] = $this->body->toJson(); + + 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 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() + { + } + + public static function fromResponse(ResponseInterface $httpResponse): self + { + $parsedBody = json_decode($httpResponse->getBody()->getContents(), associative: true); + $response = static::buildFromInput(['body' => $parsedBody], validate: false); + $response->httpResponse = $httpResponse; + return $response; + } + + public function getResponse(): ResponseInterface|null + { + return $this->httpResponse; + } +} diff --git a/src/Generated/V2/Clients/File/GetFileMeta/GetFileMetaInternalServerErrorResponse.php b/src/Generated/V2/Clients/File/GetFileMeta/GetFileMetaInternalServerErrorResponse.php new file mode 100644 index 00000000..adceb4d4 --- /dev/null +++ b/src/Generated/V2/Clients/File/GetFileMeta/GetFileMetaInternalServerErrorResponse.php @@ -0,0 +1,142 @@ + 'object', + 'required' => [ + 'body', + ], + 'properties' => [ + 'body' => [ + '$ref' => '#/components/schemas/de.mittwald.v1.commons.Error', + ], + ], + ]; + + /** + * @var Error + */ + private Error $body; + + private ResponseInterface|null $httpResponse = null; + + /** + * @param Error $body + */ + public function __construct(Error $body) + { + $this->body = $body; + } + + /** + * @return Error + */ + public function getBody(): Error + { + return $this->body; + } + + /** + * @param Error $body + * @return self + */ + public function withBody(Error $body): self + { + $clone = clone $this; + $clone->body = $body; + + 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 GetFileMetaInternalServerErrorResponse Created instance + * @throws InvalidArgumentException + */ + public static function buildFromInput(array|object $input, bool $validate = true): GetFileMetaInternalServerErrorResponse + { + $input = is_array($input) ? Validator::arrayToObjectRecursive($input) : $input; + if ($validate) { + static::validateInput($input); + } + + $body = Error::buildFromInput($input->{'body'}, validate: $validate); + + $obj = new self($body); + + 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['body'] = $this->body->toJson(); + + 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 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() + { + } + + public static function fromResponse(ResponseInterface $httpResponse): self + { + $parsedBody = json_decode($httpResponse->getBody()->getContents(), associative: true); + $response = static::buildFromInput(['body' => $parsedBody], validate: false); + $response->httpResponse = $httpResponse; + return $response; + } + + public function getResponse(): ResponseInterface|null + { + return $this->httpResponse; + } +} diff --git a/src/Generated/V2/Clients/File/GetFileMeta/GetFileMetaUnauthorizedResponse.php b/src/Generated/V2/Clients/File/GetFileMeta/GetFileMetaUnauthorizedResponse.php new file mode 100644 index 00000000..5cc1b46e --- /dev/null +++ b/src/Generated/V2/Clients/File/GetFileMeta/GetFileMetaUnauthorizedResponse.php @@ -0,0 +1,142 @@ + 'object', + 'required' => [ + 'body', + ], + 'properties' => [ + 'body' => [ + '$ref' => '#/components/schemas/de.mittwald.v1.commons.Error', + ], + ], + ]; + + /** + * @var Error + */ + private Error $body; + + private ResponseInterface|null $httpResponse = null; + + /** + * @param Error $body + */ + public function __construct(Error $body) + { + $this->body = $body; + } + + /** + * @return Error + */ + public function getBody(): Error + { + return $this->body; + } + + /** + * @param Error $body + * @return self + */ + public function withBody(Error $body): self + { + $clone = clone $this; + $clone->body = $body; + + 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 GetFileMetaUnauthorizedResponse Created instance + * @throws InvalidArgumentException + */ + public static function buildFromInput(array|object $input, bool $validate = true): GetFileMetaUnauthorizedResponse + { + $input = is_array($input) ? Validator::arrayToObjectRecursive($input) : $input; + if ($validate) { + static::validateInput($input); + } + + $body = Error::buildFromInput($input->{'body'}, validate: $validate); + + $obj = new self($body); + + 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['body'] = $this->body->toJson(); + + 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 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() + { + } + + public static function fromResponse(ResponseInterface $httpResponse): self + { + $parsedBody = json_decode($httpResponse->getBody()->getContents(), associative: true); + $response = static::buildFromInput(['body' => $parsedBody], validate: false); + $response->httpResponse = $httpResponse; + return $response; + } + + public function getResponse(): ResponseInterface|null + { + return $this->httpResponse; + } +} diff --git a/src/Generated/V2/Clients/File/GetFileMeta/GetFileMetaUnprocessableEntityResponse.php b/src/Generated/V2/Clients/File/GetFileMeta/GetFileMetaUnprocessableEntityResponse.php new file mode 100644 index 00000000..8582bcfe --- /dev/null +++ b/src/Generated/V2/Clients/File/GetFileMeta/GetFileMetaUnprocessableEntityResponse.php @@ -0,0 +1,142 @@ + 'object', + 'required' => [ + 'body', + ], + 'properties' => [ + 'body' => [ + '$ref' => '#/components/schemas/de.mittwald.v1.commons.ValidationErrors', + ], + ], + ]; + + /** + * @var ValidationErrors + */ + private ValidationErrors $body; + + private ResponseInterface|null $httpResponse = null; + + /** + * @param ValidationErrors $body + */ + public function __construct(ValidationErrors $body) + { + $this->body = $body; + } + + /** + * @return ValidationErrors + */ + public function getBody(): ValidationErrors + { + return $this->body; + } + + /** + * @param ValidationErrors $body + * @return self + */ + public function withBody(ValidationErrors $body): self + { + $clone = clone $this; + $clone->body = $body; + + 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 GetFileMetaUnprocessableEntityResponse Created instance + * @throws InvalidArgumentException + */ + public static function buildFromInput(array|object $input, bool $validate = true): GetFileMetaUnprocessableEntityResponse + { + $input = is_array($input) ? Validator::arrayToObjectRecursive($input) : $input; + if ($validate) { + static::validateInput($input); + } + + $body = ValidationErrors::buildFromInput($input->{'body'}, validate: $validate); + + $obj = new self($body); + + 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['body'] = $this->body->toJson(); + + 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 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() + { + } + + public static function fromResponse(ResponseInterface $httpResponse): self + { + $parsedBody = json_decode($httpResponse->getBody()->getContents(), associative: true); + $response = static::buildFromInput(['body' => $parsedBody], validate: false); + $response->httpResponse = $httpResponse; + return $response; + } + + public function getResponse(): ResponseInterface|null + { + return $this->httpResponse; + } +} diff --git a/src/Generated/V2/Clients/File/GetFileUploadTokenRules/GetFileUploadTokenRulesBadRequestResponse.php b/src/Generated/V2/Clients/File/GetFileUploadTokenRules/GetFileUploadTokenRulesBadRequestResponse.php new file mode 100644 index 00000000..6478f71d --- /dev/null +++ b/src/Generated/V2/Clients/File/GetFileUploadTokenRules/GetFileUploadTokenRulesBadRequestResponse.php @@ -0,0 +1,142 @@ + 'object', + 'required' => [ + 'body', + ], + 'properties' => [ + 'body' => [ + '$ref' => '#/components/schemas/de.mittwald.v1.commons.ValidationErrors', + ], + ], + ]; + + /** + * @var ValidationErrors + */ + private ValidationErrors $body; + + private ResponseInterface|null $httpResponse = null; + + /** + * @param ValidationErrors $body + */ + public function __construct(ValidationErrors $body) + { + $this->body = $body; + } + + /** + * @return ValidationErrors + */ + public function getBody(): ValidationErrors + { + return $this->body; + } + + /** + * @param ValidationErrors $body + * @return self + */ + public function withBody(ValidationErrors $body): self + { + $clone = clone $this; + $clone->body = $body; + + 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 GetFileUploadTokenRulesBadRequestResponse Created instance + * @throws InvalidArgumentException + */ + public static function buildFromInput(array|object $input, bool $validate = true): GetFileUploadTokenRulesBadRequestResponse + { + $input = is_array($input) ? Validator::arrayToObjectRecursive($input) : $input; + if ($validate) { + static::validateInput($input); + } + + $body = ValidationErrors::buildFromInput($input->{'body'}, validate: $validate); + + $obj = new self($body); + + 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['body'] = $this->body->toJson(); + + 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 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() + { + } + + public static function fromResponse(ResponseInterface $httpResponse): self + { + $parsedBody = json_decode($httpResponse->getBody()->getContents(), associative: true); + $response = static::buildFromInput(['body' => $parsedBody], validate: false); + $response->httpResponse = $httpResponse; + return $response; + } + + public function getResponse(): ResponseInterface|null + { + return $this->httpResponse; + } +} diff --git a/src/Generated/V2/Clients/File/GetFileUploadTypeRules/GetFileUploadTypeRulesBadRequestResponse.php b/src/Generated/V2/Clients/File/GetFileUploadTypeRules/GetFileUploadTypeRulesBadRequestResponse.php new file mode 100644 index 00000000..e58788ca --- /dev/null +++ b/src/Generated/V2/Clients/File/GetFileUploadTypeRules/GetFileUploadTypeRulesBadRequestResponse.php @@ -0,0 +1,142 @@ + 'object', + 'required' => [ + 'body', + ], + 'properties' => [ + 'body' => [ + '$ref' => '#/components/schemas/de.mittwald.v1.commons.ValidationErrors', + ], + ], + ]; + + /** + * @var ValidationErrors + */ + private ValidationErrors $body; + + private ResponseInterface|null $httpResponse = null; + + /** + * @param ValidationErrors $body + */ + public function __construct(ValidationErrors $body) + { + $this->body = $body; + } + + /** + * @return ValidationErrors + */ + public function getBody(): ValidationErrors + { + return $this->body; + } + + /** + * @param ValidationErrors $body + * @return self + */ + public function withBody(ValidationErrors $body): self + { + $clone = clone $this; + $clone->body = $body; + + 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 GetFileUploadTypeRulesBadRequestResponse Created instance + * @throws InvalidArgumentException + */ + public static function buildFromInput(array|object $input, bool $validate = true): GetFileUploadTypeRulesBadRequestResponse + { + $input = is_array($input) ? Validator::arrayToObjectRecursive($input) : $input; + if ($validate) { + static::validateInput($input); + } + + $body = ValidationErrors::buildFromInput($input->{'body'}, validate: $validate); + + $obj = new self($body); + + 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['body'] = $this->body->toJson(); + + 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 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() + { + } + + public static function fromResponse(ResponseInterface $httpResponse): self + { + $parsedBody = json_decode($httpResponse->getBody()->getContents(), associative: true); + $response = static::buildFromInput(['body' => $parsedBody], validate: false); + $response->httpResponse = $httpResponse; + return $response; + } + + public function getResponse(): ResponseInterface|null + { + return $this->httpResponse; + } +} diff --git a/src/Generated/V2/Clients/Project/AcceptProjectInvite/AcceptProjectInviteRequest.php b/src/Generated/V2/Clients/Project/AcceptProjectInvite/AcceptProjectInviteRequest.php index 9d081812..f883255a 100644 --- a/src/Generated/V2/Clients/Project/AcceptProjectInvite/AcceptProjectInviteRequest.php +++ b/src/Generated/V2/Clients/Project/AcceptProjectInvite/AcceptProjectInviteRequest.php @@ -19,7 +19,7 @@ class AcceptProjectInviteRequest private static array $schema = [ 'type' => 'object', 'properties' => [ - 'inviteId' => [ + 'projectInviteId' => [ 'format' => 'uuid', 'type' => 'string', ], @@ -34,7 +34,7 @@ class AcceptProjectInviteRequest ], ], 'required' => [ - 'inviteId', + 'projectInviteId', 'body', ], ]; @@ -42,7 +42,7 @@ class AcceptProjectInviteRequest /** * @var string */ - private string $inviteId; + private string $projectInviteId; /** * @var AcceptProjectInviteRequestBody @@ -54,21 +54,21 @@ class AcceptProjectInviteRequest ]; /** - * @param string $inviteId + * @param string $projectInviteId * @param AcceptProjectInviteRequestBody $body */ - public function __construct(string $inviteId, AcceptProjectInviteRequestBody $body) + public function __construct(string $projectInviteId, AcceptProjectInviteRequestBody $body) { - $this->inviteId = $inviteId; + $this->projectInviteId = $projectInviteId; $this->body = $body; } /** * @return string */ - public function getInviteId(): string + public function getProjectInviteId(): string { - return $this->inviteId; + return $this->projectInviteId; } /** @@ -80,19 +80,19 @@ public function getBody(): AcceptProjectInviteRequestBody } /** - * @param string $inviteId + * @param string $projectInviteId * @return self */ - public function withInviteId(string $inviteId): self + public function withProjectInviteId(string $projectInviteId): self { $validator = new Validator(); - $validator->validate($inviteId, static::$schema['properties']['inviteId']); + $validator->validate($projectInviteId, static::$schema['properties']['projectInviteId']); if (!$validator->isValid()) { throw new InvalidArgumentException($validator->getErrors()[0]['message']); } $clone = clone $this; - $clone->inviteId = $inviteId; + $clone->projectInviteId = $projectInviteId; return $clone; } @@ -124,10 +124,10 @@ public static function buildFromInput(array|object $input, bool $validate = true static::validateInput($input); } - $inviteId = $input->{'inviteId'}; + $projectInviteId = $input->{'projectInviteId'}; $body = AcceptProjectInviteRequestBody::buildFromInput($input->{'body'}, validate: $validate); - $obj = new self($inviteId, $body); + $obj = new self($projectInviteId, $body); return $obj; } @@ -140,7 +140,7 @@ public static function buildFromInput(array|object $input, bool $validate = true public function toJson(): array { $output = []; - $output['inviteId'] = $this->inviteId; + $output['projectInviteId'] = $this->projectInviteId; $output['body'] = ($this->body)->toJson(); return $output; @@ -178,8 +178,8 @@ public function __clone() public function getUrl(): string { $mapped = $this->toJson(); - $inviteId = urlencode($mapped['inviteId']); - return '/v2/project-invites/' . $inviteId . '/actions/accept'; + $projectInviteId = urlencode($mapped['projectInviteId']); + return '/v2/project-invites/' . $projectInviteId . '/actions/accept'; } public function getQuery(): array diff --git a/src/Generated/V2/Clients/Project/AcceptProjectInvite/AcceptProjectInviteRequestBody.php b/src/Generated/V2/Clients/Project/AcceptProjectInvite/AcceptProjectInviteRequestBody.php index 0aae46a7..476f03bc 100644 --- a/src/Generated/V2/Clients/Project/AcceptProjectInvite/AcceptProjectInviteRequestBody.php +++ b/src/Generated/V2/Clients/Project/AcceptProjectInvite/AcceptProjectInviteRequestBody.php @@ -152,8 +152,8 @@ public function __clone() public function getUrl(): string { $mapped = $this->toJson(); - $inviteId = urlencode($mapped['inviteId']); - return '/v2/project-invites/' . $inviteId . '/actions/accept'; + $projectInviteId = urlencode($mapped['projectInviteId']); + return '/v2/project-invites/' . $projectInviteId . '/actions/accept'; } public function getQuery(): array diff --git a/src/Generated/V2/Clients/Project/CreateProjectInvite/CreateProjectInviteRequest.php b/src/Generated/V2/Clients/Project/CreateProjectInvite/CreateProjectInviteRequest.php index 0fa030d1..4422167b 100644 --- a/src/Generated/V2/Clients/Project/CreateProjectInvite/CreateProjectInviteRequest.php +++ b/src/Generated/V2/Clients/Project/CreateProjectInvite/CreateProjectInviteRequest.php @@ -196,7 +196,7 @@ public function getUrl(): string { $mapped = $this->toJson(); $projectId = urlencode($mapped['projectId']); - return '/v2/project/' . $projectId . '/invites'; + return '/v2/projects/' . $projectId . '/invites'; } public function getQuery(): array diff --git a/src/Generated/V2/Clients/Project/CreateProjectInvite/CreateProjectInviteRequestBody.php b/src/Generated/V2/Clients/Project/CreateProjectInvite/CreateProjectInviteRequestBody.php index 5ae21032..d91fc4a4 100644 --- a/src/Generated/V2/Clients/Project/CreateProjectInvite/CreateProjectInviteRequestBody.php +++ b/src/Generated/V2/Clients/Project/CreateProjectInvite/CreateProjectInviteRequestBody.php @@ -286,7 +286,7 @@ public function getUrl(): string { $mapped = $this->toJson(); $projectId = urlencode($mapped['projectId']); - return '/v2/project/' . $projectId . '/invites'; + return '/v2/projects/' . $projectId . '/invites'; } public function getQuery(): array diff --git a/src/Generated/V2/Clients/Project/DeclineProjectInvite/DeclineProjectInviteRequest.php b/src/Generated/V2/Clients/Project/DeclineProjectInvite/DeclineProjectInviteRequest.php index b9aee9bc..5b6b9fb7 100644 --- a/src/Generated/V2/Clients/Project/DeclineProjectInvite/DeclineProjectInviteRequest.php +++ b/src/Generated/V2/Clients/Project/DeclineProjectInvite/DeclineProjectInviteRequest.php @@ -19,7 +19,7 @@ class DeclineProjectInviteRequest private static array $schema = [ 'type' => 'object', 'properties' => [ - 'inviteId' => [ + 'projectInviteId' => [ 'format' => 'uuid', 'type' => 'string', ], @@ -28,7 +28,7 @@ class DeclineProjectInviteRequest ], ], 'required' => [ - 'inviteId', + 'projectInviteId', 'body', ], ]; @@ -36,7 +36,7 @@ class DeclineProjectInviteRequest /** * @var string */ - private string $inviteId; + private string $projectInviteId; /** * @var mixed @@ -48,21 +48,21 @@ class DeclineProjectInviteRequest ]; /** - * @param string $inviteId + * @param string $projectInviteId * @param mixed $body */ - public function __construct(string $inviteId, $body) + public function __construct(string $projectInviteId, $body) { - $this->inviteId = $inviteId; + $this->projectInviteId = $projectInviteId; $this->body = $body; } /** * @return string */ - public function getInviteId(): string + public function getProjectInviteId(): string { - return $this->inviteId; + return $this->projectInviteId; } /** @@ -74,19 +74,19 @@ public function getBody() } /** - * @param string $inviteId + * @param string $projectInviteId * @return self */ - public function withInviteId(string $inviteId): self + public function withProjectInviteId(string $projectInviteId): self { $validator = new Validator(); - $validator->validate($inviteId, static::$schema['properties']['inviteId']); + $validator->validate($projectInviteId, static::$schema['properties']['projectInviteId']); if (!$validator->isValid()) { throw new InvalidArgumentException($validator->getErrors()[0]['message']); } $clone = clone $this; - $clone->inviteId = $inviteId; + $clone->projectInviteId = $projectInviteId; return $clone; } @@ -124,10 +124,10 @@ public static function buildFromInput(array|object $input, bool $validate = true static::validateInput($input); } - $inviteId = $input->{'inviteId'}; + $projectInviteId = $input->{'projectInviteId'}; $body = $input->{'body'}; - $obj = new self($inviteId, $body); + $obj = new self($projectInviteId, $body); return $obj; } @@ -140,7 +140,7 @@ public static function buildFromInput(array|object $input, bool $validate = true public function toJson(): array { $output = []; - $output['inviteId'] = $this->inviteId; + $output['projectInviteId'] = $this->projectInviteId; $output['body'] = $this->body; return $output; @@ -177,8 +177,8 @@ public function __clone() public function getUrl(): string { $mapped = $this->toJson(); - $inviteId = urlencode($mapped['inviteId']); - return '/v2/project-invites/' . $inviteId . '/actions/decline'; + $projectInviteId = urlencode($mapped['projectInviteId']); + return '/v2/project-invites/' . $projectInviteId . '/actions/decline'; } public function getQuery(): array diff --git a/src/Generated/V2/Clients/Project/DeleteProjectInvite/DeleteProjectInviteRequest.php b/src/Generated/V2/Clients/Project/DeleteProjectInvite/DeleteProjectInviteRequest.php index 0c59c25e..b539be5e 100644 --- a/src/Generated/V2/Clients/Project/DeleteProjectInvite/DeleteProjectInviteRequest.php +++ b/src/Generated/V2/Clients/Project/DeleteProjectInvite/DeleteProjectInviteRequest.php @@ -19,55 +19,55 @@ class DeleteProjectInviteRequest private static array $schema = [ 'type' => 'object', 'properties' => [ - 'inviteId' => [ + 'projectInviteId' => [ 'format' => 'uuid', 'type' => 'string', ], ], 'required' => [ - 'inviteId', + 'projectInviteId', ], ]; /** * @var string */ - private string $inviteId; + private string $projectInviteId; private array $headers = [ ]; /** - * @param string $inviteId + * @param string $projectInviteId */ - public function __construct(string $inviteId) + public function __construct(string $projectInviteId) { - $this->inviteId = $inviteId; + $this->projectInviteId = $projectInviteId; } /** * @return string */ - public function getInviteId(): string + public function getProjectInviteId(): string { - return $this->inviteId; + return $this->projectInviteId; } /** - * @param string $inviteId + * @param string $projectInviteId * @return self */ - public function withInviteId(string $inviteId): self + public function withProjectInviteId(string $projectInviteId): self { $validator = new Validator(); - $validator->validate($inviteId, static::$schema['properties']['inviteId']); + $validator->validate($projectInviteId, static::$schema['properties']['projectInviteId']); if (!$validator->isValid()) { throw new InvalidArgumentException($validator->getErrors()[0]['message']); } $clone = clone $this; - $clone->inviteId = $inviteId; + $clone->projectInviteId = $projectInviteId; return $clone; } @@ -87,9 +87,9 @@ public static function buildFromInput(array|object $input, bool $validate = true static::validateInput($input); } - $inviteId = $input->{'inviteId'}; + $projectInviteId = $input->{'projectInviteId'}; - $obj = new self($inviteId); + $obj = new self($projectInviteId); return $obj; } @@ -102,7 +102,7 @@ public static function buildFromInput(array|object $input, bool $validate = true public function toJson(): array { $output = []; - $output['inviteId'] = $this->inviteId; + $output['projectInviteId'] = $this->projectInviteId; return $output; } @@ -138,8 +138,8 @@ public function __clone() public function getUrl(): string { $mapped = $this->toJson(); - $inviteId = urlencode($mapped['inviteId']); - return '/v2/project-invites/' . $inviteId; + $projectInviteId = urlencode($mapped['projectInviteId']); + return '/v2/project-invites/' . $projectInviteId; } public function getQuery(): array diff --git a/src/Generated/V2/Clients/Project/DeleteProjectMembership/DeleteProjectMembershipRequest.php b/src/Generated/V2/Clients/Project/DeleteProjectMembership/DeleteProjectMembershipRequest.php index 004fd437..3c084572 100644 --- a/src/Generated/V2/Clients/Project/DeleteProjectMembership/DeleteProjectMembershipRequest.php +++ b/src/Generated/V2/Clients/Project/DeleteProjectMembership/DeleteProjectMembershipRequest.php @@ -19,55 +19,55 @@ class DeleteProjectMembershipRequest private static array $schema = [ 'type' => 'object', 'properties' => [ - 'membershipId' => [ + 'projectMembershipId' => [ 'format' => 'uuid', 'type' => 'string', ], ], 'required' => [ - 'membershipId', + 'projectMembershipId', ], ]; /** * @var string */ - private string $membershipId; + private string $projectMembershipId; private array $headers = [ ]; /** - * @param string $membershipId + * @param string $projectMembershipId */ - public function __construct(string $membershipId) + public function __construct(string $projectMembershipId) { - $this->membershipId = $membershipId; + $this->projectMembershipId = $projectMembershipId; } /** * @return string */ - public function getMembershipId(): string + public function getProjectMembershipId(): string { - return $this->membershipId; + return $this->projectMembershipId; } /** - * @param string $membershipId + * @param string $projectMembershipId * @return self */ - public function withMembershipId(string $membershipId): self + public function withProjectMembershipId(string $projectMembershipId): self { $validator = new Validator(); - $validator->validate($membershipId, static::$schema['properties']['membershipId']); + $validator->validate($projectMembershipId, static::$schema['properties']['projectMembershipId']); if (!$validator->isValid()) { throw new InvalidArgumentException($validator->getErrors()[0]['message']); } $clone = clone $this; - $clone->membershipId = $membershipId; + $clone->projectMembershipId = $projectMembershipId; return $clone; } @@ -87,9 +87,9 @@ public static function buildFromInput(array|object $input, bool $validate = true static::validateInput($input); } - $membershipId = $input->{'membershipId'}; + $projectMembershipId = $input->{'projectMembershipId'}; - $obj = new self($membershipId); + $obj = new self($projectMembershipId); return $obj; } @@ -102,7 +102,7 @@ public static function buildFromInput(array|object $input, bool $validate = true public function toJson(): array { $output = []; - $output['membershipId'] = $this->membershipId; + $output['projectMembershipId'] = $this->projectMembershipId; return $output; } @@ -138,8 +138,8 @@ public function __clone() public function getUrl(): string { $mapped = $this->toJson(); - $membershipId = urlencode($mapped['membershipId']); - return '/v2/project-memberships/' . $membershipId; + $projectMembershipId = urlencode($mapped['projectMembershipId']); + return '/v2/project-memberships/' . $projectMembershipId; } public function getQuery(): array diff --git a/src/Generated/V2/Clients/Project/GetProjectInvite/GetProjectInviteRequest.php b/src/Generated/V2/Clients/Project/GetProjectInvite/GetProjectInviteRequest.php index 57248f01..12d94113 100644 --- a/src/Generated/V2/Clients/Project/GetProjectInvite/GetProjectInviteRequest.php +++ b/src/Generated/V2/Clients/Project/GetProjectInvite/GetProjectInviteRequest.php @@ -19,54 +19,54 @@ class GetProjectInviteRequest private static array $schema = [ 'type' => 'object', 'properties' => [ - 'inviteId' => [ + 'projectInviteId' => [ 'type' => 'string', ], ], 'required' => [ - 'inviteId', + 'projectInviteId', ], ]; /** * @var string */ - private string $inviteId; + private string $projectInviteId; private array $headers = [ ]; /** - * @param string $inviteId + * @param string $projectInviteId */ - public function __construct(string $inviteId) + public function __construct(string $projectInviteId) { - $this->inviteId = $inviteId; + $this->projectInviteId = $projectInviteId; } /** * @return string */ - public function getInviteId(): string + public function getProjectInviteId(): string { - return $this->inviteId; + return $this->projectInviteId; } /** - * @param string $inviteId + * @param string $projectInviteId * @return self */ - public function withInviteId(string $inviteId): self + public function withProjectInviteId(string $projectInviteId): self { $validator = new Validator(); - $validator->validate($inviteId, static::$schema['properties']['inviteId']); + $validator->validate($projectInviteId, static::$schema['properties']['projectInviteId']); if (!$validator->isValid()) { throw new InvalidArgumentException($validator->getErrors()[0]['message']); } $clone = clone $this; - $clone->inviteId = $inviteId; + $clone->projectInviteId = $projectInviteId; return $clone; } @@ -86,9 +86,9 @@ public static function buildFromInput(array|object $input, bool $validate = true static::validateInput($input); } - $inviteId = $input->{'inviteId'}; + $projectInviteId = $input->{'projectInviteId'}; - $obj = new self($inviteId); + $obj = new self($projectInviteId); return $obj; } @@ -101,7 +101,7 @@ public static function buildFromInput(array|object $input, bool $validate = true public function toJson(): array { $output = []; - $output['inviteId'] = $this->inviteId; + $output['projectInviteId'] = $this->projectInviteId; return $output; } @@ -137,8 +137,8 @@ public function __clone() public function getUrl(): string { $mapped = $this->toJson(); - $inviteId = urlencode($mapped['inviteId']); - return '/v2/project-invites/' . $inviteId; + $projectInviteId = urlencode($mapped['projectInviteId']); + return '/v2/project-invites/' . $projectInviteId; } public function getQuery(): array diff --git a/src/Generated/V2/Clients/Project/GetProjectMembership/GetProjectMembershipRequest.php b/src/Generated/V2/Clients/Project/GetProjectMembership/GetProjectMembershipRequest.php index f459e81c..35f8d541 100644 --- a/src/Generated/V2/Clients/Project/GetProjectMembership/GetProjectMembershipRequest.php +++ b/src/Generated/V2/Clients/Project/GetProjectMembership/GetProjectMembershipRequest.php @@ -19,54 +19,54 @@ class GetProjectMembershipRequest private static array $schema = [ 'type' => 'object', 'properties' => [ - 'membershipId' => [ + 'projectMembershipId' => [ 'type' => 'string', ], ], 'required' => [ - 'membershipId', + 'projectMembershipId', ], ]; /** * @var string */ - private string $membershipId; + private string $projectMembershipId; private array $headers = [ ]; /** - * @param string $membershipId + * @param string $projectMembershipId */ - public function __construct(string $membershipId) + public function __construct(string $projectMembershipId) { - $this->membershipId = $membershipId; + $this->projectMembershipId = $projectMembershipId; } /** * @return string */ - public function getMembershipId(): string + public function getProjectMembershipId(): string { - return $this->membershipId; + return $this->projectMembershipId; } /** - * @param string $membershipId + * @param string $projectMembershipId * @return self */ - public function withMembershipId(string $membershipId): self + public function withProjectMembershipId(string $projectMembershipId): self { $validator = new Validator(); - $validator->validate($membershipId, static::$schema['properties']['membershipId']); + $validator->validate($projectMembershipId, static::$schema['properties']['projectMembershipId']); if (!$validator->isValid()) { throw new InvalidArgumentException($validator->getErrors()[0]['message']); } $clone = clone $this; - $clone->membershipId = $membershipId; + $clone->projectMembershipId = $projectMembershipId; return $clone; } @@ -86,9 +86,9 @@ public static function buildFromInput(array|object $input, bool $validate = true static::validateInput($input); } - $membershipId = $input->{'membershipId'}; + $projectMembershipId = $input->{'projectMembershipId'}; - $obj = new self($membershipId); + $obj = new self($projectMembershipId); return $obj; } @@ -101,7 +101,7 @@ public static function buildFromInput(array|object $input, bool $validate = true public function toJson(): array { $output = []; - $output['membershipId'] = $this->membershipId; + $output['projectMembershipId'] = $this->projectMembershipId; return $output; } @@ -137,8 +137,8 @@ public function __clone() public function getUrl(): string { $mapped = $this->toJson(); - $membershipId = urlencode($mapped['membershipId']); - return '/v2/project-memberships/' . $membershipId; + $projectMembershipId = urlencode($mapped['projectMembershipId']); + return '/v2/project-memberships/' . $projectMembershipId; } public function getQuery(): array diff --git a/src/Generated/V2/Clients/Project/ResendProjectInviteMail/ResendProjectInviteMailRequest.php b/src/Generated/V2/Clients/Project/ResendProjectInviteMail/ResendProjectInviteMailRequest.php index 5e346fc1..74bac737 100644 --- a/src/Generated/V2/Clients/Project/ResendProjectInviteMail/ResendProjectInviteMailRequest.php +++ b/src/Generated/V2/Clients/Project/ResendProjectInviteMail/ResendProjectInviteMailRequest.php @@ -19,7 +19,7 @@ class ResendProjectInviteMailRequest private static array $schema = [ 'type' => 'object', 'properties' => [ - 'inviteId' => [ + 'projectInviteId' => [ 'format' => 'uuid', 'type' => 'string', ], @@ -28,7 +28,7 @@ class ResendProjectInviteMailRequest ], ], 'required' => [ - 'inviteId', + 'projectInviteId', 'body', ], ]; @@ -36,7 +36,7 @@ class ResendProjectInviteMailRequest /** * @var string */ - private string $inviteId; + private string $projectInviteId; /** * @var mixed @@ -48,21 +48,21 @@ class ResendProjectInviteMailRequest ]; /** - * @param string $inviteId + * @param string $projectInviteId * @param mixed $body */ - public function __construct(string $inviteId, $body) + public function __construct(string $projectInviteId, $body) { - $this->inviteId = $inviteId; + $this->projectInviteId = $projectInviteId; $this->body = $body; } /** * @return string */ - public function getInviteId(): string + public function getProjectInviteId(): string { - return $this->inviteId; + return $this->projectInviteId; } /** @@ -74,19 +74,19 @@ public function getBody() } /** - * @param string $inviteId + * @param string $projectInviteId * @return self */ - public function withInviteId(string $inviteId): self + public function withProjectInviteId(string $projectInviteId): self { $validator = new Validator(); - $validator->validate($inviteId, static::$schema['properties']['inviteId']); + $validator->validate($projectInviteId, static::$schema['properties']['projectInviteId']); if (!$validator->isValid()) { throw new InvalidArgumentException($validator->getErrors()[0]['message']); } $clone = clone $this; - $clone->inviteId = $inviteId; + $clone->projectInviteId = $projectInviteId; return $clone; } @@ -124,10 +124,10 @@ public static function buildFromInput(array|object $input, bool $validate = true static::validateInput($input); } - $inviteId = $input->{'inviteId'}; + $projectInviteId = $input->{'projectInviteId'}; $body = $input->{'body'}; - $obj = new self($inviteId, $body); + $obj = new self($projectInviteId, $body); return $obj; } @@ -140,7 +140,7 @@ public static function buildFromInput(array|object $input, bool $validate = true public function toJson(): array { $output = []; - $output['inviteId'] = $this->inviteId; + $output['projectInviteId'] = $this->projectInviteId; $output['body'] = $this->body; return $output; @@ -177,8 +177,8 @@ public function __clone() public function getUrl(): string { $mapped = $this->toJson(); - $inviteId = urlencode($mapped['inviteId']); - return '/v2/project-invites/' . $inviteId . '/actions/resend'; + $projectInviteId = urlencode($mapped['projectInviteId']); + return '/v2/project-invites/' . $projectInviteId . '/actions/resend'; } public function getQuery(): array diff --git a/src/Generated/V2/Clients/Project/UpdateProjectMembership/UpdateProjectMembershipRequest.php b/src/Generated/V2/Clients/Project/UpdateProjectMembership/UpdateProjectMembershipRequest.php index e0ab366e..e203db59 100644 --- a/src/Generated/V2/Clients/Project/UpdateProjectMembership/UpdateProjectMembershipRequest.php +++ b/src/Generated/V2/Clients/Project/UpdateProjectMembership/UpdateProjectMembershipRequest.php @@ -19,7 +19,7 @@ class UpdateProjectMembershipRequest private static array $schema = [ 'type' => 'object', 'properties' => [ - 'membershipId' => [ + 'projectMembershipId' => [ 'format' => 'uuid', 'type' => 'string', ], @@ -41,7 +41,7 @@ class UpdateProjectMembershipRequest ], ], 'required' => [ - 'membershipId', + 'projectMembershipId', 'body', ], ]; @@ -49,7 +49,7 @@ class UpdateProjectMembershipRequest /** * @var string */ - private string $membershipId; + private string $projectMembershipId; /** * @var UpdateProjectMembershipRequestBody @@ -61,21 +61,21 @@ class UpdateProjectMembershipRequest ]; /** - * @param string $membershipId + * @param string $projectMembershipId * @param UpdateProjectMembershipRequestBody $body */ - public function __construct(string $membershipId, UpdateProjectMembershipRequestBody $body) + public function __construct(string $projectMembershipId, UpdateProjectMembershipRequestBody $body) { - $this->membershipId = $membershipId; + $this->projectMembershipId = $projectMembershipId; $this->body = $body; } /** * @return string */ - public function getMembershipId(): string + public function getProjectMembershipId(): string { - return $this->membershipId; + return $this->projectMembershipId; } /** @@ -87,19 +87,19 @@ public function getBody(): UpdateProjectMembershipRequestBody } /** - * @param string $membershipId + * @param string $projectMembershipId * @return self */ - public function withMembershipId(string $membershipId): self + public function withProjectMembershipId(string $projectMembershipId): self { $validator = new Validator(); - $validator->validate($membershipId, static::$schema['properties']['membershipId']); + $validator->validate($projectMembershipId, static::$schema['properties']['projectMembershipId']); if (!$validator->isValid()) { throw new InvalidArgumentException($validator->getErrors()[0]['message']); } $clone = clone $this; - $clone->membershipId = $membershipId; + $clone->projectMembershipId = $projectMembershipId; return $clone; } @@ -131,10 +131,10 @@ public static function buildFromInput(array|object $input, bool $validate = true static::validateInput($input); } - $membershipId = $input->{'membershipId'}; + $projectMembershipId = $input->{'projectMembershipId'}; $body = UpdateProjectMembershipRequestBody::buildFromInput($input->{'body'}, validate: $validate); - $obj = new self($membershipId, $body); + $obj = new self($projectMembershipId, $body); return $obj; } @@ -147,7 +147,7 @@ public static function buildFromInput(array|object $input, bool $validate = true public function toJson(): array { $output = []; - $output['membershipId'] = $this->membershipId; + $output['projectMembershipId'] = $this->projectMembershipId; $output['body'] = ($this->body)->toJson(); return $output; @@ -185,8 +185,8 @@ public function __clone() public function getUrl(): string { $mapped = $this->toJson(); - $membershipId = urlencode($mapped['membershipId']); - return '/v2/project-memberships/' . $membershipId; + $projectMembershipId = urlencode($mapped['projectMembershipId']); + return '/v2/project-memberships/' . $projectMembershipId; } public function getQuery(): array diff --git a/src/Generated/V2/Clients/Project/UpdateProjectMembership/UpdateProjectMembershipRequestBody.php b/src/Generated/V2/Clients/Project/UpdateProjectMembership/UpdateProjectMembershipRequestBody.php index a1f07da1..209dcdc5 100644 --- a/src/Generated/V2/Clients/Project/UpdateProjectMembership/UpdateProjectMembershipRequestBody.php +++ b/src/Generated/V2/Clients/Project/UpdateProjectMembership/UpdateProjectMembershipRequestBody.php @@ -186,8 +186,8 @@ public function __clone() public function getUrl(): string { $mapped = $this->toJson(); - $membershipId = urlencode($mapped['membershipId']); - return '/v2/project-memberships/' . $membershipId; + $projectMembershipId = urlencode($mapped['projectMembershipId']); + return '/v2/project-memberships/' . $projectMembershipId; } public function getQuery(): array