Skip to content

Commit bcfc08d

Browse files
fix: make oauth config optional in oauth api class
bump version to 0.1.5
1 parent 1b387e3 commit bcfc08d

File tree

8 files changed

+21
-13
lines changed

8 files changed

+21
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The Plane REST API
44
Visit our quick start guide and full API documentation at [developers.plane.so](https://developers.plane.so/api-reference/introduction).
55

66
- API version: 0.0.1
7-
- Package version: 0.1.4
7+
- Package version: 0.1.5
88
- Generator version: 7.13.0
99
- Build package: org.openapitools.codegen.languages.PythonPydanticV1ClientCodegen
1010
For more information, please visit [https://plane.so](https://plane.so)

plane/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
""" # noqa: E501
1616

1717

18-
__version__ = "0.1.4"
18+
__version__ = "0.1.5"
1919

2020
# import apis into sdk package
2121
from plane.api.assets_api import AssetsApi

plane/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
7878
self.default_headers[header_name] = header_value
7979
self.cookie = cookie
8080
# Set default User-Agent.
81-
self.user_agent = 'OpenAPI-Generator/0.1.4/python'
81+
self.user_agent = 'OpenAPI-Generator/0.1.5/python'
8282
self.client_side_validation = configuration.client_side_validation
8383

8484
def __enter__(self):

plane/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ def to_debug_report(self):
412412
"OS: {env}\n"\
413413
"Python Version: {pyversion}\n"\
414414
"Version of the API: 0.0.1\n"\
415-
"SDK Package Version: 0.1.4".\
415+
"SDK Package Version: 0.1.5".\
416416
format(env=sys.platform, pyversion=sys.version)
417417

418418
def get_host_settings(self):

plane/oauth/api.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,28 @@
1414
from plane.exceptions import ApiException
1515
from plane.rest import RESTClientObject
1616

17-
from .models import PlaneOAuthAppInstallation, PlaneOAuthTokenResponse
17+
from .models import OAuthConfig, PlaneOAuthAppInstallation, PlaneOAuthTokenResponse
1818

1919
logger = logging.getLogger(__name__)
2020

2121

2222
class OAuthApi:
2323
"""OAuth API helper class using urllib3."""
24+
client_id: Optional[str] = None
25+
client_secret: Optional[str] = None
26+
redirect_uri: Optional[str] = None
27+
base_url: str = "https://api.plane.so"
2428

2529
def __init__(
2630
self,
27-
client_id: str,
28-
client_secret: str,
29-
redirect_uri: str,
31+
oauth_config: Optional[OAuthConfig] = None,
3032
base_url: str = "https://api.plane.so",
3133
configuration: Optional[Configuration] = None,
3234
):
33-
self.client_id = client_id
34-
self.client_secret = client_secret
35-
self.redirect_uri = redirect_uri
35+
if oauth_config:
36+
self.client_id = oauth_config.client_id
37+
self.client_secret = oauth_config.client_secret
38+
self.redirect_uri = oauth_config.redirect_uri
3639
self.base_url = base_url.rstrip("/")
3740

3841
if configuration is None:

plane/oauth/models.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,8 @@ class PlaneOAuthAppInstallation(BaseModel):
2929
installed_by: str
3030
app_bot: str
3131
webhook: Optional[str] = None
32+
33+
class OAuthConfig(BaseModel):
34+
client_id: str
35+
client_secret: str
36+
redirect_uri: str

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "plane"
3-
version = "0.1.4"
3+
version = "0.1.5"
44
description = "The Plane REST API"
55
authors = ["Plane <[email protected]>"]
66
license = "GNU AGPLv3"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# prerequisite: setuptools
2323
# http://pypi.python.org/pypi/setuptools
2424
NAME = "plane-sdk"
25-
VERSION = "0.1.4"
25+
VERSION = "0.1.5"
2626
PYTHON_REQUIRES = ">=3.7"
2727
REQUIRES = [
2828
"urllib3 >= 1.25.3, < 3.0.0",

0 commit comments

Comments
 (0)