fabbricadigitale / scimd

SCIM v2 golang implementation
MIT License
5 stars 1 forks source link

Bulk operations #11

Open leogr opened 7 years ago

leogr commented 7 years ago

It is an optional server feature, we could implement it later.

The following is a draft of api's messages:

package messages

const BULK_REQUEST_URN = "urn:ietf:params:scim:api:messages:2.0:BulkRequest"
const BULK_RESPONSE_URN = "urn:ietf:params:scim:api:messages:2.0:BulkResponse"

type bulk struct {
    Schemas    []string `json:"schemas"`
    Operations []struct {
        Method  string `json:"method"`
        Path    string `json:"path"`
        BulkID  string `json:"bulkId,omitempty"`
        Version string `json:"version,omitempty"`
        Data    struct {
            Schemas     []string `json:"schemas"`
            DisplayName string   `json:"displayName"`
            Members     []struct {
                Type  string `json:"type"`
                Value string `json:"value"`
            } `json:"members"`
        } `json:"data"`
    } `json:"Operations"`
}

type BulkRequest struct {
    bulk
    FailOnErrors int `json:"failOnErrors,omitempty"`
}

type BulkResponse struct {
    bulk
    FailOnErrors int `json:"failOnErrors,omitempty"`
}