Class AuthorizationModelsApi
java.lang.Object
org.apache.syncope.ext.openfga.client.api.AuthorizationModelsApi
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
date="2025-10-17T13:24:48.337210454+02:00[Europe/Rome]",
comments="Generator version: 7.16.0")
public class AuthorizationModelsApi
extends Object
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondownloadFileFromResponse(HttpResponse<InputStream> response) Download file from the given response.protected ApiExceptiongetApiException(String operationId, HttpResponse<InputStream> response) readAuthorizationModel(String storeId, String id) Return a particular version of an authorization model The ReadAuthorizationModel API returns an authorization model by its identifier.Return a particular version of an authorization model The ReadAuthorizationModel API returns an authorization model by its identifier.readAuthorizationModels(String storeId, Integer pageSize, String continuationToken) Return all the authorization models for a particular store The ReadAuthorizationModels API will return all the authorization models for a certain store.readAuthorizationModels(String storeId, Integer pageSize, String continuationToken, Map<String, String> headers) Return all the authorization models for a particular store The ReadAuthorizationModels API will return all the authorization models for a certain store.readAuthorizationModelsWithHttpInfo(String storeId, Integer pageSize, String continuationToken) Return all the authorization models for a particular store The ReadAuthorizationModels API will return all the authorization models for a certain store.readAuthorizationModelsWithHttpInfo(String storeId, Integer pageSize, String continuationToken, Map<String, String> headers) Return all the authorization models for a particular store The ReadAuthorizationModels API will return all the authorization models for a certain store.readAuthorizationModelWithHttpInfo(String storeId, String id) Return a particular version of an authorization model The ReadAuthorizationModel API returns an authorization model by its identifier.Return a particular version of an authorization model The ReadAuthorizationModel API returns an authorization model by its identifier.writeAuthorizationModel(String storeId, WriteAuthorizationModelRequest body) Create a new authorization model The WriteAuthorizationModel API will add a new authorization model to a store.writeAuthorizationModel(String storeId, WriteAuthorizationModelRequest body, Map<String, String> headers) Create a new authorization model The WriteAuthorizationModel API will add a new authorization model to a store.Create a new authorization model The WriteAuthorizationModel API will add a new authorization model to a store.writeAuthorizationModelWithHttpInfo(String storeId, WriteAuthorizationModelRequest body, Map<String, String> headers) Create a new authorization model The WriteAuthorizationModel API will add a new authorization model to a store.
-
Constructor Details
-
AuthorizationModelsApi
public AuthorizationModelsApi() -
AuthorizationModelsApi
-
-
Method Details
-
getApiException
protected ApiException getApiException(String operationId, HttpResponse<InputStream> response) throws IOException - Throws:
IOException
-
downloadFileFromResponse
Download file from the given response.- Parameters:
response- Response- Returns:
- File
- Throws:
ApiException- If fail to read file content from response and write to disk
-
readAuthorizationModel
public ReadAuthorizationModelResponse readAuthorizationModel(@Nonnull String storeId, @Nonnull String id) throws ApiException Return a particular version of an authorization model The ReadAuthorizationModel API returns an authorization model by its identifier. The response will return the authorization model for the particular version. ## Example To retrieve the authorization model with ID `01G5JAVJ41T49E9TT3SKVS7X1J` for the store, call the GET authorization-models by ID API with `01G5JAVJ41T49E9TT3SKVS7X1J` as the `id` path parameter. The API will return: ```json { \"authorization_model\":{ \"id\":\"01G5JAVJ41T49E9TT3SKVS7X1J\", \"type_definitions\":[ { \"type\":\"user\" }, { \"type\":\"document\", \"relations\":{ \"reader\":{ \"union\":{ \"child\":[ { \"this\":{} }, { \"computedUserset\":{ \"object\":\"\", \"relation\":\"writer\" } } ] } }, \"writer\":{ \"this\":{} } } } ] } } ``` In the above example, there are 2 types (`user` and `document`). The `document` type has 2 relations (`writer` and `reader`).- Parameters:
storeId- (required)id- (required)- Returns:
- ReadAuthorizationModelResponse
- Throws:
ApiException- if fails to make API call
-
readAuthorizationModel
public ReadAuthorizationModelResponse readAuthorizationModel(@Nonnull String storeId, @Nonnull String id, Map<String, String> headers) throws ApiExceptionReturn a particular version of an authorization model The ReadAuthorizationModel API returns an authorization model by its identifier. The response will return the authorization model for the particular version. ## Example To retrieve the authorization model with ID `01G5JAVJ41T49E9TT3SKVS7X1J` for the store, call the GET authorization-models by ID API with `01G5JAVJ41T49E9TT3SKVS7X1J` as the `id` path parameter. The API will return: ```json { \"authorization_model\":{ \"id\":\"01G5JAVJ41T49E9TT3SKVS7X1J\", \"type_definitions\":[ { \"type\":\"user\" }, { \"type\":\"document\", \"relations\":{ \"reader\":{ \"union\":{ \"child\":[ { \"this\":{} }, { \"computedUserset\":{ \"object\":\"\", \"relation\":\"writer\" } } ] } }, \"writer\":{ \"this\":{} } } } ] } } ``` In the above example, there are 2 types (`user` and `document`). The `document` type has 2 relations (`writer` and `reader`).- Parameters:
storeId- (required)id- (required)headers- Optional headers to include in the request- Returns:
- ReadAuthorizationModelResponse
- Throws:
ApiException- if fails to make API call
-
readAuthorizationModelWithHttpInfo
public ApiResponse<ReadAuthorizationModelResponse> readAuthorizationModelWithHttpInfo(@Nonnull String storeId, @Nonnull String id) throws ApiException Return a particular version of an authorization model The ReadAuthorizationModel API returns an authorization model by its identifier. The response will return the authorization model for the particular version. ## Example To retrieve the authorization model with ID `01G5JAVJ41T49E9TT3SKVS7X1J` for the store, call the GET authorization-models by ID API with `01G5JAVJ41T49E9TT3SKVS7X1J` as the `id` path parameter. The API will return: ```json { \"authorization_model\":{ \"id\":\"01G5JAVJ41T49E9TT3SKVS7X1J\", \"type_definitions\":[ { \"type\":\"user\" }, { \"type\":\"document\", \"relations\":{ \"reader\":{ \"union\":{ \"child\":[ { \"this\":{} }, { \"computedUserset\":{ \"object\":\"\", \"relation\":\"writer\" } } ] } }, \"writer\":{ \"this\":{} } } } ] } } ``` In the above example, there are 2 types (`user` and `document`). The `document` type has 2 relations (`writer` and `reader`).- Parameters:
storeId- (required)id- (required)- Returns:
- ApiResponse<ReadAuthorizationModelResponse>
- Throws:
ApiException- if fails to make API call
-
readAuthorizationModelWithHttpInfo
public ApiResponse<ReadAuthorizationModelResponse> readAuthorizationModelWithHttpInfo(@Nonnull String storeId, @Nonnull String id, Map<String, String> headers) throws ApiExceptionReturn a particular version of an authorization model The ReadAuthorizationModel API returns an authorization model by its identifier. The response will return the authorization model for the particular version. ## Example To retrieve the authorization model with ID `01G5JAVJ41T49E9TT3SKVS7X1J` for the store, call the GET authorization-models by ID API with `01G5JAVJ41T49E9TT3SKVS7X1J` as the `id` path parameter. The API will return: ```json { \"authorization_model\":{ \"id\":\"01G5JAVJ41T49E9TT3SKVS7X1J\", \"type_definitions\":[ { \"type\":\"user\" }, { \"type\":\"document\", \"relations\":{ \"reader\":{ \"union\":{ \"child\":[ { \"this\":{} }, { \"computedUserset\":{ \"object\":\"\", \"relation\":\"writer\" } } ] } }, \"writer\":{ \"this\":{} } } } ] } } ``` In the above example, there are 2 types (`user` and `document`). The `document` type has 2 relations (`writer` and `reader`).- Parameters:
storeId- (required)id- (required)headers- Optional headers to include in the request- Returns:
- ApiResponse<ReadAuthorizationModelResponse>
- Throws:
ApiException- if fails to make API call
-
readAuthorizationModels
public ReadAuthorizationModelsResponse readAuthorizationModels(@Nonnull String storeId, @Nullable Integer pageSize, @Nullable String continuationToken) throws ApiException Return all the authorization models for a particular store The ReadAuthorizationModels API will return all the authorization models for a certain store. OpenFGA's response will contain an array of all authorization models, sorted in descending order of creation. ## Example Assume that a store's authorization model has been configured twice. To get all the authorization models that have been created in this store, call GET authorization-models. The API will return a response that looks like: ```json { \"authorization_models\": [ { \"id\": \"01G50QVV17PECNVAHX1GG4Y5NC\", \"type_definitions\": [...] }, { \"id\": \"01G4ZW8F4A07AKQ8RHSVG9RW04\", \"type_definitions\": [...] }, ], \"continuation_token\": \"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\" } ``` If there are no more authorization models available, the `continuation_token` field will be empty ```json { \"authorization_models\": [ { \"id\": \"01G50QVV17PECNVAHX1GG4Y5NC\", \"type_definitions\": [...] }, { \"id\": \"01G4ZW8F4A07AKQ8RHSVG9RW04\", \"type_definitions\": [...] }, ], \"continuation_token\": \"\" } ```- Parameters:
storeId- (required)pageSize- (optional)continuationToken- (optional)- Returns:
- ReadAuthorizationModelsResponse
- Throws:
ApiException- if fails to make API call
-
readAuthorizationModels
public ReadAuthorizationModelsResponse readAuthorizationModels(@Nonnull String storeId, @Nullable Integer pageSize, @Nullable String continuationToken, Map<String, String> headers) throws ApiExceptionReturn all the authorization models for a particular store The ReadAuthorizationModels API will return all the authorization models for a certain store. OpenFGA's response will contain an array of all authorization models, sorted in descending order of creation. ## Example Assume that a store's authorization model has been configured twice. To get all the authorization models that have been created in this store, call GET authorization-models. The API will return a response that looks like: ```json { \"authorization_models\": [ { \"id\": \"01G50QVV17PECNVAHX1GG4Y5NC\", \"type_definitions\": [...] }, { \"id\": \"01G4ZW8F4A07AKQ8RHSVG9RW04\", \"type_definitions\": [...] }, ], \"continuation_token\": \"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\" } ``` If there are no more authorization models available, the `continuation_token` field will be empty ```json { \"authorization_models\": [ { \"id\": \"01G50QVV17PECNVAHX1GG4Y5NC\", \"type_definitions\": [...] }, { \"id\": \"01G4ZW8F4A07AKQ8RHSVG9RW04\", \"type_definitions\": [...] }, ], \"continuation_token\": \"\" } ```- Parameters:
storeId- (required)pageSize- (optional)continuationToken- (optional)headers- Optional headers to include in the request- Returns:
- ReadAuthorizationModelsResponse
- Throws:
ApiException- if fails to make API call
-
readAuthorizationModelsWithHttpInfo
public ApiResponse<ReadAuthorizationModelsResponse> readAuthorizationModelsWithHttpInfo(@Nonnull String storeId, @Nullable Integer pageSize, @Nullable String continuationToken) throws ApiException Return all the authorization models for a particular store The ReadAuthorizationModels API will return all the authorization models for a certain store. OpenFGA's response will contain an array of all authorization models, sorted in descending order of creation. ## Example Assume that a store's authorization model has been configured twice. To get all the authorization models that have been created in this store, call GET authorization-models. The API will return a response that looks like: ```json { \"authorization_models\": [ { \"id\": \"01G50QVV17PECNVAHX1GG4Y5NC\", \"type_definitions\": [...] }, { \"id\": \"01G4ZW8F4A07AKQ8RHSVG9RW04\", \"type_definitions\": [...] }, ], \"continuation_token\": \"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\" } ``` If there are no more authorization models available, the `continuation_token` field will be empty ```json { \"authorization_models\": [ { \"id\": \"01G50QVV17PECNVAHX1GG4Y5NC\", \"type_definitions\": [...] }, { \"id\": \"01G4ZW8F4A07AKQ8RHSVG9RW04\", \"type_definitions\": [...] }, ], \"continuation_token\": \"\" } ```- Parameters:
storeId- (required)pageSize- (optional)continuationToken- (optional)- Returns:
- ApiResponse<ReadAuthorizationModelsResponse>
- Throws:
ApiException- if fails to make API call
-
readAuthorizationModelsWithHttpInfo
public ApiResponse<ReadAuthorizationModelsResponse> readAuthorizationModelsWithHttpInfo(@Nonnull String storeId, @Nullable Integer pageSize, @Nullable String continuationToken, Map<String, String> headers) throws ApiExceptionReturn all the authorization models for a particular store The ReadAuthorizationModels API will return all the authorization models for a certain store. OpenFGA's response will contain an array of all authorization models, sorted in descending order of creation. ## Example Assume that a store's authorization model has been configured twice. To get all the authorization models that have been created in this store, call GET authorization-models. The API will return a response that looks like: ```json { \"authorization_models\": [ { \"id\": \"01G50QVV17PECNVAHX1GG4Y5NC\", \"type_definitions\": [...] }, { \"id\": \"01G4ZW8F4A07AKQ8RHSVG9RW04\", \"type_definitions\": [...] }, ], \"continuation_token\": \"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\" } ``` If there are no more authorization models available, the `continuation_token` field will be empty ```json { \"authorization_models\": [ { \"id\": \"01G50QVV17PECNVAHX1GG4Y5NC\", \"type_definitions\": [...] }, { \"id\": \"01G4ZW8F4A07AKQ8RHSVG9RW04\", \"type_definitions\": [...] }, ], \"continuation_token\": \"\" } ```- Parameters:
storeId- (required)pageSize- (optional)continuationToken- (optional)headers- Optional headers to include in the request- Returns:
- ApiResponse<ReadAuthorizationModelsResponse>
- Throws:
ApiException- if fails to make API call
-
writeAuthorizationModel
public WriteAuthorizationModelResponse writeAuthorizationModel(@Nonnull String storeId, @Nonnull WriteAuthorizationModelRequest body) throws ApiException Create a new authorization model The WriteAuthorizationModel API will add a new authorization model to a store. Each item in the `type_definitions` array is a type definition as specified in the field `type_definition`. The response will return the authorization model's ID in the `id` field. ## Example To add an authorization model with `user` and `document` type definitions, call POST authorization-models API with the body: ```json { \"type_definitions\":[ { \"type\":\"user\" }, { \"type\":\"document\", \"relations\":{ \"reader\":{ \"union\":{ \"child\":[ { \"this\":{} }, { \"computedUserset\":{ \"object\":\"\", \"relation\":\"writer\" } } ] } }, \"writer\":{ \"this\":{} } } } ] } ``` OpenFGA's response will include the version id for this authorization model, which will look like ``` {\"authorization_model_id\": \"01G50QVV17PECNVAHX1GG4Y5NC\"} ```- Parameters:
storeId- (required)body- (required)- Returns:
- WriteAuthorizationModelResponse
- Throws:
ApiException- if fails to make API call
-
writeAuthorizationModel
public WriteAuthorizationModelResponse writeAuthorizationModel(@Nonnull String storeId, @Nonnull WriteAuthorizationModelRequest body, Map<String, String> headers) throws ApiExceptionCreate a new authorization model The WriteAuthorizationModel API will add a new authorization model to a store. Each item in the `type_definitions` array is a type definition as specified in the field `type_definition`. The response will return the authorization model's ID in the `id` field. ## Example To add an authorization model with `user` and `document` type definitions, call POST authorization-models API with the body: ```json { \"type_definitions\":[ { \"type\":\"user\" }, { \"type\":\"document\", \"relations\":{ \"reader\":{ \"union\":{ \"child\":[ { \"this\":{} }, { \"computedUserset\":{ \"object\":\"\", \"relation\":\"writer\" } } ] } }, \"writer\":{ \"this\":{} } } } ] } ``` OpenFGA's response will include the version id for this authorization model, which will look like ``` {\"authorization_model_id\": \"01G50QVV17PECNVAHX1GG4Y5NC\"} ```- Parameters:
storeId- (required)body- (required)headers- Optional headers to include in the request- Returns:
- WriteAuthorizationModelResponse
- Throws:
ApiException- if fails to make API call
-
writeAuthorizationModelWithHttpInfo
public ApiResponse<WriteAuthorizationModelResponse> writeAuthorizationModelWithHttpInfo(@Nonnull String storeId, @Nonnull WriteAuthorizationModelRequest body) throws ApiException Create a new authorization model The WriteAuthorizationModel API will add a new authorization model to a store. Each item in the `type_definitions` array is a type definition as specified in the field `type_definition`. The response will return the authorization model's ID in the `id` field. ## Example To add an authorization model with `user` and `document` type definitions, call POST authorization-models API with the body: ```json { \"type_definitions\":[ { \"type\":\"user\" }, { \"type\":\"document\", \"relations\":{ \"reader\":{ \"union\":{ \"child\":[ { \"this\":{} }, { \"computedUserset\":{ \"object\":\"\", \"relation\":\"writer\" } } ] } }, \"writer\":{ \"this\":{} } } } ] } ``` OpenFGA's response will include the version id for this authorization model, which will look like ``` {\"authorization_model_id\": \"01G50QVV17PECNVAHX1GG4Y5NC\"} ```- Parameters:
storeId- (required)body- (required)- Returns:
- ApiResponse<WriteAuthorizationModelResponse>
- Throws:
ApiException- if fails to make API call
-
writeAuthorizationModelWithHttpInfo
public ApiResponse<WriteAuthorizationModelResponse> writeAuthorizationModelWithHttpInfo(@Nonnull String storeId, @Nonnull WriteAuthorizationModelRequest body, Map<String, String> headers) throws ApiExceptionCreate a new authorization model The WriteAuthorizationModel API will add a new authorization model to a store. Each item in the `type_definitions` array is a type definition as specified in the field `type_definition`. The response will return the authorization model's ID in the `id` field. ## Example To add an authorization model with `user` and `document` type definitions, call POST authorization-models API with the body: ```json { \"type_definitions\":[ { \"type\":\"user\" }, { \"type\":\"document\", \"relations\":{ \"reader\":{ \"union\":{ \"child\":[ { \"this\":{} }, { \"computedUserset\":{ \"object\":\"\", \"relation\":\"writer\" } } ] } }, \"writer\":{ \"this\":{} } } } ] } ``` OpenFGA's response will include the version id for this authorization model, which will look like ``` {\"authorization_model_id\": \"01G50QVV17PECNVAHX1GG4Y5NC\"} ```- Parameters:
storeId- (required)body- (required)headers- Optional headers to include in the request- Returns:
- ApiResponse<WriteAuthorizationModelResponse>
- Throws:
ApiException- if fails to make API call
-