Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"homepage": "https://www.cloudpdf.com"
}
},
"originGitCommit": "3283147ded32fc15c426768f75557a4d95943d84",
"originGitCommit": "ce65e1390549db1272ac3720a5ddfcea55be2c07",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
"requestedVersion": "3.0.0-alpha.21",
"requestedVersion": "3.0.0-alpha.22",
"ciProvider": "github",
"sdkVersion": "3.0.0-alpha.21"
"sdkVersion": "3.0.0-alpha.22"
}
8 changes: 4 additions & 4 deletions cloudpdf-generation.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"language": "php",
"canonicalVersion": "3.0.0-next.21",
"sdkVersion": "3.0.0-alpha.21",
"canonicalVersion": "3.0.0-next.22",
"sdkVersion": "3.0.0-alpha.22",
"source": {
"repository": "embedpdf/embed-pdf-viewer",
"openapi": "cloudpdf/contract/openapi.json",
"openapiSha256": "f85648401f5c683a32e2b50acc3d753df9f4ce06df8492e5d2b599beceb0e788",
"gitCommit": "3283147ded32fc15c426768f75557a4d95943d84",
"openapiSha256": "1f5aa976eec4d5fc4e2b22efe725df58a01389896733ec1870f96a6441b62859",
"gitCommit": "ce65e1390549db1272ac3720a5ddfcea55be2c07",
"gitCommitIsDirty": false
},
"fern": {
Expand Down
55 changes: 55 additions & 0 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,45 @@ $client->deployment->licenseStatus();
</dl>


</dd>
</dl>
</details>

<details><summary><code>$client-&gt;deployment-&gt;modules() -> ?DeploymentModulesResponse</code></summary>
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

What each module declares, for a dashboard or a script that lists modules, offers their permissions in its dialogs and shows their meters. Which tenants may use one is in their `features` (`tenants.get`); what it costs, if anything, is the operator's.
</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```php
$client->deployment->modules();
```
</dd>
</dl>
</dd>
</dl>


</dd>
</dl>
</details>
Expand Down Expand Up @@ -1608,6 +1647,22 @@ $client->tenants->usage(

**$period:** `?string`

</dd>
</dl>

<dl>
<dd>

**$from:** `?string`

</dd>
</dl>

<dl>
<dd>

**$to:** `?string`

</dd>
</dl>
</dd>
Expand Down
4 changes: 2 additions & 2 deletions src/CloudPDFClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ public function __construct(
$defaultHeaders = [
'X-Fern-Language' => 'PHP',
'X-Fern-SDK-Name' => 'CloudPDF',
'X-Fern-SDK-Version' => '3.0.0-alpha.21',
'User-Agent' => 'cloudpdf/sdk/3.0.0-alpha.21',
'X-Fern-SDK-Version' => '3.0.0-alpha.22',
'User-Agent' => 'cloudpdf/sdk/3.0.0-alpha.22',
];
if ($token != null) {
$defaultHeaders['Authorization'] = "Bearer $token";
Expand Down
53 changes: 53 additions & 0 deletions src/Deployment/DeploymentClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use CloudPDF\Core\Client\HttpMethod;
use JsonException;
use Psr\Http\Client\ClientExceptionInterface;
use CloudPDF\Types\DeploymentModulesResponse;

class DeploymentClient
{
Expand Down Expand Up @@ -98,4 +99,56 @@ public function licenseStatus(?array $options = null): ?DeploymentLicenseStatusR
body: $response->getBody()->getContents(),
);
}

/**
* What each module declares, for a dashboard or a script that lists modules, offers their permissions in its dialogs and shows their meters. Which tenants may use one is in their `features` (`tenants.get`); what it costs, if anything, is the operator's.
*
* Example:
* ```php
* $client->deployment->modules();
* ```
*
* @param ?array{
* baseUrl?: string,
* maxRetries?: int,
* timeout?: float,
* headers?: array<string, string>,
* queryParameters?: array<string, mixed>,
* bodyProperties?: array<string, mixed>,
* } $options
* @return ?DeploymentModulesResponse
* @throws CloudPDFException
* @throws CloudPDFApiException
*/
public function modules(?array $options = null): ?DeploymentModulesResponse
{
$options = array_merge($this->options, $options ?? []);
try {
$response = $this->client->sendRequest(
new JsonApiRequest(
baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value,
path: "v1/deployment/modules",
method: HttpMethod::GET,
),
$options,
);
$statusCode = $response->getStatusCode();
if ($statusCode >= 200 && $statusCode < 400) {
$json = $response->getBody()->getContents();
if (empty($json)) {
return null;
}
return DeploymentModulesResponse::fromJson($json);
}
} catch (JsonException $e) {
throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
} catch (ClientExceptionInterface $e) {
throw new CloudPDFException(message: $e->getMessage(), previous: $e);
}
throw new CloudPDFApiException(
message: 'API request failed',
statusCode: $statusCode,
body: $response->getBody()->getContents(),
);
}
}
14 changes: 14 additions & 0 deletions src/Tenants/Requests/UsageTenantsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,28 @@ class UsageTenantsRequest extends JsonSerializableType
*/
public ?string $period;

/**
* @var ?string $from
*/
public ?string $from;

/**
* @var ?string $to
*/
public ?string $to;

/**
* @param array{
* period?: ?string,
* from?: ?string,
* to?: ?string,
* } $values
*/
public function __construct(
array $values = [],
) {
$this->period = $values['period'] ?? null;
$this->from = $values['from'] ?? null;
$this->to = $values['to'] ?? null;
}
}
6 changes: 6 additions & 0 deletions src/Tenants/TenantsClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,12 @@ public function usage(string $tenantId, UsageTenantsRequest $request = new Usage
if ($request->period != null) {
$query['period'] = $request->period;
}
if ($request->from != null) {
$query['from'] = $request->from;
}
if ($request->to != null) {
$query['to'] = $request->to;
}
try {
$response = $this->client->sendRequest(
new JsonApiRequest(
Expand Down
8 changes: 8 additions & 0 deletions src/Types/AnnotationCaret.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ class AnnotationCaret extends JsonSerializableType
#[JsonProperty('actions')]
public ?PdfAnnotationActions $actions;

/**
* @var ?RichTextDocument $richText
*/
#[JsonProperty('richText')]
public ?RichTextDocument $richText;

/**
* @var string $color
*/
Expand Down Expand Up @@ -262,6 +268,7 @@ class AnnotationCaret extends JsonSerializableType
* modifiedBy?: ?string,
* importedBy?: ?string,
* actions?: ?PdfAnnotationActions,
* richText?: ?RichTextDocument,
* rotation?: ?float,
* intent?: ?value-of<AnnotationCaretIntent>,
* } $values
Expand Down Expand Up @@ -300,6 +307,7 @@ public function __construct(
$this->modifiedBy = $values['modifiedBy'] ?? null;
$this->importedBy = $values['importedBy'] ?? null;
$this->actions = $values['actions'] ?? null;
$this->richText = $values['richText'] ?? null;
$this->color = $values['color'];
$this->opacity = $values['opacity'];
$this->box = $values['box'];
Expand Down
16 changes: 12 additions & 4 deletions src/Types/AnnotationCircle.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,16 @@ class AnnotationCircle extends JsonSerializableType
public ?PdfAnnotationActions $actions;

/**
* @var string $color
* @var ?RichTextDocument $richText
*/
#[JsonProperty('richText')]
public ?RichTextDocument $richText;

/**
* @var ?string $color
*/
#[JsonProperty('color')]
public string $color;
public ?string $color;

/**
* @var float $opacity
Expand Down Expand Up @@ -267,7 +273,6 @@ class AnnotationCircle extends JsonSerializableType
* locked: bool,
* toggleNoView: bool,
* lockedContents: bool,
* color: string,
* opacity: float,
* strokeWidth: float,
* borderStyle: value-of<AnnotationCircleBorderStyle>,
Expand All @@ -288,6 +293,8 @@ class AnnotationCircle extends JsonSerializableType
* modifiedBy?: ?string,
* importedBy?: ?string,
* actions?: ?PdfAnnotationActions,
* richText?: ?RichTextDocument,
* color?: ?string,
* dashArray?: ?array<float>,
* interiorColor?: ?string,
* rotation?: ?float,
Expand Down Expand Up @@ -328,7 +335,8 @@ public function __construct(
$this->modifiedBy = $values['modifiedBy'] ?? null;
$this->importedBy = $values['importedBy'] ?? null;
$this->actions = $values['actions'] ?? null;
$this->color = $values['color'];
$this->richText = $values['richText'] ?? null;
$this->color = $values['color'] ?? null;
$this->opacity = $values['opacity'];
$this->strokeWidth = $values['strokeWidth'];
$this->borderStyle = $values['borderStyle'];
Expand Down
8 changes: 8 additions & 0 deletions src/Types/AnnotationDraftCaret.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@ class AnnotationDraftCaret extends JsonSerializableType
#[JsonProperty('actions')]
public mixed $actions;

/**
* @var ?RichTextDocumentInput $richText
*/
#[JsonProperty('richText')]
public ?RichTextDocumentInput $richText;

/**
* @var ?string $color
*/
Expand Down Expand Up @@ -256,6 +262,7 @@ class AnnotationDraftCaret extends JsonSerializableType
* modifiedBy?: mixed,
* importedBy?: mixed,
* actions?: mixed,
* richText?: ?RichTextDocumentInput,
* color?: ?string,
* opacity?: ?float,
* box?: ?AnnotationDraftCaretBox,
Expand Down Expand Up @@ -297,6 +304,7 @@ public function __construct(
$this->modifiedBy = $values['modifiedBy'] ?? null;
$this->importedBy = $values['importedBy'] ?? null;
$this->actions = $values['actions'] ?? null;
$this->richText = $values['richText'] ?? null;
$this->color = $values['color'] ?? null;
$this->opacity = $values['opacity'] ?? null;
$this->box = $values['box'] ?? null;
Expand Down
8 changes: 8 additions & 0 deletions src/Types/AnnotationDraftCircle.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ class AnnotationDraftCircle extends JsonSerializableType
#[JsonProperty('actions')]
public mixed $actions;

/**
* @var ?RichTextDocumentInput $richText
*/
#[JsonProperty('richText')]
public ?RichTextDocumentInput $richText;

/**
* @var ?string $color
*/
Expand Down Expand Up @@ -281,6 +287,7 @@ class AnnotationDraftCircle extends JsonSerializableType
* modifiedBy?: mixed,
* importedBy?: mixed,
* actions?: mixed,
* richText?: ?RichTextDocumentInput,
* color?: ?string,
* opacity?: ?float,
* strokeWidth?: ?float,
Expand Down Expand Up @@ -326,6 +333,7 @@ public function __construct(
$this->modifiedBy = $values['modifiedBy'] ?? null;
$this->importedBy = $values['importedBy'] ?? null;
$this->actions = $values['actions'] ?? null;
$this->richText = $values['richText'] ?? null;
$this->color = $values['color'] ?? null;
$this->opacity = $values['opacity'] ?? null;
$this->strokeWidth = $values['strokeWidth'] ?? null;
Expand Down
8 changes: 8 additions & 0 deletions src/Types/AnnotationDraftFileAttachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@ class AnnotationDraftFileAttachment extends JsonSerializableType
#[JsonProperty('actions')]
public mixed $actions;

/**
* @var ?RichTextDocumentInput $richText
*/
#[JsonProperty('richText')]
public ?RichTextDocumentInput $richText;

/**
* @var ?string $color
*/
Expand Down Expand Up @@ -250,6 +256,7 @@ class AnnotationDraftFileAttachment extends JsonSerializableType
* modifiedBy?: mixed,
* importedBy?: mixed,
* actions?: mixed,
* richText?: ?RichTextDocumentInput,
* color?: ?string,
* opacity?: ?float,
* icon?: ?value-of<AnnotationDraftFileAttachmentIcon>,
Expand Down Expand Up @@ -290,6 +297,7 @@ public function __construct(
$this->modifiedBy = $values['modifiedBy'] ?? null;
$this->importedBy = $values['importedBy'] ?? null;
$this->actions = $values['actions'] ?? null;
$this->richText = $values['richText'] ?? null;
$this->color = $values['color'] ?? null;
$this->opacity = $values['opacity'] ?? null;
$this->icon = $values['icon'] ?? null;
Expand Down
Loading
Loading