# ory-keto-client
Documentation for all of Ory Keto's REST APIs. gRPC is documented separately.


This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: v0.11.0-alpha.0
- Package version: v0.11.0-alpha.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen

## Requirements.

Python >=3.6

## Installation & Usage
### pip install

If the python package is hosted on a repository, you can install directly using:

```sh
pip install git+https://github.com/ory/sdk.git
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/ory/sdk.git`)

Then import the package:
```python
import ory_keto_client
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)

Then import the package:
```python
import ory_keto_client
```

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

```python

import time
import ory_keto_client
from pprint import pprint
from ory_keto_client.api import metadata_api
from ory_keto_client.model.generic_error import GenericError
from ory_keto_client.model.get_version200_response import GetVersion200Response
from ory_keto_client.model.is_alive200_response import IsAlive200Response
from ory_keto_client.model.is_ready503_response import IsReady503Response
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = ory_keto_client.Configuration(
    host = "http://localhost"
)



# Enter a context with an instance of the API client
with ory_keto_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = metadata_api.MetadataApi(api_client)

    try:
        # Return Running Software Version.
        api_response = api_instance.get_version()
        pprint(api_response)
    except ory_keto_client.ApiException as e:
        print("Exception when calling MetadataApi->get_version: %s\n" % e)
```

## Documentation for API Endpoints

All URIs are relative to *http://localhost*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*MetadataApi* | [**get_version**](docs/MetadataApi.md#get_version) | **GET** /version | Return Running Software Version.
*MetadataApi* | [**is_alive**](docs/MetadataApi.md#is_alive) | **GET** /health/alive | Check HTTP Server Status
*MetadataApi* | [**is_ready**](docs/MetadataApi.md#is_ready) | **GET** /health/ready | Check HTTP Server and Database Status
*PermissionApi* | [**check_permission**](docs/PermissionApi.md#check_permission) | **GET** /relation-tuples/check/openapi | Check a permission
*PermissionApi* | [**check_permission_or_error**](docs/PermissionApi.md#check_permission_or_error) | **GET** /relation-tuples/check | Check a permission
*PermissionApi* | [**expand_permissions**](docs/PermissionApi.md#expand_permissions) | **GET** /relation-tuples/expand | Expand a Relationship into permissions.
*PermissionApi* | [**post_check_permission**](docs/PermissionApi.md#post_check_permission) | **POST** /relation-tuples/check/openapi | Check a permission
*PermissionApi* | [**post_check_permission_or_error**](docs/PermissionApi.md#post_check_permission_or_error) | **POST** /relation-tuples/check | Check a permission
*RelationshipApi* | [**check_opl_syntax**](docs/RelationshipApi.md#check_opl_syntax) | **POST** /opl/syntax/check | Check the syntax of an OPL file
*RelationshipApi* | [**create_relationship**](docs/RelationshipApi.md#create_relationship) | **PUT** /admin/relation-tuples | Create a Relationship
*RelationshipApi* | [**delete_relationships**](docs/RelationshipApi.md#delete_relationships) | **DELETE** /admin/relation-tuples | Delete Relationships
*RelationshipApi* | [**get_relationships**](docs/RelationshipApi.md#get_relationships) | **GET** /relation-tuples | Query relationships
*RelationshipApi* | [**list_relationship_namespaces**](docs/RelationshipApi.md#list_relationship_namespaces) | **GET** /namespaces | Query namespaces
*RelationshipApi* | [**patch_relationships**](docs/RelationshipApi.md#patch_relationships) | **PATCH** /admin/relation-tuples | Patch Multiple Relationships


## Documentation For Models

 - [CheckOplSyntaxResult](docs/CheckOplSyntaxResult.md)
 - [CheckPermissionResult](docs/CheckPermissionResult.md)
 - [CreateRelationshipBody](docs/CreateRelationshipBody.md)
 - [ErrorGeneric](docs/ErrorGeneric.md)
 - [ExpandedPermissionTree](docs/ExpandedPermissionTree.md)
 - [GenericError](docs/GenericError.md)
 - [GetVersion200Response](docs/GetVersion200Response.md)
 - [HealthNotReadyStatus](docs/HealthNotReadyStatus.md)
 - [HealthStatus](docs/HealthStatus.md)
 - [IsAlive200Response](docs/IsAlive200Response.md)
 - [IsReady503Response](docs/IsReady503Response.md)
 - [Namespace](docs/Namespace.md)
 - [ParseError](docs/ParseError.md)
 - [PostCheckPermissionBody](docs/PostCheckPermissionBody.md)
 - [PostCheckPermissionOrErrorBody](docs/PostCheckPermissionOrErrorBody.md)
 - [RelationQuery](docs/RelationQuery.md)
 - [Relationship](docs/Relationship.md)
 - [RelationshipNamespaces](docs/RelationshipNamespaces.md)
 - [RelationshipPatch](docs/RelationshipPatch.md)
 - [Relationships](docs/Relationships.md)
 - [SourcePosition](docs/SourcePosition.md)
 - [SubjectSet](docs/SubjectSet.md)
 - [Version](docs/Version.md)


## Documentation For Authorization

 All endpoints do not require authorization.

## Author

hi@ory.sh


## Notes for Large OpenAPI documents
If the OpenAPI document is large, imports in ory_keto_client.apis and ory_keto_client.models may fail with a
RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:

Solution 1:
Use specific imports for apis and models like:
- `from ory_keto_client.api.default_api import DefaultApi`
- `from ory_keto_client.model.pet import Pet`

Solution 2:
Before importing the package, adjust the maximum recursion limit as shown below:
```
import sys
sys.setrecursionlimit(1500)
import ory_keto_client
from ory_keto_client.apis import *
from ory_keto_client.models import *
```

