Skip to content

Commit b25690e

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

32 files changed

+2991
-11
lines changed

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 = "ssoready"
3-
version = "1.0.1"
3+
version = "1.1.0"
44
description = ""
55
readme = "README.md"
66
authors = []

src/ssoready/__init__.py

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,69 @@
11
# This file was auto-generated by Fern from our API Definition.
22

33
from .types import (
4+
CreateOrganizationResponse,
5+
CreateSamlConnectionResponse,
6+
CreateScimDirectoryResponse,
7+
CreateSetupUrlResponse,
8+
GetOrganizationResponse,
9+
GetSamlConnectionResponse,
410
GetSamlRedirectUrlResponse,
11+
GetScimDirectoryResponse,
512
GetScimGroupResponse,
613
GetScimUserResponse,
714
GoogleProtobufAny,
15+
ListOrganizationsResponse,
16+
ListSamlConnectionsResponse,
17+
ListScimDirectoriesResponse,
818
ListScimGroupsResponse,
919
ListScimUsersResponse,
20+
Organization,
1021
RedeemSamlAccessCodeResponse,
22+
RotateScimDirectoryBearerTokenResponse,
23+
SamlConnection,
24+
ScimDirectory,
1125
ScimGroup,
1226
ScimUser,
1327
Status,
28+
UpdateOrganizationResponse,
29+
UpdateSamlConnectionResponse,
30+
UpdateScimDirectoryResponse,
1431
)
15-
from . import saml, scim
32+
from . import management, saml, scim
1633
from .environment import SSOReadyEnvironment
1734
from .version import __version__
1835

1936
__all__ = [
37+
"CreateOrganizationResponse",
38+
"CreateSamlConnectionResponse",
39+
"CreateScimDirectoryResponse",
40+
"CreateSetupUrlResponse",
41+
"GetOrganizationResponse",
42+
"GetSamlConnectionResponse",
2043
"GetSamlRedirectUrlResponse",
44+
"GetScimDirectoryResponse",
2145
"GetScimGroupResponse",
2246
"GetScimUserResponse",
2347
"GoogleProtobufAny",
48+
"ListOrganizationsResponse",
49+
"ListSamlConnectionsResponse",
50+
"ListScimDirectoriesResponse",
2451
"ListScimGroupsResponse",
2552
"ListScimUsersResponse",
53+
"Organization",
2654
"RedeemSamlAccessCodeResponse",
55+
"RotateScimDirectoryBearerTokenResponse",
2756
"SSOReadyEnvironment",
57+
"SamlConnection",
58+
"ScimDirectory",
2859
"ScimGroup",
2960
"ScimUser",
3061
"Status",
62+
"UpdateOrganizationResponse",
63+
"UpdateSamlConnectionResponse",
64+
"UpdateScimDirectoryResponse",
3165
"__version__",
66+
"management",
3267
"saml",
3368
"scim",
3469
]

src/ssoready/client.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55

66
import httpx
77

8+
from .core.api_error import ApiError
89
from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
910
from .environment import SSOReadyEnvironment
11+
from .management.client import AsyncManagementClient, ManagementClient
1012
from .saml.client import AsyncSamlClient, SamlClient
1113
from .scim.client import AsyncScimClient, ScimClient
1214

@@ -59,6 +61,10 @@ def __init__(
5961
httpx_client: typing.Optional[httpx.Client] = None
6062
):
6163
_defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
64+
if api_key is None:
65+
raise ApiError(
66+
body="The client must be instantiated be either passing in api_key or setting SSOREADY_API_KEY"
67+
)
6268
self._client_wrapper = SyncClientWrapper(
6369
base_url=_get_base_url(base_url=base_url, environment=environment),
6470
api_key=api_key,
@@ -69,6 +75,7 @@ def __init__(
6975
else httpx.Client(timeout=_defaulted_timeout),
7076
timeout=_defaulted_timeout,
7177
)
78+
self.management = ManagementClient(client_wrapper=self._client_wrapper)
7279
self.saml = SamlClient(client_wrapper=self._client_wrapper)
7380
self.scim = ScimClient(client_wrapper=self._client_wrapper)
7481

@@ -121,6 +128,10 @@ def __init__(
121128
httpx_client: typing.Optional[httpx.AsyncClient] = None
122129
):
123130
_defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
131+
if api_key is None:
132+
raise ApiError(
133+
body="The client must be instantiated be either passing in api_key or setting SSOREADY_API_KEY"
134+
)
124135
self._client_wrapper = AsyncClientWrapper(
125136
base_url=_get_base_url(base_url=base_url, environment=environment),
126137
api_key=api_key,
@@ -131,6 +142,7 @@ def __init__(
131142
else httpx.AsyncClient(timeout=_defaulted_timeout),
132143
timeout=_defaulted_timeout,
133144
)
145+
self.management = AsyncManagementClient(client_wrapper=self._client_wrapper)
134146
self.saml = AsyncSamlClient(client_wrapper=self._client_wrapper)
135147
self.scim = AsyncScimClient(client_wrapper=self._client_wrapper)
136148

src/ssoready/core/client_wrapper.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class BaseClientWrapper:
1111
def __init__(
1212
self,
1313
*,
14-
api_key: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
14+
api_key: typing.Union[str, typing.Callable[[], str]],
1515
base_url: str,
1616
timeout: typing.Optional[float] = None,
1717
):
@@ -23,15 +23,13 @@ def get_headers(self) -> typing.Dict[str, str]:
2323
headers: typing.Dict[str, str] = {
2424
"X-Fern-Language": "Python",
2525
"X-Fern-SDK-Name": "ssoready",
26-
"X-Fern-SDK-Version": "1.0.1",
26+
"X-Fern-SDK-Version": "1.1.0",
2727
}
28-
api_key = self._get_api_key()
29-
if api_key is not None:
30-
headers["Authorization"] = f"Bearer {api_key}"
28+
headers["Authorization"] = f"Bearer {self._get_api_key()}"
3129
return headers
3230

33-
def _get_api_key(self) -> typing.Optional[str]:
34-
if isinstance(self._api_key, str) or self._api_key is None:
31+
def _get_api_key(self) -> str:
32+
if isinstance(self._api_key, str):
3533
return self._api_key
3634
else:
3735
return self._api_key()
@@ -47,7 +45,7 @@ class SyncClientWrapper(BaseClientWrapper):
4745
def __init__(
4846
self,
4947
*,
50-
api_key: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
48+
api_key: typing.Union[str, typing.Callable[[], str]],
5149
base_url: str,
5250
timeout: typing.Optional[float] = None,
5351
httpx_client: httpx.Client,
@@ -60,7 +58,7 @@ class AsyncClientWrapper(BaseClientWrapper):
6058
def __init__(
6159
self,
6260
*,
63-
api_key: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
61+
api_key: typing.Union[str, typing.Callable[[], str]],
6462
base_url: str,
6563
timeout: typing.Optional[float] = None,
6664
httpx_client: httpx.AsyncClient,
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
from . import organizations, saml_connections, scim_directories, setup_urls
4+
5+
__all__ = ["organizations", "saml_connections", "scim_directories", "setup_urls"]

src/ssoready/management/client.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
4+
from .organizations.client import AsyncOrganizationsClient, OrganizationsClient
5+
from .saml_connections.client import AsyncSamlConnectionsClient, SamlConnectionsClient
6+
from .scim_directories.client import AsyncScimDirectoriesClient, ScimDirectoriesClient
7+
from .setup_urls.client import AsyncSetupUrlsClient, SetupUrlsClient
8+
9+
10+
class ManagementClient:
11+
def __init__(self, *, client_wrapper: SyncClientWrapper):
12+
self._client_wrapper = client_wrapper
13+
self.organizations = OrganizationsClient(client_wrapper=self._client_wrapper)
14+
self.saml_connections = SamlConnectionsClient(client_wrapper=self._client_wrapper)
15+
self.scim_directories = ScimDirectoriesClient(client_wrapper=self._client_wrapper)
16+
self.setup_urls = SetupUrlsClient(client_wrapper=self._client_wrapper)
17+
18+
19+
class AsyncManagementClient:
20+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
21+
self._client_wrapper = client_wrapper
22+
self.organizations = AsyncOrganizationsClient(client_wrapper=self._client_wrapper)
23+
self.saml_connections = AsyncSamlConnectionsClient(client_wrapper=self._client_wrapper)
24+
self.scim_directories = AsyncScimDirectoriesClient(client_wrapper=self._client_wrapper)
25+
self.setup_urls = AsyncSetupUrlsClient(client_wrapper=self._client_wrapper)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+

0 commit comments

Comments
 (0)