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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ query {
phone
email
recoveryCode
custom
}
}
```
2 changes: 1 addition & 1 deletion examples/1.9.x/console-cli/examples/oauth2/create-grant.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
```bash
appwrite oauth2 create-grant \
--user-_code <USER_CODE>
--user-code <USER_CODE>
```
6 changes: 3 additions & 3 deletions examples/1.9.x/console-cli/examples/oauth2/create-par.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
```bash
appwrite oauth2 create-par \
--client-_id <CLIENT_ID> \
--redirect-_uri https://example.com \
--response-_type code
--client-id <CLIENT_ID> \
--redirect-uri https://example.com \
--response-type code
```
2 changes: 1 addition & 1 deletion examples/1.9.x/console-cli/examples/oauth2/create-token.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
```bash
appwrite oauth2 create-token \
--grant-_type <GRANT_TYPE>
--grant-type <GRANT_TYPE>
```
2 changes: 1 addition & 1 deletion examples/1.9.x/console-cli/examples/oauth2/get-grant.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
```bash
appwrite oauth2 get-grant \
--grant-_id <GRANT_ID>
--grant-id <GRANT_ID>
```
2 changes: 1 addition & 1 deletion examples/1.9.x/console-cli/examples/oauth2/reject.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
```bash
appwrite oauth2 reject \
--grant-_id <GRANT_ID>
--grant-id <GRANT_ID>
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```bash
appwrite project update-mfa-factors-policy
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
```bash
appwrite tablesdb cutover-migration \
--database-id <DATABASE_ID> \
--migration-id <MIGRATION_ID>
```
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ result: DedicatedDatabaseRestoration = mongo.create_restoration(
database_id = '<DATABASE_ID>',
type = 'backup', # optional
backup_id = '<BACKUP_ID>', # optional
target_database_id = '<TARGET_DATABASE_ID>', # optional
target_time = '2020-10-15T06:38:00.000+00:00' # optional
)

Expand Down
1 change: 0 additions & 1 deletion examples/1.9.x/console-python/examples/mongo/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ result: DedicatedDatabase = mongo.create(
specification = '<SPECIFICATION>', # optional
replicas = 0, # optional
sync_mode = 'async', # optional
standby_region = '<STANDBY_REGION>', # optional
network_idle_timeout_seconds = 60, # optional
network_ip_allowlist = [], # optional
idle_timeout_minutes = 5, # optional
Expand Down
2 changes: 0 additions & 2 deletions examples/1.9.x/console-python/examples/mongo/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ result: DedicatedDatabase = mongo.update(
specification = '<SPECIFICATION>', # optional
replicas = 0, # optional
sync_mode = 'async', # optional
cross_region_replicas = 0, # optional
standby_region = '<STANDBY_REGION>', # optional
network_idle_timeout_seconds = 60, # optional
network_ip_allowlist = [], # optional
idle_timeout_minutes = 5, # optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ result: DedicatedDatabaseRestoration = mysql.create_restoration(
database_id = '<DATABASE_ID>',
type = 'backup', # optional
backup_id = '<BACKUP_ID>', # optional
target_database_id = '<TARGET_DATABASE_ID>', # optional
target_time = '2020-10-15T06:38:00.000+00:00' # optional
)

Expand Down
1 change: 0 additions & 1 deletion examples/1.9.x/console-python/examples/mysql/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ result: DedicatedDatabase = mysql.create(
specification = '<SPECIFICATION>', # optional
replicas = 0, # optional
sync_mode = 'async', # optional
standby_region = '<STANDBY_REGION>', # optional
network_idle_timeout_seconds = 60, # optional
network_ip_allowlist = [], # optional
idle_timeout_minutes = 5, # optional
Expand Down
2 changes: 0 additions & 2 deletions examples/1.9.x/console-python/examples/mysql/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ result: DedicatedDatabase = mysql.update(
specification = '<SPECIFICATION>', # optional
replicas = 0, # optional
sync_mode = 'async', # optional
cross_region_replicas = 0, # optional
standby_region = '<STANDBY_REGION>', # optional
network_idle_timeout_seconds = 60, # optional
network_ip_allowlist = [], # optional
idle_timeout_minutes = 5, # optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ result: DedicatedDatabaseRestoration = postgresql.create_restoration(
database_id = '<DATABASE_ID>',
type = 'backup', # optional
backup_id = '<BACKUP_ID>', # optional
target_database_id = '<TARGET_DATABASE_ID>', # optional
target_time = '2020-10-15T06:38:00.000+00:00' # optional
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ result: DedicatedDatabase = postgresql.create(
specification = '<SPECIFICATION>', # optional
replicas = 0, # optional
sync_mode = 'async', # optional
standby_region = '<STANDBY_REGION>', # optional
network_idle_timeout_seconds = 60, # optional
network_ip_allowlist = [], # optional
idle_timeout_minutes = 5, # optional
Expand Down
2 changes: 0 additions & 2 deletions examples/1.9.x/console-python/examples/postgresql/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ result: DedicatedDatabase = postgresql.update(
specification = '<SPECIFICATION>', # optional
replicas = 0, # optional
sync_mode = 'async', # optional
cross_region_replicas = 0, # optional
standby_region = '<STANDBY_REGION>', # optional
network_idle_timeout_seconds = 60, # optional
network_ip_allowlist = [], # optional
idle_timeout_minutes = 5, # optional
Expand Down
3 changes: 2 additions & 1 deletion examples/1.9.x/console-python/examples/project/get-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ from appwrite_console.models import PolicySessionInvalidation
from appwrite_console.models import PolicySessionLimit
from appwrite_console.models import PolicyUserLimit
from appwrite_console.models import PolicyMembershipPrivacy
from appwrite_console.models import PolicyMfaFactors
from appwrite_console.models import PolicyDenyAliasedEmail
from appwrite_console.models import PolicyDenyDisposableEmail
from appwrite_console.models import PolicyDenyFreeEmail
Expand All @@ -24,7 +25,7 @@ client.set_project('<YOUR_PROJECT_ID>') # Your project ID

project = Project(client)

result: Union[PolicyPasswordDictionary, PolicyPasswordHistory, PolicyPasswordStrength, PolicyPasswordPersonalData, PolicySessionAlert, PolicySessionDuration, PolicySessionInvalidation, PolicySessionLimit, PolicyUserLimit, PolicyMembershipPrivacy, PolicyDenyAliasedEmail, PolicyDenyDisposableEmail, PolicyDenyFreeEmail, PolicyDenyCorporateEmail] = project.get_policy(
result: Union[PolicyPasswordDictionary, PolicyPasswordHistory, PolicyPasswordStrength, PolicyPasswordPersonalData, PolicySessionAlert, PolicySessionDuration, PolicySessionInvalidation, PolicySessionLimit, PolicyUserLimit, PolicyMembershipPrivacy, PolicyMfaFactors, PolicyDenyAliasedEmail, PolicyDenyDisposableEmail, PolicyDenyFreeEmail, PolicyDenyCorporateEmail] = project.get_policy(
policy_id = ProjectPolicyId.PASSWORD_DICTIONARY
)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
```python
from appwrite_console.client import Client
from appwrite_console.services.project import Project
from appwrite_console.models import Project as ProjectModel

client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID

project = Project(client)

result: ProjectModel = project.update_mfa_factors_policy(
totp = False, # optional
email = False, # optional
phone = False, # optional
custom = False # optional
)

print(result.model_dump())
```
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ result: ProjectModel = project.update_o_auth2_server(
user_code_length = 6, # optional
user_code_format = 'numeric', # optional
device_code_duration = 60, # optional
default_scopes = [] # optional
default_scopes = [], # optional
installation_scopes = [] # optional
)

print(result.model_dump())
Expand Down
4 changes: 3 additions & 1 deletion examples/1.9.x/console-python/examples/sites/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ from appwrite_console.models import Site
from appwrite_console.enums import Framework
from appwrite_console.enums import BuildRuntime
from appwrite_console.enums import Adapter
from appwrite_console.enums import ProjectKeyScopes

client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
Expand Down Expand Up @@ -35,7 +36,8 @@ result: Site = sites.create(
provider_paths = [], # optional
build_specification = '', # optional
runtime_specification = '', # optional
deployment_retention = 0 # optional
deployment_retention = 0, # optional
scopes = [ProjectKeyScopes.PROJECT_READ] # optional
)

print(result.model_dump())
Expand Down
4 changes: 3 additions & 1 deletion examples/1.9.x/console-python/examples/sites/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ from appwrite_console.models import Site
from appwrite_console.enums import Framework
from appwrite_console.enums import BuildRuntime
from appwrite_console.enums import Adapter
from appwrite_console.enums import ProjectKeyScopes

client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
Expand Down Expand Up @@ -35,7 +36,8 @@ result: Site = sites.update(
provider_paths = [], # optional
build_specification = '', # optional
runtime_specification = '', # optional
deployment_retention = 0 # optional
deployment_retention = 0, # optional
scopes = [ProjectKeyScopes.PROJECT_READ] # optional
)

print(result.model_dump())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ tables_db = TablesDB(client)

result: DatabaseMigration = tables_db.create_migration(
database_id = '<DATABASE_ID>',
specification = 's-1vcpu-1gb'
specification = 's-1vcpu-1gb',
auto_cutover = False # optional
)

print(result.model_dump())
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```python
from appwrite_console.client import Client
from appwrite_console.services.tables_db import TablesDB
from appwrite_console.models import DatabaseMigration

client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID

tables_db = TablesDB(client)

result: DatabaseMigration = tables_db.cutover_migration(
database_id = '<DATABASE_ID>',
migration_id = '<MIGRATION_ID>'
)

print(result.model_dump())
```
3 changes: 2 additions & 1 deletion examples/1.9.x/console-python/examples/usage/list-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from appwrite_console.client import Client
from appwrite_console.services.usage import Usage
from appwrite_console.models import UsageEventList
from appwrite_console.enums import UsageEventMetric
from appwrite_console.enums import UsageInterval
from appwrite_console.enums import UsageEventDimension
from appwrite_console.enums import UsageOrderBy
Expand All @@ -14,7 +15,7 @@ client.set_project('<YOUR_PROJECT_ID>') # Your project ID
usage = Usage(client)

result: UsageEventList = usage.list_events(
metrics = [],
metrics = [UsageEventMetric.NETWORK_REQUESTS],
queries = [], # optional
interval = UsageInterval.ONE_MINUTE, # optional
dimensions = [UsageEventDimension.PATH], # optional
Expand Down
6 changes: 4 additions & 2 deletions examples/1.9.x/console-python/examples/usage/list-gauges.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from appwrite_console.client import Client
from appwrite_console.services.usage import Usage
from appwrite_console.models import UsageGaugeList
from appwrite_console.enums import UsageGaugeMetric
from appwrite_console.enums import UsageInterval
from appwrite_console.enums import UsageGaugeDimension
from appwrite_console.enums import UsageOrderBy
Expand All @@ -14,7 +15,7 @@ client.set_project('<YOUR_PROJECT_ID>') # Your project ID
usage = Usage(client)

result: UsageGaugeList = usage.list_gauges(
metrics = [],
metrics = [UsageGaugeMetric.TEAMS],
queries = [], # optional
interval = UsageInterval.ONE_MINUTE, # optional
dimensions = [UsageGaugeDimension.RESOURCEID], # optional
Expand All @@ -23,7 +24,8 @@ result: UsageGaugeList = usage.list_gauges(
order_by = UsageOrderBy.TIME, # optional
order_dir = UsageOrderDirection.ASC, # optional
limit = 1, # optional
offset = 0 # optional
offset = 0, # optional
aggregate = 'last' # optional
)

print(result.model_dump())
Expand Down
18 changes: 18 additions & 0 deletions examples/1.9.x/console-python/examples/users/get-mfa-challenge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```python
from appwrite_console.client import Client
from appwrite_console.services.users import Users
from appwrite_console.models import MfaChallengeSecret

client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('<YOUR_PROJECT_ID>') # Your project ID

users = Users(client)

result: MfaChallengeSecret = users.get_mfa_challenge(
user_id = '<USER_ID>',
challenge_id = '<CHALLENGE_ID>'
)

print(result.model_dump())
```
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ result: WafRuleRateLimit = waf.create_rate_limit_rule(
resource_id = '<RESOURCE_ID>', # optional
description = '<DESCRIPTION>', # optional
key = 'ip', # optional
strategy = 'fixedWindow', # optional
max_bucket_size = 1, # optional
priority = -100000, # optional
enabled = False, # optional
conditions = '' # optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ result: WafRuleRateLimit = waf.update_rate_limit_rule(
limit = 1, # optional
interval = 1, # optional
key = 'ip', # optional
max_bucket_size = 1, # optional
priority = -100000, # optional
enabled = False, # optional
conditions = '' # optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const result = await mongo.createRestoration({
databaseId: '<DATABASE_ID>',
type: 'backup', // optional
backupId: '<BACKUP_ID>', // optional
targetDatabaseId: '<TARGET_DATABASE_ID>', // optional
targetTime: '2020-10-15T06:38:00.000+00:00' // optional
});

Expand Down
1 change: 0 additions & 1 deletion examples/1.9.x/console-web/examples/mongo/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const result = await mongo.create({
specification: '<SPECIFICATION>', // optional
replicas: 0, // optional
syncMode: 'async', // optional
standbyRegion: '<STANDBY_REGION>', // optional
networkIdleTimeoutSeconds: 60, // optional
networkIPAllowlist: [], // optional
idleTimeoutMinutes: 5, // optional
Expand Down
2 changes: 0 additions & 2 deletions examples/1.9.x/console-web/examples/mongo/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ const result = await mongo.update({
specification: '<SPECIFICATION>', // optional
replicas: 0, // optional
syncMode: 'async', // optional
crossRegionReplicas: 0, // optional
standbyRegion: '<STANDBY_REGION>', // optional
networkIdleTimeoutSeconds: 60, // optional
networkIPAllowlist: [], // optional
idleTimeoutMinutes: 5, // optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const result = await mysql.createRestoration({
databaseId: '<DATABASE_ID>',
type: 'backup', // optional
backupId: '<BACKUP_ID>', // optional
targetDatabaseId: '<TARGET_DATABASE_ID>', // optional
targetTime: '2020-10-15T06:38:00.000+00:00' // optional
});

Expand Down
1 change: 0 additions & 1 deletion examples/1.9.x/console-web/examples/mysql/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const result = await mysql.create({
specification: '<SPECIFICATION>', // optional
replicas: 0, // optional
syncMode: 'async', // optional
standbyRegion: '<STANDBY_REGION>', // optional
networkIdleTimeoutSeconds: 60, // optional
networkIPAllowlist: [], // optional
idleTimeoutMinutes: 5, // optional
Expand Down
2 changes: 0 additions & 2 deletions examples/1.9.x/console-web/examples/mysql/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ const result = await mysql.update({
specification: '<SPECIFICATION>', // optional
replicas: 0, // optional
syncMode: 'async', // optional
crossRegionReplicas: 0, // optional
standbyRegion: '<STANDBY_REGION>', // optional
networkIdleTimeoutSeconds: 60, // optional
networkIPAllowlist: [], // optional
idleTimeoutMinutes: 5, // optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const result = await postgresql.createRestoration({
databaseId: '<DATABASE_ID>',
type: 'backup', // optional
backupId: '<BACKUP_ID>', // optional
targetDatabaseId: '<TARGET_DATABASE_ID>', // optional
targetTime: '2020-10-15T06:38:00.000+00:00' // optional
});

Expand Down
1 change: 0 additions & 1 deletion examples/1.9.x/console-web/examples/postgresql/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const result = await postgresql.create({
specification: '<SPECIFICATION>', // optional
replicas: 0, // optional
syncMode: 'async', // optional
standbyRegion: '<STANDBY_REGION>', // optional
networkIdleTimeoutSeconds: 60, // optional
networkIPAllowlist: [], // optional
idleTimeoutMinutes: 5, // optional
Expand Down
2 changes: 0 additions & 2 deletions examples/1.9.x/console-web/examples/postgresql/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ const result = await postgresql.update({
specification: '<SPECIFICATION>', // optional
replicas: 0, // optional
syncMode: 'async', // optional
crossRegionReplicas: 0, // optional
standbyRegion: '<STANDBY_REGION>', // optional
networkIdleTimeoutSeconds: 60, // optional
networkIPAllowlist: [], // optional
idleTimeoutMinutes: 5, // optional
Expand Down
Loading