Skip to content
Open
4 changes: 4 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ docs/RelationshipCondition.md
docs/SourceInfo.md
docs/Status.md
docs/Store.md
docs/StreamResultOfStreamedListObjectsResponse.md
docs/StreamedListObjectsResponse.md
docs/Tuple.md
docs/TupleChange.md
docs/TupleKey.md
Expand Down Expand Up @@ -157,6 +159,8 @@ model_relationship_condition.go
model_source_info.go
model_status.go
model_store.go
model_stream_result_of_streamed_list_objects_response.go
model_streamed_list_objects_response.go
model_tuple.go
model_tuple_change.go
model_tuple_key.go
Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
- feat: add generic `ToPtr[T any](v T) *T` function for creating pointers to any type
- deprecation: `PtrBool`, `PtrInt`, `PtrInt32`, `PtrInt64`, `PtrFloat32`, `PtrFloat64`, `PtrString`, and `PtrTime` are now deprecated in favor of the generic `ToPtr` function
- feat: add a top-level makefile in go-sdk to simplify running tests and linters: (#250)

- feat: add support for StreamedListObjects endpoint (#252)
## v0.7.3

### [0.7.3](https://github.com/openfga/go-sdk/compare/v0.7.2...v0.7.3)
### [0.7.3](https://github.com/openfga/go-sdk/compare/v0.7.2...v0.7.3) (2025-10-08)

- feat: add support for custom headers per request. See [documentation](https://github.com/openfga/go-sdk#custom-headers).
- feat: add support for conflict options for Write operations**: (#229)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Reading and following these guidelines will help us make the contribution proces
* [Getting Started](#getting-started)
* [Making Changes](#making-changes)
* [Opening Issues](#opening-issues)
* [Submitting Pull Requests](#submitting-pull-requests) [Note: We are not accepting Pull Requests at this time!]
* [Submitting Pull Requests](#submitting-pull-requests)
* [Getting in Touch](#getting-in-touch)
* [Have a question or problem?](#have-a-question-or-problem)
* [Vulnerability Reporting](#vulnerability-reporting)
Expand Down
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ This is an autogenerated Go SDK for OpenFGA. It provides a wrapper around the [O
- [Batch Check](#batch-check)
- [Expand](#expand)
- [List Objects](#list-objects)
- [Streamed List Objects](#streamed-list-objects)
- [List Relations](#list-relations)
- [List Users](#list-users)
- [Assertions](#assertions)
Expand Down Expand Up @@ -912,6 +913,50 @@ data, err := fgaClient.ListObjects(context.Background()).
// data.Objects = ["document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a"]
```

##### Streamed List Objects

List objects of a particular type that the user has access to, using the streaming API.

The Streamed ListObjects API is very similar to the ListObjects API, with two key differences:
1. **Streaming Results**: Instead of collecting all objects before returning a response, it streams them to the client as they are collected.
2. **No Pagination Limit**: Returns all results without the 1000-object limit of the standard ListObjects API.

This is particularly useful when querying **computed relations** that may return large result sets.

[API Documentation](https://openfga.dev/api/service#/Relationship%20Queries/StreamedListObjects)

```golang
options := ClientStreamedListObjectsOptions{
// You can rely on the model id set in the configuration or override it for this specific request
AuthorizationModelId: openfga.PtrString("01GAHCE4YVKPQEKZQHT2R89MQV"),
}

body := ClientStreamedListObjectsRequest{
User: "user:anne",
Relation: "can_read",
Type: "document",
}

response, err := fgaClient.StreamedListObjects(context.Background()).Body(body).Options(options).Execute()
if err != nil {
// .. Handle error
}
defer response.Close()

// Consume objects from the stream
var objects []string
for obj := range response.Objects {
objects = append(objects, obj.Object)
}

// Check for any errors during streaming
if err := <-response.Errors; err != nil {
// .. Handle streaming error
}

// objects = ["document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a"]
```

#### List Relations

List the relations a user has on an object.
Expand Down Expand Up @@ -1101,6 +1146,7 @@ Class | Method | HTTP request | Description
*OpenFgaApi* | [**ReadAuthorizationModel**](docs/OpenFgaApi.md#readauthorizationmodel) | **Get** /stores/{store_id}/authorization-models/{id} | Return a particular version of an authorization model
*OpenFgaApi* | [**ReadAuthorizationModels**](docs/OpenFgaApi.md#readauthorizationmodels) | **Get** /stores/{store_id}/authorization-models | Return all the authorization models for a particular store
*OpenFgaApi* | [**ReadChanges**](docs/OpenFgaApi.md#readchanges) | **Get** /stores/{store_id}/changes | Return a list of all the tuple changes
*OpenFgaApi* | [**StreamedListObjects**](docs/OpenFgaApi.md#streamedlistobjects) | **Post** /stores/{store_id}/streamed-list-objects | Stream all objects of the given type that the user has a relation with
*OpenFgaApi* | [**Write**](docs/OpenFgaApi.md#write) | **Post** /stores/{store_id}/write | Add or delete tuples from the store
*OpenFgaApi* | [**WriteAssertions**](docs/OpenFgaApi.md#writeassertions) | **Put** /stores/{store_id}/assertions/{authorization_model_id} | Upsert assertions for an authorization model ID
*OpenFgaApi* | [**WriteAuthorizationModel**](docs/OpenFgaApi.md#writeauthorizationmodel) | **Post** /stores/{store_id}/authorization-models | Create a new authorization model
Expand Down Expand Up @@ -1166,6 +1212,8 @@ Class | Method | HTTP request | Description
- [SourceInfo](docs/SourceInfo.md)
- [Status](docs/Status.md)
- [Store](docs/Store.md)
- [StreamResultOfStreamedListObjectsResponse](docs/StreamResultOfStreamedListObjectsResponse.md)
- [StreamedListObjectsResponse](docs/StreamedListObjectsResponse.md)
- [Tuple](docs/Tuple.md)
- [TupleChange](docs/TupleChange.md)
- [TupleKey](docs/TupleKey.md)
Expand Down
Loading
Loading