Skip to content

Commit e15f828

Browse files
authored
feat: Update openapi.json (#1)
* Update openapi.json * Apply php-cs-fixer changes --------- Co-authored-by: cedricziel <cedricziel@users.noreply.github.com>
1 parent c3c19bf commit e15f828

File tree

3,163 files changed

+587185
-444
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,163 files changed

+587185
-444
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/*
6+
* This file has been auto generated by Jane,
7+
*
8+
* Do no edit it directly.
9+
*/
10+
11+
namespace cedricziel\phpbaserowclient\Generated\Authentication;
12+
13+
class JWTAuthentication implements \Jane\Component\OpenApiRuntime\Client\AuthenticationPlugin
14+
{
15+
private $token;
16+
17+
public function __construct(string $token)
18+
{
19+
$this->{'token'} = $token;
20+
}
21+
22+
public function authentication(\Psr\Http\Message\RequestInterface $request): \Psr\Http\Message\RequestInterface
23+
{
24+
$header = sprintf('Bearer %s', $this->{'token'});
25+
$request = $request->withHeader('Authorization', $header);
26+
27+
return $request;
28+
}
29+
30+
public function getScope(): string
31+
{
32+
return 'JWT';
33+
}
34+
}

generated/Client.php

Lines changed: 6072 additions & 16 deletions
Large diffs are not rendered by default.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/*
6+
* This file has been auto generated by Jane,
7+
*
8+
* Do no edit it directly.
9+
*/
10+
11+
namespace cedricziel\phpbaserowclient\Generated\Endpoint;
12+
13+
class AcceptGroupInvitation extends \cedricziel\phpbaserowclient\Generated\Runtime\Client\BaseEndpoint implements \cedricziel\phpbaserowclient\Generated\Runtime\Client\Endpoint
14+
{
15+
use \cedricziel\phpbaserowclient\Generated\Runtime\Client\EndpointTrait;
16+
protected $group_invitation_id;
17+
18+
/**
19+
* **This endpoint has been deprecated and replaced with a new endpoint, [accept_workspace_invitation](#tag/Workspace-invitations/operation/accept_workspace_invitation).**.
20+
*
21+
**Support for this endpoint will end in 2024.**
22+
*
23+
* Accepts a group invitation with the given id if the email address of the user matches that of the invitation.
24+
*
25+
* @param int $groupInvitationId accepts the group invitation related to the provided value
26+
*/
27+
public function __construct(int $groupInvitationId)
28+
{
29+
$this->group_invitation_id = $groupInvitationId;
30+
}
31+
32+
public function getMethod(): string
33+
{
34+
return 'POST';
35+
}
36+
37+
public function getUri(): string
38+
{
39+
return str_replace(['{group_invitation_id}'], [$this->group_invitation_id], '/api/groups/invitations/{group_invitation_id}/accept/');
40+
}
41+
42+
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array
43+
{
44+
return [[], null];
45+
}
46+
47+
public function getExtraHeaders(): array
48+
{
49+
return ['Accept' => ['application/json']];
50+
}
51+
52+
/**
53+
* @return \cedricziel\phpbaserowclient\Generated\Model\WorkspaceUserWorkspace|null
54+
*
55+
* @throws \cedricziel\phpbaserowclient\Generated\Exception\AcceptGroupInvitationBadRequestException
56+
* @throws \cedricziel\phpbaserowclient\Generated\Exception\AcceptGroupInvitationNotFoundException
57+
*/
58+
protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
59+
{
60+
$status = $response->getStatusCode();
61+
$body = (string) $response->getBody();
62+
if (false === is_null($contentType) && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) {
63+
return $serializer->deserialize($body, 'cedricziel\phpbaserowclient\Generated\Model\WorkspaceUserWorkspace', 'json');
64+
}
65+
if (false === is_null($contentType) && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) {
66+
throw new \cedricziel\phpbaserowclient\Generated\Exception\AcceptGroupInvitationBadRequestException($serializer->deserialize($body, 'cedricziel\phpbaserowclient\Generated\Model\ApiGroupsInvitationsGroupInvitationIdAcceptPostResponse400', 'json'), $response);
67+
}
68+
if (false === is_null($contentType) && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) {
69+
throw new \cedricziel\phpbaserowclient\Generated\Exception\AcceptGroupInvitationNotFoundException($serializer->deserialize($body, 'cedricziel\phpbaserowclient\Generated\Model\ApiGroupsInvitationsGroupInvitationIdAcceptPostResponse404', 'json'), $response);
70+
}
71+
}
72+
73+
public function getAuthenticationScopes(): array
74+
{
75+
return ['JWT'];
76+
}
77+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/*
6+
* This file has been auto generated by Jane,
7+
*
8+
* Do no edit it directly.
9+
*/
10+
11+
namespace cedricziel\phpbaserowclient\Generated\Endpoint;
12+
13+
class AcceptWorkspaceInvitation extends \cedricziel\phpbaserowclient\Generated\Runtime\Client\BaseEndpoint implements \cedricziel\phpbaserowclient\Generated\Runtime\Client\Endpoint
14+
{
15+
use \cedricziel\phpbaserowclient\Generated\Runtime\Client\EndpointTrait;
16+
protected $workspace_invitation_id;
17+
18+
/**
19+
* Accepts a workspace invitation with the given id if the email address of the user matches that of the invitation.
20+
*
21+
* @param int $workspaceInvitationId accepts the workspace invitation related to the provided value
22+
*/
23+
public function __construct(int $workspaceInvitationId)
24+
{
25+
$this->workspace_invitation_id = $workspaceInvitationId;
26+
}
27+
28+
public function getMethod(): string
29+
{
30+
return 'POST';
31+
}
32+
33+
public function getUri(): string
34+
{
35+
return str_replace(['{workspace_invitation_id}'], [$this->workspace_invitation_id], '/api/workspaces/invitations/{workspace_invitation_id}/accept/');
36+
}
37+
38+
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array
39+
{
40+
return [[], null];
41+
}
42+
43+
public function getExtraHeaders(): array
44+
{
45+
return ['Accept' => ['application/json']];
46+
}
47+
48+
/**
49+
* @return \cedricziel\phpbaserowclient\Generated\Model\WorkspaceUserWorkspace|null
50+
*
51+
* @throws \cedricziel\phpbaserowclient\Generated\Exception\AcceptWorkspaceInvitationBadRequestException
52+
* @throws \cedricziel\phpbaserowclient\Generated\Exception\AcceptWorkspaceInvitationNotFoundException
53+
*/
54+
protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
55+
{
56+
$status = $response->getStatusCode();
57+
$body = (string) $response->getBody();
58+
if (false === is_null($contentType) && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) {
59+
return $serializer->deserialize($body, 'cedricziel\phpbaserowclient\Generated\Model\WorkspaceUserWorkspace', 'json');
60+
}
61+
if (false === is_null($contentType) && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) {
62+
throw new \cedricziel\phpbaserowclient\Generated\Exception\AcceptWorkspaceInvitationBadRequestException($serializer->deserialize($body, 'cedricziel\phpbaserowclient\Generated\Model\ApiWorkspacesInvitationsWorkspaceInvitationIdAcceptPostResponse400', 'json'), $response);
63+
}
64+
if (false === is_null($contentType) && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) {
65+
throw new \cedricziel\phpbaserowclient\Generated\Exception\AcceptWorkspaceInvitationNotFoundException($serializer->deserialize($body, 'cedricziel\phpbaserowclient\Generated\Model\ApiWorkspacesInvitationsWorkspaceInvitationIdAcceptPostResponse404', 'json'), $response);
66+
}
67+
}
68+
69+
public function getAuthenticationScopes(): array
70+
{
71+
return ['JWT'];
72+
}
73+
}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/*
6+
* This file has been auto generated by Jane,
7+
*
8+
* Do no edit it directly.
9+
*/
10+
11+
namespace cedricziel\phpbaserowclient\Generated\Endpoint;
12+
13+
class AdminAddUserToLicense extends \cedricziel\phpbaserowclient\Generated\Runtime\Client\BaseEndpoint implements \cedricziel\phpbaserowclient\Generated\Runtime\Client\Endpoint
14+
{
15+
use \cedricziel\phpbaserowclient\Generated\Runtime\Client\EndpointTrait;
16+
protected $id;
17+
protected $user_id;
18+
19+
/**
20+
* Adds the user related to the provided parameter and to the license related to the parameter. This only happens if there are enough seats left on the license and if the user is not already on the license.
21+
*
22+
* @param int $id the internal identifier of the license, this is `id` and not `license_id`
23+
* @param int $userId the ID of the user that must be added to the license
24+
*/
25+
public function __construct(int $id, int $userId)
26+
{
27+
$this->id = $id;
28+
$this->user_id = $userId;
29+
}
30+
31+
public function getMethod(): string
32+
{
33+
return 'POST';
34+
}
35+
36+
public function getUri(): string
37+
{
38+
return str_replace(['{id}', '{user_id}'], [$this->id, $this->user_id], '/api/licenses/{id}/{user_id}/');
39+
}
40+
41+
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array
42+
{
43+
return [[], null];
44+
}
45+
46+
public function getExtraHeaders(): array
47+
{
48+
return ['Accept' => ['application/json']];
49+
}
50+
51+
/**
52+
* @return \cedricziel\phpbaserowclient\Generated\Model\LicenseUser|null
53+
*
54+
* @throws \cedricziel\phpbaserowclient\Generated\Exception\AdminAddUserToLicenseBadRequestException
55+
* @throws \cedricziel\phpbaserowclient\Generated\Exception\AdminAddUserToLicenseNotFoundException
56+
*/
57+
protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
58+
{
59+
$status = $response->getStatusCode();
60+
$body = (string) $response->getBody();
61+
if (false === is_null($contentType) && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) {
62+
return $serializer->deserialize($body, 'cedricziel\phpbaserowclient\Generated\Model\LicenseUser', 'json');
63+
}
64+
if (false === is_null($contentType) && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) {
65+
throw new \cedricziel\phpbaserowclient\Generated\Exception\AdminAddUserToLicenseBadRequestException($serializer->deserialize($body, 'cedricziel\phpbaserowclient\Generated\Model\ApiLicensesIdUserIdPostResponse400', 'json'), $response);
66+
}
67+
if (false === is_null($contentType) && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) {
68+
throw new \cedricziel\phpbaserowclient\Generated\Exception\AdminAddUserToLicenseNotFoundException($serializer->deserialize($body, 'cedricziel\phpbaserowclient\Generated\Model\ApiLicensesIdUserIdPostResponse404', 'json'), $response);
69+
}
70+
}
71+
72+
public function getAuthenticationScopes(): array
73+
{
74+
return ['JWT'];
75+
}
76+
}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/*
6+
* This file has been auto generated by Jane,
7+
*
8+
* Do no edit it directly.
9+
*/
10+
11+
namespace cedricziel\phpbaserowclient\Generated\Endpoint;
12+
13+
class AdminCreateUser extends \cedricziel\phpbaserowclient\Generated\Runtime\Client\BaseEndpoint implements \cedricziel\phpbaserowclient\Generated\Runtime\Client\Endpoint
14+
{
15+
use \cedricziel\phpbaserowclient\Generated\Runtime\Client\EndpointTrait;
16+
17+
/**
18+
* Creates and returns a new user if the requesting user is staff. This works even if new signups are disabled.
19+
*
20+
* This is a **premium** feature.
21+
*/
22+
public function __construct(\cedricziel\phpbaserowclient\Generated\Model\UserAdminCreate $requestBody)
23+
{
24+
$this->body = $requestBody;
25+
}
26+
27+
public function getMethod(): string
28+
{
29+
return 'POST';
30+
}
31+
32+
public function getUri(): string
33+
{
34+
return '/api/admin/users/';
35+
}
36+
37+
public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array
38+
{
39+
if ($this->body instanceof \cedricziel\phpbaserowclient\Generated\Model\UserAdminCreate) {
40+
return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')];
41+
}
42+
if ($this->body instanceof \cedricziel\phpbaserowclient\Generated\Model\UserAdminCreate) {
43+
return [['Content-Type' => ['application/x-www-form-urlencoded']], http_build_query($serializer->normalize($this->body, 'json'))];
44+
}
45+
if ($this->body instanceof \cedricziel\phpbaserowclient\Generated\Model\UserAdminCreate) {
46+
$bodyBuilder = new \Http\Message\MultipartStream\MultipartStreamBuilder($streamFactory);
47+
$formParameters = $serializer->normalize($this->body, 'json');
48+
foreach ($formParameters as $key => $value) {
49+
$value = is_int($value) ? (string) $value : $value;
50+
$bodyBuilder->addResource($key, $value);
51+
}
52+
53+
return [['Content-Type' => ['multipart/form-data; boundary="'.($bodyBuilder->getBoundary().'"')]], $bodyBuilder->build()];
54+
}
55+
56+
return [[], null];
57+
}
58+
59+
public function getExtraHeaders(): array
60+
{
61+
return ['Accept' => ['application/json']];
62+
}
63+
64+
/**
65+
* @return \cedricziel\phpbaserowclient\Generated\Model\UserAdminResponse|null
66+
*
67+
* @throws \cedricziel\phpbaserowclient\Generated\Exception\AdminCreateUserBadRequestException
68+
*/
69+
protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
70+
{
71+
$status = $response->getStatusCode();
72+
$body = (string) $response->getBody();
73+
if (false === is_null($contentType) && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) {
74+
return $serializer->deserialize($body, 'cedricziel\phpbaserowclient\Generated\Model\UserAdminResponse', 'json');
75+
}
76+
if (false === is_null($contentType) && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) {
77+
throw new \cedricziel\phpbaserowclient\Generated\Exception\AdminCreateUserBadRequestException($serializer->deserialize($body, 'cedricziel\phpbaserowclient\Generated\Model\ApiAdminUsersPostResponse400', 'json'), $response);
78+
}
79+
}
80+
81+
public function getAuthenticationScopes(): array
82+
{
83+
return ['JWT'];
84+
}
85+
}

0 commit comments

Comments
 (0)