Skip to content

Commit 5bfd947

Browse files
committed
fix createMembership
1 parent fb184c2 commit 5bfd947

401 files changed

Lines changed: 802 additions & 19 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

appwrite/encoders/value_class_encoder.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
from ..enums.adapter import Adapter
2828
from ..enums.compression import Compression
2929
from ..enums.image_gravity import ImageGravity
30-
from ..enums.roles import Roles
3130
from ..enums.password_hash import PasswordHash
3231
from ..enums.messaging_provider_type import MessagingProviderType
3332
from ..enums.database_type import DatabaseType
@@ -127,9 +126,6 @@ def default(self, o):
127126
if isinstance(o, ImageGravity):
128127
return o.value
129128

130-
if isinstance(o, Roles):
131-
return o.value
132-
133129
if isinstance(o, PasswordHash):
134130
return o.value
135131

appwrite/enums/build_runtime.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class BuildRuntime(Enum):
4040
DART_3_5 = "dart-3.5"
4141
DART_3_8 = "dart-3.8"
4242
DART_3_9 = "dart-3.9"
43+
DART_3_10 = "dart-3.10"
4344
DOTNET_6_0 = "dotnet-6.0"
4445
DOTNET_7_0 = "dotnet-7.0"
4546
DOTNET_8_0 = "dotnet-8.0"
@@ -68,3 +69,4 @@ class BuildRuntime(Enum):
6869
FLUTTER_3_29 = "flutter-3.29"
6970
FLUTTER_3_32 = "flutter-3.32"
7071
FLUTTER_3_35 = "flutter-3.35"
72+
FLUTTER_3_38 = "flutter-3.38"

appwrite/enums/roles.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

appwrite/enums/runtime.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class Runtime(Enum):
4040
DART_3_5 = "dart-3.5"
4141
DART_3_8 = "dart-3.8"
4242
DART_3_9 = "dart-3.9"
43+
DART_3_10 = "dart-3.10"
4344
DOTNET_6_0 = "dotnet-6.0"
4445
DOTNET_7_0 = "dotnet-7.0"
4546
DOTNET_8_0 = "dotnet-8.0"
@@ -68,3 +69,4 @@ class Runtime(Enum):
6869
FLUTTER_3_29 = "flutter-3.29"
6970
FLUTTER_3_32 = "flutter-3.32"
7071
FLUTTER_3_35 = "flutter-3.35"
72+
FLUTTER_3_38 = "flutter-3.38"

appwrite/services/teams.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from typing import List, Dict, Any, Optional
33
from ..exception import AppwriteException
44
from appwrite.utils.deprecated import deprecated
5-
from ..enums.roles import Roles;
65

76
class Teams(Service):
87

@@ -232,7 +231,7 @@ def list_memberships(self, team_id: str, queries: Optional[List[str]] = None, se
232231
return self.client.call('get', api_path, {
233232
}, api_params)
234233

235-
def create_membership(self, team_id: str, roles: List[Roles], email: Optional[str] = None, user_id: Optional[str] = None, phone: Optional[str] = None, url: Optional[str] = None, name: Optional[str] = None) -> Dict[str, Any]:
234+
def create_membership(self, team_id: str, roles: List[str], email: Optional[str] = None, user_id: Optional[str] = None, phone: Optional[str] = None, url: Optional[str] = None, name: Optional[str] = None) -> Dict[str, Any]:
236235
"""
237236
Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.
238237
@@ -247,7 +246,7 @@ def create_membership(self, team_id: str, roles: List[Roles], email: Optional[st
247246
----------
248247
team_id : str
249248
Team ID.
250-
roles : List[Roles]
249+
roles : List[str]
251250
Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
252251
email : Optional[str]
253252
Email of the new team member.
@@ -334,7 +333,7 @@ def get_membership(self, team_id: str, membership_id: str) -> Dict[str, Any]:
334333
return self.client.call('get', api_path, {
335334
}, api_params)
336335

337-
def update_membership(self, team_id: str, membership_id: str, roles: List[Roles]) -> Dict[str, Any]:
336+
def update_membership(self, team_id: str, membership_id: str, roles: List[str]) -> Dict[str, Any]:
338337
"""
339338
Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https://appwrite.io/docs/permissions).
340339
@@ -345,7 +344,7 @@ def update_membership(self, team_id: str, membership_id: str, roles: List[Roles]
345344
Team ID.
346345
membership_id : str
347346
Membership ID.
348-
roles : List[Roles]
347+
roles : List[str]
349348
An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
350349
351350
Returns

docs/examples/account/create-anonymous-session.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```python
12
from appwrite.client import Client
23
from appwrite.services.account import Account
34

@@ -9,3 +10,4 @@ client.set_session('') # The user session to authenticate with
910
account = Account(client)
1011

1112
result = account.create_anonymous_session()
13+
```

docs/examples/account/create-email-password-session.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```python
12
from appwrite.client import Client
23
from appwrite.services.account import Account
34

@@ -12,3 +13,4 @@ result = account.create_email_password_session(
1213
email = 'email@example.com',
1314
password = 'password'
1415
)
16+
```

docs/examples/account/create-email-token.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```python
12
from appwrite.client import Client
23
from appwrite.services.account import Account
34

@@ -13,3 +14,4 @@ result = account.create_email_token(
1314
email = 'email@example.com',
1415
phrase = False # optional
1516
)
17+
```

docs/examples/account/create-email-verification.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```python
12
from appwrite.client import Client
23
from appwrite.services.account import Account
34

@@ -11,3 +12,4 @@ account = Account(client)
1112
result = account.create_email_verification(
1213
url = 'https://example.com'
1314
)
15+
```

docs/examples/account/create-jwt.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```python
12
from appwrite.client import Client
23
from appwrite.services.account import Account
34

@@ -11,3 +12,4 @@ account = Account(client)
1112
result = account.create_jwt(
1213
duration = 0 # optional
1314
)
15+
```

0 commit comments

Comments
 (0)