diff --git a/.fern/metadata.json b/.fern/metadata.json
index 7b0a48af..c8ed3979 100644
--- a/.fern/metadata.json
+++ b/.fern/metadata.json
@@ -11,10 +11,10 @@
"homepage": "https://www.cloudpdf.com"
}
},
- "originGitCommit": "622018abaf6e4578d1f4d8377982c48b92c9ced3",
+ "originGitCommit": "3283147ded32fc15c426768f75557a4d95943d84",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
- "requestedVersion": "3.0.0-alpha.20",
+ "requestedVersion": "3.0.0-alpha.21",
"ciProvider": "github",
- "sdkVersion": "3.0.0-alpha.20"
+ "sdkVersion": "3.0.0-alpha.21"
}
\ No newline at end of file
diff --git a/cloudpdf-generation.json b/cloudpdf-generation.json
index ed92d9b3..66188d98 100644
--- a/cloudpdf-generation.json
+++ b/cloudpdf-generation.json
@@ -1,12 +1,12 @@
{
"language": "php",
- "canonicalVersion": "3.0.0-next.20",
- "sdkVersion": "3.0.0-alpha.20",
+ "canonicalVersion": "3.0.0-next.21",
+ "sdkVersion": "3.0.0-alpha.21",
"source": {
"repository": "embedpdf/embed-pdf-viewer",
"openapi": "cloudpdf/contract/openapi.json",
- "openapiSha256": "47d739acb956ce8ba0c3990117e505be2e9406038d9e0cd1729608921a40b2d9",
- "gitCommit": "622018abaf6e4578d1f4d8377982c48b92c9ced3",
+ "openapiSha256": "f85648401f5c683a32e2b50acc3d753df9f4ce06df8492e5d2b599beceb0e788",
+ "gitCommit": "3283147ded32fc15c426768f75557a4d95943d84",
"gitCommitIsDirty": false
},
"fern": {
diff --git a/reference.md b/reference.md
index f3d102a3..06886c26 100644
--- a/reference.md
+++ b/reference.md
@@ -1371,6 +1371,77 @@ $client->tenants->delete(
+
+
+
+
+$client->tenants->update($tenantId, $request) -> ?TenantsUpdate200Response
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+A feature names an installed module; any other id is a 400. A module route answers a tenant without its feature 403 FeatureNotEnabled, and one whose feature is stopped 402 FeatureStopped (details.feature, details.stopped). Other replicas apply a change within 30 seconds.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->tenants->update(
+ 'tenantId',
+ new TenantsUpdateRequest([
+ 'features' => [
+ new TenantFeature([
+ 'id' => 'id',
+ ]),
+ ],
+ ]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$tenantId:** `string`
+
+
+
+
+
+-
+
+**$features:** `array`
+
+
+
+
+
+
+
diff --git a/src/CloudPDFClient.php b/src/CloudPDFClient.php
index 6b37e26b..2a73da10 100644
--- a/src/CloudPDFClient.php
+++ b/src/CloudPDFClient.php
@@ -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.20',
- 'User-Agent' => 'cloudpdf/sdk/3.0.0-alpha.20',
+ 'X-Fern-SDK-Version' => '3.0.0-alpha.21',
+ 'User-Agent' => 'cloudpdf/sdk/3.0.0-alpha.21',
];
if ($token != null) {
$defaultHeaders['Authorization'] = "Bearer $token";
diff --git a/src/Tenants/Requests/TenantsUpdateRequest.php b/src/Tenants/Requests/TenantsUpdateRequest.php
new file mode 100644
index 00000000..7cc1ebe3
--- /dev/null
+++ b/src/Tenants/Requests/TenantsUpdateRequest.php
@@ -0,0 +1,28 @@
+ $features
+ */
+ #[JsonProperty('features'), ArrayType([TenantFeature::class])]
+ public array $features;
+
+ /**
+ * @param array{
+ * features: array,
+ * } $values
+ */
+ public function __construct(
+ array $values,
+ ) {
+ $this->features = $values['features'];
+ }
+}
diff --git a/src/Tenants/TenantsClient.php b/src/Tenants/TenantsClient.php
index eb6de8e0..29629714 100644
--- a/src/Tenants/TenantsClient.php
+++ b/src/Tenants/TenantsClient.php
@@ -16,6 +16,8 @@
use CloudPDF\Tenants\Requests\TenantsCreateRequest;
use CloudPDF\Types\TenantsCreate200Response;
use CloudPDF\Types\TenantsGet200Response;
+use CloudPDF\Tenants\Requests\TenantsUpdateRequest;
+use CloudPDF\Types\TenantsUpdate200Response;
use CloudPDF\Tenants\Requests\TenantsSuspendRequest;
use CloudPDF\Tenants\Requests\UsageTenantsRequest;
use CloudPDF\Types\TenantsUsage200Response;
@@ -274,6 +276,70 @@ public function delete(string $tenantId, ?array $options = null): void
);
}
+ /**
+ * A feature names an installed module; any other id is a 400. A module route answers a tenant without its feature 403 FeatureNotEnabled, and one whose feature is stopped 402 FeatureStopped (details.feature, details.stopped). Other replicas apply a change within 30 seconds.
+ *
+ * Example:
+ * ```php
+ * $client->tenants->update(
+ * 'tenantId',
+ * new TenantsUpdateRequest([
+ * 'features' => [
+ * new TenantFeature([
+ * 'id' => 'id',
+ * ]),
+ * ],
+ * ]),
+ * );
+ * ```
+ *
+ * @param string $tenantId
+ * @param TenantsUpdateRequest $request
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?TenantsUpdate200Response
+ * @throws CloudPDFException
+ * @throws CloudPDFApiException
+ */
+ public function update(string $tenantId, TenantsUpdateRequest $request, ?array $options = null): ?TenantsUpdate200Response
+ {
+ $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/tenants/{$tenantId}",
+ method: HttpMethod::PATCH,
+ body: $request,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return TenantsUpdate200Response::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(),
+ );
+ }
+
/**
* Example:
* ```php
diff --git a/src/Types/TenantFeature.php b/src/Types/TenantFeature.php
new file mode 100644
index 00000000..6a51c5ea
--- /dev/null
+++ b/src/Types/TenantFeature.php
@@ -0,0 +1,42 @@
+ $stopped
+ */
+ #[JsonProperty('stopped')]
+ public ?string $stopped;
+
+ /**
+ * @param array{
+ * id: string,
+ * stopped?: ?value-of,
+ * } $values
+ */
+ public function __construct(
+ array $values,
+ ) {
+ $this->id = $values['id'];
+ $this->stopped = $values['stopped'] ?? null;
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString(): string
+ {
+ return $this->toJson();
+ }
+}
diff --git a/src/Types/TenantFeatureStopped.php b/src/Types/TenantFeatureStopped.php
new file mode 100644
index 00000000..8da234c0
--- /dev/null
+++ b/src/Types/TenantFeatureStopped.php
@@ -0,0 +1,8 @@
+ $features
+ */
+ #[JsonProperty('features'), ArrayType([TenantFeature::class])]
+ public ?array $features;
+
/**
* @var float $createdAt
*/
@@ -44,6 +51,7 @@ class TenantsCreate200ResponseTenant extends JsonSerializableType
* autoProvisioned: bool,
* createdAt: float,
* status?: ?value-of,
+ * features?: ?array,
* } $values
*/
public function __construct(
@@ -53,6 +61,7 @@ public function __construct(
$this->name = $values['name'];
$this->autoProvisioned = $values['autoProvisioned'];
$this->status = $values['status'] ?? null;
+ $this->features = $values['features'] ?? null;
$this->createdAt = $values['createdAt'];
}
diff --git a/src/Types/TenantsGet200ResponseTenant.php b/src/Types/TenantsGet200ResponseTenant.php
index 21573854..c8417279 100644
--- a/src/Types/TenantsGet200ResponseTenant.php
+++ b/src/Types/TenantsGet200ResponseTenant.php
@@ -4,6 +4,7 @@
use CloudPDF\Core\Json\JsonSerializableType;
use CloudPDF\Core\Json\JsonProperty;
+use CloudPDF\Core\Types\ArrayType;
class TenantsGet200ResponseTenant extends JsonSerializableType
{
@@ -31,6 +32,12 @@ class TenantsGet200ResponseTenant extends JsonSerializableType
#[JsonProperty('status')]
public ?string $status;
+ /**
+ * @var ?array $features
+ */
+ #[JsonProperty('features'), ArrayType([TenantFeature::class])]
+ public ?array $features;
+
/**
* @var float $createdAt
*/
@@ -44,6 +51,7 @@ class TenantsGet200ResponseTenant extends JsonSerializableType
* autoProvisioned: bool,
* createdAt: float,
* status?: ?value-of,
+ * features?: ?array,
* } $values
*/
public function __construct(
@@ -53,6 +61,7 @@ public function __construct(
$this->name = $values['name'];
$this->autoProvisioned = $values['autoProvisioned'];
$this->status = $values['status'] ?? null;
+ $this->features = $values['features'] ?? null;
$this->createdAt = $values['createdAt'];
}
diff --git a/src/Types/TenantsList200ResponseTenantsItem.php b/src/Types/TenantsList200ResponseTenantsItem.php
index 80424caf..55898aeb 100644
--- a/src/Types/TenantsList200ResponseTenantsItem.php
+++ b/src/Types/TenantsList200ResponseTenantsItem.php
@@ -4,6 +4,7 @@
use CloudPDF\Core\Json\JsonSerializableType;
use CloudPDF\Core\Json\JsonProperty;
+use CloudPDF\Core\Types\ArrayType;
class TenantsList200ResponseTenantsItem extends JsonSerializableType
{
@@ -31,6 +32,12 @@ class TenantsList200ResponseTenantsItem extends JsonSerializableType
#[JsonProperty('status')]
public ?string $status;
+ /**
+ * @var ?array $features
+ */
+ #[JsonProperty('features'), ArrayType([TenantFeature::class])]
+ public ?array $features;
+
/**
* @var float $createdAt
*/
@@ -44,6 +51,7 @@ class TenantsList200ResponseTenantsItem extends JsonSerializableType
* autoProvisioned: bool,
* createdAt: float,
* status?: ?value-of,
+ * features?: ?array,
* } $values
*/
public function __construct(
@@ -53,6 +61,7 @@ public function __construct(
$this->name = $values['name'];
$this->autoProvisioned = $values['autoProvisioned'];
$this->status = $values['status'] ?? null;
+ $this->features = $values['features'] ?? null;
$this->createdAt = $values['createdAt'];
}
diff --git a/src/Types/TenantsUpdate200Response.php b/src/Types/TenantsUpdate200Response.php
new file mode 100644
index 00000000..bfa70a07
--- /dev/null
+++ b/src/Types/TenantsUpdate200Response.php
@@ -0,0 +1,34 @@
+tenant = $values['tenant'];
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString(): string
+ {
+ return $this->toJson();
+ }
+}
diff --git a/src/Types/TenantsUpdate200ResponseTenant.php b/src/Types/TenantsUpdate200ResponseTenant.php
new file mode 100644
index 00000000..42ced47a
--- /dev/null
+++ b/src/Types/TenantsUpdate200ResponseTenant.php
@@ -0,0 +1,75 @@
+ $status
+ */
+ #[JsonProperty('status')]
+ public ?string $status;
+
+ /**
+ * @var ?array $features
+ */
+ #[JsonProperty('features'), ArrayType([TenantFeature::class])]
+ public ?array $features;
+
+ /**
+ * @var float $createdAt
+ */
+ #[JsonProperty('createdAt')]
+ public float $createdAt;
+
+ /**
+ * @param array{
+ * id: string,
+ * name: string,
+ * autoProvisioned: bool,
+ * createdAt: float,
+ * status?: ?value-of,
+ * features?: ?array,
+ * } $values
+ */
+ public function __construct(
+ array $values,
+ ) {
+ $this->id = $values['id'];
+ $this->name = $values['name'];
+ $this->autoProvisioned = $values['autoProvisioned'];
+ $this->status = $values['status'] ?? null;
+ $this->features = $values['features'] ?? null;
+ $this->createdAt = $values['createdAt'];
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString(): string
+ {
+ return $this->toJson();
+ }
+}
diff --git a/src/Types/TenantsUpdate200ResponseTenantStatus.php b/src/Types/TenantsUpdate200ResponseTenantStatus.php
new file mode 100644
index 00000000..eb719a5c
--- /dev/null
+++ b/src/Types/TenantsUpdate200ResponseTenantStatus.php
@@ -0,0 +1,9 @@
+