Skip to content

Commit a1345aa

Browse files
authored
Merge pull request #14 from Permify/update-sdk-from-openapi
chore: update Python SDK from latest OpenAPI specification
2 parents ff94fb7 + d6f78ea commit a1345aa

File tree

296 files changed

+2037
-300
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

296 files changed

+2037
-300
lines changed

docs/BulkCheckBody.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# BulkCheckBody
2+
3+
PermissionBulkCheckRequest is the request message for the BulkCheck method in the Permission service.
4+
5+
## Properties
6+
7+
Name | Type | Description | Notes
8+
------------ | ------------- | ------------- | -------------
9+
**metadata** | [**PermissionCheckRequestMetadata**](PermissionCheckRequestMetadata.md) | | [optional]
10+
**items** | [**List[PermissionBulkCheckRequestItem]**](PermissionBulkCheckRequestItem.md) | List of permission check requests, maximum 100 items. | [optional]
11+
**context** | [**Context**](Context.md) | | [optional]
12+
**arguments** | [**List[Argument]**](Argument.md) | Additional arguments associated with this request. | [optional]
13+
14+
## Example
15+
16+
```python
17+
from permify.models.bulk_check_body import BulkCheckBody
18+
19+
# TODO update the JSON string below
20+
json = "{}"
21+
# create an instance of BulkCheckBody from a JSON string
22+
bulk_check_body_instance = BulkCheckBody.from_json(json)
23+
# print the JSON string representation of the object
24+
print BulkCheckBody.to_json()
25+
26+
# convert the object into a dict
27+
bulk_check_body_dict = bulk_check_body_instance.to_dict()
28+
# create an instance of BulkCheckBody from a dict
29+
bulk_check_body_form_dict = bulk_check_body.from_dict(bulk_check_body_dict)
30+
```
31+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
32+
33+

docs/Component.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Component
2+
3+
CEL component specifier. - COMPONENT_PARSER: Parser. Converts a CEL string to an AST. - COMPONENT_TYPE_CHECKER: Type checker. Checks that references in an AST are defined and types agree. - COMPONENT_RUNTIME: Runtime. Evaluates a parsed and optionally checked CEL AST against a context.
4+
5+
## Properties
6+
7+
Name | Type | Description | Notes
8+
------------ | ------------- | ------------- | -------------
9+
10+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
11+
12+

docs/Comprehension.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# Comprehension
22

3-
A comprehension expression applied to a list or map. Comprehensions are not part of the core syntax, but enabled with macros. A macro matches a specific call signature within a parsed AST and replaces the call with an alternate AST block. Macro expansion happens at parse time. The following macros are supported within CEL: Aggregate type macros may be applied to all elements in a list or all keys in a map: * `all`, `exists`, `exists_one` - test a predicate expression against the inputs and return `true` if the predicate is satisfied for all, any, or only one value `list.all(x, x < 10)`. * `filter` - test a predicate expression against the inputs and return the subset of elements which satisfy the predicate: `payments.filter(p, p > 1000)`. * `map` - apply an expression to all elements in the input and return the output aggregate type: `[1, 2, 3].map(i, i * i)`. The `has(m.x)` macro tests whether the property `x` is present in struct `m`. The semantics of this macro depend on the type of `m`. For proto2 messages `has(m.x)` is defined as 'defined, but not set`. For proto3, the macro tests whether the property is set to its default. For map and struct types, the macro tests whether the property `x` is defined on `m`.
3+
A comprehension expression applied to a list or map. Comprehensions are not part of the core syntax, but enabled with macros. A macro matches a specific call signature within a parsed AST and replaces the call with an alternate AST block. Macro expansion happens at parse time. The following macros are supported within CEL: Aggregate type macros may be applied to all elements in a list or all keys in a map: * `all`, `exists`, `exists_one` - test a predicate expression against the inputs and return `true` if the predicate is satisfied for all, any, or only one value `list.all(x, x < 10)`. * `filter` - test a predicate expression against the inputs and return the subset of elements which satisfy the predicate: `payments.filter(p, p > 1000)`. * `map` - apply an expression to all elements in the input and return the output aggregate type: `[1, 2, 3].map(i, i * i)`. The `has(m.x)` macro tests whether the property `x` is present in struct `m`. The semantics of this macro depend on the type of `m`. For proto2 messages `has(m.x)` is defined as 'defined, but not set`. For proto3, the macro tests whether the property is set to its default. For map and struct types, the macro tests whether the property `x` is defined on `m`. Comprehensions for the standard environment macros evaluation can be best visualized as the following pseudocode: ``` let `accu_var` = `accu_init` for (let `iter_var` in `iter_range`) { if (!`loop_condition`) { break } `accu_var` = `loop_step` } return `result` ``` Comprehensions for the optional V2 macros which support map-to-map translation differ slightly from the standard environment macros in that they expose both the key or index in addition to the value for each list or map entry: ``` let `accu_var` = `accu_init` for (let `iter_var`, `iter_var2` in `iter_range`) { if (!`loop_condition`) { break } `accu_var` = `loop_step` } return `result` ```
44

55
## Properties
66

77
Name | Type | Description | Notes
88
------------ | ------------- | ------------- | -------------
9-
**iter_var** | **str** | The name of the iteration variable. | [optional]
9+
**iter_var** | **str** | The name of the first iteration variable. When the iter_range is a list, this variable is the list element. When the iter_range is a map, this variable is the map entry key. | [optional]
10+
**iter_var2** | **str** | The name of the second iteration variable, empty if not set. When the iter_range is a list, this variable is the integer index. When the iter_range is a map, this variable is the map entry value. This field is only set for comprehension v2 macros. | [optional]
1011
**iter_range** | [**Expr**](Expr.md) | | [optional]
1112
**accu_var** | **str** | The name of the variable used for accumulation of the result. | [optional]
1213
**accu_init** | [**Expr**](Expr.md) | | [optional]

docs/Extension.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Extension
2+
3+
An extension that was requested for the source expression.
4+
5+
## Properties
6+
7+
Name | Type | Description | Notes
8+
------------ | ------------- | ------------- | -------------
9+
**id** | **str** | | [optional]
10+
**affected_components** | [**List[Component]**](Component.md) | If set, the listed components must understand the extension for the expression to evaluate correctly. This field has set semantics, repeated values should be deduplicated. | [optional]
11+
**version** | [**Version**](Version.md) | | [optional]
12+
13+
## Example
14+
15+
```python
16+
from permify.models.extension import Extension
17+
18+
# TODO update the JSON string below
19+
json = "{}"
20+
# create an instance of Extension from a JSON string
21+
extension_instance = Extension.from_json(json)
22+
# print the JSON string representation of the object
23+
print Extension.to_json()
24+
25+
# convert the object into a dict
26+
extension_dict = extension_instance.to_dict()
27+
# create an instance of Extension from a dict
28+
extension_form_dict = extension.from_dict(extension_dict)
29+
```
30+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
31+
32+

docs/PermissionApi.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ All URIs are relative to *http://localhost*
44

55
Method | HTTP request | Description
66
------------- | ------------- | -------------
7+
[**permissions_bulk_check**](PermissionApi.md#permissions_bulk_check) | **POST** /v1/tenants/{tenant_id}/permissions/bulk-check | bulk check api
78
[**permissions_check**](PermissionApi.md#permissions_check) | **POST** /v1/tenants/{tenant_id}/permissions/check | check api
89
[**permissions_expand**](PermissionApi.md#permissions_expand) | **POST** /v1/tenants/{tenant_id}/permissions/expand | expand api
910
[**permissions_lookup_entity**](PermissionApi.md#permissions_lookup_entity) | **POST** /v1/tenants/{tenant_id}/permissions/lookup-entity | lookup entity
@@ -12,6 +13,80 @@ Method | HTTP request | Description
1213
[**permissions_subject_permission**](PermissionApi.md#permissions_subject_permission) | **POST** /v1/tenants/{tenant_id}/permissions/subject-permission | subject permission
1314

1415

16+
# **permissions_bulk_check**
17+
> PermissionBulkCheckResponse permissions_bulk_check(tenant_id, body)
18+
19+
bulk check api
20+
21+
Check multiple permissions in a single request. Maximum 100 requests allowed.
22+
23+
### Example
24+
25+
26+
```python
27+
import time
28+
import os
29+
import permify
30+
from permify.models.bulk_check_body import BulkCheckBody
31+
from permify.models.permission_bulk_check_response import PermissionBulkCheckResponse
32+
from permify.rest import ApiException
33+
from pprint import pprint
34+
35+
# Defining the host is optional and defaults to http://localhost
36+
# See configuration.py for a list of all supported configuration parameters.
37+
configuration = permify.Configuration(
38+
host = "http://localhost"
39+
)
40+
41+
42+
# Enter a context with an instance of the API client
43+
with permify.ApiClient(configuration) as api_client:
44+
# Create an instance of the API class
45+
api_instance = permify.PermissionApi(api_client)
46+
tenant_id = 'tenant_id_example' # str | Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes.
47+
body = permify.BulkCheckBody() # BulkCheckBody |
48+
49+
try:
50+
# bulk check api
51+
api_response = api_instance.permissions_bulk_check(tenant_id, body)
52+
print("The response of PermissionApi->permissions_bulk_check:\n")
53+
pprint(api_response)
54+
except Exception as e:
55+
print("Exception when calling PermissionApi->permissions_bulk_check: %s\n" % e)
56+
```
57+
58+
59+
60+
### Parameters
61+
62+
63+
Name | Type | Description | Notes
64+
------------- | ------------- | ------------- | -------------
65+
**tenant_id** | **str**| Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant &lt;code&gt;t1&lt;/code&gt; for this field. Required, and must match the pattern \\[a-zA-Z0-9-,]+\\“, max 64 bytes. |
66+
**body** | [**BulkCheckBody**](BulkCheckBody.md)| |
67+
68+
### Return type
69+
70+
[**PermissionBulkCheckResponse**](PermissionBulkCheckResponse.md)
71+
72+
### Authorization
73+
74+
No authorization required
75+
76+
### HTTP request headers
77+
78+
- **Content-Type**: application/json
79+
- **Accept**: application/json
80+
81+
### HTTP response details
82+
83+
| Status code | Description | Response headers |
84+
|-------------|-------------|------------------|
85+
**200** | A successful response. | - |
86+
**0** | An unexpected error response. | - |
87+
88+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
89+
1590
# **permissions_check**
1691
> PermissionCheckResponse permissions_check(tenant_id, body)
1792
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# PermissionBulkCheckRequestItem
2+
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**entity** | [**Entity**](Entity.md) | | [optional]
9+
**permission** | **str** | The action the user wants to perform on the resource | [optional]
10+
**subject** | [**Subject**](Subject.md) | | [optional]
11+
12+
## Example
13+
14+
```python
15+
from permify.models.permission_bulk_check_request_item import PermissionBulkCheckRequestItem
16+
17+
# TODO update the JSON string below
18+
json = "{}"
19+
# create an instance of PermissionBulkCheckRequestItem from a JSON string
20+
permission_bulk_check_request_item_instance = PermissionBulkCheckRequestItem.from_json(json)
21+
# print the JSON string representation of the object
22+
print PermissionBulkCheckRequestItem.to_json()
23+
24+
# convert the object into a dict
25+
permission_bulk_check_request_item_dict = permission_bulk_check_request_item_instance.to_dict()
26+
# create an instance of PermissionBulkCheckRequestItem from a dict
27+
permission_bulk_check_request_item_form_dict = permission_bulk_check_request_item.from_dict(permission_bulk_check_request_item_dict)
28+
```
29+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
30+
31+
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# PermissionBulkCheckResponse
2+
3+
PermissionBulkCheckResponse is the response message for the BulkCheck method in the Permission service.
4+
5+
## Properties
6+
7+
Name | Type | Description | Notes
8+
------------ | ------------- | ------------- | -------------
9+
**results** | [**List[PermissionCheckResponse]**](PermissionCheckResponse.md) | List of permission check responses corresponding to each request. | [optional]
10+
11+
## Example
12+
13+
```python
14+
from permify.models.permission_bulk_check_response import PermissionBulkCheckResponse
15+
16+
# TODO update the JSON string below
17+
json = "{}"
18+
# create an instance of PermissionBulkCheckResponse from a JSON string
19+
permission_bulk_check_response_instance = PermissionBulkCheckResponse.from_json(json)
20+
# print the JSON string representation of the object
21+
print PermissionBulkCheckResponse.to_json()
22+
23+
# convert the object into a dict
24+
permission_bulk_check_response_dict = permission_bulk_check_response_instance.to_dict()
25+
# create an instance of PermissionBulkCheckResponse from a dict
26+
permission_bulk_check_response_form_dict = permission_bulk_check_response.from_dict(permission_bulk_check_response_dict)
27+
```
28+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
29+
30+

docs/SourceInfo.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Name | Type | Description | Notes
1111
**line_offsets** | **List[int]** | Monotonically increasing list of code point offsets where newlines &#x60;\\n&#x60; appear. The line number of a given position is the index &#x60;i&#x60; where for a given &#x60;id&#x60; the &#x60;line_offsets[i] &lt; id_positions[id] &lt; line_offsets[i+1]&#x60;. The column may be derivd from &#x60;id_positions[id] - line_offsets[i]&#x60;. | [optional]
1212
**positions** | **Dict[str, int]** | A map from the parse node id (e.g. &#x60;Expr.id&#x60;) to the code point offset within the source. | [optional]
1313
**macro_calls** | [**Dict[str, Expr]**](Expr.md) | A map from the parse node id where a macro replacement was made to the call &#x60;Expr&#x60; that resulted in a macro expansion. For example, &#x60;has(value.field)&#x60; is a function call that is replaced by a &#x60;test_only&#x60; field selection in the AST. Likewise, the call &#x60;list.exists(e, e &gt; 10)&#x60; translates to a comprehension expression. The key in the map corresponds to the expression id of the expanded macro, and the value is the call &#x60;Expr&#x60; that was replaced. | [optional]
14+
**extensions** | [**List[Extension]**](Extension.md) | A list of tags for extensions that were used while parsing or type checking the source expression. For example, optimizations that require special runtime support may be specified. These are used to check feature support between components in separate implementations. This can be used to either skip redundant work or report an error if the extension is unsupported. | [optional]
1415

1516
## Example
1617

docs/Version.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Version
2+
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**major** | **str** | Major version changes indicate different required support level from the required components. | [optional]
9+
**minor** | **str** | Minor version changes must not change the observed behavior from existing implementations, but may be provided informationally. | [optional]
10+
11+
## Example
12+
13+
```python
14+
from permify.models.version import Version
15+
16+
# TODO update the JSON string below
17+
json = "{}"
18+
# create an instance of Version from a JSON string
19+
version_instance = Version.from_json(json)
20+
# print the JSON string representation of the object
21+
print Version.to_json()
22+
23+
# convert the object into a dict
24+
version_dict = version_instance.to_dict()
25+
# create an instance of Version from a dict
26+
version_form_dict = version.from_dict(version_dict)
27+
```
28+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
29+
30+

0 commit comments

Comments
 (0)