Skip to content

Commit

Permalink
chore: cleanup models
Browse files Browse the repository at this point in the history
  • Loading branch information
rhamzeh committed Oct 13, 2023
1 parent 56da501 commit 45c579a
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 51 deletions.
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 45c579a

Please sign in to comment.