Skip to content

Commit

Permalink
feat!: remove store ID from API config, allow override per-request (#101
Browse files Browse the repository at this point in the history
)

* feat!: remove store ID from API config, allow override per-request

* add back list relations maxParallelReqs from generation

* adds back removed MaxParallelRequests docs

* update ULID format error description
  • Loading branch information
jimmyjames authored May 30, 2024
1 parent 4d3ff71 commit 392f47a
Show file tree
Hide file tree
Showing 96 changed files with 1,721 additions and 716 deletions.
2 changes: 2 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ docs/TupleToUserset.md
docs/TypeDefinition.md
docs/TypeName.md
docs/TypedWildcard.md
docs/UnauthenticatedResponse.md
docs/UnprocessableContentErrorCode.md
docs/UnprocessableContentMessageResponse.md
docs/User.md
Expand Down Expand Up @@ -171,6 +172,7 @@ model_tuple_to_userset.go
model_type_definition.go
model_type_name.go
model_typed_wildcard.go
model_unauthenticated_response.go
model_unprocessable_content_error_code.go
model_unprocessable_content_message_response.go
model_user.go
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,8 @@ List the relations a user has on an object.
options := ClientListRelationsOptions{
// You can rely on the model id set in the configuration or override it for this specific request
AuthorizationModelId: openfga.PtrString("01GAHCE4YVKPQEKZQHT2R89MQV"),
// Max number of requests to issue in parallel, defaults to 10
MaxParallelRequests: openfga.PtrInt32(5),
}
body := ClientListRelationsRequest{
User: "user:81684243-9356-4421-8fbf-a4f8d36aa31b",
Expand Down Expand Up @@ -896,7 +898,7 @@ Class | Method | HTTP request | Description
*OpenFgaApi* | [**GetStore**](docs/OpenFgaApi.md#getstore) | **Get** /stores/{store_id} | Get a store
*OpenFgaApi* | [**ListObjects**](docs/OpenFgaApi.md#listobjects) | **Post** /stores/{store_id}/list-objects | List all objects of the given type that the user has a relation with
*OpenFgaApi* | [**ListStores**](docs/OpenFgaApi.md#liststores) | **Get** /stores | List all stores
*OpenFgaApi* | [**ListUsers**](docs/OpenFgaApi.md#listusers) | **Post** /stores/{store_id}/list-users | List all users of the given type that the object has a relation with
*OpenFgaApi* | [**ListUsers**](docs/OpenFgaApi.md#listusers) | **Post** /stores/{store_id}/list-users | [EXPERIMENTAL] List the users matching the provided filter who have a certain relation to a particular type.
*OpenFgaApi* | [**Read**](docs/OpenFgaApi.md#read) | **Post** /stores/{store_id}/read | Get tuples from the store that matches a query, without following userset rewrite rules
*OpenFgaApi* | [**ReadAssertions**](docs/OpenFgaApi.md#readassertions) | **Get** /stores/{store_id}/assertions/{authorization_model_id} | Read assertions for an authorization model ID
*OpenFgaApi* | [**ReadAuthorizationModel**](docs/OpenFgaApi.md#readauthorizationmodel) | **Get** /stores/{store_id}/authorization-models/{id} | Return a particular version of an authorization model
Expand Down Expand Up @@ -969,6 +971,7 @@ Class | Method | HTTP request | Description
- [TypeDefinition](docs/TypeDefinition.md)
- [TypeName](docs/TypeName.md)
- [TypedWildcard](docs/TypedWildcard.md)
- [UnauthenticatedResponse](docs/UnauthenticatedResponse.md)
- [UnprocessableContentErrorCode](docs/UnprocessableContentErrorCode.md)
- [UnprocessableContentMessageResponse](docs/UnprocessableContentMessageResponse.md)
- [User](docs/User.md)
Expand Down
12 changes: 2 additions & 10 deletions api_client.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Go SDK for OpenFGA
*
* API version: 0.1
* API version: 1.x
* Website: https://openfga.dev
* Documentation: https://openfga.dev/docs
* Support: https://openfga.dev/community
Expand Down Expand Up @@ -44,7 +44,7 @@ type ErrorResponse struct {
Message string `json:"message"`
}

// APIClient manages communication with the OpenFGA API v0.1
// APIClient manages communication with the OpenFGA API v1.x
// In most cases there should be only one, shared, APIClient.
type APIClient struct {
cfg *Configuration
Expand Down Expand Up @@ -90,14 +90,6 @@ func NewAPIClient(cfg *Configuration) *APIClient {
return c
}

func (a APIClient) GetStoreId() string {
return a.cfg.StoreId
}

func (a APIClient) SetStoreId(storeId string) {
a.cfg.StoreId = storeId
}

// selectHeaderContentType select a content type from the available list.
func selectHeaderContentType(contentTypes []string) string {
if len(contentTypes) == 0 {
Expand Down
757 changes: 364 additions & 393 deletions api_open_fga.go

Large diffs are not rendered by default.

Loading

0 comments on commit 392f47a

Please sign in to comment.