Metadata-Version: 2.1
Name: agilicus
Version: 1.297.10
Summary: Agilicus SDK
Home-page: https://www.agilicus.com/
License: MIT
Author: Agilicus Devs
Author-email: dev@agilicus.com
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Provides-Extra: billing
Requires-Dist: PyJWT (>=2.8.0,<3.0.0)
Requires-Dist: appdirs (>=1.4.4,<2.0.0)
Requires-Dist: babel (>=2.13.1,<3.0.0)
Requires-Dist: certifi (>=14.05.14)
Requires-Dist: click (>=8.0.0,<9.0.0)
Requires-Dist: click-shell (>=2.1,<3.0)
Requires-Dist: colorama (>=0.4.3,<0.5.0)
Requires-Dist: cryptography (>=39.0.0)
Requires-Dist: dateparser (==1.2.2)
Requires-Dist: keyring (>=23.0.0)
Requires-Dist: keyrings.alt (>=4.2,<6.0)
Requires-Dist: oauth2client (>=4.1.3,<4.2.0)
Requires-Dist: paho-mqtt (>=1.6.1,<3.0.0)
Requires-Dist: pem (>=23.1.0,<24.0.0)
Requires-Dist: prettytable (>=3.9.0,<4.0.0)
Requires-Dist: prometheus_client (==0.21.1) ; extra == "billing"
Requires-Dist: python_dateutil (>2.5.3)
Requires-Dist: pyyaml (==6.0.2)
Requires-Dist: requests (>=2.23.0,<3.0.0)
Requires-Dist: shortuuid (>=1.0.13,<2.0.0)
Requires-Dist: six (>=1.14.0,<2.0.0)
Requires-Dist: stripe (>=2.60,<13.0) ; extra == "billing"
Requires-Dist: xdg (>=5.1.1,<6.0.0)
Project-URL: Repository, https://github.com/Agilicus
Description-Content-Type: text/markdown

## Agilicus SDK (Python)


The [Agilicus Platform](https://www.agilicus.com/) [API](https://www.agilicus.com/api).
is defined using [OpenAPI 3.0](https://github.com/OAI/OpenAPI-Specification),
and may be used from any language. This allows configuration of our Zero-Trust Network Access cloud native platform
using REST. You can see the API specification [online](https://www.agilicus.com/api).

This package provides a Python SDK, class library interfaces for use in
accessing individual collections. In addition it provides a command-line-interface (CLI)
for interactive use.

Read the class-library documentation [online](https://www.agilicus.com/api/)

[Samples](https://git.agilicus.com/pub/samples) shows various examples of this code in use.

Generally you may install this from [pypi](https://pypi.org/project/agilicus/) as:

```
pip install --upgrade agilicus
```

You may wish to add bash completion by adding this to your ~/.bashrc:

```
eval "$(_AGILICUS_CLI_COMPLETE=source agilicus-cli)"
```

## Example: List users
The below python code will show the same output as the CLI command:
`agilicus-cli --issuer https://auth.dbt.agilicus.cloud list-users`

```
import agilicus
import argparse
import sys

scopes = agilicus.scopes.DEFAULT_SCOPES

parser = argparse.ArgumentParser(description="update-user")
parser.add_argument("--auth-doc", type=str)
parser.add_argument("--issuer", type=str)
parser.add_argument("--email", type=str)
parser.add_argument("--disable-user", type=bool, default=None)
args = parser.parse_args()

if not args.auth_doc and not args.issuer:
    print("error: specify either an --auth-doc or --issuer")
    sys.exit(1)

if not args.email:
    print("error: specify an email to search for a user")
    sys.exit(1)

api = agilicus.GetClient(
    agilicus_scopes=scopes, issuer=args.issuer, authentication_document=args.auth_doc
)

users = api.users.list_users(org_id=api.default_org_id, email=args.email)
if len(users.users) != 1:
    print(f"error: failed to find user with email: {args.email}")
    sys.exit(1)

user = users.users[0]

if args.disable_user is not None:
    user.enabled = args.disable_user

result = api.users.replace_user(
    user.id, user=user, _check_input_type=False, _host_index=0
)
print(result)
```

