Skip to content

feat: Update openapi.json #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
34 changes: 34 additions & 0 deletions generated/Authentication/JWTAuthentication.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

declare(strict_types=1);

/*
* This file has been auto generated by Jane,
*
* Do no edit it directly.
*/

namespace cedricziel\phpbaserowclient\Generated\Authentication;

class JWTAuthentication implements \Jane\Component\OpenApiRuntime\Client\AuthenticationPlugin
{
private $token;

public function __construct(string $token)
{
$this->{'token'} = $token;
}

public function authentication(\Psr\Http\Message\RequestInterface $request): \Psr\Http\Message\RequestInterface
{
$header = sprintf('Bearer %s', $this->{'token'});
$request = $request->withHeader('Authorization', $header);

return $request;
}

public function getScope(): string
{
return 'JWT';
}
}
6,088 changes: 6,072 additions & 16 deletions generated/Client.php

Large diffs are not rendered by default.

77 changes: 77 additions & 0 deletions generated/Endpoint/AcceptGroupInvitation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?php

declare(strict_types=1);

/*
* This file has been auto generated by Jane,
*
* Do no edit it directly.
*/

namespace cedricziel\phpbaserowclient\Generated\Endpoint;

class AcceptGroupInvitation extends \cedricziel\phpbaserowclient\Generated\Runtime\Client\BaseEndpoint implements \cedricziel\phpbaserowclient\Generated\Runtime\Client\Endpoint
{
use \cedricziel\phpbaserowclient\Generated\Runtime\Client\EndpointTrait;
protected $group_invitation_id;

/**
* **This endpoint has been deprecated and replaced with a new endpoint, [accept_workspace_invitation](#tag/Workspace-invitations/operation/accept_workspace_invitation).**.
*
**Support for this endpoint will end in 2024.**
*
* Accepts a group invitation with the given id if the email address of the user matches that of the invitation.
*
* @param int $groupInvitationId accepts the group invitation related to the provided value
*/
public function __construct(int $groupInvitationId)
{
$this->group_invitation_id = $groupInvitationId;
}

public function getMethod(): string
{
return 'POST';
}

public function getUri(): string
{
return str_replace(['{group_invitation_id}'], [$this->group_invitation_id], '/api/groups/invitations/{group_invitation_id}/accept/');
}

public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array
{
return [[], null];
}

public function getExtraHeaders(): array
{
return ['Accept' => ['application/json']];
}

/**
* @return \cedricziel\phpbaserowclient\Generated\Model\WorkspaceUserWorkspace|null
*
* @throws \cedricziel\phpbaserowclient\Generated\Exception\AcceptGroupInvitationBadRequestException
* @throws \cedricziel\phpbaserowclient\Generated\Exception\AcceptGroupInvitationNotFoundException
*/
protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
{
$status = $response->getStatusCode();
$body = (string) $response->getBody();
if (false === is_null($contentType) && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) {
return $serializer->deserialize($body, 'cedricziel\phpbaserowclient\Generated\Model\WorkspaceUserWorkspace', 'json');
}
if (false === is_null($contentType) && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) {
throw new \cedricziel\phpbaserowclient\Generated\Exception\AcceptGroupInvitationBadRequestException($serializer->deserialize($body, 'cedricziel\phpbaserowclient\Generated\Model\ApiGroupsInvitationsGroupInvitationIdAcceptPostResponse400', 'json'), $response);
}
if (false === is_null($contentType) && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) {
throw new \cedricziel\phpbaserowclient\Generated\Exception\AcceptGroupInvitationNotFoundException($serializer->deserialize($body, 'cedricziel\phpbaserowclient\Generated\Model\ApiGroupsInvitationsGroupInvitationIdAcceptPostResponse404', 'json'), $response);
}
}

public function getAuthenticationScopes(): array
{
return ['JWT'];
}
}
73 changes: 73 additions & 0 deletions generated/Endpoint/AcceptWorkspaceInvitation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?php

declare(strict_types=1);

/*
* This file has been auto generated by Jane,
*
* Do no edit it directly.
*/

namespace cedricziel\phpbaserowclient\Generated\Endpoint;

class AcceptWorkspaceInvitation extends \cedricziel\phpbaserowclient\Generated\Runtime\Client\BaseEndpoint implements \cedricziel\phpbaserowclient\Generated\Runtime\Client\Endpoint
{
use \cedricziel\phpbaserowclient\Generated\Runtime\Client\EndpointTrait;
protected $workspace_invitation_id;

/**
* Accepts a workspace invitation with the given id if the email address of the user matches that of the invitation.
*
* @param int $workspaceInvitationId accepts the workspace invitation related to the provided value
*/
public function __construct(int $workspaceInvitationId)
{
$this->workspace_invitation_id = $workspaceInvitationId;
}

public function getMethod(): string
{
return 'POST';
}

public function getUri(): string
{
return str_replace(['{workspace_invitation_id}'], [$this->workspace_invitation_id], '/api/workspaces/invitations/{workspace_invitation_id}/accept/');
}

public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array
{
return [[], null];
}

public function getExtraHeaders(): array
{
return ['Accept' => ['application/json']];
}

/**
* @return \cedricziel\phpbaserowclient\Generated\Model\WorkspaceUserWorkspace|null
*
* @throws \cedricziel\phpbaserowclient\Generated\Exception\AcceptWorkspaceInvitationBadRequestException
* @throws \cedricziel\phpbaserowclient\Generated\Exception\AcceptWorkspaceInvitationNotFoundException
*/
protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
{
$status = $response->getStatusCode();
$body = (string) $response->getBody();
if (false === is_null($contentType) && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) {
return $serializer->deserialize($body, 'cedricziel\phpbaserowclient\Generated\Model\WorkspaceUserWorkspace', 'json');
}
if (false === is_null($contentType) && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) {
throw new \cedricziel\phpbaserowclient\Generated\Exception\AcceptWorkspaceInvitationBadRequestException($serializer->deserialize($body, 'cedricziel\phpbaserowclient\Generated\Model\ApiWorkspacesInvitationsWorkspaceInvitationIdAcceptPostResponse400', 'json'), $response);
}
if (false === is_null($contentType) && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) {
throw new \cedricziel\phpbaserowclient\Generated\Exception\AcceptWorkspaceInvitationNotFoundException($serializer->deserialize($body, 'cedricziel\phpbaserowclient\Generated\Model\ApiWorkspacesInvitationsWorkspaceInvitationIdAcceptPostResponse404', 'json'), $response);
}
}

public function getAuthenticationScopes(): array
{
return ['JWT'];
}
}
76 changes: 76 additions & 0 deletions generated/Endpoint/AdminAddUserToLicense.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?php

declare(strict_types=1);

/*
* This file has been auto generated by Jane,
*
* Do no edit it directly.
*/

namespace cedricziel\phpbaserowclient\Generated\Endpoint;

class AdminAddUserToLicense extends \cedricziel\phpbaserowclient\Generated\Runtime\Client\BaseEndpoint implements \cedricziel\phpbaserowclient\Generated\Runtime\Client\Endpoint
{
use \cedricziel\phpbaserowclient\Generated\Runtime\Client\EndpointTrait;
protected $id;
protected $user_id;

/**
* 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.
*
* @param int $id the internal identifier of the license, this is `id` and not `license_id`
* @param int $userId the ID of the user that must be added to the license
*/
public function __construct(int $id, int $userId)
{
$this->id = $id;
$this->user_id = $userId;
}

public function getMethod(): string
{
return 'POST';
}

public function getUri(): string
{
return str_replace(['{id}', '{user_id}'], [$this->id, $this->user_id], '/api/licenses/{id}/{user_id}/');
}

public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array
{
return [[], null];
}

public function getExtraHeaders(): array
{
return ['Accept' => ['application/json']];
}

/**
* @return \cedricziel\phpbaserowclient\Generated\Model\LicenseUser|null
*
* @throws \cedricziel\phpbaserowclient\Generated\Exception\AdminAddUserToLicenseBadRequestException
* @throws \cedricziel\phpbaserowclient\Generated\Exception\AdminAddUserToLicenseNotFoundException
*/
protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
{
$status = $response->getStatusCode();
$body = (string) $response->getBody();
if (false === is_null($contentType) && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) {
return $serializer->deserialize($body, 'cedricziel\phpbaserowclient\Generated\Model\LicenseUser', 'json');
}
if (false === is_null($contentType) && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) {
throw new \cedricziel\phpbaserowclient\Generated\Exception\AdminAddUserToLicenseBadRequestException($serializer->deserialize($body, 'cedricziel\phpbaserowclient\Generated\Model\ApiLicensesIdUserIdPostResponse400', 'json'), $response);
}
if (false === is_null($contentType) && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) {
throw new \cedricziel\phpbaserowclient\Generated\Exception\AdminAddUserToLicenseNotFoundException($serializer->deserialize($body, 'cedricziel\phpbaserowclient\Generated\Model\ApiLicensesIdUserIdPostResponse404', 'json'), $response);
}
}

public function getAuthenticationScopes(): array
{
return ['JWT'];
}
}
85 changes: 85 additions & 0 deletions generated/Endpoint/AdminCreateUser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?php

declare(strict_types=1);

/*
* This file has been auto generated by Jane,
*
* Do no edit it directly.
*/

namespace cedricziel\phpbaserowclient\Generated\Endpoint;

class AdminCreateUser extends \cedricziel\phpbaserowclient\Generated\Runtime\Client\BaseEndpoint implements \cedricziel\phpbaserowclient\Generated\Runtime\Client\Endpoint
{
use \cedricziel\phpbaserowclient\Generated\Runtime\Client\EndpointTrait;

/**
* Creates and returns a new user if the requesting user is staff. This works even if new signups are disabled.
*
* This is a **premium** feature.
*/
public function __construct(\cedricziel\phpbaserowclient\Generated\Model\UserAdminCreate $requestBody)
{
$this->body = $requestBody;
}

public function getMethod(): string
{
return 'POST';
}

public function getUri(): string
{
return '/api/admin/users/';
}

public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array
{
if ($this->body instanceof \cedricziel\phpbaserowclient\Generated\Model\UserAdminCreate) {
return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')];
}
if ($this->body instanceof \cedricziel\phpbaserowclient\Generated\Model\UserAdminCreate) {
return [['Content-Type' => ['application/x-www-form-urlencoded']], http_build_query($serializer->normalize($this->body, 'json'))];
}
if ($this->body instanceof \cedricziel\phpbaserowclient\Generated\Model\UserAdminCreate) {
$bodyBuilder = new \Http\Message\MultipartStream\MultipartStreamBuilder($streamFactory);
$formParameters = $serializer->normalize($this->body, 'json');
foreach ($formParameters as $key => $value) {
$value = is_int($value) ? (string) $value : $value;
$bodyBuilder->addResource($key, $value);
}

return [['Content-Type' => ['multipart/form-data; boundary="'.($bodyBuilder->getBoundary().'"')]], $bodyBuilder->build()];
}

return [[], null];
}

public function getExtraHeaders(): array
{
return ['Accept' => ['application/json']];
}

/**
* @return \cedricziel\phpbaserowclient\Generated\Model\UserAdminResponse|null
*
* @throws \cedricziel\phpbaserowclient\Generated\Exception\AdminCreateUserBadRequestException
*/
protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType = null)
{
$status = $response->getStatusCode();
$body = (string) $response->getBody();
if (false === is_null($contentType) && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) {
return $serializer->deserialize($body, 'cedricziel\phpbaserowclient\Generated\Model\UserAdminResponse', 'json');
}
if (false === is_null($contentType) && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) {
throw new \cedricziel\phpbaserowclient\Generated\Exception\AdminCreateUserBadRequestException($serializer->deserialize($body, 'cedricziel\phpbaserowclient\Generated\Model\ApiAdminUsersPostResponse400', 'json'), $response);
}
}

public function getAuthenticationScopes(): array
{
return ['JWT'];
}
}
Loading