Skip to content

Commit 78148ac

Browse files
SDK regeneration (#1)
Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
1 parent 3fa0cd3 commit 78148ac

30 files changed

+1849
-1
lines changed

.fernignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Specify files that shouldn't be modified by Fern

.github/workflows/ci.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: ci
2+
3+
on: [push]
4+
jobs:
5+
compile:
6+
runs-on: ubuntu-20.04
7+
steps:
8+
- name: Checkout repo
9+
uses: actions/checkout@v3
10+
- name: Set up python
11+
uses: actions/setup-python@v4
12+
with:
13+
python-version: 3.8
14+
- name: Bootstrap poetry
15+
run: |
16+
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
17+
- name: Install dependencies
18+
run: poetry install
19+
- name: Compile
20+
run: poetry run mypy .
21+
test:
22+
runs-on: ubuntu-20.04
23+
steps:
24+
- name: Checkout repo
25+
uses: actions/checkout@v3
26+
- name: Set up python
27+
uses: actions/setup-python@v4
28+
with:
29+
python-version: 3.8
30+
- name: Bootstrap poetry
31+
run: |
32+
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
33+
- name: Install dependencies
34+
run: poetry install
35+
- name: Test
36+
run: poetry run pytest ./tests/custom/

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist/
2+
.mypy_cache/
3+
__pycache__/
4+
poetry.toml

README.md

+60-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,60 @@
1-
# ssoready-python
1+
<!-- Begin Title, generated by Fern -->
2+
# Ssoready Python Library
3+
4+
[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-SDK%20generated%20by%20Fern-brightgreen)](https://github.com/fern-api/fern)
5+
6+
The Ssoready Python Library provides convenient access to the Ssoready API from applications written in Python.
7+
<!-- End Title -->
8+
9+
<!-- Begin Installation, generated by Fern -->
10+
# Installation
11+
12+
```sh
13+
pip install --upgrade ssoready
14+
```
15+
<!-- End Installation -->
16+
17+
<!-- Begin Usage, generated by Fern -->
18+
# Usage
19+
20+
```python
21+
from ssoready.client import SSOReady
22+
23+
client = SSOReady(
24+
api_key="YOUR_API_KEY",
25+
)
26+
```
27+
<!-- End Usage -->
28+
29+
<!-- Begin Async Usage, generated by Fern -->
30+
# Async Client
31+
32+
```python
33+
from ssoready.client import AsyncSSOReady
34+
35+
client = AsyncSSOReady(
36+
api_key="YOUR_API_KEY",
37+
)
38+
```
39+
<!-- End Async Usage -->
40+
41+
<!-- Begin Status, generated by Fern -->
42+
# Beta Status
43+
44+
This SDK is in beta, and there may be breaking changes between versions without a major
45+
version update. Therefore, we recommend pinning the package version to a specific version.
46+
This way, you can install the same version each time without breaking changes.
47+
<!-- End Status -->
48+
49+
<!-- Begin Contributing, generated by Fern -->
50+
# Contributing
51+
52+
While we value open-source contributions to this SDK, this library is generated programmatically.
53+
Additions made directly to this library would have to be moved over to our generation code,
54+
otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
55+
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
56+
an issue first to discuss with us!
57+
58+
On the other hand, contributions to the README are always very welcome!
59+
<!-- End Contributing -->
60+

poetry.lock

+448
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
[tool.poetry]
2+
name = "ssoready"
3+
version = "0.0.0"
4+
description = ""
5+
readme = "README.md"
6+
authors = []
7+
keywords = []
8+
9+
classifiers = [
10+
"Intended Audience :: Developers",
11+
"Programming Language :: Python",
12+
"Programming Language :: Python :: 3",
13+
"Programming Language :: Python :: 3.8",
14+
"Programming Language :: Python :: 3.9",
15+
"Programming Language :: Python :: 3.10",
16+
"Programming Language :: Python :: 3.11",
17+
"Programming Language :: Python :: 3.12",
18+
"Operating System :: OS Independent",
19+
"Operating System :: POSIX",
20+
"Operating System :: MacOS",
21+
"Operating System :: POSIX :: Linux",
22+
"Operating System :: Microsoft :: Windows",
23+
"Topic :: Software Development :: Libraries :: Python Modules",
24+
"Typing :: Typed"
25+
]
26+
packages = [
27+
{ include = "ssoready", from = "src"}
28+
]
29+
30+
[project.urls]
31+
Repository = 'https://github.com/fern-demo/ssoready-python'
32+
33+
[tool.poetry.dependencies]
34+
python = "^3.8"
35+
httpx = ">=0.21.2"
36+
pydantic = ">= 1.9.2"
37+
typing_extensions = ">= 4.0.0"
38+
39+
[tool.poetry.dev-dependencies]
40+
mypy = "1.9.0"
41+
pytest = "^7.4.0"
42+
pytest-asyncio = "^0.23.5"
43+
python-dateutil = "^2.9.0"
44+
45+
[tool.pytest.ini_options]
46+
testpaths = [ "tests" ]
47+
asyncio_mode = "auto"
48+
49+
[tool.mypy]
50+
plugins = ["pydantic.mypy"]
51+
52+
53+
[build-system]
54+
requires = ["poetry-core"]
55+
build-backend = "poetry.core.masonry.api"

src/ssoready/__init__.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
from .types import GetSamlRedirectUrlResponse, GoogleProtobufAny, RedeemSamlAccessCodeResponse, Status
4+
from . import saml
5+
from .environment import SSOReadyEnvironment
6+
from .version import __version__
7+
8+
__all__ = [
9+
"GetSamlRedirectUrlResponse",
10+
"GoogleProtobufAny",
11+
"RedeemSamlAccessCodeResponse",
12+
"SSOReadyEnvironment",
13+
"Status",
14+
"__version__",
15+
"saml",
16+
]

src/ssoready/client.py

+141
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
import os
4+
import typing
5+
6+
import httpx
7+
8+
from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
9+
from .environment import SSOReadyEnvironment
10+
from .saml.client import AsyncSamlClient, SamlClient
11+
12+
13+
class SSOReady:
14+
"""
15+
Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.
16+
17+
Parameters
18+
----------
19+
base_url : typing.Optional[str]
20+
The base url to use for requests from the client.
21+
22+
environment : SSOReadyEnvironment
23+
The environment to use for requests from the client. from .environment import SSOReadyEnvironment
24+
25+
26+
27+
Defaults to SSOReadyEnvironment.DEFAULT
28+
29+
30+
31+
api_key : typing.Optional[typing.Union[str, typing.Callable[[], str]]]
32+
timeout : typing.Optional[float]
33+
The timeout to be used, in seconds, for requests by default the timeout is 60 seconds, unless a custom httpx client is used, in which case a default is not set.
34+
35+
follow_redirects : typing.Optional[bool]
36+
Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.
37+
38+
httpx_client : typing.Optional[httpx.Client]
39+
The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
40+
41+
Examples
42+
--------
43+
from ssoready.client import SSOReady
44+
45+
client = SSOReady(
46+
api_key="YOUR_API_KEY",
47+
)
48+
"""
49+
50+
def __init__(
51+
self,
52+
*,
53+
base_url: typing.Optional[str] = None,
54+
environment: SSOReadyEnvironment = SSOReadyEnvironment.DEFAULT,
55+
api_key: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = os.getenv("SSOREADY_API_KEY"),
56+
timeout: typing.Optional[float] = None,
57+
follow_redirects: typing.Optional[bool] = True,
58+
httpx_client: typing.Optional[httpx.Client] = None
59+
):
60+
_defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
61+
self._client_wrapper = SyncClientWrapper(
62+
base_url=_get_base_url(base_url=base_url, environment=environment),
63+
api_key=api_key,
64+
httpx_client=httpx_client
65+
if httpx_client is not None
66+
else httpx.Client(timeout=_defaulted_timeout, follow_redirects=follow_redirects)
67+
if follow_redirects is not None
68+
else httpx.Client(timeout=_defaulted_timeout),
69+
timeout=_defaulted_timeout,
70+
)
71+
self.saml = SamlClient(client_wrapper=self._client_wrapper)
72+
73+
74+
class AsyncSSOReady:
75+
"""
76+
Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.
77+
78+
Parameters
79+
----------
80+
base_url : typing.Optional[str]
81+
The base url to use for requests from the client.
82+
83+
environment : SSOReadyEnvironment
84+
The environment to use for requests from the client. from .environment import SSOReadyEnvironment
85+
86+
87+
88+
Defaults to SSOReadyEnvironment.DEFAULT
89+
90+
91+
92+
api_key : typing.Optional[typing.Union[str, typing.Callable[[], str]]]
93+
timeout : typing.Optional[float]
94+
The timeout to be used, in seconds, for requests by default the timeout is 60 seconds, unless a custom httpx client is used, in which case a default is not set.
95+
96+
follow_redirects : typing.Optional[bool]
97+
Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.
98+
99+
httpx_client : typing.Optional[httpx.AsyncClient]
100+
The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
101+
102+
Examples
103+
--------
104+
from ssoready.client import AsyncSSOReady
105+
106+
client = AsyncSSOReady(
107+
api_key="YOUR_API_KEY",
108+
)
109+
"""
110+
111+
def __init__(
112+
self,
113+
*,
114+
base_url: typing.Optional[str] = None,
115+
environment: SSOReadyEnvironment = SSOReadyEnvironment.DEFAULT,
116+
api_key: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = os.getenv("SSOREADY_API_KEY"),
117+
timeout: typing.Optional[float] = None,
118+
follow_redirects: typing.Optional[bool] = True,
119+
httpx_client: typing.Optional[httpx.AsyncClient] = None
120+
):
121+
_defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
122+
self._client_wrapper = AsyncClientWrapper(
123+
base_url=_get_base_url(base_url=base_url, environment=environment),
124+
api_key=api_key,
125+
httpx_client=httpx_client
126+
if httpx_client is not None
127+
else httpx.AsyncClient(timeout=_defaulted_timeout, follow_redirects=follow_redirects)
128+
if follow_redirects is not None
129+
else httpx.AsyncClient(timeout=_defaulted_timeout),
130+
timeout=_defaulted_timeout,
131+
)
132+
self.saml = AsyncSamlClient(client_wrapper=self._client_wrapper)
133+
134+
135+
def _get_base_url(*, base_url: typing.Optional[str] = None, environment: SSOReadyEnvironment) -> str:
136+
if base_url is not None:
137+
return base_url
138+
elif environment is not None:
139+
return environment.value
140+
else:
141+
raise Exception("Please pass in either base_url or environment to construct the client")

src/ssoready/core/__init__.py

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
from .api_error import ApiError
4+
from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper
5+
from .datetime_utils import serialize_datetime
6+
from .file import File, convert_file_dict_to_httpx_tuples
7+
from .http_client import AsyncHttpClient, HttpClient
8+
from .jsonable_encoder import jsonable_encoder
9+
from .pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
10+
from .query_encoder import encode_query
11+
from .remove_none_from_dict import remove_none_from_dict
12+
from .request_options import RequestOptions
13+
14+
__all__ = [
15+
"ApiError",
16+
"AsyncClientWrapper",
17+
"AsyncHttpClient",
18+
"BaseClientWrapper",
19+
"File",
20+
"HttpClient",
21+
"RequestOptions",
22+
"SyncClientWrapper",
23+
"convert_file_dict_to_httpx_tuples",
24+
"deep_union_pydantic_dicts",
25+
"encode_query",
26+
"jsonable_encoder",
27+
"pydantic_v1",
28+
"remove_none_from_dict",
29+
"serialize_datetime",
30+
]

src/ssoready/core/api_error.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
import typing
4+
5+
6+
class ApiError(Exception):
7+
status_code: typing.Optional[int]
8+
body: typing.Any
9+
10+
def __init__(self, *, status_code: typing.Optional[int] = None, body: typing.Any = None):
11+
self.status_code = status_code
12+
self.body = body
13+
14+
def __str__(self) -> str:
15+
return f"status_code: {self.status_code}, body: {self.body}"

0 commit comments

Comments
 (0)