Skip to content

Commit

Permalink
SDK regeneration
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed May 24, 2024
1 parent 3fa0cd3 commit 0d633c8
Show file tree
Hide file tree
Showing 30 changed files with 1,849 additions and 1 deletion.
1 change: 1 addition & 0 deletions .fernignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Specify files that shouldn't be modified by Fern
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: ci

on: [push]
jobs:
compile:
runs-on: ubuntu-20.04
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Bootstrap poetry
run: |
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
- name: Install dependencies
run: poetry install
- name: Compile
run: poetry run mypy .
test:
runs-on: ubuntu-20.04
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Bootstrap poetry
run: |
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
- name: Install dependencies
run: poetry install
- name: Test
run: poetry run pytest ./tests/custom/
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist/
.mypy_cache/
__pycache__/
poetry.toml
61 changes: 60 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,60 @@
# ssoready-python
<!-- Begin Title, generated by Fern -->
# Ssoready Python Library

[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-SDK%20generated%20by%20Fern-brightgreen)](https://github.com/fern-api/fern)

The Ssoready Python Library provides convenient access to the Ssoready API from applications written in Python.
<!-- End Title -->

<!-- Begin Installation, generated by Fern -->
# Installation

```sh
pip install --upgrade ssoready
```
<!-- End Installation -->

<!-- Begin Usage, generated by Fern -->
# Usage

```python
from ssoready.client import SSOReady

client = SSOReady(
api_key="YOUR_API_KEY",
)
```
<!-- End Usage -->

<!-- Begin Async Usage, generated by Fern -->
# Async Client

```python
from ssoready.client import AsyncSSOReady

client = AsyncSSOReady(
api_key="YOUR_API_KEY",
)
```
<!-- End Async Usage -->

<!-- Begin Status, generated by Fern -->
# Beta Status

This SDK is in beta, and there may be breaking changes between versions without a major
version update. Therefore, we recommend pinning the package version to a specific version.
This way, you can install the same version each time without breaking changes.
<!-- End Status -->

<!-- Begin Contributing, generated by Fern -->
# Contributing

While we value open-source contributions to this SDK, this library is generated programmatically.
Additions made directly to this library would have to be moved over to our generation code,
otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
an issue first to discuss with us!

On the other hand, contributions to the README are always very welcome!
<!-- End Contributing -->

448 changes: 448 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

55 changes: 55 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
[tool.poetry]
name = "ssoready"
version = "0.0.0"
description = ""
readme = "README.md"
authors = []
keywords = []

classifiers = [
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: OS Independent",
"Operating System :: POSIX",
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed"
]
packages = [
{ include = "ssoready", from = "src"}
]

[project.urls]
Repository = 'https://github.com/fern-demo/ssoready-python'

[tool.poetry.dependencies]
python = "^3.8"
httpx = ">=0.21.2"
pydantic = ">= 1.9.2"
typing_extensions = ">= 4.0.0"

[tool.poetry.dev-dependencies]
mypy = "1.9.0"
pytest = "^7.4.0"
pytest-asyncio = "^0.23.5"
python-dateutil = "^2.9.0"

[tool.pytest.ini_options]
testpaths = [ "tests" ]
asyncio_mode = "auto"

[tool.mypy]
plugins = ["pydantic.mypy"]


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
16 changes: 16 additions & 0 deletions src/ssoready/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This file was auto-generated by Fern from our API Definition.

from .types import GetSamlRedirectUrlResponse, GoogleProtobufAny, RedeemSamlAccessCodeResponse, Status
from . import saml
from .environment import SSOReadyEnvironment
from .version import __version__

__all__ = [
"GetSamlRedirectUrlResponse",
"GoogleProtobufAny",
"RedeemSamlAccessCodeResponse",
"SSOReadyEnvironment",
"Status",
"__version__",
"saml",
]
141 changes: 141 additions & 0 deletions src/ssoready/client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# This file was auto-generated by Fern from our API Definition.

import os
import typing

import httpx

from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from .environment import SSOReadyEnvironment
from .saml.client import AsyncSamlClient, SamlClient


class SSOReady:
"""
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.
Parameters
----------
base_url : typing.Optional[str]
The base url to use for requests from the client.
environment : SSOReadyEnvironment
The environment to use for requests from the client. from .environment import SSOReadyEnvironment
Defaults to SSOReadyEnvironment.DEFAULT
api_key : typing.Optional[typing.Union[str, typing.Callable[[], str]]]
timeout : typing.Optional[float]
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.
follow_redirects : typing.Optional[bool]
Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.
httpx_client : typing.Optional[httpx.Client]
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.
Examples
--------
from ssoready.client import SSOReady
client = SSOReady(
api_key="YOUR_API_KEY",
)
"""

def __init__(
self,
*,
base_url: typing.Optional[str] = None,
environment: SSOReadyEnvironment = SSOReadyEnvironment.DEFAULT,
api_key: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = os.getenv("SSOREADY_API_KEY"),
timeout: typing.Optional[float] = None,
follow_redirects: typing.Optional[bool] = True,
httpx_client: typing.Optional[httpx.Client] = None
):
_defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
self._client_wrapper = SyncClientWrapper(
base_url=_get_base_url(base_url=base_url, environment=environment),
api_key=api_key,
httpx_client=httpx_client
if httpx_client is not None
else httpx.Client(timeout=_defaulted_timeout, follow_redirects=follow_redirects)
if follow_redirects is not None
else httpx.Client(timeout=_defaulted_timeout),
timeout=_defaulted_timeout,
)
self.saml = SamlClient(client_wrapper=self._client_wrapper)


class AsyncSSOReady:
"""
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.
Parameters
----------
base_url : typing.Optional[str]
The base url to use for requests from the client.
environment : SSOReadyEnvironment
The environment to use for requests from the client. from .environment import SSOReadyEnvironment
Defaults to SSOReadyEnvironment.DEFAULT
api_key : typing.Optional[typing.Union[str, typing.Callable[[], str]]]
timeout : typing.Optional[float]
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.
follow_redirects : typing.Optional[bool]
Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.
httpx_client : typing.Optional[httpx.AsyncClient]
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.
Examples
--------
from ssoready.client import AsyncSSOReady
client = AsyncSSOReady(
api_key="YOUR_API_KEY",
)
"""

def __init__(
self,
*,
base_url: typing.Optional[str] = None,
environment: SSOReadyEnvironment = SSOReadyEnvironment.DEFAULT,
api_key: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = os.getenv("SSOREADY_API_KEY"),
timeout: typing.Optional[float] = None,
follow_redirects: typing.Optional[bool] = True,
httpx_client: typing.Optional[httpx.AsyncClient] = None
):
_defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
self._client_wrapper = AsyncClientWrapper(
base_url=_get_base_url(base_url=base_url, environment=environment),
api_key=api_key,
httpx_client=httpx_client
if httpx_client is not None
else httpx.AsyncClient(timeout=_defaulted_timeout, follow_redirects=follow_redirects)
if follow_redirects is not None
else httpx.AsyncClient(timeout=_defaulted_timeout),
timeout=_defaulted_timeout,
)
self.saml = AsyncSamlClient(client_wrapper=self._client_wrapper)


def _get_base_url(*, base_url: typing.Optional[str] = None, environment: SSOReadyEnvironment) -> str:
if base_url is not None:
return base_url
elif environment is not None:
return environment.value
else:
raise Exception("Please pass in either base_url or environment to construct the client")
30 changes: 30 additions & 0 deletions src/ssoready/core/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file was auto-generated by Fern from our API Definition.

from .api_error import ApiError
from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper
from .datetime_utils import serialize_datetime
from .file import File, convert_file_dict_to_httpx_tuples
from .http_client import AsyncHttpClient, HttpClient
from .jsonable_encoder import jsonable_encoder
from .pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
from .query_encoder import encode_query
from .remove_none_from_dict import remove_none_from_dict
from .request_options import RequestOptions

__all__ = [
"ApiError",
"AsyncClientWrapper",
"AsyncHttpClient",
"BaseClientWrapper",
"File",
"HttpClient",
"RequestOptions",
"SyncClientWrapper",
"convert_file_dict_to_httpx_tuples",
"deep_union_pydantic_dicts",
"encode_query",
"jsonable_encoder",
"pydantic_v1",
"remove_none_from_dict",
"serialize_datetime",
]
15 changes: 15 additions & 0 deletions src/ssoready/core/api_error.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file was auto-generated by Fern from our API Definition.

import typing


class ApiError(Exception):
status_code: typing.Optional[int]
body: typing.Any

def __init__(self, *, status_code: typing.Optional[int] = None, body: typing.Any = None):
self.status_code = status_code
self.body = body

def __str__(self) -> str:
return f"status_code: {self.status_code}, body: {self.body}"
Loading

0 comments on commit 0d633c8

Please sign in to comment.