diff --git a/README.md b/README.md index 8870364..5e8531f 100644 --- a/README.md +++ b/README.md @@ -461,7 +461,7 @@ body := ClientWriteRequest{ Relation: "viewer", Object: "document:budget", } }, - Deletes: &[]ClientTupleKey{ { + Deletes: &[]ClientTupleKeyWithoutCondition{ { User: "user:81684243-9356-4421-8fbf-a4f8d36aa31b", Relation: "writer", Object: "document:roadmap", @@ -492,7 +492,7 @@ body := ClientWriteRequest{ Relation: "viewer", Object: "document:budget", } }, - Deletes: &[]ClientTupleKey{ { + Deletes: &[]ClientTupleKeyWithoutCondition{ { User: "user:81684243-9356-4421-8fbf-a4f8d36aa31b", Relation: "writer", Object: "document:roadmap", @@ -843,6 +843,7 @@ Class | Method | HTTP request | Description - [Tuple](docs/Tuple.md) - [TupleChange](docs/TupleChange.md) - [TupleKey](docs/TupleKey.md) + - [TupleKeyWithoutCondition](docs/TupleKeyWithoutCondition.md) - [TupleOperation](docs/TupleOperation.md) - [TupleToUserset](docs/TupleToUserset.md) - [TypeDefinition](docs/TypeDefinition.md) @@ -858,8 +859,8 @@ Class | Method | HTTP request | Description - [WriteAuthorizationModelRequest](docs/WriteAuthorizationModelRequest.md) - [WriteAuthorizationModelResponse](docs/WriteAuthorizationModelResponse.md) - [WriteRequest](docs/WriteRequest.md) - - [WriteRequestTupleKey](docs/WriteRequestTupleKey.md) - - [WriteRequestTupleKeys](docs/WriteRequestTupleKeys.md) + - [WriteRequestDeletes](docs/WriteRequestDeletes.md) + - [WriteRequestWrites](docs/WriteRequestWrites.md) ## Contributing diff --git a/api_open_fga.go b/api_open_fga.go index 40c60e2..c7f71df 100644 --- a/api_open_fga.go +++ b/api_open_fga.go @@ -189,6 +189,7 @@ type OpenFgaApi interface { You may also specify `contextual_tuples` that will be treated as regular tuples. The response will contain the related objects in an array in the "objects" field of the response and they will be strings in the object format `:` (e.g. "document:roadmap"). The number of objects in the response array will be limited by the execution timeout specified in the flag OPENFGA_LIST_OBJECTS_DEADLINE and by the upper bound specified in the flag OPENFGA_LIST_OBJECTS_MAX_RESULTS, whichever is hit first. + The objects given will not be sorted, and therefore two identical calls can give a given different set of objects. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return ApiListObjectsRequest */ @@ -1998,6 +1999,7 @@ An `authorization_model_id` may be specified in the body. If it is not specified You may also specify `contextual_tuples` that will be treated as regular tuples. The response will contain the related objects in an array in the "objects" field of the response and they will be strings in the object format `:` (e.g. "document:roadmap"). The number of objects in the response array will be limited by the execution timeout specified in the flag OPENFGA_LIST_OBJECTS_DEADLINE and by the upper bound specified in the flag OPENFGA_LIST_OBJECTS_MAX_RESULTS, whichever is hit first. +The objects given will not be sorted, and therefore two identical calls can give a given different set of objects. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiListObjectsRequest */ diff --git a/api_open_fga_test.go b/api_open_fga_test.go index af76e2f..b81df49 100644 --- a/api_open_fga_test.go +++ b/api_open_fga_test.go @@ -621,8 +621,8 @@ func TestOpenFgaApi(t *testing.T) { RequestPath: "write", } requestBody := WriteRequest{ - Writes: &WriteRequestTupleKeys{ - TupleKeys: []WriteRequestTupleKey{{ + Writes: &WriteRequestWrites{ + TupleKeys: []TupleKey{{ User: "user:81684243-9356-4421-8fbf-a4f8d36aa31b", Relation: "viewer", Object: "document:roadmap", @@ -667,8 +667,8 @@ func TestOpenFgaApi(t *testing.T) { } requestBody := WriteRequest{ - Deletes: &WriteRequestTupleKeys{ - TupleKeys: []WriteRequestTupleKey{{ + Deletes: &WriteRequestDeletes{ + TupleKeys: []TupleKeyWithoutCondition{{ User: "user:81684243-9356-4421-8fbf-a4f8d36aa31b", Relation: "viewer", Object: "document:roadmap", diff --git a/client/client.go b/client/client.go index 40375ec..6eaaa91 100644 --- a/client/client.go +++ b/client/client.go @@ -114,7 +114,7 @@ type ClientRequestOptionsWithAuthZModelId struct { } type ClientTupleKey = fgaSdk.TupleKey -type ClientWriteRequestTupleKey = fgaSdk.WriteRequestTupleKey +type ClientTupleKeyWithoutCondition = fgaSdk.TupleKeyWithoutCondition type ClientCheckRequestTupleKey = fgaSdk.CheckRequestTupleKey type ClientReadRequestTupleKey = fgaSdk.ReadRequestTupleKey type ClientExpandRequestTupleKey = fgaSdk.ExpandRequestTupleKey @@ -1156,8 +1156,8 @@ type SdkClientWriteRequestInterface interface { } type ClientWriteRequest struct { - Writes []ClientWriteRequestTupleKey - Deletes []ClientWriteRequestTupleKey + Writes []ClientTupleKey + Deletes []ClientTupleKeyWithoutCondition } type TransactionOptions struct { @@ -1182,14 +1182,34 @@ const ( FAILURE ClientWriteStatus = "CLIENT_WRITE_STATUS_FAILURE" ) -type ClientWriteSingleResponse struct { - TupleKey ClientWriteRequestTupleKey `json:"tuple_key,omitempty"` - Status ClientWriteStatus `json:"status,omitempty"` - HttpResponse *_nethttp.Response `json:"http_response,omitempty"` - Error error `json:"error,omitempty"` +type ClientWriteRequestWriteResponse struct { + TupleKey ClientTupleKey `json:"tuple_key,omitempty"` + Status ClientWriteStatus `json:"status,omitempty"` + HttpResponse *_nethttp.Response `json:"http_response,omitempty"` + Error error `json:"error,omitempty"` } -func (o ClientWriteSingleResponse) MarshalJSON() ([]byte, error) { +func (o ClientWriteRequestWriteResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + toSerialize["tuple_key"] = o.TupleKey + toSerialize["status"] = o.Status + if o.HttpResponse != nil { + toSerialize["http_response"] = o.HttpResponse + } + if o.Error != nil { + toSerialize["error"] = o.Error + } + return json.Marshal(toSerialize) +} + +type ClientWriteRequestDeleteResponse struct { + TupleKey ClientTupleKeyWithoutCondition `json:"tuple_key,omitempty"` + Status ClientWriteStatus `json:"status,omitempty"` + HttpResponse *_nethttp.Response `json:"http_response,omitempty"` + Error error `json:"error,omitempty"` +} + +func (o ClientWriteRequestDeleteResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} toSerialize["tuple_key"] = o.TupleKey toSerialize["status"] = o.Status @@ -1203,8 +1223,8 @@ func (o ClientWriteSingleResponse) MarshalJSON() ([]byte, error) { } type ClientWriteResponse struct { - Writes []ClientWriteSingleResponse `json:"writes,omitempty"` - Deletes []ClientWriteSingleResponse `json:"deletes,omitempty"` + Writes []ClientWriteRequestWriteResponse `json:"writes,omitempty"` + Deletes []ClientWriteRequestDeleteResponse `json:"deletes,omitempty"` } func (o ClientWriteResponse) MarshalJSON() ([]byte, error) { @@ -1269,8 +1289,8 @@ func (client *OpenFgaClient) WriteExecute(request SdkClientWriteRequestInterface } response := ClientWriteResponse{ - Writes: []ClientWriteSingleResponse{}, - Deletes: []ClientWriteSingleResponse{}, + Writes: []ClientWriteRequestWriteResponse{}, + Deletes: []ClientWriteRequestDeleteResponse{}, } authorizationModelId, err := client.getAuthorizationModelId(request.GetAuthorizationModelIdOverride()) @@ -1285,14 +1305,14 @@ func (client *OpenFgaClient) WriteExecute(request SdkClientWriteRequestInterface AuthorizationModelId: authorizationModelId, } if request.GetBody().Writes != nil && len(request.GetBody().Writes) > 0 { - writes := fgaSdk.WriteRequestTupleKeys{} + writes := fgaSdk.WriteRequestWrites{} for index := 0; index < len(request.GetBody().Writes); index++ { writes.TupleKeys = append(writes.TupleKeys, (request.GetBody().Writes)[index]) } writeRequest.Writes = &writes } if request.GetBody().Deletes != nil && len(request.GetBody().Deletes) > 0 { - deletes := fgaSdk.WriteRequestTupleKeys{} + deletes := fgaSdk.WriteRequestDeletes{} for index := 0; index < len(request.GetBody().Deletes); index++ { deletes.TupleKeys = append(deletes.TupleKeys, (request.GetBody().Deletes)[index]) } @@ -1308,7 +1328,7 @@ func (client *OpenFgaClient) WriteExecute(request SdkClientWriteRequestInterface if request.GetBody() != nil && request.GetBody().Writes != nil { writeRequestTupleKeys := request.GetBody().Writes for index := 0; index < len(writeRequestTupleKeys); index++ { - response.Writes = append(response.Writes, ClientWriteSingleResponse{ + response.Writes = append(response.Writes, ClientWriteRequestWriteResponse{ TupleKey: writeRequestTupleKeys[index], HttpResponse: httpResponse, Status: clientWriteStatus, @@ -1320,7 +1340,7 @@ func (client *OpenFgaClient) WriteExecute(request SdkClientWriteRequestInterface if request.GetBody() != nil && request.GetBody().Deletes != nil { deleteRequestTupleKeys := request.GetBody().Deletes for index := 0; index < len(deleteRequestTupleKeys); index++ { - response.Deletes = append(response.Deletes, ClientWriteSingleResponse{ + response.Deletes = append(response.Deletes, ClientWriteRequestDeleteResponse{ TupleKey: deleteRequestTupleKeys[index], HttpResponse: httpResponse, Status: clientWriteStatus, @@ -1337,7 +1357,7 @@ func (client *OpenFgaClient) WriteExecute(request SdkClientWriteRequestInterface // - each request is a transaction // - the max items in each request are based on maxPerChunk (default=1) var writeChunkSize = int(maxPerChunk) - var writeChunks [][]ClientWriteRequestTupleKey + var writeChunks [][]ClientTupleKey if request.GetBody() != nil { for i := 0; i < len(request.GetBody().Writes); i += writeChunkSize { end := int(math.Min(float64(i+writeChunkSize), float64(len(request.GetBody().Writes)))) @@ -1377,7 +1397,7 @@ func (client *OpenFgaClient) WriteExecute(request SdkClientWriteRequestInterface _ = writeGroup.Wait() var deleteChunkSize = int(maxPerChunk) - var deleteChunks [][]ClientWriteRequestTupleKey + var deleteChunks [][]ClientTupleKeyWithoutCondition if request.GetBody() != nil { for i := 0; i < len(request.GetBody().Deletes); i += deleteChunkSize { end := int(math.Min(float64(i+writeChunkSize), float64(len(request.GetBody().Deletes)))) @@ -1445,7 +1465,7 @@ type SdkClientWriteTuplesRequestInterface interface { GetOptions() *ClientWriteOptions } -type ClientWriteTuplesBody = []ClientWriteRequestTupleKey +type ClientWriteTuplesBody = []ClientTupleKey func (client *OpenFgaClient) WriteTuples(ctx _context.Context) SdkClientWriteTuplesRequestInterface { return &SdkClientWriteTuplesRequest{ @@ -1509,7 +1529,7 @@ type SdkClientDeleteTuplesRequestInterface interface { GetOptions() *ClientWriteOptions } -type ClientDeleteTuplesBody = []ClientWriteRequestTupleKey +type ClientDeleteTuplesBody = []ClientTupleKeyWithoutCondition func (client *OpenFgaClient) DeleteTuples(ctx _context.Context) SdkClientDeleteTuplesRequestInterface { return &SdkClientDeleteTuplesRequest{ diff --git a/client/client_test.go b/client/client_test.go index 8fb326c..c13141f 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -677,7 +677,7 @@ func TestOpenFgaClient(t *testing.T) { RequestPath: "write", } requestBody := ClientWriteRequest{ - Writes: []ClientWriteRequestTupleKey{{ + Writes: []ClientTupleKey{{ User: "user:81684243-9356-4421-8fbf-a4f8d36aa31b", Relation: "viewer", Object: "document:roadmap", @@ -761,7 +761,7 @@ func TestOpenFgaClient(t *testing.T) { RequestPath: "write", } requestBody := ClientWriteRequest{ - Writes: []ClientWriteRequestTupleKey{{ + Writes: []ClientTupleKey{{ User: "user:81684243-9356-4421-8fbf-a4f8d36aa31b", Relation: "viewer", Object: "document:roadmap", @@ -791,7 +791,7 @@ func TestOpenFgaClient(t *testing.T) { RequestPath: "write", } requestBody := ClientWriteRequest{ - Writes: []ClientWriteRequestTupleKey{{ + Writes: []ClientTupleKey{{ User: "user:81684243-9356-4421-8fbf-a4f8d36aa31b", Relation: "viewer", Object: "document:roadmap", @@ -800,7 +800,7 @@ func TestOpenFgaClient(t *testing.T) { Relation: "viewer", Object: "document:budget", }}, - Deletes: []ClientWriteRequestTupleKey{{ + Deletes: []ClientTupleKeyWithoutCondition{{ User: "user:81684243-9356-4421-8fbf-a4f8d36aa31b", Relation: "viewer", Object: "document:planning", @@ -889,7 +889,7 @@ func TestOpenFgaClient(t *testing.T) { Method: http.MethodPost, RequestPath: "write", } - requestBody := []ClientWriteRequestTupleKey{{ + requestBody := []ClientTupleKey{{ User: "user:81684243-9356-4421-8fbf-a4f8d36aa31b", Relation: "viewer", Object: "document:roadmap", @@ -972,7 +972,7 @@ func TestOpenFgaClient(t *testing.T) { RequestPath: "write", } - requestBody := []ClientWriteRequestTupleKey{{ + requestBody := []ClientTupleKeyWithoutCondition{{ User: "user:81684243-9356-4421-8fbf-a4f8d36aa31b", Relation: "viewer", Object: "document:roadmap", diff --git a/docs/TupleKeyWithoutCondition.md b/docs/TupleKeyWithoutCondition.md new file mode 100644 index 0000000..91f07a3 --- /dev/null +++ b/docs/TupleKeyWithoutCondition.md @@ -0,0 +1,93 @@ +# TupleKeyWithoutCondition + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**User** | **string** | | +**Relation** | **string** | | +**Object** | **string** | | + +## Methods + +### NewTupleKeyWithoutCondition + +`func NewTupleKeyWithoutCondition(user string, relation string, object string, ) *TupleKeyWithoutCondition` + +NewTupleKeyWithoutCondition instantiates a new TupleKeyWithoutCondition object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTupleKeyWithoutConditionWithDefaults + +`func NewTupleKeyWithoutConditionWithDefaults() *TupleKeyWithoutCondition` + +NewTupleKeyWithoutConditionWithDefaults instantiates a new TupleKeyWithoutCondition object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetUser + +`func (o *TupleKeyWithoutCondition) GetUser() string` + +GetUser returns the User field if non-nil, zero value otherwise. + +### GetUserOk + +`func (o *TupleKeyWithoutCondition) GetUserOk() (*string, bool)` + +GetUserOk returns a tuple with the User field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUser + +`func (o *TupleKeyWithoutCondition) SetUser(v string)` + +SetUser sets User field to given value. + + +### GetRelation + +`func (o *TupleKeyWithoutCondition) GetRelation() string` + +GetRelation returns the Relation field if non-nil, zero value otherwise. + +### GetRelationOk + +`func (o *TupleKeyWithoutCondition) GetRelationOk() (*string, bool)` + +GetRelationOk returns a tuple with the Relation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRelation + +`func (o *TupleKeyWithoutCondition) SetRelation(v string)` + +SetRelation sets Relation field to given value. + + +### GetObject + +`func (o *TupleKeyWithoutCondition) GetObject() string` + +GetObject returns the Object field if non-nil, zero value otherwise. + +### GetObjectOk + +`func (o *TupleKeyWithoutCondition) GetObjectOk() (*string, bool)` + +GetObjectOk returns a tuple with the Object field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetObject + +`func (o *TupleKeyWithoutCondition) SetObject(v string)` + +SetObject sets Object field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/WriteRequest.md b/docs/WriteRequest.md index f090a70..3577332 100644 --- a/docs/WriteRequest.md +++ b/docs/WriteRequest.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Writes** | Pointer to [**WriteRequestTupleKeys**](WriteRequestTupleKeys.md) | | [optional] -**Deletes** | Pointer to [**WriteRequestTupleKeys**](WriteRequestTupleKeys.md) | | [optional] +**Writes** | Pointer to [**WriteRequestWrites**](WriteRequestWrites.md) | | [optional] +**Deletes** | Pointer to [**WriteRequestDeletes**](WriteRequestDeletes.md) | | [optional] **AuthorizationModelId** | Pointer to **string** | | [optional] ## Methods @@ -29,20 +29,20 @@ but it doesn't guarantee that properties required by API are set ### GetWrites -`func (o *WriteRequest) GetWrites() WriteRequestTupleKeys` +`func (o *WriteRequest) GetWrites() WriteRequestWrites` GetWrites returns the Writes field if non-nil, zero value otherwise. ### GetWritesOk -`func (o *WriteRequest) GetWritesOk() (*WriteRequestTupleKeys, bool)` +`func (o *WriteRequest) GetWritesOk() (*WriteRequestWrites, bool)` GetWritesOk returns a tuple with the Writes field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetWrites -`func (o *WriteRequest) SetWrites(v WriteRequestTupleKeys)` +`func (o *WriteRequest) SetWrites(v WriteRequestWrites)` SetWrites sets Writes field to given value. @@ -54,20 +54,20 @@ HasWrites returns a boolean if a field has been set. ### GetDeletes -`func (o *WriteRequest) GetDeletes() WriteRequestTupleKeys` +`func (o *WriteRequest) GetDeletes() WriteRequestDeletes` GetDeletes returns the Deletes field if non-nil, zero value otherwise. ### GetDeletesOk -`func (o *WriteRequest) GetDeletesOk() (*WriteRequestTupleKeys, bool)` +`func (o *WriteRequest) GetDeletesOk() (*WriteRequestDeletes, bool)` GetDeletesOk returns a tuple with the Deletes field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetDeletes -`func (o *WriteRequest) SetDeletes(v WriteRequestTupleKeys)` +`func (o *WriteRequest) SetDeletes(v WriteRequestDeletes)` SetDeletes sets Deletes field to given value. diff --git a/docs/WriteRequestTupleKeys.md b/docs/WriteRequestDeletes.md similarity index 58% rename from docs/WriteRequestTupleKeys.md rename to docs/WriteRequestDeletes.md index 68c4b9f..9ef9418 100644 --- a/docs/WriteRequestTupleKeys.md +++ b/docs/WriteRequestDeletes.md @@ -1,46 +1,46 @@ -# WriteRequestTupleKeys +# WriteRequestDeletes ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TupleKeys** | [**[]WriteRequestTupleKey**](WriteRequestTupleKey.md) | | +**TupleKeys** | [**[]TupleKeyWithoutCondition**](TupleKeyWithoutCondition.md) | | ## Methods -### NewWriteRequestTupleKeys +### NewWriteRequestDeletes -`func NewWriteRequestTupleKeys(tupleKeys []WriteRequestTupleKey, ) *WriteRequestTupleKeys` +`func NewWriteRequestDeletes(tupleKeys []TupleKeyWithoutCondition, ) *WriteRequestDeletes` -NewWriteRequestTupleKeys instantiates a new WriteRequestTupleKeys object +NewWriteRequestDeletes instantiates a new WriteRequestDeletes object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed -### NewWriteRequestTupleKeysWithDefaults +### NewWriteRequestDeletesWithDefaults -`func NewWriteRequestTupleKeysWithDefaults() *WriteRequestTupleKeys` +`func NewWriteRequestDeletesWithDefaults() *WriteRequestDeletes` -NewWriteRequestTupleKeysWithDefaults instantiates a new WriteRequestTupleKeys object +NewWriteRequestDeletesWithDefaults instantiates a new WriteRequestDeletes object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set ### GetTupleKeys -`func (o *WriteRequestTupleKeys) GetTupleKeys() []WriteRequestTupleKey` +`func (o *WriteRequestDeletes) GetTupleKeys() []TupleKeyWithoutCondition` GetTupleKeys returns the TupleKeys field if non-nil, zero value otherwise. ### GetTupleKeysOk -`func (o *WriteRequestTupleKeys) GetTupleKeysOk() (*[]WriteRequestTupleKey, bool)` +`func (o *WriteRequestDeletes) GetTupleKeysOk() (*[]TupleKeyWithoutCondition, bool)` GetTupleKeysOk returns a tuple with the TupleKeys field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetTupleKeys -`func (o *WriteRequestTupleKeys) SetTupleKeys(v []WriteRequestTupleKey)` +`func (o *WriteRequestDeletes) SetTupleKeys(v []TupleKeyWithoutCondition)` SetTupleKeys sets TupleKeys field to given value. diff --git a/docs/WriteRequestTupleKey.md b/docs/WriteRequestTupleKey.md deleted file mode 100644 index 0bbb904..0000000 --- a/docs/WriteRequestTupleKey.md +++ /dev/null @@ -1,119 +0,0 @@ -# WriteRequestTupleKey - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**User** | **string** | | -**Relation** | **string** | | -**Object** | **string** | | -**Condition** | Pointer to [**RelationshipCondition**](RelationshipCondition.md) | | [optional] - -## Methods - -### NewWriteRequestTupleKey - -`func NewWriteRequestTupleKey(user string, relation string, object string, ) *WriteRequestTupleKey` - -NewWriteRequestTupleKey instantiates a new WriteRequestTupleKey object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewWriteRequestTupleKeyWithDefaults - -`func NewWriteRequestTupleKeyWithDefaults() *WriteRequestTupleKey` - -NewWriteRequestTupleKeyWithDefaults instantiates a new WriteRequestTupleKey object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetUser - -`func (o *WriteRequestTupleKey) GetUser() string` - -GetUser returns the User field if non-nil, zero value otherwise. - -### GetUserOk - -`func (o *WriteRequestTupleKey) GetUserOk() (*string, bool)` - -GetUserOk returns a tuple with the User field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUser - -`func (o *WriteRequestTupleKey) SetUser(v string)` - -SetUser sets User field to given value. - - -### GetRelation - -`func (o *WriteRequestTupleKey) GetRelation() string` - -GetRelation returns the Relation field if non-nil, zero value otherwise. - -### GetRelationOk - -`func (o *WriteRequestTupleKey) GetRelationOk() (*string, bool)` - -GetRelationOk returns a tuple with the Relation field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRelation - -`func (o *WriteRequestTupleKey) SetRelation(v string)` - -SetRelation sets Relation field to given value. - - -### GetObject - -`func (o *WriteRequestTupleKey) GetObject() string` - -GetObject returns the Object field if non-nil, zero value otherwise. - -### GetObjectOk - -`func (o *WriteRequestTupleKey) GetObjectOk() (*string, bool)` - -GetObjectOk returns a tuple with the Object field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetObject - -`func (o *WriteRequestTupleKey) SetObject(v string)` - -SetObject sets Object field to given value. - - -### GetCondition - -`func (o *WriteRequestTupleKey) GetCondition() RelationshipCondition` - -GetCondition returns the Condition field if non-nil, zero value otherwise. - -### GetConditionOk - -`func (o *WriteRequestTupleKey) GetConditionOk() (*RelationshipCondition, bool)` - -GetConditionOk returns a tuple with the Condition field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCondition - -`func (o *WriteRequestTupleKey) SetCondition(v RelationshipCondition)` - -SetCondition sets Condition field to given value. - -### HasCondition - -`func (o *WriteRequestTupleKey) HasCondition() bool` - -HasCondition returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/WriteRequestWrites.md b/docs/WriteRequestWrites.md new file mode 100644 index 0000000..0f8aa86 --- /dev/null +++ b/docs/WriteRequestWrites.md @@ -0,0 +1,51 @@ +# WriteRequestWrites + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TupleKeys** | [**[]TupleKey**](TupleKey.md) | | + +## Methods + +### NewWriteRequestWrites + +`func NewWriteRequestWrites(tupleKeys []TupleKey, ) *WriteRequestWrites` + +NewWriteRequestWrites instantiates a new WriteRequestWrites object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewWriteRequestWritesWithDefaults + +`func NewWriteRequestWritesWithDefaults() *WriteRequestWrites` + +NewWriteRequestWritesWithDefaults instantiates a new WriteRequestWrites object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTupleKeys + +`func (o *WriteRequestWrites) GetTupleKeys() []TupleKey` + +GetTupleKeys returns the TupleKeys field if non-nil, zero value otherwise. + +### GetTupleKeysOk + +`func (o *WriteRequestWrites) GetTupleKeysOk() (*[]TupleKey, bool)` + +GetTupleKeysOk returns a tuple with the TupleKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTupleKeys + +`func (o *WriteRequestWrites) SetTupleKeys(v []TupleKey)` + +SetTupleKeys sets TupleKeys field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/go.mod b/go.mod index 5242eb3..9eda334 100644 --- a/go.mod +++ b/go.mod @@ -4,5 +4,5 @@ go 1.21.1 require ( github.com/jarcoal/httpmock v1.3.1 - golang.org/x/sync v0.5.0 + golang.org/x/sync v0.4.0 ) diff --git a/go.sum b/go.sum index 2ad7cad..db97259 100644 --- a/go.sum +++ b/go.sum @@ -4,5 +4,5 @@ github.com/jarcoal/httpmock v1.3.1 h1:iUx3whfZWVf3jT01hQTO/Eo5sAYtB2/rqaUuOtpInw github.com/jarcoal/httpmock v1.3.1/go.mod h1:3yb8rc4BI7TCBhFY8ng0gjuLKJNquuDNiPaZjnENuYg= github.com/maxatome/go-testdeep v1.12.0 h1:Ql7Go8Tg0C1D/uMMX59LAoYK7LffeJQ6X2T04nTH68g= github.com/maxatome/go-testdeep v1.12.0/go.mod h1:lPZc/HAcJMP92l7yI6TRz1aZN5URwUBUAfUNvrclaNM= -golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= +golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= diff --git a/model_null_value.go b/model_null_value.go index e409c1c..a3203d9 100644 --- a/model_null_value.go +++ b/model_null_value.go @@ -17,7 +17,7 @@ import ( "fmt" ) -// NullValue `NullValue` is a singleton enumeration to represent the null value for the `Value` type union. The JSON representation for `NullValue` is JSON `null`. - NULL_VALUE: Null value. +// NullValue `NullValue` is a singleton enumeration to represent the null value for the `Value` type union. The JSON representation for `NullValue` is JSON `null`. - NULL_VALUE: Null value. type NullValue string // List of NullValue diff --git a/model_tuple_key_without_condition.go b/model_tuple_key_without_condition.go new file mode 100644 index 0000000..3e6e0d9 --- /dev/null +++ b/model_tuple_key_without_condition.go @@ -0,0 +1,160 @@ +/** + * Go SDK for OpenFGA + * + * API version: 0.1 + * Website: https://openfga.dev + * Documentation: https://openfga.dev/docs + * Support: https://discord.gg/8naAwJfWN6 + * License: [Apache-2.0](https://github.com/openfga/go-sdk/blob/main/LICENSE) + * + * NOTE: This file was auto generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT. + */ + +package openfga + +import ( + "encoding/json" +) + +// TupleKeyWithoutCondition struct for TupleKeyWithoutCondition +type TupleKeyWithoutCondition struct { + User string `json:"user"yaml:"user"` + Relation string `json:"relation"yaml:"relation"` + Object string `json:"object"yaml:"object"` +} + +// NewTupleKeyWithoutCondition instantiates a new TupleKeyWithoutCondition object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTupleKeyWithoutCondition(user string, relation string, object string) *TupleKeyWithoutCondition { + this := TupleKeyWithoutCondition{} + this.User = user + this.Relation = relation + this.Object = object + return &this +} + +// NewTupleKeyWithoutConditionWithDefaults instantiates a new TupleKeyWithoutCondition object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTupleKeyWithoutConditionWithDefaults() *TupleKeyWithoutCondition { + this := TupleKeyWithoutCondition{} + return &this +} + +// GetUser returns the User field value +func (o *TupleKeyWithoutCondition) GetUser() string { + if o == nil { + var ret string + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *TupleKeyWithoutCondition) GetUserOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *TupleKeyWithoutCondition) SetUser(v string) { + o.User = v +} + +// GetRelation returns the Relation field value +func (o *TupleKeyWithoutCondition) GetRelation() string { + if o == nil { + var ret string + return ret + } + + return o.Relation +} + +// GetRelationOk returns a tuple with the Relation field value +// and a boolean to check if the value has been set. +func (o *TupleKeyWithoutCondition) GetRelationOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Relation, true +} + +// SetRelation sets field value +func (o *TupleKeyWithoutCondition) SetRelation(v string) { + o.Relation = v +} + +// GetObject returns the Object field value +func (o *TupleKeyWithoutCondition) GetObject() string { + if o == nil { + var ret string + return ret + } + + return o.Object +} + +// GetObjectOk returns a tuple with the Object field value +// and a boolean to check if the value has been set. +func (o *TupleKeyWithoutCondition) GetObjectOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Object, true +} + +// SetObject sets field value +func (o *TupleKeyWithoutCondition) SetObject(v string) { + o.Object = v +} + +func (o TupleKeyWithoutCondition) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + toSerialize["user"] = o.User + toSerialize["relation"] = o.Relation + toSerialize["object"] = o.Object + return json.Marshal(toSerialize) +} + +type NullableTupleKeyWithoutCondition struct { + value *TupleKeyWithoutCondition + isSet bool +} + +func (v NullableTupleKeyWithoutCondition) Get() *TupleKeyWithoutCondition { + return v.value +} + +func (v *NullableTupleKeyWithoutCondition) Set(val *TupleKeyWithoutCondition) { + v.value = val + v.isSet = true +} + +func (v NullableTupleKeyWithoutCondition) IsSet() bool { + return v.isSet +} + +func (v *NullableTupleKeyWithoutCondition) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTupleKeyWithoutCondition(val *TupleKeyWithoutCondition) *NullableTupleKeyWithoutCondition { + return &NullableTupleKeyWithoutCondition{value: val, isSet: true} +} + +func (v NullableTupleKeyWithoutCondition) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTupleKeyWithoutCondition) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_write_request.go b/model_write_request.go index 7acf8b6..12843b7 100644 --- a/model_write_request.go +++ b/model_write_request.go @@ -18,9 +18,9 @@ import ( // WriteRequest struct for WriteRequest type WriteRequest struct { - Writes *WriteRequestTupleKeys `json:"writes,omitempty"yaml:"writes,omitempty"` - Deletes *WriteRequestTupleKeys `json:"deletes,omitempty"yaml:"deletes,omitempty"` - AuthorizationModelId *string `json:"authorization_model_id,omitempty"yaml:"authorization_model_id,omitempty"` + Writes *WriteRequestWrites `json:"writes,omitempty"yaml:"writes,omitempty"` + Deletes *WriteRequestDeletes `json:"deletes,omitempty"yaml:"deletes,omitempty"` + AuthorizationModelId *string `json:"authorization_model_id,omitempty"yaml:"authorization_model_id,omitempty"` } // NewWriteRequest instantiates a new WriteRequest object @@ -41,9 +41,9 @@ func NewWriteRequestWithDefaults() *WriteRequest { } // GetWrites returns the Writes field value if set, zero value otherwise. -func (o *WriteRequest) GetWrites() WriteRequestTupleKeys { +func (o *WriteRequest) GetWrites() WriteRequestWrites { if o == nil || o.Writes == nil { - var ret WriteRequestTupleKeys + var ret WriteRequestWrites return ret } return *o.Writes @@ -51,7 +51,7 @@ func (o *WriteRequest) GetWrites() WriteRequestTupleKeys { // GetWritesOk returns a tuple with the Writes field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *WriteRequest) GetWritesOk() (*WriteRequestTupleKeys, bool) { +func (o *WriteRequest) GetWritesOk() (*WriteRequestWrites, bool) { if o == nil || o.Writes == nil { return nil, false } @@ -67,15 +67,15 @@ func (o *WriteRequest) HasWrites() bool { return false } -// SetWrites gets a reference to the given WriteRequestTupleKeys and assigns it to the Writes field. -func (o *WriteRequest) SetWrites(v WriteRequestTupleKeys) { +// SetWrites gets a reference to the given WriteRequestWrites and assigns it to the Writes field. +func (o *WriteRequest) SetWrites(v WriteRequestWrites) { o.Writes = &v } // GetDeletes returns the Deletes field value if set, zero value otherwise. -func (o *WriteRequest) GetDeletes() WriteRequestTupleKeys { +func (o *WriteRequest) GetDeletes() WriteRequestDeletes { if o == nil || o.Deletes == nil { - var ret WriteRequestTupleKeys + var ret WriteRequestDeletes return ret } return *o.Deletes @@ -83,7 +83,7 @@ func (o *WriteRequest) GetDeletes() WriteRequestTupleKeys { // GetDeletesOk returns a tuple with the Deletes field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *WriteRequest) GetDeletesOk() (*WriteRequestTupleKeys, bool) { +func (o *WriteRequest) GetDeletesOk() (*WriteRequestDeletes, bool) { if o == nil || o.Deletes == nil { return nil, false } @@ -99,8 +99,8 @@ func (o *WriteRequest) HasDeletes() bool { return false } -// SetDeletes gets a reference to the given WriteRequestTupleKeys and assigns it to the Deletes field. -func (o *WriteRequest) SetDeletes(v WriteRequestTupleKeys) { +// SetDeletes gets a reference to the given WriteRequestDeletes and assigns it to the Deletes field. +func (o *WriteRequest) SetDeletes(v WriteRequestDeletes) { o.Deletes = &v } diff --git a/model_write_request_tuple_keys.go b/model_write_request_deletes.go similarity index 50% rename from model_write_request_tuple_keys.go rename to model_write_request_deletes.go index 0fb3009..841d7f1 100644 --- a/model_write_request_tuple_keys.go +++ b/model_write_request_deletes.go @@ -16,33 +16,33 @@ import ( "encoding/json" ) -// WriteRequestTupleKeys struct for WriteRequestTupleKeys -type WriteRequestTupleKeys struct { - TupleKeys []WriteRequestTupleKey `json:"tuple_keys"yaml:"tuple_keys"` +// WriteRequestDeletes struct for WriteRequestDeletes +type WriteRequestDeletes struct { + TupleKeys []TupleKeyWithoutCondition `json:"tuple_keys"yaml:"tuple_keys"` } -// NewWriteRequestTupleKeys instantiates a new WriteRequestTupleKeys object +// NewWriteRequestDeletes instantiates a new WriteRequestDeletes object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewWriteRequestTupleKeys(tupleKeys []WriteRequestTupleKey) *WriteRequestTupleKeys { - this := WriteRequestTupleKeys{} +func NewWriteRequestDeletes(tupleKeys []TupleKeyWithoutCondition) *WriteRequestDeletes { + this := WriteRequestDeletes{} this.TupleKeys = tupleKeys return &this } -// NewWriteRequestTupleKeysWithDefaults instantiates a new WriteRequestTupleKeys object +// NewWriteRequestDeletesWithDefaults instantiates a new WriteRequestDeletes object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set -func NewWriteRequestTupleKeysWithDefaults() *WriteRequestTupleKeys { - this := WriteRequestTupleKeys{} +func NewWriteRequestDeletesWithDefaults() *WriteRequestDeletes { + this := WriteRequestDeletes{} return &this } // GetTupleKeys returns the TupleKeys field value -func (o *WriteRequestTupleKeys) GetTupleKeys() []WriteRequestTupleKey { +func (o *WriteRequestDeletes) GetTupleKeys() []TupleKeyWithoutCondition { if o == nil { - var ret []WriteRequestTupleKey + var ret []TupleKeyWithoutCondition return ret } @@ -51,7 +51,7 @@ func (o *WriteRequestTupleKeys) GetTupleKeys() []WriteRequestTupleKey { // GetTupleKeysOk returns a tuple with the TupleKeys field value // and a boolean to check if the value has been set. -func (o *WriteRequestTupleKeys) GetTupleKeysOk() (*[]WriteRequestTupleKey, bool) { +func (o *WriteRequestDeletes) GetTupleKeysOk() (*[]TupleKeyWithoutCondition, bool) { if o == nil { return nil, false } @@ -59,48 +59,48 @@ func (o *WriteRequestTupleKeys) GetTupleKeysOk() (*[]WriteRequestTupleKey, bool) } // SetTupleKeys sets field value -func (o *WriteRequestTupleKeys) SetTupleKeys(v []WriteRequestTupleKey) { +func (o *WriteRequestDeletes) SetTupleKeys(v []TupleKeyWithoutCondition) { o.TupleKeys = v } -func (o WriteRequestTupleKeys) MarshalJSON() ([]byte, error) { +func (o WriteRequestDeletes) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} toSerialize["tuple_keys"] = o.TupleKeys return json.Marshal(toSerialize) } -type NullableWriteRequestTupleKeys struct { - value *WriteRequestTupleKeys +type NullableWriteRequestDeletes struct { + value *WriteRequestDeletes isSet bool } -func (v NullableWriteRequestTupleKeys) Get() *WriteRequestTupleKeys { +func (v NullableWriteRequestDeletes) Get() *WriteRequestDeletes { return v.value } -func (v *NullableWriteRequestTupleKeys) Set(val *WriteRequestTupleKeys) { +func (v *NullableWriteRequestDeletes) Set(val *WriteRequestDeletes) { v.value = val v.isSet = true } -func (v NullableWriteRequestTupleKeys) IsSet() bool { +func (v NullableWriteRequestDeletes) IsSet() bool { return v.isSet } -func (v *NullableWriteRequestTupleKeys) Unset() { +func (v *NullableWriteRequestDeletes) Unset() { v.value = nil v.isSet = false } -func NewNullableWriteRequestTupleKeys(val *WriteRequestTupleKeys) *NullableWriteRequestTupleKeys { - return &NullableWriteRequestTupleKeys{value: val, isSet: true} +func NewNullableWriteRequestDeletes(val *WriteRequestDeletes) *NullableWriteRequestDeletes { + return &NullableWriteRequestDeletes{value: val, isSet: true} } -func (v NullableWriteRequestTupleKeys) MarshalJSON() ([]byte, error) { +func (v NullableWriteRequestDeletes) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } -func (v *NullableWriteRequestTupleKeys) UnmarshalJSON(src []byte) error { +func (v *NullableWriteRequestDeletes) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/model_write_request_tuple_key.go b/model_write_request_tuple_key.go deleted file mode 100644 index b5e6d5f..0000000 --- a/model_write_request_tuple_key.go +++ /dev/null @@ -1,196 +0,0 @@ -/** - * Go SDK for OpenFGA - * - * API version: 0.1 - * Website: https://openfga.dev - * Documentation: https://openfga.dev/docs - * Support: https://discord.gg/8naAwJfWN6 - * License: [Apache-2.0](https://github.com/openfga/go-sdk/blob/main/LICENSE) - * - * NOTE: This file was auto generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT. - */ - -package openfga - -import ( - "encoding/json" -) - -// WriteRequestTupleKey struct for WriteRequestTupleKey -type WriteRequestTupleKey struct { - User string `json:"user"yaml:"user"` - Relation string `json:"relation"yaml:"relation"` - Object string `json:"object"yaml:"object"` - Condition *RelationshipCondition `json:"condition,omitempty"yaml:"condition,omitempty"` -} - -// NewWriteRequestTupleKey instantiates a new WriteRequestTupleKey object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewWriteRequestTupleKey(user string, relation string, object string) *WriteRequestTupleKey { - this := WriteRequestTupleKey{} - this.User = user - this.Relation = relation - this.Object = object - return &this -} - -// NewWriteRequestTupleKeyWithDefaults instantiates a new WriteRequestTupleKey object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewWriteRequestTupleKeyWithDefaults() *WriteRequestTupleKey { - this := WriteRequestTupleKey{} - return &this -} - -// GetUser returns the User field value -func (o *WriteRequestTupleKey) GetUser() string { - if o == nil { - var ret string - return ret - } - - return o.User -} - -// GetUserOk returns a tuple with the User field value -// and a boolean to check if the value has been set. -func (o *WriteRequestTupleKey) GetUserOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.User, true -} - -// SetUser sets field value -func (o *WriteRequestTupleKey) SetUser(v string) { - o.User = v -} - -// GetRelation returns the Relation field value -func (o *WriteRequestTupleKey) GetRelation() string { - if o == nil { - var ret string - return ret - } - - return o.Relation -} - -// GetRelationOk returns a tuple with the Relation field value -// and a boolean to check if the value has been set. -func (o *WriteRequestTupleKey) GetRelationOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Relation, true -} - -// SetRelation sets field value -func (o *WriteRequestTupleKey) SetRelation(v string) { - o.Relation = v -} - -// GetObject returns the Object field value -func (o *WriteRequestTupleKey) GetObject() string { - if o == nil { - var ret string - return ret - } - - return o.Object -} - -// GetObjectOk returns a tuple with the Object field value -// and a boolean to check if the value has been set. -func (o *WriteRequestTupleKey) GetObjectOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Object, true -} - -// SetObject sets field value -func (o *WriteRequestTupleKey) SetObject(v string) { - o.Object = v -} - -// GetCondition returns the Condition field value if set, zero value otherwise. -func (o *WriteRequestTupleKey) GetCondition() RelationshipCondition { - if o == nil || o.Condition == nil { - var ret RelationshipCondition - return ret - } - return *o.Condition -} - -// GetConditionOk returns a tuple with the Condition field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WriteRequestTupleKey) GetConditionOk() (*RelationshipCondition, bool) { - if o == nil || o.Condition == nil { - return nil, false - } - return o.Condition, true -} - -// HasCondition returns a boolean if a field has been set. -func (o *WriteRequestTupleKey) HasCondition() bool { - if o != nil && o.Condition != nil { - return true - } - - return false -} - -// SetCondition gets a reference to the given RelationshipCondition and assigns it to the Condition field. -func (o *WriteRequestTupleKey) SetCondition(v RelationshipCondition) { - o.Condition = &v -} - -func (o WriteRequestTupleKey) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - toSerialize["user"] = o.User - toSerialize["relation"] = o.Relation - toSerialize["object"] = o.Object - if o.Condition != nil { - toSerialize["condition"] = o.Condition - } - return json.Marshal(toSerialize) -} - -type NullableWriteRequestTupleKey struct { - value *WriteRequestTupleKey - isSet bool -} - -func (v NullableWriteRequestTupleKey) Get() *WriteRequestTupleKey { - return v.value -} - -func (v *NullableWriteRequestTupleKey) Set(val *WriteRequestTupleKey) { - v.value = val - v.isSet = true -} - -func (v NullableWriteRequestTupleKey) IsSet() bool { - return v.isSet -} - -func (v *NullableWriteRequestTupleKey) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWriteRequestTupleKey(val *WriteRequestTupleKey) *NullableWriteRequestTupleKey { - return &NullableWriteRequestTupleKey{value: val, isSet: true} -} - -func (v NullableWriteRequestTupleKey) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWriteRequestTupleKey) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/model_write_request_writes.go b/model_write_request_writes.go new file mode 100644 index 0000000..4bd7aee --- /dev/null +++ b/model_write_request_writes.go @@ -0,0 +1,106 @@ +/** + * Go SDK for OpenFGA + * + * API version: 0.1 + * Website: https://openfga.dev + * Documentation: https://openfga.dev/docs + * Support: https://discord.gg/8naAwJfWN6 + * License: [Apache-2.0](https://github.com/openfga/go-sdk/blob/main/LICENSE) + * + * NOTE: This file was auto generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT. + */ + +package openfga + +import ( + "encoding/json" +) + +// WriteRequestWrites struct for WriteRequestWrites +type WriteRequestWrites struct { + TupleKeys []TupleKey `json:"tuple_keys"yaml:"tuple_keys"` +} + +// NewWriteRequestWrites instantiates a new WriteRequestWrites object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWriteRequestWrites(tupleKeys []TupleKey) *WriteRequestWrites { + this := WriteRequestWrites{} + this.TupleKeys = tupleKeys + return &this +} + +// NewWriteRequestWritesWithDefaults instantiates a new WriteRequestWrites object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWriteRequestWritesWithDefaults() *WriteRequestWrites { + this := WriteRequestWrites{} + return &this +} + +// GetTupleKeys returns the TupleKeys field value +func (o *WriteRequestWrites) GetTupleKeys() []TupleKey { + if o == nil { + var ret []TupleKey + return ret + } + + return o.TupleKeys +} + +// GetTupleKeysOk returns a tuple with the TupleKeys field value +// and a boolean to check if the value has been set. +func (o *WriteRequestWrites) GetTupleKeysOk() (*[]TupleKey, bool) { + if o == nil { + return nil, false + } + return &o.TupleKeys, true +} + +// SetTupleKeys sets field value +func (o *WriteRequestWrites) SetTupleKeys(v []TupleKey) { + o.TupleKeys = v +} + +func (o WriteRequestWrites) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + toSerialize["tuple_keys"] = o.TupleKeys + return json.Marshal(toSerialize) +} + +type NullableWriteRequestWrites struct { + value *WriteRequestWrites + isSet bool +} + +func (v NullableWriteRequestWrites) Get() *WriteRequestWrites { + return v.value +} + +func (v *NullableWriteRequestWrites) Set(val *WriteRequestWrites) { + v.value = val + v.isSet = true +} + +func (v NullableWriteRequestWrites) IsSet() bool { + return v.isSet +} + +func (v *NullableWriteRequestWrites) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWriteRequestWrites(val *WriteRequestWrites) *NullableWriteRequestWrites { + return &NullableWriteRequestWrites{value: val, isSet: true} +} + +func (v NullableWriteRequestWrites) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWriteRequestWrites) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +}