-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
31870f6
commit a951dd2
Showing
3 changed files
with
152 additions
and
10 deletions.
There are no files selected for viewing
80 changes: 80 additions & 0 deletions
80
src/main/java/dev/openfga/sdk/api/client/ClientBatchCheckResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
* OpenFGA | ||
* A high performance and flexible authorization/permission engine built for developers and inspired by Google Zanzibar. | ||
* | ||
* The version of the OpenAPI document: 0.1 | ||
* Contact: community@openfga.dev | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | ||
* https://openapi-generator.tech | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
package dev.openfga.sdk.api.client; | ||
|
||
import dev.openfga.sdk.api.model.CheckResponse; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class ClientBatchCheckResponse extends CheckResponse { | ||
private final ClientCheckRequest request; | ||
private final Throwable throwable; | ||
private final int statusCode; | ||
private final Map<String, List<String>> headers; | ||
private final String rawResponse; | ||
|
||
public ClientBatchCheckResponse( | ||
ClientCheckRequest request, ClientCheckResponse clientCheckResponse, Throwable throwable) { | ||
this.request = request; | ||
this.throwable = throwable; | ||
|
||
this.statusCode = clientCheckResponse.getStatusCode(); | ||
this.headers = clientCheckResponse.getHeaders(); | ||
this.rawResponse = clientCheckResponse.getRawResponse(); | ||
this.setAllowed(clientCheckResponse.getAllowed()); | ||
this.setResolution(clientCheckResponse.getResolution()); | ||
} | ||
|
||
public ClientCheckRequest getRequest() { | ||
return request; | ||
} | ||
|
||
/** | ||
* Returns the result of the check. | ||
* <p> | ||
* If the HTTP request was unsuccessful, this result will be null. If this is the case, you can examine the | ||
* original request with {@link ClientBatchCheckResponse#getRequest()} and the exception with | ||
* {@link ClientBatchCheckResponse#getThrowable()}. | ||
* | ||
* @return the check result. Is null if the HTTP request was unsuccessful. | ||
*/ | ||
@Override | ||
public Boolean getAllowed() { | ||
return super.getAllowed(); | ||
} | ||
|
||
/** | ||
* Returns the caught exception if the HTTP request was unsuccessful. | ||
* <p> | ||
* If the HTTP request was unsuccessful, this result will be null. If this is the case, you can examine the | ||
* original request with {@link ClientBatchCheckResponse#getRequest()} and the exception with | ||
* {@link ClientBatchCheckResponse#getThrowable()}. | ||
* | ||
* @return the caught exception. Is null if the HTTP request was successful. | ||
*/ | ||
public Throwable getThrowable() { | ||
return throwable; | ||
} | ||
|
||
public int getStatusCode() { | ||
return statusCode; | ||
} | ||
|
||
public Map<String, List<String>> getHeaders() { | ||
return headers; | ||
} | ||
|
||
public String getRawResponse() { | ||
return rawResponse; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters