Skip to content

Commit

Permalink
release(v0.2.3): with various client fixes (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhamzeh authored Oct 13, 2023
2 parents 56da501 + 9a204b3 commit 868313b
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 53 deletions.
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.3

### [0.2.3](https://github.com/openfga/go-sdk/compare/v0.2.2...v0.2.3) (2023-10-13)

- fix: allow setting user agent
- fix(client): resolve null pointer exceptions when getting auth model id
- fix(client): allow read to contain empty fields
- fix(client): require auth model id and store id to be ulids
- fix(client): resolve cases where req options was not respected
- fix: add retry logic to oauth
- chore: target go1.21.3 and upgrade dependencies

## v0.2.2

### [0.2.2](https://github.com/openfga/go-sdk/compare/v0.2.1...v0.2.2) (2023-04-21)
Expand Down
4 changes: 2 additions & 2 deletions configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
)

const (
SdkVersion = "0.2.2"
SdkVersion = "0.2.3"

defaultUserAgent = "openfga-sdk go/0.2.2"
defaultUserAgent = "openfga-sdk go/0.2.3"
)

// RetryParams configures configuration for retry in case of HTTP too many request
Expand Down
8 changes: 2 additions & 6 deletions model_assertion.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,8 @@ func (o *Assertion) SetExpectation(v bool) {

func (o Assertion) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["tuple_key"] = o.TupleKey
}
if true {
toSerialize["expectation"] = o.Expectation
}
toSerialize["tuple_key"] = o.TupleKey
toSerialize["expectation"] = o.Expectation
return json.Marshal(toSerialize)
}

Expand Down
4 changes: 1 addition & 3 deletions model_authorization_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,7 @@ func (o AuthorizationModel) MarshalJSON() ([]byte, error) {
if o.Id != nil {
toSerialize["id"] = o.Id
}
if true {
toSerialize["schema_version"] = o.SchemaVersion
}
toSerialize["schema_version"] = o.SchemaVersion
if o.TypeDefinitions != nil {
toSerialize["type_definitions"] = o.TypeDefinitions
}
Expand Down
4 changes: 1 addition & 3 deletions model_check_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,7 @@ func (o *CheckRequest) SetTrace(v bool) {

func (o CheckRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["tuple_key"] = o.TupleKey
}
toSerialize["tuple_key"] = o.TupleKey
if o.ContextualTuples != nil {
toSerialize["contextual_tuples"] = o.ContextualTuples
}
Expand Down
4 changes: 1 addition & 3 deletions model_contextual_tuple_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ func (o *ContextualTupleKeys) SetTupleKeys(v []TupleKey) {

func (o ContextualTupleKeys) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["tuple_keys"] = o.TupleKeys
}
toSerialize["tuple_keys"] = o.TupleKeys
return json.Marshal(toSerialize)
}

Expand Down
4 changes: 1 addition & 3 deletions model_create_store_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ func (o *CreateStoreRequest) SetName(v string) {

func (o CreateStoreRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["name"] = o.Name
}
toSerialize["name"] = o.Name
return json.Marshal(toSerialize)
}

Expand Down
8 changes: 2 additions & 6 deletions model_difference.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,8 @@ func (o *Difference) SetSubtract(v Userset) {

func (o Difference) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["base"] = o.Base
}
if true {
toSerialize["subtract"] = o.Subtract
}
toSerialize["base"] = o.Base
toSerialize["subtract"] = o.Subtract
return json.Marshal(toSerialize)
}

Expand Down
4 changes: 1 addition & 3 deletions model_expand_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,7 @@ func (o *ExpandRequest) SetAuthorizationModelId(v string) {

func (o ExpandRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["tuple_key"] = o.TupleKey
}
toSerialize["tuple_key"] = o.TupleKey
if o.AuthorizationModelId != nil {
toSerialize["authorization_model_id"] = o.AuthorizationModelId
}
Expand Down
12 changes: 3 additions & 9 deletions model_list_objects_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,9 @@ func (o ListObjectsRequest) MarshalJSON() ([]byte, error) {
if o.AuthorizationModelId != nil {
toSerialize["authorization_model_id"] = o.AuthorizationModelId
}
if true {
toSerialize["type"] = o.Type
}
if true {
toSerialize["relation"] = o.Relation
}
if true {
toSerialize["user"] = o.User
}
toSerialize["type"] = o.Type
toSerialize["relation"] = o.Relation
toSerialize["user"] = o.User
if o.ContextualTuples != nil {
toSerialize["contextual_tuples"] = o.ContextualTuples
}
Expand Down
4 changes: 1 addition & 3 deletions model_relation_reference.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ func (o *RelationReference) SetWildcard(v map[string]interface{}) {

func (o RelationReference) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["type"] = o.Type
}
toSerialize["type"] = o.Type
if o.Relation != nil {
toSerialize["relation"] = o.Relation
}
Expand Down
4 changes: 1 addition & 3 deletions model_tuple_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ func (o *TupleKeys) SetTupleKeys(v []TupleKey) {

func (o TupleKeys) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["tuple_keys"] = o.TupleKeys
}
toSerialize["tuple_keys"] = o.TupleKeys
return json.Marshal(toSerialize)
}

Expand Down
4 changes: 1 addition & 3 deletions model_type_definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ func (o *TypeDefinition) SetMetadata(v Metadata) {

func (o TypeDefinition) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["type"] = o.Type
}
toSerialize["type"] = o.Type
if o.Relations != nil {
toSerialize["relations"] = o.Relations
}
Expand Down
4 changes: 1 addition & 3 deletions model_write_assertions_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ func (o *WriteAssertionsRequest) SetAssertions(v []Assertion) {

func (o WriteAssertionsRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["assertions"] = o.Assertions
}
toSerialize["assertions"] = o.Assertions
return json.Marshal(toSerialize)
}

Expand Down
4 changes: 1 addition & 3 deletions model_write_authorization_model_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,7 @@ func (o *WriteAuthorizationModelRequest) SetSchemaVersion(v string) {

func (o WriteAuthorizationModelRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["type_definitions"] = o.TypeDefinitions
}
toSerialize["type_definitions"] = o.TypeDefinitions
if o.SchemaVersion != nil {
toSerialize["schema_version"] = o.SchemaVersion
}
Expand Down

0 comments on commit 868313b

Please sign in to comment.