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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## 28.0.0

* Breaking: `email_enabled` moved after the new provider params in positional `functions.update` calls
* Added: `provider_comments`, `provider_deployments` and `provider_statuses` on function and site create and update, and on `Function` and `Site`
* Added: `teams.get_photo`, `teams.update_photo` and `teams.delete_photo`
* Added: `project` OAuth2 settings for Atlassian, Instagram, LINE, Linear, Netlify, Patreon, Railway, Reddit, Roblox, Strava, Vercel, VK and WorkOS

## 27.3.0

* Added: `account.create_ldap_session` for LDAP sign-in
Expand Down
4 changes: 2 additions & 2 deletions appwrite/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ def __init__(self):
self._endpoint = 'https://cloud.appwrite.io/v1'
self._global_headers = {
'content-type': '',
'user-agent': f'AppwritePythonSDK/27.3.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})',
'user-agent': f'AppwritePythonSDK/28.0.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})',
'x-sdk-name': 'Python',
'x-sdk-platform': 'server',
'x-sdk-language': 'python',
'x-sdk-version': '27.3.0',
'x-sdk-version': '28.0.0',
'X-Appwrite-Response-Format': '2.7.2',
}
self._config = {}
Expand Down
13 changes: 13 additions & 0 deletions appwrite/enums/o_auth_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class OAuthProvider(Enum):
AMAZON = "amazon"
APPLE = "apple"
APPWRITE = "appwrite"
ATLASSIAN = "atlassian"
AUTH0 = "auth0"
AUTHENTIK = "authentik"
AUTODESK = "autodesk"
Expand All @@ -24,31 +25,43 @@ class OAuthProvider(Enum):
GITLAB = "gitlab"
GOOGLE = "google"
HUGGINGFACE = "huggingface"
INSTAGRAM = "instagram"
KAKAO = "kakao"
KEYCLOAK = "keycloak"
KICK = "kick"
LINE = "line"
LINEAR = "linear"
LINKEDIN = "linkedin"
MICROSOFT = "microsoft"
NAVER = "naver"
NETLIFY = "netlify"
NOTION = "notion"
OIDC = "oidc"
OKTA = "okta"
PATREON = "patreon"
PAYPAL = "paypal"
PAYPALSANDBOX = "paypalSandbox"
PODIO = "podio"
RAILWAY = "railway"
REDDIT = "reddit"
RESEND = "resend"
ROBLOX = "roblox"
SALESFORCE = "salesforce"
SLACK = "slack"
SPOTIFY = "spotify"
STRAVA = "strava"
STRIPE = "stripe"
TIKTOK = "tiktok"
TRADESHIFT = "tradeshift"
TRADESHIFTBOX = "tradeshiftBox"
TWITCH = "twitch"
VERCEL = "vercel"
VIPPS = "vipps"
VIPPSSANDBOX = "vippsSandbox"
VK = "vk"
WEBFLOW = "webflow"
WORDPRESS = "wordpress"
WORKOS = "workos"
X = "x"
YAHOO = "yahoo"
YAMMER = "yammer"
Expand Down
13 changes: 13 additions & 0 deletions appwrite/enums/project_o_auth_provider_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class ProjectOAuthProviderId(Enum):
AMAZON = "amazon"
APPLE = "apple"
APPWRITE = "appwrite"
ATLASSIAN = "atlassian"
AUTH0 = "auth0"
AUTHENTIK = "authentik"
AUTODESK = "autodesk"
Expand All @@ -24,31 +25,43 @@ class ProjectOAuthProviderId(Enum):
GITLAB = "gitlab"
GOOGLE = "google"
HUGGINGFACE = "huggingface"
INSTAGRAM = "instagram"
KAKAO = "kakao"
KEYCLOAK = "keycloak"
KICK = "kick"
LINE = "line"
LINEAR = "linear"
LINKEDIN = "linkedin"
MICROSOFT = "microsoft"
NAVER = "naver"
NETLIFY = "netlify"
NOTION = "notion"
OIDC = "oidc"
OKTA = "okta"
PATREON = "patreon"
PAYPAL = "paypal"
PAYPALSANDBOX = "paypalSandbox"
PODIO = "podio"
RAILWAY = "railway"
REDDIT = "reddit"
RESEND = "resend"
ROBLOX = "roblox"
SALESFORCE = "salesforce"
SLACK = "slack"
SPOTIFY = "spotify"
STRAVA = "strava"
STRIPE = "stripe"
TIKTOK = "tiktok"
TRADESHIFT = "tradeshift"
TRADESHIFTBOX = "tradeshiftBox"
TWITCH = "twitch"
VERCEL = "vercel"
VIPPS = "vipps"
VIPPSSANDBOX = "vippsSandbox"
VK = "vk"
WEBFLOW = "webflow"
WORDPRESS = "wordpress"
WORKOS = "workos"
X = "x"
YAHOO = "yahoo"
YAMMER = "yammer"
Expand Down
26 changes: 26 additions & 0 deletions appwrite/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,19 @@
from .o_auth2_yahoo import OAuth2Yahoo
from .o_auth2_cloudflare import OAuth2Cloudflare
from .o_auth2_hugging_face import OAuth2HuggingFace
from .o_auth2_instagram import OAuth2Instagram
from .o_auth2_patreon import OAuth2Patreon
from .o_auth2_strava import OAuth2Strava
from .o_auth2_vk import OAuth2VK
from .o_auth2_netlify import OAuth2Netlify
from .o_auth2_railway import OAuth2Railway
from .o_auth2_reddit import OAuth2Reddit
from .o_auth2_vercel import OAuth2Vercel
from .o_auth2_atlassian import OAuth2Atlassian
from .o_auth2_line import OAuth2Line
from .o_auth2_linear import OAuth2Linear
from .o_auth2_roblox import OAuth2Roblox
from .o_auth2_work_os import OAuth2WorkOS
from .o_auth2_linkedin import OAuth2Linkedin
from .o_auth2_disqus import OAuth2Disqus
from .o_auth2_amazon import OAuth2Amazon
Expand Down Expand Up @@ -493,6 +506,19 @@
'OAuth2Yahoo',
'OAuth2Cloudflare',
'OAuth2HuggingFace',
'OAuth2Instagram',
'OAuth2Patreon',
'OAuth2Strava',
'OAuth2VK',
'OAuth2Netlify',
'OAuth2Railway',
'OAuth2Reddit',
'OAuth2Vercel',
'OAuth2Atlassian',
'OAuth2Line',
'OAuth2Linear',
'OAuth2Roblox',
'OAuth2WorkOS',
'OAuth2Linkedin',
'OAuth2Disqus',
'OAuth2Amazon',
Expand Down
15 changes: 15 additions & 0 deletions appwrite/models/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ class Function(AppwriteModel):
Path to function in VCS (Version Control System) repository
providersilentmode : bool
Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests
providercomments : bool
Whether a build summary is posted on pull requests. Commit statuses are still reported when disabled.
providerdeployments : bool
Whether pushes that match the branch and path rules are deployed automatically.
providerstatuses : bool
Whether the build status is reported on each commit.
providerbranches : List[Any]
List of branch name patterns that trigger automatic deployments. Supports glob wildcards. Empty list deploys on all branches.
providerpaths : List[Any]
Expand Down Expand Up @@ -113,6 +119,9 @@ class Function(AppwriteModel):
providerbranch: str = Field(..., alias='providerBranch')
providerrootdirectory: str = Field(..., alias='providerRootDirectory')
providersilentmode: bool = Field(..., alias='providerSilentMode')
providercomments: bool = Field(..., alias='providerComments')
providerdeployments: bool = Field(..., alias='providerDeployments')
providerstatuses: bool = Field(..., alias='providerStatuses')
providerbranches: List[Any] = Field(..., alias='providerBranches')
providerpaths: List[Any] = Field(..., alias='providerPaths')
buildspecification: str = Field(..., alias='buildSpecification')
Expand Down Expand Up @@ -184,6 +193,12 @@ def _apply_defaults(cls, data: Any) -> Any:
data['providerRootDirectory'] = ''
if 'providerSilentMode' not in data and 'providersilentmode' not in data:
data['providerSilentMode'] = False
if 'providerComments' not in data and 'providercomments' not in data:
data['providerComments'] = True
if 'providerDeployments' not in data and 'providerdeployments' not in data:
data['providerDeployments'] = True
if 'providerStatuses' not in data and 'providerstatuses' not in data:
data['providerStatuses'] = True
if 'providerBranches' not in data and 'providerbranches' not in data:
data['providerBranches'] = []
if 'providerPaths' not in data and 'providerpaths' not in data:
Expand Down
43 changes: 43 additions & 0 deletions appwrite/models/o_auth2_atlassian.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
from typing import Any, Dict, List, Optional, Union, cast
from pydantic import Field, PrivateAttr, model_validator

from .base_model import AppwriteModel


class OAuth2Atlassian(AppwriteModel):
"""
OAuth2Atlassian

Attributes
----------
id : str
OAuth2 provider ID.
enabled : bool
OAuth2 provider is active and can be used to create sessions.
clientid : str
Atlassian OAuth2 client ID.
clientsecret : str
Atlassian OAuth2 client secret.
"""

id: str = Field(..., alias='$id')
enabled: bool = Field(..., alias='enabled')
clientid: str = Field(..., alias='clientId')
clientsecret: str = Field(..., alias='clientSecret', json_schema_extra={'format': 'password'})

@model_validator(mode='before')
@classmethod
def _apply_defaults(cls, data: Any) -> Any:
if not isinstance(data, dict):
return data

data = dict(data)
if '$id' not in data and 'id' not in data:
data['$id'] = ''
if 'enabled' not in data:
data['enabled'] = False
if 'clientId' not in data and 'clientid' not in data:
data['clientId'] = ''
if 'clientSecret' not in data and 'clientsecret' not in data:
data['clientSecret'] = ''
return data
43 changes: 43 additions & 0 deletions appwrite/models/o_auth2_instagram.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
from typing import Any, Dict, List, Optional, Union, cast
from pydantic import Field, PrivateAttr, model_validator

from .base_model import AppwriteModel


class OAuth2Instagram(AppwriteModel):
"""
OAuth2Instagram

Attributes
----------
id : str
OAuth2 provider ID.
enabled : bool
OAuth2 provider is active and can be used to create sessions.
clientid : str
Instagram OAuth2 client ID.
clientsecret : str
Instagram OAuth2 client secret.
"""

id: str = Field(..., alias='$id')
enabled: bool = Field(..., alias='enabled')
clientid: str = Field(..., alias='clientId')
clientsecret: str = Field(..., alias='clientSecret', json_schema_extra={'format': 'password'})

@model_validator(mode='before')
@classmethod
def _apply_defaults(cls, data: Any) -> Any:
if not isinstance(data, dict):
return data

data = dict(data)
if '$id' not in data and 'id' not in data:
data['$id'] = ''
if 'enabled' not in data:
data['enabled'] = False
if 'clientId' not in data and 'clientid' not in data:
data['clientId'] = ''
if 'clientSecret' not in data and 'clientsecret' not in data:
data['clientSecret'] = ''
return data
43 changes: 43 additions & 0 deletions appwrite/models/o_auth2_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
from typing import Any, Dict, List, Optional, Union, cast
from pydantic import Field, PrivateAttr, model_validator

from .base_model import AppwriteModel


class OAuth2Line(AppwriteModel):
"""
OAuth2Line

Attributes
----------
id : str
OAuth2 provider ID.
enabled : bool
OAuth2 provider is active and can be used to create sessions.
clientid : str
LINE OAuth2 client ID.
clientsecret : str
LINE OAuth2 client secret.
"""

id: str = Field(..., alias='$id')
enabled: bool = Field(..., alias='enabled')
clientid: str = Field(..., alias='clientId')
clientsecret: str = Field(..., alias='clientSecret', json_schema_extra={'format': 'password'})

@model_validator(mode='before')
@classmethod
def _apply_defaults(cls, data: Any) -> Any:
if not isinstance(data, dict):
return data

data = dict(data)
if '$id' not in data and 'id' not in data:
data['$id'] = ''
if 'enabled' not in data:
data['enabled'] = False
if 'clientId' not in data and 'clientid' not in data:
data['clientId'] = ''
if 'clientSecret' not in data and 'clientsecret' not in data:
data['clientSecret'] = ''
return data
43 changes: 43 additions & 0 deletions appwrite/models/o_auth2_linear.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
from typing import Any, Dict, List, Optional, Union, cast
from pydantic import Field, PrivateAttr, model_validator

from .base_model import AppwriteModel


class OAuth2Linear(AppwriteModel):
"""
OAuth2Linear

Attributes
----------
id : str
OAuth2 provider ID.
enabled : bool
OAuth2 provider is active and can be used to create sessions.
clientid : str
Linear OAuth2 client ID.
clientsecret : str
Linear OAuth2 client secret.
"""

id: str = Field(..., alias='$id')
enabled: bool = Field(..., alias='enabled')
clientid: str = Field(..., alias='clientId')
clientsecret: str = Field(..., alias='clientSecret', json_schema_extra={'format': 'password'})

@model_validator(mode='before')
@classmethod
def _apply_defaults(cls, data: Any) -> Any:
if not isinstance(data, dict):
return data

data = dict(data)
if '$id' not in data and 'id' not in data:
data['$id'] = ''
if 'enabled' not in data:
data['enabled'] = False
if 'clientId' not in data and 'clientid' not in data:
data['clientId'] = ''
if 'clientSecret' not in data and 'clientsecret' not in data:
data['clientSecret'] = ''
return data
Loading
Loading