Skip to content

Commit a815b26

Browse files
regen
1 parent 67c30a8 commit a815b26

34 files changed

Lines changed: 1823 additions & 60 deletions

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Change Log
22

3+
## 20.2.0
4+
5+
* Added optional encrypt parameter for database attributes (Text, Longtext, Mediumtext, Varchar) and corresponding column creation methods to enable encryption at rest. Encrypted attributes/columns cannot be queried.
6+
* Updated API docs and code examples to include the new encrypt option (defaulting to false) across databases and TablesDB sections.
7+
* Updated README compatibility note to reflect Appwrite server version 1.8.x.
8+
* Add support for the new `Backups` service
9+
310
## 20.0.1
411

512
* Fix doc examples with proper formatting
@@ -52,4 +59,4 @@
5259
* Add `dart38` and `flutter332` support to runtime models
5360
* Add `gif` support to `ImageFormat` enum
5461
* Add `upsertDocument` support to `Databases` service
55-
* Add `sequence` support to `Document` model
62+
* Add `sequence` support to `Document` model

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
77
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
88

9-
**This SDK is compatible with Appwrite server version latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-php/releases).**
9+
**This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-php/releases).**
1010

1111
Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the PHP SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
1212

docs/activities.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Activities Service
2+
3+
4+
```http request
5+
GET https://cloud.appwrite.io/v1/activities/events
6+
```
7+
8+
** List all events for selected filters. **
9+
10+
### Parameters
11+
12+
| Field Name | Type | Description | Default |
13+
| --- | --- | --- | --- |
14+
| queries | string | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as userId, teamId, etc. | [] |
15+
16+
17+
```http request
18+
GET https://cloud.appwrite.io/v1/activities/events/{eventId}
19+
```
20+
21+
** Get event by ID.
22+
**
23+
24+
### Parameters
25+
26+
| Field Name | Type | Description | Default |
27+
| --- | --- | --- | --- |
28+
| eventId | string | **Required** Event ID. | |
29+

docs/backups.md

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
# Backups Service
2+
3+
4+
```http request
5+
GET https://cloud.appwrite.io/v1/backups/archives
6+
```
7+
8+
** List all archives for a project. **
9+
10+
### Parameters
11+
12+
| Field Name | Type | Description | Default |
13+
| --- | --- | --- | --- |
14+
| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. | [] |
15+
16+
17+
```http request
18+
POST https://cloud.appwrite.io/v1/backups/archives
19+
```
20+
21+
** Create a new archive asynchronously for a project. **
22+
23+
### Parameters
24+
25+
| Field Name | Type | Description | Default |
26+
| --- | --- | --- | --- |
27+
| services | array | Array of services to backup | |
28+
| resourceId | string | Resource ID. When set, only this single resource will be backed up. | |
29+
30+
31+
```http request
32+
GET https://cloud.appwrite.io/v1/backups/archives/{archiveId}
33+
```
34+
35+
** Get a backup archive using it's ID. **
36+
37+
### Parameters
38+
39+
| Field Name | Type | Description | Default |
40+
| --- | --- | --- | --- |
41+
| archiveId | string | **Required** Archive ID. Choose a custom ID`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | |
42+
43+
44+
```http request
45+
DELETE https://cloud.appwrite.io/v1/backups/archives/{archiveId}
46+
```
47+
48+
** Delete an existing archive for a project. **
49+
50+
### Parameters
51+
52+
| Field Name | Type | Description | Default |
53+
| --- | --- | --- | --- |
54+
| archiveId | string | **Required** Policy ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | |
55+
56+
57+
```http request
58+
GET https://cloud.appwrite.io/v1/backups/policies
59+
```
60+
61+
** List all policies for a project. **
62+
63+
### Parameters
64+
65+
| Field Name | Type | Description | Default |
66+
| --- | --- | --- | --- |
67+
| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. | [] |
68+
69+
70+
```http request
71+
POST https://cloud.appwrite.io/v1/backups/policies
72+
```
73+
74+
** Create a new backup policy. **
75+
76+
### Parameters
77+
78+
| Field Name | Type | Description | Default |
79+
| --- | --- | --- | --- |
80+
| policyId | string | Policy ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | |
81+
| name | string | Policy name. Max length: 128 chars. | |
82+
| services | array | Array of services to backup | |
83+
| resourceId | string | Resource ID. When set, only this single resource will be backed up. | |
84+
| enabled | boolean | Is policy enabled? When set to 'disabled', no backups will be taken | 1 |
85+
| retention | integer | Days to keep backups before deletion | |
86+
| schedule | string | Schedule CRON syntax. | |
87+
88+
89+
```http request
90+
GET https://cloud.appwrite.io/v1/backups/policies/{policyId}
91+
```
92+
93+
** Get a backup policy using it's ID. **
94+
95+
### Parameters
96+
97+
| Field Name | Type | Description | Default |
98+
| --- | --- | --- | --- |
99+
| policyId | string | **Required** Policy ID. Choose a custom ID`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | |
100+
101+
102+
```http request
103+
PATCH https://cloud.appwrite.io/v1/backups/policies/{policyId}
104+
```
105+
106+
** Update an existing policy using it's ID. **
107+
108+
### Parameters
109+
110+
| Field Name | Type | Description | Default |
111+
| --- | --- | --- | --- |
112+
| policyId | string | **Required** Policy ID. Choose a custom ID`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | |
113+
| name | string | Policy name. Max length: 128 chars. | |
114+
| retention | integer | Days to keep backups before deletion | |
115+
| schedule | string | Cron expression | |
116+
| enabled | boolean | Is Backup enabled? When set to 'disabled', No backup will be taken | |
117+
118+
119+
```http request
120+
DELETE https://cloud.appwrite.io/v1/backups/policies/{policyId}
121+
```
122+
123+
** Delete a policy using it's ID. **
124+
125+
### Parameters
126+
127+
| Field Name | Type | Description | Default |
128+
| --- | --- | --- | --- |
129+
| policyId | string | **Required** Policy ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | |
130+
131+
132+
```http request
133+
POST https://cloud.appwrite.io/v1/backups/restoration
134+
```
135+
136+
** Create and trigger a new restoration for a backup on a project. **
137+
138+
### Parameters
139+
140+
| Field Name | Type | Description | Default |
141+
| --- | --- | --- | --- |
142+
| archiveId | string | Backup archive ID to restore | |
143+
| services | array | Array of services to restore | |
144+
| newResourceId | string | Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | |
145+
| newResourceName | string | Database name. Max length: 128 chars. | |
146+
147+
148+
```http request
149+
GET https://cloud.appwrite.io/v1/backups/restorations
150+
```
151+
152+
** List all backup restorations for a project. **
153+
154+
### Parameters
155+
156+
| Field Name | Type | Description | Default |
157+
| --- | --- | --- | --- |
158+
| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. | [] |
159+
160+
161+
```http request
162+
GET https://cloud.appwrite.io/v1/backups/restorations/{restorationId}
163+
```
164+
165+
** Get the current status of a backup restoration. **
166+
167+
### Parameters
168+
169+
| Field Name | Type | Description | Default |
170+
| --- | --- | --- | --- |
171+
| restorationId | string | **Required** Restoration ID. Choose a custom ID`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | |
172+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
```php
2+
<?php
3+
4+
use Appwrite\Client;
5+
use Appwrite\Services\Activities;
6+
7+
$client = (new Client())
8+
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
9+
->setProject('<YOUR_PROJECT_ID>') // Your project ID
10+
->setKey('<YOUR_API_KEY>'); // Your secret API key
11+
12+
$activities = new Activities($client);
13+
14+
$result = $activities->getEvent(
15+
eventId: '<EVENT_ID>'
16+
);```
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
```php
2+
<?php
3+
4+
use Appwrite\Client;
5+
use Appwrite\Services\Activities;
6+
7+
$client = (new Client())
8+
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
9+
->setProject('<YOUR_PROJECT_ID>') // Your project ID
10+
->setKey('<YOUR_API_KEY>'); // Your secret API key
11+
12+
$activities = new Activities($client);
13+
14+
$result = $activities->listEvents(
15+
queries: '' // optional
16+
);```
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
```php
2+
<?php
3+
4+
use Appwrite\Client;
5+
use Appwrite\Services\Backups;
6+
use Appwrite\Enums\BackupServices;
7+
8+
$client = (new Client())
9+
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
10+
->setProject('<YOUR_PROJECT_ID>') // Your project ID
11+
->setKey('<YOUR_API_KEY>'); // Your secret API key
12+
13+
$backups = new Backups($client);
14+
15+
$result = $backups->createArchive(
16+
services: [BackupServices::DATABASES()],
17+
resourceId: '<RESOURCE_ID>' // optional
18+
);```
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
```php
2+
<?php
3+
4+
use Appwrite\Client;
5+
use Appwrite\Services\Backups;
6+
use Appwrite\Enums\BackupServices;
7+
8+
$client = (new Client())
9+
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
10+
->setProject('<YOUR_PROJECT_ID>') // Your project ID
11+
->setKey('<YOUR_API_KEY>'); // Your secret API key
12+
13+
$backups = new Backups($client);
14+
15+
$result = $backups->createPolicy(
16+
policyId: '<POLICY_ID>',
17+
services: [BackupServices::DATABASES()],
18+
retention: 1,
19+
schedule: '',
20+
name: '<NAME>', // optional
21+
resourceId: '<RESOURCE_ID>', // optional
22+
enabled: false // optional
23+
);```
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
```php
2+
<?php
3+
4+
use Appwrite\Client;
5+
use Appwrite\Services\Backups;
6+
use Appwrite\Enums\BackupServices;
7+
8+
$client = (new Client())
9+
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
10+
->setProject('<YOUR_PROJECT_ID>') // Your project ID
11+
->setKey('<YOUR_API_KEY>'); // Your secret API key
12+
13+
$backups = new Backups($client);
14+
15+
$result = $backups->createRestoration(
16+
archiveId: '<ARCHIVE_ID>',
17+
services: [BackupServices::DATABASES()],
18+
newResourceId: '<NEW_RESOURCE_ID>', // optional
19+
newResourceName: '<NEW_RESOURCE_NAME>' // optional
20+
);```
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
```php
2+
<?php
3+
4+
use Appwrite\Client;
5+
use Appwrite\Services\Backups;
6+
7+
$client = (new Client())
8+
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
9+
->setProject('<YOUR_PROJECT_ID>') // Your project ID
10+
->setKey('<YOUR_API_KEY>'); // Your secret API key
11+
12+
$backups = new Backups($client);
13+
14+
$result = $backups->deleteArchive(
15+
archiveId: '<ARCHIVE_ID>'
16+
);```

0 commit comments

Comments
 (0)