Skip to content

Commit

Permalink
Merge pull request #26 from openfga/feat/model-http-in-client-responses
Browse files Browse the repository at this point in the history
feat: model client responses
  • Loading branch information
rhamzeh authored Oct 11, 2023
2 parents 38361ba + 38835f2 commit 6cecea0
Show file tree
Hide file tree
Showing 39 changed files with 1,389 additions and 1,483 deletions.
17 changes: 17 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,27 @@ src/main/java/dev/openfga/sdk/api/client/ApiClient.java
src/main/java/dev/openfga/sdk/api/client/ApiResponse.java
src/main/java/dev/openfga/sdk/api/client/ClientAssertion.java
src/main/java/dev/openfga/sdk/api/client/ClientCheckRequest.java
src/main/java/dev/openfga/sdk/api/client/ClientCheckResponse.java
src/main/java/dev/openfga/sdk/api/client/ClientCreateStoreResponse.java
src/main/java/dev/openfga/sdk/api/client/ClientDeleteStoreResponse.java
src/main/java/dev/openfga/sdk/api/client/ClientExpandRequest.java
src/main/java/dev/openfga/sdk/api/client/ClientExpandResponse.java
src/main/java/dev/openfga/sdk/api/client/ClientGetStoreResponse.java
src/main/java/dev/openfga/sdk/api/client/ClientListObjectsRequest.java
src/main/java/dev/openfga/sdk/api/client/ClientListObjectsResponse.java
src/main/java/dev/openfga/sdk/api/client/ClientListRelationsRequest.java
src/main/java/dev/openfga/sdk/api/client/ClientListStoresResponse.java
src/main/java/dev/openfga/sdk/api/client/ClientReadAssertionsResponse.java
src/main/java/dev/openfga/sdk/api/client/ClientReadAuthorizationModelResponse.java
src/main/java/dev/openfga/sdk/api/client/ClientReadAuthorizationModelsResponse.java
src/main/java/dev/openfga/sdk/api/client/ClientReadChangesResponse.java
src/main/java/dev/openfga/sdk/api/client/ClientReadRequest.java
src/main/java/dev/openfga/sdk/api/client/ClientReadResponse.java
src/main/java/dev/openfga/sdk/api/client/ClientTupleKey.java
src/main/java/dev/openfga/sdk/api/client/ClientWriteAssertionsResponse.java
src/main/java/dev/openfga/sdk/api/client/ClientWriteAuthorizationModelResponse.java
src/main/java/dev/openfga/sdk/api/client/ClientWriteRequest.java
src/main/java/dev/openfga/sdk/api/client/ClientWriteResponse.java
src/main/java/dev/openfga/sdk/api/client/HttpRequestAttempt.java
src/main/java/dev/openfga/sdk/api/client/OpenFgaClient.java
src/main/java/dev/openfga/sdk/api/configuration/ApiToken.java
Expand Down Expand Up @@ -172,7 +187,9 @@ src/main/java/dev/openfga/sdk/errors/FgaApiInternalError.java
src/main/java/dev/openfga/sdk/errors/FgaApiNotFoundError.java
src/main/java/dev/openfga/sdk/errors/FgaApiRateLimitExceededError.java
src/main/java/dev/openfga/sdk/errors/FgaApiValidationError.java
src/main/java/dev/openfga/sdk/errors/FgaError.java
src/main/java/dev/openfga/sdk/errors/FgaInvalidParameterException.java
src/main/java/dev/openfga/sdk/errors/HttpStatusCode.java
src/main/java/dev/openfga/sdk/util/Pair.java
src/main/java/dev/openfga/sdk/util/StringUtil.java
src/test-integration/java/dev/openfga/sdk/api/OpenFgaApiIntegrationTest.java
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## v0.2.0

### [0.2.0](https://github.com/openfga/java-sdk/compare/v0.1.0...v0.2.0) (2023-10-11)

- feat(client): automatic retries for errors have been implemented. HTTP 429 and HTTP 5XX error responses
will automatically be retried. (With the exception of the HTTP 501 "Not Implemented" status code.)
- feat(client): new response error classes have been introduced to classify FGA error responses
- feat(client): response types have been enriched with HTTP status/header/body response data
- feat(client): response errors have been enriched with data from both the HTTP request and its repsonse
- [BREAKING] refactor(client): in the lower level OpenFgaApi class, api calls and api calls "...WithHttpInfo"
are collapsed into a single api call that always includes HTTP information.

## v0.1.0

### [0.1.0](https://github.com/openfga/java-sdk/compare/v0.0.5...v0.1.0) (2023-09-27)
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ It can be used with the following:
* Gradle (Groovy)

```groovy
implementation 'dev.openfga:openfga-sdk:0.1.0'
implementation 'dev.openfga:openfga-sdk:0.2.0'
```

* Gradle (Kotlin)

```kotlin
implementation("dev.openfga:openfga-sdk:0.1.0")
implementation("dev.openfga:openfga-sdk:0.2.0")
```

* Apache Maven
Expand All @@ -89,26 +89,26 @@ implementation("dev.openfga:openfga-sdk:0.1.0")
<dependency>
<groupId>dev.openfga</groupId>
<artifactId>openfga-sdk</artifactId>
<version>0.1.0</version>
<version>0.2.0</version>
</dependency>
```

* Ivy

```xml
<dependency org="dev.openfga" name="openfga-sdk" rev="0.1.0"/>
<dependency org="dev.openfga" name="openfga-sdk" rev="0.2.0"/>
```

* SBT

```scala
libraryDependencies += "dev.openfga" % "openfga-sdk" % "0.1.0"
libraryDependencies += "dev.openfga" % "openfga-sdk" % "0.2.0"
```

* Leiningen

```edn
[dev.openfga/openfga-sdk "0.1.0"]
[dev.openfga/openfga-sdk "0.2.0"]
```


Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ plugins {
apply from: 'publish.gradle'

group = 'dev.openfga'
version = '0.1.0'
version = '0.2.0'

repositories {
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ publishing {
pom {
group = 'dev.openfga'
name = 'openfga-sdk'
version = '0.1.0'
version = '0.2.0'
description = 'This is an autogenerated Java SDK for OpenFGA. It provides a wrapper around the [OpenFGA API definition](https://openfga.dev/api).'
url = 'https://openfga.dev'
licenses {
Expand Down
Loading

0 comments on commit 6cecea0

Please sign in to comment.